Description:
The method returns object of the
PmVar type that represents one variable defined on the "
Data" tab.
Syntax:
Object Item(Variant id)
Parameters:
id | (Variant) Specifies the variable. The value is:
- Name (String, case sensitive text, for example "d1") or
- Index (Long, zero-based index) |
---|
Note:
The
PmVar object contains information about the variable (value, name, index, etc.).
If the variable does not exist, then error value (
null for
JavaScript or
Nothing for
VBScript) is returned. The
global error of the INFO system is generated. For
variable existence testing, it is better to use the
ItemEx method.
The method returns only variables (with corresponding data extension) that are created directly in this object (own variables). In fact also other variables from
PmaData 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 the
GetVarExtensions method.
Example1:
JavaScriptVBScriptSelect and copy to clipboard
var oOpcGroup = pMe.Pm("/OpcClient/Group1");
var val = oOpcGroup.Item(0).Value;
// Reading the value
oOpcGroup.Item(0).Value = 2;
// Writing the value
Dim oOpcGroup, val
Set oOpcGroup = pMe.Pm("/OpcClient/Group1")
val = oOpcGroup.Item(0).Value
' Reading the value
oOpcGroup.Item(0).Value = 2
' Writing the value
Example2:
The
Item method returns object of the
PmVar type. In this case this object has the following properties
Value,
TimeStamp and
Quality that can be, for example, find out as follows:
JavaScriptVBScriptSelect and copy to clipboard
var oOpcGroup = pMe.Pm("/OpcClient/Group1");
var val = oOpcGroup.Item(0).Value;
var tim = oOpcGroup.Item(0).TimeStamp;
var qual = oOpcGroup.Item(0).Quality;
Dim oOpcGroup
Set oOpcGroup = pMe.Pm("/OpcClient/Group1")
Dim val, tim, qual
val = oOpcGroup.Item(0).Value
tim = oOpcGroup.Item(0).TimeStamp
qual = oOpcGroup.Item(0).Quality