onEndOfTransfer - event of the PmaCommMsg object

The event is triggered after the transfer of the whole message with any result. It can be used, for example, to find out if the message has been successfully transferred.
pMe(Object) Reference to the PmaCommMsg object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.Error - (Long) Success rate of the message transfer.
0 - the transfer passed successfully
4 - transfer proceeded without errors but less data were received than expected
5 - transfer proceeded without errors but more data were received than expected
21 - error in the message setting (wrong configured tab Data-sent, Data-received or Parameters)
24 - timeout from the input (sufficient number of characters wasn't accepted)
33 - software error
62 - negative acknowledement
65 - wrong transmitted data (e.g. the wrong configuration of the communication card)
66 - wrong received data (e.g. the check sum error)
67 - not possible to create the connection with the server (Ethernet) or the port is not ready for communication (serial link).
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.

The error state can be detected even after this event using the LastErr and LastTextErr properties. Cumulative error count can be detected by the PmaCommMsg.GetCount or PmaComm.GetCount methods (it is usefull when detecting communication problems).

the following script in this event reads the received value from the communication and then saves it into the variable in the PmaData object.
JavaScriptVBScriptSelect and copy to clipboard

var val = pMe.ReadVars(0).Value;
pMe.Pm("/Boiler1/Data/#vars/Temperature").Value = 100 + 10 * val;
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person