Update cookies preferences
Promotic

ReadVars - method of the PmaCommMsg object

Description:
The method returns object of the PmVar type that represents one variable defined on the "Data-received" tab.
Syntax:
Object ReadVars(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.
See also:
- PmaData.Item (method)
Example1:
JavaScriptVBScriptSelect and copy to clipboard

var val = oMsg.ReadVars("xy").Value;
// or
val = oMsg.ReadVars(0).Value;
Example2:
Values of variables on the "Data-received" tab will be copied into variables of the PmaData object.
JavaScriptVBScriptSelect and copy to clipboard

var oData = pMe.Pm("/Data");   // Path to the PmaData object
var oMsg = pMe.Pm("/Comm/mr1");   // Path to the PmaCommMsg object
var nVar = oMsg.GetVarCount(2);   // The number of variables on the "Data-received" tab
var iVar;
for (iVar = 0; iVar < nVar; iVar++)
{
oData.Item(iVar).Value = oMsg.ReadVars(iVar).Value;
}
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.