Exchanging data between the Quantum processor and the serial ports of the ESI module involves the following steps:
Transmit direction:
-
Transfer of the data from the PLC registers to the ESI register area through the 12 output registers assigned to the ESI module in the I/O configuration.
-
Interpreting the data in the ESI registers based on the ASCII messages and transfer to the port transmit buffer.
Receive direction:
-
Interpreting the data in the port receive buffer based on the ASCII messages and transfer to the ESI register area.
-
Transfer of the data from the ESI register area to the PLC registers through the 12 input registers assigned to the ESI module in the I/O configuration.
The ASCII messages represent the central mechanism of how the data in the ESI registers are formated for the transmission through the RS-232 ports in either direction. A single 16-bit register for example could represent 2 ASCII characters and thus be transmitted as two characters it could also represent a single number which may be transmitted as an integer with leading spaces resulting in a string of five characters. For a detailed description of the available formats see
ASCII Message Formats.
The following diagram is an example of transmitting 4 characters from the Quantum controller using the "2A2" message format (2 registers with 2 characters each). Port Buffer content is in ASCII format, register content in hex:
The following diagram is an example of receiving 1 numerical value from the RS-232 port using the "1L5" message format (1 register, 5 digits with leading zeros). Port Buffer content is in ASCII format, register content in hex:
NOTE: Ensure the number of incoming characters match the number defined in the ASCII message. If in the above example the device sends "0013", the ESI module would not be able to finish the receive command and would wait until reception of a 5th character.
Possible Synchronisation Problems
As the ESI module only supports fixed length message formats without start or termination characters, any lost character (or additional unexpected character) can lead to a wrong interpretation of received data. The following examples show the result of 3 different error types. The assumed message format is "1L5 maximum 65,535":
Effect of lost character:
Effect of buffer not empty at start of reception:
Effect of terminated reception:
To prevent mis-interpretation of data or locking the module the buffer related commands FLUSH BUFFER, ABORT, GET BUFFER STATUS should be used to control the data exchange.