Professional Documents
Culture Documents
2001
1.0 GENERAL
Communication between cards 9010/20LCD and any supervision unit occurs through serial communication in RS485
using the MODBUS protocol with RTU transmission mode. All cards 9010/20LCD are slave whilst the supervision
unit is master. Slaves are peripheral with address from 1 to 255.
Transmission is fixed at 9600 bit/s, one stop bit and no parity.
- Slave address ;
- Function code ;
- Function data;
- CRC.
A message starts by sending the slave address to the line. A transmission ends when no characters are received for a
time equal at least to 3.5 times than the time needed for transmitting a character, thus equal to 1:9600*10*3.5 = 3,64
ms. Therefore no longer than 3,64 ms should pass from one character to another of the same transmission.
As far as answer transmission times from the slave are concerned, these can vary. As a matter of fact they depend on
the kind of Function received, but above all they depend on the state of the control unit during the receipt. Therefore
it is possibile to estabilish only a min. and max. time for the answer to be received.
It can be said that from the end of the answer transmission by the master, to the beginning of the receipt by the
slave, min. 6 ms and max. 70 ms pass. However, it could happen that if the control unit 9010/20 is carrying out the
calibration of ADC (once every hour), the max. answer time could reach up to 370 ms.
Furthermore, the control unit could not answer if it is carrying out the ram test (in such case all processes are stopped,
including the receipt by the serial line). Such test is carried out once a minute.
2.4 CRC
The CRC is calculated with the algorithm CRC16. The CRC on two bytes is transmitted at the end of the message,
particularly first the low byte and then the high byte is sent. Procedure for the crc calculation is shown below:
(1) load the crc record (at 16 bits) with value FFFFh;
(2) point to the 1st character to be transmitted;
(3) XOR between the pointed character and the crc record, resulted in the crc record;
(4) CONT is initialized at 0;
(5) the crc record shifts rightwise of a bit;
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 1
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
(6) if the bit on the right is 1, then the XOR between the crc record and A001h results in the crc record, if on the
contrary it is 0, switch to point (7);
(7) increase of CONT;
(8) if COUNT is lower than 8, go to point (5), if equal to 8 go to point (9
(9) increase the pointer to the bytes to be transmitted;
(10) if the pointer for the bytes to transmit has exceeded the last data to be transmitted, go to point (11), otherwise go
to point (3).
(11) the crc record includes now the crc value, ready to be transmitted.
When the slave receives a message, the crc is calculated on the data received and it is compared with the crc
received. In case of discordance, the slave ignores the message received.
3.0 FUNCTION 03
The 03 Function permits to ask the slave for the value of one or more words (max. 125).
Syntax of this Function will be:
The broadcast mode for this Function is not enabled. Il mode broadcast per questa funzione non è permesso.
4.0 06 FUNCTION
The 06 Function permits to write the value of a word.
The syntax of this Function will be:
The slave answer to the 06 Function (with successful conclusion and if the mode broadcast has not been used) will be
the just the same as the question.
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 2
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
5.0 07 FUNCTION
The 07 Function permits to read the state of 8 bits with a compact message. Particulary this Function returns the state
of alarms CAUTION, WARNING, ALARM and the state of FAIL for both channels.
Syntax of this Function will be:
6.0 09 FUNCTION
The 09 Function permits to aknowledge and silence alarms.
Syntax of this Function will be:
The slave answer to the 09 Function (with successful conclusion and if the broadcast mode has not been used) will be
7.0 16 FUNCTION
The 16 Function permits to write a consecutive block of word.
Syntax of this Function will be:
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 3
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
The slave answer to the 16 Function (with successful conclusion and if the broadcast mode has not been used) will
be:
Please note that especially for functions 06 and 16, word writing, no control on the value which will be written
in a word is carried out. That means that the master should send relevant values regarding single words.
Writing of values out of range can cause serious failures to control units 9010/20.
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 4
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 5
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 6
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
0001h = downwards
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 7
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 8
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
Min. = 0000h
Max. = 0064h (100)
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 9
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 10
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
0003h = mode 2A
0004h = mode 2M
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 11
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 12
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
105 STATE_FAIL_CHA Shows if the CHA has a failure and which is the current failure R
0000h = no failure
0001h = failure F1
0002h = failure F2
0003h = failure F3
0004h = failure F4
0005h = failure F5
0006h = failure F6
0007h = failure F7
0008h = failure F8
115 STATE_FAIL_CHB Shows if the CHB has a failure and which is the current failure R
0000h = no fail
0001h = fail F1
0002h = fail F2
0003h = fail F3
0004h = fail F4
0005h = fail F5
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 13
MODBUS PROTOCOL FOR COMMUNICATION WITH CARDS 9010/20 LCD Release 1.0 08.01.2001
0006h = fail F6
0007h = fail F7
0008h = fail F8
MSA Italiana s.p.a. Divisione Strumenti Via Po, 13/17 Rozzano (MI) 14