29
2
2
.
.
B
B
I
I
N
N
A
A
R
R
Y
Y
m
m
o
o
d
d
e
e
The transfer table is as follows:
/* measurements */
table_tr_byte[0] = voie[0].mes;
table_tr_byte[2] = voie[1].mes;
table_tr_byte[4] = voie[2].mes;
table_tr_byte[6] = mes_ligne;
table_tr_byte[8] = mes_temp_int;
table_tr_byte[10] = mes_temp_ext;
table_tr_byte[12] = mes_1v2;
table_tr_byte[14] = mes_ref;
table_tr_byte[16] = taux_usure;
/* statuses */
table_tr_byte[30] = voie[0].etat;
table_tr_byte[32] = voie[0].def;
table_tr_byte[34] = voie[1].etat;
table_tr_byte[36] = voie[1].def;
table_tr_byte[38] = voie[2].etat;
table_tr_byte[40] = voie[2].def;
table_tr_byte[42] = defaut;
table_tr_byte[44] = etat_al_def;
table_tr_byte[46] = etat;
/* relays */
table_tr_byte[50] = etat_rel;
settable speed, 1 start, 8 data or control bits, 1 stop
Timeout of 450 ms (reading response time is less than 10 ms).
Frame example: 5A 03 00 04 00 05 C9 23 (reading of 5 words from address 4 on slave 5A)
byte 5A (or letter "Z")
corresponds to the slave number
byte 03
corresponds to the function number (read of N words)
byte 00
is the most significant byte of the 1st word address
byte 04
is the least significant byte of the 1st word address
byte 00
is the most significant byte of the word number to be read
byte 05
is the least significant byte of the word number to be read
byte C9
is the least significant byte of CRC16 (checksum)
byte 23
is the most significant byte of CRC16 (checksum)