|pMe||(Object) Reference to the PmaData object where the event rises.|
|pEvent||(Object) Reference to object describing detailed information about the specific event.|
pEvent.Item - (Object) The PmVar object containing the information about the variable, in which some writing (change) occurred
To achieve calling this event for the specific variable, it is necessary to enable the calling explicitly in the variable (see the "ExtWriteAction > Data extension configuration: ExtWriteAction > Event "onItemAfterWrite"" configurator). There it is also defined if the event is triggered after each writing or after each change of the value.
If the triggering is enabled for each variable and writing into (the change of) all variables occurs at a time, then the event is triggered for each variable separately!
The The usage of this event is appropriate, for example, to inform and test the value for alarm purposes or for special actions that have to occur if the variable changes.
The event is triggered only if the real writing is performed (e.g. object.Item(0).Value=3) into the variable - let's mark it A. But if the data binding (during the reading) to another variable B (in another object) is defined in the A variable and it is written into the B variable, then the A variable doesn't know about the change and thus the event is not triggered (the variable A does know about the change only when it is read by someone - data binding is then "performed" - but the the event is not triggered again !).
Pm.Debug("Name:" + pEvent.Item.Name);
Pm.Debug("Index:" + pEvent.Item.Index);
Pm.Debug("NewValue:" + pEvent.Item.Value);
Pm.Debug("OldValue:" + pEvent.OldVal);