Update cookies preferences
Promotic

onDataReceive - event of the PmaOpcDaClientGroup object

Description:
The event is triggered after receiving the data from the OPC server.
The triggering procedure of this event depends on setting the ""onDataReceive" event" configurator. It is recommended to use the "A = trigger the event for all registered variables (in this object and also in other PmaData objects)" setting.
Parameters:
pMe(Object) Reference to the PmaOpcDaClientGroup object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
pEvent.Items - (Array) [for reading] The property is set only if the ""onDataReceive" event" configurator is set to:
- "A = trigger the event for all registered variables (in this object and also in other PmaData objects)".
Then each item of the array represents the "data extension ExtOpcDa" object of the variable that is defined either in the PmaOpcDaClientGroup object or in another PmaData object.
- "B = calling for the whole group of received variables - only for variables defined in this object (obsolete)".
Then each item of the array represents the PmVar object that is defined in the PmaOpcDaClientGroup object. Variables in other PmaData objects (that have the ExtOpcDa data extension) are not processed here.

In both cases, if for example 10 data items are simultaneously received from the OPC server then the event is triggered only once and there are these 10 items in the array.
pEvent.VarName - (String) [for reading] Data item name. The property is set only if the ""onDataReceive" event" configurator is set to "C = calling for each variable separately - only for variables defined in this object (obsolete)".
For example if 10 data items are received from the OPC server, then the event is triggered for each item separatelly and the name of the item is in the pEvent.VarName property.
pEvent.Reason - (Long) [for reading] Reason of the receipt.
0 - Receiving from the automatic update (only if the "Refresh from server at server change" configurator is checked).
1 - After calling the Read method.
2 - After calling the Refresh method.
Note:
Triggering of this event can also be emulated in the INFO system when this object is being viewed and the "Actions" button is pressed. See "PmaRoot > Permissions > InfoEdit" permission.
See also:
Example:
The ""onDataReceive" event" configurator is set to "A = trigger the event for all registered variables (in this object and also in other PmaData objects)".
We will report following information about the received data items into the Debug item of the INFO system:
JavaScriptVBScriptSelect and copy to clipboard

var aItems = pEvent.Items;
var nItems = aItems.GetSize(1);
Pm.Debug("OPC onDataReceive: Size=" + nItems + ", Reason=" + pEvent.Reason);

var iItm;
for (iItm = 0; iItm < nItems; iItm++)
{
Pm.Debug("Name=" + aItems.GetItem(iItm).Var.Name);
Pm.Debug("Value=" + aItems.GetItem(iItm).Var.Value);
Pm.Debug("Quality=" + aItems.GetItem(iItm).Var.Quality);
Pm.Debug("ItemId=" + aItems.GetItem(iItm).ItemId);
}
PROMOTIC 9.0.28 SCADA system documentation MICROSYS, spol. s r.o.

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