WP9038ADAM User’s Manual V1.42
When module receives correct command, it will make corresponding actions and send response back to the master. This is
successful communication.
5.6
、
Command for state collection of digital output
:
Send: 01 01 00 00 00 04 3D C9
(
example/hexadecimal
)
data byte data description remark
01 1 module address Address range 01-FE
01 1 function code 01-read coil state
0000 2 coil address(0x mode) 0000-initial address of coil
0004 2 read coil length 0004-read 4 coils state
3DC9 2 CRC check code CRC check code for all data
Receive: 01 01 01 03 11 89
(
example/hexadecimal
)
data byte data description remark
01 1 module address Address range 01-FE
01 1 function code 01-read coil state
01 1 byte numbers 01-read one byte data
03 1 read data 03-read coil state
1189 2 CRC check code RC check code for all data
Converting reading data “03” to 2 hexadecimal results “0000 0011”. From left to right, it represents the 4 digital output channel
status DI_04 ~ DI_01. Here it means DO_02
、
DO_01 have output but others no.
5.7
、
command for module address setting
:
Send
:
00 06 00 64 00 01 08 04
(
example/hexadecimal
)
date byte data description remark
00 1 module address 00-group sending
06 1 function code 06-write single register
0064 2 register address (4x mode) 0064-modify module address
0001 2 data writing set new address for module, range 0001-00FE
0804 2 CRC check code CRC check code for all data
Receive
:
00 06 00 64 00 01 08 04
(
example/hexadecimal
)
This command means to send a code to a module, set the module address as 01, this setting could be saved when power off;
default address of module is 01,each module address could be assigned separately when using multiple modules for
network.Attentions is required that only one module could be used in 485 network when using multiple address sending,
otherwise all the modules will share the same address in 485 network. When module receives correct command, it will make
corresponding actions and send response back to the master. This is successful communication.
5.8
、
Command for communication parameter setting
:
Send
:
01 06 00 65 00 02 18 14
(
example/hexadecimal
)
data byte data description remark
01 1 module address address range:01-FE
06 1 function code 06-write single register
0065 2 register address (4x mode) 0065-modify communication parameter
0002 2 data writing 0001-set communication parameter 4800,N(no
check) ,8,1
0002-set communication parameter 9600,N(no
check) ,8,1
0003-set communication parameter 19200,N(no
check) ,8,1
0004-set communication parameter 38400,N(no
check) ,8,1
0005-set communication parameter 4800,E(even
check) ,8,1
0006-set communication parameter 9600,E(even
check) ,8,1
0007-set communication parameter 19200,E(even
check) ,8,1
0008-set communication parameter 38400,E(even
check) ,8,1
1814 2 CRC check code CRC check code for all data