Promotic

onEndOfTransfer - event of the PmaCommMsg object

Description:
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.
Parameters:
pMe(Object) Reference to the PmaCommMsg object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
pEvent.Error - (Long) [for reading] The message transfer success value.
0 - Transmission passed successfully
4 - Transmission proceeded without errors but less data were received than expected
5 - Transmission 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 confirmation
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).
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.
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).
Example:
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.27 SCADA system documentation MICROSYS, spol. s r.o.

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