
3
CARLO GAVAZZI
CONTROLS
SERIAL COMMUNICATION PROTOCOL
WM24-96
V1 R0
Page
1 SERIAL COMMUNICATION PROTOCOL
1.1 INTRODUCTION
WM24-96 can be equipped with a RS485 or RS232 serial interface. The serial communication
protocol, MODBUS-RTU, is the same on both interfaces. When using RS485, it is possible to
connect up to 255 instruments using MODBUS protocol. When using RS232 it is only possible to
connect a single instrument (multidrop feature is not available). Only one interface must be used at a
time.
The command structure of the protocol allows the user to read and write from/in the µP RAM
memory and EEPROM so that all the functions are completely transparent.
The communication parameters are fixed and in accordance with the following table:
Interface Baud rate (bps) Parity Stop bit
RS232 9600 None 1
RS485 9600 None 1
The communication can be started only by the HOST unit, which sends the request frame. Each
frame contains the following information:
• slave address: is a number from 1 to 255, which identifies the instrument connected to the
network. Address 0 (zero) is accepted (in write frames only) by all the instruments, which will
execute the relevant command but won’t send any answer frame.
• command: it defines the command type (e.g. read function, write function etc.).
• data fields: these numbers define the operating parameters of the command (e.g. the address of
the word, the value of the word to be written, etc.).
• CRC word: it allows detecting transmission errors that may occur. CRC calculation is carried out
by the MASTER unit once it has defined address, command and data fields. When the frame is
received by the SLAVE, it is stored in a temporary buffer. The CRC is calculated and then
compared with the received one. If they correspond and the address is recognised by the SLAVE
unit, the command is executed and an answer frame is sent.
If the CRC is not correct, the frame is discarded and no answer is sent.
1.2 FUNCTIONS
WM24-96 accepts the following two commands:
• Read words (code 04h)
• Write one word (code 06h)
Komentarze do niniejszej Instrukcji