EZT-430i Communications Manual
Serial
Communication
CSZ
EZT-430i
REV
C
4.10
4.3.2 Error
Checking
In Modbus communications, every message sent from the master (your software) receives a response from
the slave (EZT-430i ), including write commands. Thus, after each command sent, you must read the
controller response before sending the next message. This provides the method of error checking in order to
verify that the message you sent was received correctly, and that the controller is operating accordingly. This
allows you to then determine the appropriate recovery response in case the message was not received
correctly by the controller, and what action is to be taken by an operator and/or the software itself.
The exception responses provide a basic form of error checking. When an exception response is received,
the code provided in the response will tell you what the error was in the sent message. However, this is only
valid if the controller receives the message you sent, and there was an out-of-range value or simple
transmission error in the message. It does not validate incomplete or failed transmissions. To insure that the
data you receive from a read command is correct, and that the controller properly received a write command,
you must parse the controller’s response and validate the return message to insure it is correct.
In order to validate that the message you received is correct, you must caulate the CRC for the received
message and compare it with the CRC that the controller appended to the message. This verifies that the
data you received was what EZT-430i sent. If the CRC’s do not match, there was an error in the transmission
and the entire message should be ignored. This could then be followed by an attempt to resend the failed
command, or halt operation and alert an operator.
Example:
Read registers 35 and 36 (loop 1 process variable and setpoint) of controller at address 1.
Command sent to EZT-430i :
01 03 00 23 00 02 35 C1
Message received from EZT-430i :
01 03 04 03 0D 01 F3 2A 61
Caulated CRC: 2A61 (caulated from message 01 03 04 03 0D 01 F3)
Received CRC: 2A61
The caulated CRC matches the received CRC, the message is valid. Note that the last two bytes of
the received message are not used to caulate the CRC. The last two bytes are the CRC that EZT-
430i appended to the message. Do not include them when caulating the CRC.