Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ItemEx - method of object PmaOpcClientGroup

Description:
The method enables an access to object of the PmVar type that represents one variable defined on the page Data.
Syntax:
Object ItemEx(Variant id, [Long nAttr])
Calling:
Reading the value:
val = oOpcData.ItemEx(id).Value
Writing the value:
oOpcData.ItemEx(id).Value = val
Parameters:
id(Variant) Specifies the variable. The value is:
- Name (String, case sensitive text, for example "a1") or
- Index (Long, zero-based index)
nAttr[optional] (Long) It allows to change the behavior of the method.
0 (default) - default behavior (as the Item method).
1 - when referencing the non-existent variable the global error in the INFO system won't be generated.
Note:

The PmVar object includes information about the variable (value, name, index, etc.).

If the variable doesn't exist, then error value (null for JavaScript or Nothing pro VBScript) is returned. Nothing value can be tested by VBScript Is operator.

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 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 method GetVarExtensions.

See also:
Example:
Test whether the variable named "Temperature3" exists:
JavaScriptVBScriptSelect and copy to clipboard

var oItem = oOpcData.ItemEx("Temperature3", 1);
if (!oItem)
//... error
PROMOTIC 9.0.6 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