0% found this document useful (0 votes)
53 views8 pages

AMDIB16 MODBUS RTU Commamd

The document provides detailed instructions for using the AMDIB16 MODBUS RTU command, including supported function codes, register addresses, and examples for reading and writing data. It emphasizes the importance of consistent baud rate and parity settings, as well as the correct slave address for communication. Additionally, it includes commands for setting device parameters, automatic reporting, and performing factory resets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views8 pages

AMDIB16 MODBUS RTU Commamd

The document provides detailed instructions for using the AMDIB16 MODBUS RTU command, including supported function codes, register addresses, and examples for reading and writing data. It emphasizes the importance of consistent baud rate and parity settings, as well as the correct slave address for communication. Additionally, it includes commands for setting device parameters, automatic reporting, and performing factory resets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

AMDIB16 MODBUS RTU Commamd

MODBUS command (function code, write 06/16, read 02/03)

DEMO : https://youtu.be/qS2_hhnYAhk

Note :
1 MODBUS command must be HEX
2 Slave address (device address) must be the same as the setting. You can also use this
command to query the current device address: FF 03 00 FD 00 01 00 24
3 The Baudrate and parity should be consistent

Supported function codes:


Function Modbus Register Describe
Code Address Address
(PLC)
02: 10001 0x0000-0x000F Read DI digital input (optical isolation input)
(0-15)
03 40001
0x0080-0x00FF Read special function registers (baud rate 485
(128-255) address, etc.)
06 40001
0x0080-0x00FF Write a single special function register (baud rate
(128-255) 485 address, etc.)
16(0x10) 40001
0x0080-0x00FF Write multiple special function registers (baud rate
(128-255) 485 address, etc.)

All states are mapped into 4xxxx range registers. The user can monitor the input and output
status of the module by reading or modifying the value of the 4xxxx interval register (03 06
16 function code)
Register Register contents Register Remarks R/W
address value

0x0090 DI digital input 0 Digital input status 0-15 bits R


(144)

0x00F7 Product ID 0-65535 SKU ID


(247) AMDIB16 2016
0x00F8 Automatic reporting 0-255 0: Query function (default) R/W
(248) of digital input(DI) 1-255: Automatically report,
status the unit is second.
1: Report every 1 second
2: Report every 2 seconds
10: Report every 10 seconds
Maximum interval of 255
seconds
0x00FB Factory Reset 00 Factory Reset: R/W
(251) Enter the following command
at the current baud rate:
FF 06 00 FB 00 00 ED E5
0x00FC Command Return 0-25 Time interval for command R/W
(252) Time return (unit: 40MS) Setting
value: 0-25
0x00FD RS485 address Read address:FF 03 00 FD 00 01 00 24; R/W
(253) (Station address) Set address to 0x02:
FF 06 00 FD 00 02 8C 25
0x00FE Baud rate 0-255 0:1200 1:2400 2:4800 R/W
(254) 3:9600(default)4:19200
5:38400 6:57600
7:115200
Others:Factory reset
0x00FF Parity 0-2 0 None Parity R/W
(255) 1 Even Parity
2 Odd Parity

9600 Band ,8 Data bits,None Parity,1 Stop Bit。

MODBUS commands you can use "Modbus Poll" input, as shown below
(CRC check generated automatically)
You can also use HyperTerminal serial input, as shown below
(Manually add CRC check)

1. Read DI digital input status (NPN/PNP photoelectric isolation


input): Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):10001-10016
RS485 address : 0x01~0x3F
Function code: 0x02
Register address:0x0000-0x000F
Read number :0x0001-0x0010

For example, read the status of DI digital input of channel 0-7:


Send data(address 1): 01 02 00 00 00 08 79 CC
Return data : 01 02 01 89 60 2E
01 RS485 address, 02 function code, 01 length, 89 refers to the current
DI digital input status, converted to binary 10001001, indicating that
0/3/7 channels have input, and other channels have no input.

In addition, the DI digital input is also mapped to the 40000 interval


register. The user can read the value of the DI digital input through
the 03 function code.

Modbus Address(PLC):40145
RS485 address : 0x01~0x3F
Function code:0x03
Register address:0x0090
Read number: 0x0001

For example, read the status of DI digital input of channel 0-7:


Send data(address 1): 01 03 00 90 00 01 84 27
Return data : 01 03 02 00 56 38 7A
01 RS485 address, 03 function code, 02 length, 0056 refers to the
current DI digital input status, converted to binary 01010110,
indicating that 1/2/4/6 channels have input, and other channels have
no input.

Special function Register


1.Set the 485 address(Slave ID)
Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40254
RS485 address :0x01~0Xf8/0XFF
Function code:Write 0x06/0x10,Read 0x03
Register address:0x00FD(253)
Value: 2 bytes (values 1-248)

For example 1: Set the current device address to 0x02


Send data(address is 1): 01 06 00 FD 00 02 99 FB
Return data : 01 06 00 FD 00 02 99 FB
Send data(don't know the address): FF 06 00 FD 00 02 8C 25
Return data : FF 06 00 FD 00 02 8C 25

For example 2: Read device address(0X0001)


Send data : FF 03 00 FD 00 01 00 24
Return data : 01 03 02 00 01 79 84

Note:With this command, there can be only one module on the bus 485,
More than one will go wrong!

2.Write baud rate


Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40255
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FE(254)
Value: 2 bytes (values 0-7)

For example 1, Change the baud rate to 4800bps:


Send data(address 1):01 06 00 FE 00 02 69 FB
Return data :01 06 00 FE 00 02 69 FB

Baud rate corresponds to the number: 0:1200 1:2400 2:4800 3:9600


4:19200 5:38400 6:57600 7: 115200 8: Factory reset
Note: 1 The baud rate will be updated only when the module is powered on
again when this command is used!
2 When the number corresponding to the baud rate is 8, the factory
settings can be restored
For example:01 06 00 FE 00 08 E9 FC

For example 2 Read the current baud rate:


Send data(address 1):01 03 00 FE 00 01 E5 FA
Return data :01 03 02 00 03 F8 45
01 RS485 address,03 Function,02 length,F8 45 crc16,03 means the current
baud rate is 9600bps

Baud rate corresponds to the number: 0:1200 1:2400 2:4800 3:9600


4:19200 5:38400 6:57600 7: 115200

4. Set DI digital input status to automatically report (8 channels are set at the

same time):(Automatic reporting of digital input(DI) status)

Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40249
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00F8(248)
Value: 2 bytes (values 0-255)

For example : For example, the current query function should be changed
to automatic reporting:

1 second automatic report : 01 06 00 F8 00 01 C9 FB


2 second automatic report : 01 06 00 F8 00 02 89 FA
3 second automatic report : 01 06 00 F8 00 03 48 3A
4 second automatic report : 01 06 00 F8 00 04 09 F8
5 second automatic report : 01 06 00 F8 00 05 C8 38
10 second automatic report : 01 06 00 F8 00 0A 88 3C

Disable reporting function(Query function): 01 06 00 F8 00 00 08 3B

5.Set Command(Date) Return Time


Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40253
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FC(252)
Value: 2 bytes (values 0-25)

For example, set the data return delay to 200ms


Send data(address 1):01 06 00 FC 00 05 89 F9
Return data :01 06 00 FC 00 05 89 F9
Return the delay time calculation formula:X = 05 * 40 = 200MS

Note: The maximum can be set to 1000MS. If it exceeds 1000MS, that is,
the setting value is greater than 25, and the data return delay will be
initialized.
That is: 01 06 00 FC 00 20 48 22 can make the data return delay to restore
initialization 0

6.Set Parity
Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40256
RS485 address :0x01~0x3F
Function code:Write 0x06/0x16;Read 0x03
Register address:0x00FF(255)
Value: 2 bytes (values 0-2)

For example, set the parity to Even parity


Send data(address 1):01 06 00 FF 00 01 78 3A
Return data :01 06 00 FF 00 01 78 3A
0 None Parity 1 Even Parity 2 Odd Parity
Note: 1. When using this command, the module is powered on again, and the check
digit will be updated!
2. When the setting is greater than 2, the default value will be restored to 0
after powering on again, and there will be no verification.

7.Factory reset:
Send data
RS485 address Functio Register address Read number (2) CRC16(2
(Station address) n (1) (2) )
(1)
Returns data
RS485 address Functio Number of bytes data (n) CRC16(2
(Station address) n (1) (1) )
(1)

Modbus Address(PLC):40252
RS485 address : 0x01~0x3F
Function code:Write 0x06;
Register address:0x00FB(251)
Send data(address 1):FF 06 00 FB 00 00 ED E5
Return data :FF 06 00 FB 00 00 ED E5

For Command reset details, see: "AMIOA08 Factory Reset"

Link :https://1drv.ms/u/s!Av4PLxH_z8f1mBCFrTZWZSsyyg4l?e=fgC5o

You can also open the shell to reset the hardware: short the RES

jumper of the board for 5 seconds, then power on again.

You might also like