
FEMA ELECTRÓNICA . Series K . K40-232
7
The protocol frames are structure with a header section (‘Header’), a
data section (‘Data’) and a end of frame section (‘Trail’).
Section ‘Header’
Contains the start of frame byte (‘STX’), the frame identifier (‘ID’),
the sender (‘FROM’) and destination (‘TO’) addresses, the register
number (‘REG’) and the length (‘LONG’) of the ‘Data’ section.
Section ‘Data’
Contains the data of the register (‘REG’).
Header
Data
Trail
STX
ID
RSV
FROM
TO
REG
RSV
LONG
D0
D1
...
Dn
CRC
ETX
2
x
32
x
x
x
32
n+1
[data]
x
3
0
1
2
3
4
5
6
7
8
9
...
n+7
n+8
n+9
Field
Description
Size
Position
Real value
Frame value
STX
Start of frame
1 byte
0
does not apply
2
ID
Type of frame
1 byte
1
real_value
RSV
Reserved
1 byte
2
0
32
FROM
Sender address
1 byte
3
0 (‘Master’) / 1 a 31 (‘Slave’)
32 + real_value
TO
Destination address
1 byte
4
0 (‘Master’) / 1 a 31 (‘Slave’)
128 (‘broadcast’)
32 + v
REG
Register number
1 byte
5
see sections 1.16, 1.17 and 1.18 32 + real_value
RSV
Reserved
1 byte
6
0
32
LONG
Length of ‘Data’ section
1 byte
7
n (between 0 and 32)
32 + real_value
D0 … Dn
Data
n bytes
8 a n+7
number 0 to 9
decimal point
sign (+/-)
ASCII code for number (48 to 57)
ASCII code for dot (46)
ASCII code for ‘+’ (43)
ASCII code for ‘-’ (45)
CRC
CRC calculated value
1 byte
n+8
does not apply
ETX
End of frame
1 byte
n+9
does not apply
3
Table 2 - Description of the ASCII frame bytes
Section ‘Trail’
Contains the ‘CRC’ code and the end of frame byte (‘ETX’).
‘Real value’ and ‘Frame value’
In order to use frame characters that are representable and easily
recognizable on screen, the protocol codifies the values before intro
-
ducing them into the frame. The following nomenclature is defined :
• ‘real value’ is the value of the field without codification
• ‘frame value’ is the value codified
1.14 Frame structure
Summary of Contents for K Series
Page 32: ......