The property enables an access to the object of Var
type that represents one variable defined on the page Data
. The variable is there defined by the index
Item(index As Variant) As Object
Reading the value:
val = oOpcData.Item(index).Value
Writing the value:
oOpcData.Item(index).Value = val
|index||(Variant) Identification of the variable either by its name (String data type, case sensitive text, for example "a1") or by the index (zero-based index).|
Property access for read only
The Var object includes information about the variable (value, name, index, etc.).
The Item property (like Var object) is read only, which means that the object cannot be changed but for example it is possible to write into the Value of the Var object.
If the variable does'nt exist, Nothing value is returned. global error in the INFO system is generated. For variable existence testing, it is better to use the ItemEx property.
property returns the reference to the Var
type object. In this case this object has the following properties Value
that can be, for example, find out as follows:
val = oOpcData.Item(0).Value
Some OPC servers (for Simatic
..) can transfer a data array (Array) in one data item
(the common limitation is that all data array items must be of the same data type). If such data has to be received/sent as well, than the Data type
configurator has to be set to Variant
data type for the data item (enabled only with the development key or with the PmRtProf
Example see Data vector transfer