Read method

Description
This function makes a blocking call to the server to read the item. Read can be called with only a source (either OPC_DS_CACHE or OPC_DS_DEVICE) to refresh the item's value, quality, and timestamp properties.
Syntax
Read
(Source As Integer, Optional ByRef Value As Variant, Optional ByRef Quality As Variant, Optional ByRef TimeStamp As Variant)
Source
— Specifies readinf from cache (OPC_DS_CACHE) or from device (OPC_DS_DEVICE).
Value
(optional) — Returns the latest value read either from cache if OPC_DS_DEVICE is specified or from the server if OPC_DS_DEVICE is specified.
Quality
(optional) — Returns the latest quality read from the server.
TimeStamp
(optional) — Returns the latest timestamp read from the server.
Example
Private Sub ReadButton_Click()
Dim MyOPCItem as OPCItem
Dim vValue As Variant
Dim vQuality As Variant
Dim vTimeStamp As Variant
Set MyOPCItem = MyOPCGroup.OPCItems(txtValue(i))
'/* Read selected items value and quality
MyOPCItem.Read OPC_DS_CACHE, vValue, vQuality, vTimeStamp
'/* Display information
txtValue = vValue
txtQuality = vQuality
txtTimeStamp = vTimeStamp
End Sub
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal