Download CPC400 Series User's Guide
Transcript
CPC400 Series User’s Guide Appendix A: Modbus Protocol Modbus ASCII and RTU Modes The Modbus protocol supports two distinct serial transmission modes: ASCII and RTU. The mode determines how messages are framed and coded. Typically, ASCII is used for simple communication tasks or diagnostics while RTU is used where a more robust and efficient protocol is required. The CPC400 supports Modbus RTU mode only. In ASCII mode, each character in a message string is composed of a hexadecimal character which is correlated to an ASCII character. For example, an ASCII message string contains the value of a process variable, 5500 (550.0 degrees). 5500 in an ASCII string is composed of 4 bytes, 35 35 30 30. 35 and 30 in hexadecimal equate to the characters “5” and “0” in the ASCII table respectively. In RTU mode, the actual value is embedded in a message string. There is no translation to ASCII characters. This results in more compact message strings and efficient serial communications. The value 5500 in an RTU string is composed of its hexadecimal equivalent which is only 2 bytes, 15 7C. Many host devices can communicate in either ASCII or RTU mode. However, it should be noted that some PLCs can only be an ASCII host. Message Framing Messages start with a silent interval of at least 3.5 character times. This is most easily implemented as a multiple of character times at the baud rate that is being used on the network (shown as T1-T2-T3-T4 in Figure A.2). The first field then transmitted is the device address. Networked controllers monitor the network bus continuously, including during the silent intervals. When the first field (the address field) is received, each device decodes it to find out if it is the addressed device. Following the last transmitted character, a similar interval of at least 3.5 character times marks the end of the message. A new message can begin after this interval. Similarly, if a new message begins earlier than 3.5 character times following a previous message, the receiving device will consider it a continuation of the previous message. This will set an error, as the value in the final CRC field will not be valid for the combined messages. An example message frame is shown in Figure A.2. Doc. 0600-2900-2000 Watlow Anafaze 185