APPENDIX C: MODBUS PROTOCOL SERIAL COMMANDS
The CRC is started by first preloading a 16-bit register to all 1’s. Then a process begins of
applying successive eight-bit bytes of the message to the current contents of the register. Only
the eight bits of data in each character are used for generating the CRC. Start and stop bits, and
the parity bit, do not apply to the CRC. During generation of the CRC, each eight-bit character
is exclusive ORed with the register contents. Then the result is shifted in the direction of the least
significant bit (LSB), with a zero filled into the most significant bit (MSB) position. The LSB is
extracted and examined. If the LSB was a 1, the register is then exclusive ORed with a preset,
fixed value. If the LSB was a 0, no exclusive OR takes place.
This process is repeated until eight shifts have been performed. After the last (eighth) shift, the
next eight-bit byte is exclusive ORed with the register’s current value, and the process repeats for
eight more shifts as described above. The final contents of the register, after all the bytes of the
message have been applied, is the CRC value. When the CRC is appended to the message, the
low-order byte is appended first, followed by the high-order byte.
Modbus PDU for serial line communication = 256 - Server address (1 byte) - CRC (2bytes) = 253
bytes.
The Modbus protocol defines three PDUs. They are:
•
Modbus Request PDU, mb_req_pdu
•
Modbus Response PDU, mb_rsp_pdu
•
Modbus Exception Response PDU, mb_excep_rsp_pdu
•
The mb_req_pdu is defined as: mb_req_pdu = {function_code, request_data}, where:
function_code = [1 byte] Modbus function code corresponding to the desired Modbus
function code or requested through the client API
request_data = [n bytes] This field is function code dependent and usually contains
information such as variable references, variable counts, data offsets, sub-function codes etc.
The mb_rsp_pdu is defined as:
mb_rsp_pdu = {function_code, response_data}, where:
function_code = [1 byte] Modbus function code
response_data = [n bytes] This field is function code dependent and usually contains
information such as variable references, variable counts, data offsets, sub-function
codes, etc.
For additional information on the Modbus protocol, refer to the “Modbus Application Protocol
Specification “ which can be found on the www.modbus.org website.
C-2
Summary of Contents for STXplus
Page 18: ...CHAPTER 3 STAND ALONE ANALOG CALIBRATION AND SET UP Table 3 2 3 9...
Page 21: ...APPENDIX B KISTLER MORSE PROTOCOL SERIAL COMMANDS B 2...
Page 22: ...APPENDIX B KISTLER MORSE PROTOCOL SERIAL COMMANDS B 3...
Page 61: ...APPENDIX C MODBUS PROTOCOL SERIAL COMMANDS Table C 1 Modbus Address Map C 8...
Page 62: ...APPENDIX C MODBUS PROTOCOL SERIAL COMMANDS C 9 Table C 1 Modbus Address Map continued...
Page 63: ...APPENDIX C MODBUS PROTOCOL SERIAL COMMANDS Table C 1 Modbus Address Map continued C 10...
Page 64: ...APPENDIX C MODBUS PROTOCOL SERIAL COMMANDS C 11 Table C 1 Modbus Address Map continued...
Page 65: ...APPENDIX C MODBUS PROTOCOL SERIAL COMMANDS Table C 1 Modbus Address Map continued C 12...
Page 67: ...APPENDIX D TECHNICAL DRAWINGS D 2...
Page 68: ...APPENDIX D TECHNICAL DRAWINGS D 3...
Page 69: ...APPENDIX D TECHNICAL DRAWINGS D 4...
Page 70: ...APPENDIX D TECHNICAL DRAWINGS D 5...
Page 71: ...APPENDIX D TECHNICAL DRAWINGS D 6...
Page 72: ...APPENDIX D TECHNICAL DRAWINGS D 7...
Page 74: ...NOTES...
Page 75: ...NOTES...