EPICS Data Validity using the TRIUMF Modtcp driver


Rolf Keitel,   updated 2005/04/07


Functionality
The TRIUMF modtcp driver uses a memory buffer in the IOC to store PLC data.
EPICS device support reads and writes data from/to this memory buffer.
Two vxWorks tasks (plcRead, plcWrite) move data between this memory buffern and the PLC using TCP/IP.
One vxWorks task (plcWatch) monitors the PLC-to-IOC communication.


Communication Issues
This section is based on Quantum Series PLCs.

Problems, which can lead to "stale" = invalid data.

  1. Channel access (CA) broken: The IOC is running ok,  but does not communicate with CA clients
  2. IOC<>PLC communication broken: EPICS device support is reading/writing to the memory buffer, but the plcRead task does not communicate with the PLC
  3. PLC program stopped: EPICS device support is reading/writing to the memory buffer, plcRead task reads from the PLC, but the PLC program has stopped. Note that in this case communication with the PLC still works on Quantum Series PLCs.
In the control system, stale data must be recognizable and it is desirable to have diagnostics to also recognize the cause of stale data.

How does the ISAC control system handle these issues?

Case 1) is handled by the CA protocol, which notifies the CA clients about the state of the connection between the client and a process variable.
  Responsibility: the CA client  must respond properly to invalid data

Case 2 and 3):  the modtcpSupport EPICS driver counts successful read transactions and  monitors a watchdog location in the PLC.  If the watchdog is not updated for five seconds, all EPICS input records are flagged invalid and are put into an invalid alarm state.
The successful read counters are provided as vxWorks global variables to EPICS. This allows to distinguish case 2) (neither read counters nor watchdog are  updating) from case 3) (read counters are updating, but watchdog is not).

Responsibility: