Simple Poll Example
Specify a valid Process Variable name and a timeout for the connection (-1: wait forever).
The PV will then be polled at the given period. Polling might be preferred to monitoring if you depend on data at a specific rate, e.g. for a control loop or an integrator.
Please note the handling of disconnections or invalid PVs:
- When the PV does not exist at all, PVCheckConnect.vi will timeout, the PV Handle will be invalid, PVCheckError.vi stops the loop and PVDisconnect.vi displays the error.
Result: The VI stops.- When the PV exists initially, the PVOpen.vi can connect alright. If the PV gets disconnected, the PVGetXX.vi indicates that the value is temporarily invalid.
Result: The VI runs on.The reason for this behaviour is that the PV has to exist initially in order to retrieve the type, size, units etc. If you want the LabVIEW display to run in any case, put a loop around the initial PVOpen.vi until the PV can be connected.
The diagram looks more complicated than the monitoring example because the connection is checked initially and the unit information is retrieved.
09-Aug-1999, Kay-Uwe Kasemir