4.10. Pushing external data into the event stream

The slow controls port can also be used to send data that will be periodically inserted in the data stream. The mechanism for this is intended to monitor slowly varying values (for example magnet currents). Here's a brief sketch about how this works:

4.10.1. Specifying variables to be monitored.

The key to monitoring variables is that the control server is really a Tcl interpreter executing commands that are poked into it by its client sockets. The Tcl server supports a new command watch which allows you to specify which variables should be monitored.

The example below specifies that the arrays EPICS_DATA, EPICS_UNITS, EPICS_UPDATED and the scalar variable monitored should be monitored.;

Example 4-33. Specifying VM-USB monitored variables

array set EPICS_DATA    [list]
array set EPICS_UNITS   [list]     (1)
array set EPICS_UPDATED [list]

watch EPICS_UNITS                  (2)

watch monitored                   (3)
In order to monitor an array, the array must first be created. Note that this is not the case for a scalar variable.
These commands specify that the three arrays we created with the array set command should be monitored.
Since monitored was not created as an array only the single scalar value will be monitored.

For more information about the watch command see watch in the reference manual pages.