MC150
8.3.1 Protocol structure
Field
Value
Function
EOT
04 H
End Of Transmit
AD1
ascii
Unit address, MSByte
AD2
ascii
Unit address, LSByte
STX
02 H
Start of TeXt
C1,C2
ascii
Level code = 20 : Level 1
21: Level 2
C3,C4
ascii
Parameter code = 00…99
DATA
n byte
ascii
Process data
ETX
03 H
End of TeXt
BCC
ascii
Block Check Character
ENQ
05 H
ENQuiry
NAK
15 H
Not Acknowledge
ACK
06 H
Acknowledge
NOTE:
•
BCC
(block-check-character) is a character used
for check the correct transmission. It is
generated by XOR-ing characters C1, C2, C3,
C4, DATA and ETX (including). If BCC < 20 Hex,
BCC must be added up with 20 Hex, this avoids
BCC to have values in the range of control
character values.
•
DATA
field can contain any number of
numerical characters, a sign and can be filled
up with zeros. All DATA are sent in ASCII Code.
8.3.2 Send data from Master to Slave
PC
MC150
EOT AD1 AD2 STX
C1
C2
C3
C4
DATA
ETX BCC
When transmission is correct slave replies with ACK
in any other cases with NAK.
MC150
PC
ACK
or
NAK
All parameters sent to the slave are stored in a data
buffer. Parameters have to be activated by the
"activate parameter" command (see chap. 8.3.4).
Example:
Sets the parameter P01 = 100 (unit address = 11).
PC
MC150
EOT AD1 AD2 STX C1 C2 C3
C4
ascii
1
1
2
1
0
1
Hex
04
31
31
02
32
31
30
31
DATA
ETX BCC
ascii
1
0
0
Hex
31 30 30
03
30
MC150
PC
ACK
ascii
Hex
06
8.3.3 Receive data from slave
PC
MC150
EOT AD1 AD2 STX C1 C2 C3 C4 ENQ
The correct reception of the string is acknowledged
with the following message:
MC150
PC
STX C1 C2 C3 C4
DATA
ETX BCC
The reception of a incorrect string is followed by a
negative acknowledgment like:
MC150
PC
STX
C1
C2
C3
C4
EOT
in any other cases with “NAK”:
MC150
PC
NAK
Example:
Read actual value (unit address = 11).
PC MC150
EOT AD1 AD2 STX C1 C2 C3 C4 ENQ
ascii
1
1
2
1
9
9
Hex
04
31
31
02 32 31 39 39
05
If actual value = 12 acknowledge message will be:
MC150 PC
STX C1 C2 C3 C4
DATA
ETX BCC
ascii
2
1
9
9
1
2
Hex
02 32 31 39 39 31
32
03
23
MAN MC150 I_E 1.7
15
www.lika.it
www.lika.biz