Item - property of object PmOpcClientData

The property enables an access to the object of Var type that represents one variable defined on the page Data.
Item(id As Variant) As Object
Reading the value:
val = oOpcData.Item(id).Value
Writing the value:
oOpcData.Item(id).Value = val
id(Variant) Specifies the variable either by its name (String data type, case sensitive text, for example "a1") or by 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, it 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 doesn't exist, then Nothing value is returned. global error in the INFO system is generated. For variable existence testing, it is better to use the ItemEx property.

This method enables access only to variables (with corresponding data extension) that are created directly in this object (own variables). In fact also other variables from PmData objects are registered into this object - those that have corresponding data extension configured with path to this object. All data extensions registered in this object can be accessed by method GetVarExtensions.

The Item property returns the reference to the Var type object. In this case this object has the following properties Value, TimeStamp and Quality that can be, for example, find out as follows:
VBScriptSelect and copy to clipboard

Dim val, tim, qual
val = oOpcData.Item(0).Value
tim = oOpcData.Item(0).TimeStamp
qual = oOpcData.Item(0).Quality
Some OPC servers (for Simatic, Schneider, Bernecker&Reiner ..) 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, then the Data type configurator has to be set to Variant data type for the variable (this is disabled in PmRtFree - Free runtime license).

Example see Data vector transfer

PROMOTIC 8.3.29 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice