How To Keep Trying To Open A Device That Fails To Connect - CX-Supervisor

In CX-Supervisor when a device is successfully opened (either during start up, or from an OpenPLC() script command), CX-Supervisor starts a 'heartbeat communication' to monitor the status of the connection.  Therefore, if a subsequent communication error occurs a Timeout event is logged.
 
However if CX-Supervisor cannot communicate with a device when it is first opened, it remains closed (and a 'Failed to open' event logged).  If you want to make your application continue trying to open devices in this situation, add a Boolean memory point called "PLCConnected" and create a simple project level script:

  
 
This script will test every minute (at zero seconds) if 'PLCConnected' is FALSE (which indicates the device is not currently open). If this is the case then it attempts to open the device. The outcome of the OpenPLC will be stored in the PLCConnected memory point. Once the PLC is successfully open, this script will stop running.
 
 

Note: If you are using VBScript make sure you upgrade to the latest version as there were fixes added to ensure this works properly.

 

 


Link:
http://www.myomron.com/index.php?action=kb&print=1344



Comments  

Translate: