Value

<< Click to Display Table of Contents >>

 

Value

Variant Updated whenever a new valid reading from a device is performed, using N1 to N4 parameter configuration. Data type of this variable, such as integer, floating point, or text, depends on the I/O Driver to which the I/O Tag is associated and its configuration.

This property is only updated this way if the AllowRead property is set to True, and when there are no communication errors. In this case, the Quality and TimeStamp properties are updated according to a scan time defined in the Scan property. Another way to use this property is to write values to a device, by simply setting a new value to this property or to some of the bits from Bit00 to Bit31 properties. In this case, the AllowWrite property must be set to True.

This is also I/O Tag's default property. Therefore, a reference by value to an I/O Tag does not need to explicit this property to access its value. Default value of this property is empty. The next script contains an example of using this property.

Sub Button1_Click()
  ' Accesses a tag and shows current value
  ' tag1 is an I/O tag
  Set obj = Application.GetObject("IODriver1.tag1")
  MsgBox "Tag1's current value: " & obj.Value
  'This can also be performed in a different way,
  'with no need to show Value property, which is default
  MsgBox " Tag1's current value: " & obj
End Sub

 

NOTE

Bit values, the properties from Bit00 to Bit31, are not affected by adjustments in the scale, that is, they represent the bits from the value read by a device before conversion.

Was this page useful?