pMe | (Object) Reference to the PmaCommGroup object where the event rises. |
---|---|
pEvent | (Object) Reference to an object describing detailed information about the specific event.
pEvent.Items - (Array) [for reading] The property is set to various objects depending on the ""onDataReceive" event" configurator setup:
- "A = call for all registered variables (in this object and also in other PmaData objects)".
Then each item of the array represents the "data extension ExtComm" object of the variable that is defined either in the PmaCommGroup object or in the PmaData object. - "B = call only for variables defined in this object (obsolete)".
Then each item of the array represents the PmVar object that is defined in the PmaCommGroup object. Variables in other PmaData objects (having the ExtComm data extension) are not processed here. In both cases if 10 data items are received simultaneously from the communication, then the event is triggered only once and there are these 10 items in the array. pEvent.ErrorCount - (Long) [for reading] The number of data items in the array pEvent.Items, that do not have the Quality property set to Good.
|
var aItems = pEvent.Items;
var nItems = aItems.GetSize(1);
Pm.Debug("PmaCommGroup.onDataReceive: Size=" + nItems + ", ErrorCount=" + pEvent.ErrorCount);
var iItem;
for (iItem = 0; iItem < nItems; iItem++)
{
var oItem = aItems.GetItem(iItem);
// Data extension = ExtComm object
var oVar = oItem.Var;
// Variable = PmVar object
Pm.Debug(" Name=" + oVar.Name);
Pm.Debug(" Value=" + oVar.Value);
Pm.Debug(" Quality=" + oVar.Quality);
Pm.Debug(" ItemId=" + oItem.ItemId);
}