12.1.4 Read the status of digital input(Function code 0x02)
Frame
structur
e
Host
Byte
request
Data
range
Message
example
Frame
structur
e
Slave
respons
e
Byte
Message
example
Remark: the register value in the slave response indicates the status of digital
input. Beginning from the lowest bit of the byte, each number corresponds
to the status of a loop of digital input. "1" indicates the switch is closed, while
"0" indicates the switch is cut off. In the upper list the register value "0x02"
SAM3001 Manual de usuario V5
addres
functio
s code
n code
1 byte
1 byte
1~247
0x02
0x01
0x02
addres
functio
s data
n code
1 byte
1 byte
0x01
0x02
-92-
data code
initial
number
switch
of
addres
switches
s
2 bytes
2 bytes
0x0001
~
0x0000
0x000C
0x00
0x00
0x00
0x04
data code
byte of
register
registe
value
r
1 byte
1 byte
0x01
0x02
CRC
check
code
2
bytes
CRC1
6
0x79
0xC9
CRC
check
code
2
bytes
0x20
0x49