The procedure of calling this event depends on the settings of the "onDataReceive" event configurator. It is recommended to use the "A = call for all registered variables (in this object and also in other PmData objects)" setting.
|pMe||(Object) Reference to the PROMOTIC object where the event rises.|
|pEvent||(Object) A referrence to object describing detailed information about the specific event.|
pEvent.Items - (Array) The property is set for various objects depending on "onDataReceive" event configurator setup:
- "A = call for all registered variables (in this object and also in other PmData objects)".
- "B = call only for variables defined in this object (obsolete)".
Then each item of this array represents the "variable object Var" that is defined in this PmCommData object. Variables in other PmData objects (having the ExtComm data extension) are not processed here.
In both cases if 10 data items are received simultaneously from communication, then the event is fired only once and there are these 10 items in the array.
pEvent.ErrorCount - (Long) The number of data items in the array pEvent.Items, that do not have the Quality property set to Good.
Dim i, u
u = UBound(pEvent.Items)
Pm.Debug "COMM onDataReceive: Count=" & (u + 1) & ", ErrorCount=" & pEvent.ErrorCount
For i = 0 To u
Pm.Debug "Name=" & pEvent.Items(i).Var.Name
Pm.Debug "Value=" & pEvent.Items(i).Var.Value
Pm.Debug "Quality=" & pEvent.Items(i).Var.Quality
Pm.Debug "ItemId=" & pEvent.Items(i).ItemId