lcaSetMonitor(pvs, nmax, type)
Use the lcaNewMonitorValue call to check monitor status (local flag) or lcaNewMonitorWait to wait for new data to become available (since last lcaGet or lcaSetMonitor). If new data are available, they are retrieved using the ordinary lcaGet call.
Note the difference between polling and monitoring a PV in combination with polling the local monitor status flag (lcaNewMonitorValue). In the first case, remote data are fetched on every polling cycle whereas in the second case, data are transferred only when they change. Also, in the monitored case, lcaGet reads from a local buffer rather than from the network. It is most convenient however to wait for monitored data to arrive using lcaNewMonitorWait rather than polling.
There is currently no possibility to selectively remove a monitor. Use the lcaClear call to disconnect a channel and as a side-effect, remove all monitors on that channel. Future access to a cleared channel simply reestablishes a connection (but no monitors).
Note that a subsequent lcaGet must specify a nmax argument equal or less than the number given to lcaSetMonitor — otherwise the lcaGet operation results in fetching a new set of data from the server because the lcaGet request cannot be satisfied using the copy locally cached by the monitor-thread.
The type specified for the subsequent lcaGet for retrieving the data should match the monitor's data type. Otherwise, lcaGet will fetch a new copy from the server instead of using the data that was already transferred as a result of the monitoring.
lcaSetMonitor('PV') // monitor 'PV'. Reduce network traffic by just have the // library retrieve the first 20 elements. Use DBR_SHORT // for transfer. lcaSetMonitor('PV', 20, 's')