<< Click to Display Table of Contents >>
Value |
Updated whenever a new value is read from the OPC Server, according to OPC Block's ItemID property specifications where this OPC Block Element is inserted, and also considering the Index property, which specifies the position of an OPC Block Element in an OPC Block array. This property's data type, such as integer, floating point, or text, depends on the OPC Driver to which it is associated and its configuration.
This property is only updated this way if the AllowRead property of the OPC Block to which the OPC Block Element belongs is set to True, and according to a scan time defined in the Scan property of the OPC Group that contains the OPC Block. If OPC Block's AllowWrite property is set to True, users can write values to the device simply by attributing a new value to this property.
This is also the default property of an OPC Block Element. Therefore, a reference by value to an OPC Block Element does not need necessarily to explicit this property to have access to its value. If this property is not being updated, check if the Index property is correctly configured, that is, its value must be between zero and the size of the OPC Block minus one. The next script contains an example of using this property.
Sub Button1_Click()
' Accesses an Element and shows its current value
' elm1 is an OPC Block Element object
Set obj = Application.GetObject_
("OPCDriver1.Group1.OPCBlock1.elm1")
MsgBox "Elm1's current value: " & obj.Value
' This can also be performed in a different way,
' without displaying the Value property, which is default
MsgBox "Elm1's current value: " & obj
End Sub