Promotic
WikipediaLinkedInYoutubeTwitterFacebook

onItemAfterWrite - event of the PmaData object

Description:
The event is triggered after writing into (the change of) the value of one variable defined on the "Data" tab.
Parameters:
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
pEvent.OldVal - (Variant) Old value of the variable. The variable had this value before writing.
Note:

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.

 
Caution:

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 !).

See also:
Example:
The following script in the onItemAfterWrite event dumps the information about the written value into the Debug item of the INFO system - it dumps the variable name where it was written, the index of the variable and an old and new value of the variable.
JavaScriptVBScriptSelect and copy to clipboard

Pm.Debug("Name:" + pEvent.Item.Name);
Pm.Debug("Index:" + pEvent.Item.Index);
Pm.Debug("NewValue:" + pEvent.Item.Value);
Pm.Debug("OldValue:" + pEvent.OldVal);
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice