App 2-8
Appendix 2. Communication Commands
IM CW120-E
1.5
Messages on RS-485
Messages
In the same way as in RS-232 communication, RS-485 communication between a CW120 (or
CW121) and a personal computer is carried out in blocks of data called messages. In RS-485
communication, an STX (ASCII-code “02H”), the device address, the checksum, an ETX (ASCII-
code “03H”), and a CR (ASCII-code “0DH”) are attached to each program message sent from the
personal computer and each message sent from the CW120 (or CW121) to the personal computer.
If a received program message contains a query command (a command which requests a
response), the CW120 (or CW121) returns a response message. If a received program message
does not contain a query command, the CW120 (or CW121) returns OK or ERROR as a response
message. Also in response to a syntax error in a program message, the CW120 returns ERROR.
Program Messages to CW120/121 and Response from CW120/121
<STX><device address><program message><checksum><ETX><CR>
Range of data to calculate checksum
<STX><device address><response message><checksum><ETX><CR>
Range of data to calculate checksum
STX (start of text)
ASCII-code “02H”
1 byte
Device address
ASCII-codes “000” to “999”
3 bytes
Program message
Uppercase alphabetical and numerical characters
Variable
Checksum
ASCII-codes “00” to “FF”
2 bytes
A value calculated by summing up the specified block of data in
hexadecimal and encoding the last two digits as ASCII code characters
ETX (end of text)
ASCII “03H”
1 byte
CR (terminator)
ASCII “0DH”
1 byte