When you use datasocket to connect with OPC object by DataSocket Open Connection. vi in LabVIEW, it follow these steps:
- DataSocket Open Connection. vi creates default group, server, update rate and deadband based on the mode (Read, Write, ReadAutoUpdate, WriteAutoUpdate).
- Datasocket executes ValidateItems and AddItems commands for new objects.
- Pass the ItemName (ItemID and AccessPath) after the DataSocket.
For example, the URL opc:/National Instruments.OPCDemo/sine,
sine is the ItemName, which is passed by the ItemID
and AccessPath, but when using the datasocket to connect with OPC server, there is no way to give an AccessPath different from the ItemID. When the data is returned and communicated by datasocket , LabVIEW uses VariantChangeType to transfer the data to the original format requested by the user. Other input to AddItems are optional and usually do not pass any data.
The available attributes in the datasocket communication return object are
Quality and
TimeStamp. The
TimeStamp property is only suitable timing to 1s. For a more accurate
TimeStamp, you can use other properties,
TimeHigh and
TimeLow, which means
TimeStamp is expressed as a 64-bit interval of 100ns starting from 1/1/1601. For more information, please refer to the links below.