EasyManua.ls Logo

RuiDeng DPH5005 - MODBUS Communication Examples; Reading Voltage and Current (Function 0 x03); Setting Voltage (Function 0 x06); Setting Voltage and Current (Function 0 x10)

RuiDeng DPH5005
14 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Three examples of communication using the three available MODBUS
Functions Codes supported on this device. (0x03) (0x06) and (0x10)
1 : Read the displayed output voltage and current value. (Using Function 0x03)
Message format sent from Host:
Host sends
Number of
bytes
Information sent
Notes
Slave address
1
01
From host to slave address 01H
Function code
1
03
Read holding register(s)
Register starting
address
2
0002H
Register starting address
Number of registers to
read
2
0002H
A total of 2 registers (4 byte = 2
words)
CRC Checksum:
2
65CBH
CRC Checksum from Host:
For example if the displayed values are 05.00V , 5.000A , The Slave return response would be:
Slave responds
Number of
bytes
The
information
returned
Notes
Slave address
1
01
From slave address 01H
Function code
1
03
Read holding register
Number of bytes read
1
04
A total of 4 Bytes
The contents of 1
st
register read
2
01F4H
Output voltage display
values
The contents of 2
nd
register read
2
1388H
Output current display value
CRC Checksum:
2
B76BH
CRC Checksum from Slave
2 : Host to set the voltage to 24.00V. (Using Function 0x06)
Message format sent from host:
Host sends
Number of
bytes
Information
sent
Notes
Slave address
1
01H
From host to slave address
01H
Function code
1
06H
Write single register
Register address
2
0000H
Register address
The value to write to the register
2
0960H
Set the output voltage
CRC Checksum
2
8FB2H
CRC Checksum from host
Message format returned from Slave:
Slave responds
Number of
bytes
The
information
returned
Notes
Slave address
1
01H
From slave address 01H
Function code
1
06H
Write single register
Register address
2
0000H
The Register address
The contents of the register read
2
0960H
Value read
CRC Checksum
2
8FB2H
CRC Checksum from slave
3 : Host to set the voltage to 24.00V , The current 1.500A. (Using Function 0x10 (decimal 16))
Message format sent from HOST:
Host sends
Number of
bytes
Information
sent
Notes
Slave address
1
01H
From host to slave address
01H
Function code
1
10H
Write multiple registers
Register starting address
2
0000H
Register the starting address
Quantity of registers to write to
2
0002H
2 registers
Number of bytes to write
1
04H
4 Bytes = 2 words = 2 registers
Contents of 1
st
register
2
0960H
Set the output voltage
Contents of 2nd register
2
05DCH
Set the output current
CRC Code:
2
F2E4H
CRC Checksum from Host:

Related product manuals