Unfortunately using the error code from the Driver tag often won't catch the case when the PLC is switched to program mode as many devices will still communicate properly with SCADA in this state but return data that no longer changes. In this situation, the driver will report good communication (i.e. no error) but the program won't be running.
To resolve this we create an Alarm tag that uses an expression for its "Triggered By" parameter that monitors the state of the heartbeat from the PLC using an expression something like this:
PickValid(TimeOut([HeartBeatInput], 30) || TimeOut(![HeartBeatInput], 30),1)
Where "HeartBeatInput" is the name of the input tag (Digital Status typically) that has the heartbeat from the PLC. If the value of HeartBeatInput is 0 or 1 for more than 30 seconds, the expression returns a value of 1 that you can then use to trigger the alarm, otherwise it will have a value of 0. Also, if the comms are lost and the driver's HOLD setting is not checked, the expression also returns a value of 1 to trigger the alarm. You can adjust the time settings in the TimeOut() functions as needed to match your actual configuration.
Hope that helps.
Unfortunately using the error code from the Driver tag often won't catch the case when the PLC is switched to program mode as many devices will still communicate properly with SCADA in this state but return data that no longer changes. In this situation, the driver will report good communication (i.e. no error) but the program won't be running.
To resolve this we create an Alarm tag that uses an expression for its "Triggered By" parameter that monitors the state of the heartbeat from the PLC using an expression something like this:
PickValid(TimeOut([HeartBeatInput], 30) || TimeOut(![HeartBeatInput], 30),1)
Where "HeartBeatInput" is the name of the input tag (Digital Status typically) that has the heartbeat from the PLC. If the value of HeartBeatInput is 0 or 1 for more than 30 seconds, the expression returns a value of 1 that you can then use to trigger the alarm, otherwise it will have a value of 0. Also, if the comms are lost and the driver's HOLD setting is not checked, the expression also returns a value of 1 to trigger the alarm. You can adjust the time settings in the TimeOut() functions as needed to match your actual configuration.
Hope that helps.
Lawrence MacNeil
Trihedral Engineering Limited