51
OPERATION_INIT:Pre-set value of power on operation command
0b00=Power OFF, pre-set 0x00(OFF)
0b01=Power ON, pre-set0x01(ON)
0b10=Pre-set is previous set value
0b11=not used, reserved
0x80
0x03
0x
8C
00
0x
3
000
0xDA31
6.3.7 Communication Examples
The following provides examples of request and response for each
function code of the Modbus RTU.
6.3.7.1
Read Holding Registers (FC=03)
The request message specifies the starting register and quantity
of registers to be read.
For example: the master requests the content of analog output
holding registers
0x008C-0 008E
x
(MFR_REVISION_B0B5)
from slave 0.
Request:
0x80: Slave ID 0
0x03: Function code 3 (Read Analog Output Holding R Registers)
0x008C: The Data Address of the first register requested.
0x0003: The total number of registers requested ( Read 3 registers from
0x008C
0 008E
x
to
)
0x
:
sending the Lo byte first
DA31
CRC16 Error Check. Please be aware that CRC
.
Response:
0x80: Slave ID 0
0x03: Function code 3 (Read Analog Output Holding R Registers)
0x06: The number of data bytes to follow (6 bytes)
0x0A FF FF FF FF FF: means that the firmware version of the MCU number1
is R01.0.
0x
:
sending the Lo byte
7DEC
CRC16 Error Check. Please be aware that CRC
first
.
0x80
0x03
0x06
0x0AFFFFFFFFFF
0x7DEC
6.3.7.2 Read Input Register
(FC=04)
The request message specifies the starting register and quantity
of registers to be read. For example: The master requests the
content of analog input register
(
) from salve 0
0x0060 READ_VOUT
6
52
Request:
0x80
0x04
0x80: Slave ID 0
0x0 : Function code 4 (Read Analog Input Registers)
4
0x0060: The Data Address of the first register requested
0x0001: he total number of registers requested ( read only 1 registers from
0x0060
)
0x2FC5:
sending the Lo byte first
CRC16 Error Check. Please be aware that CRC
.
0x0 6
0 0
0x
1
000
0x2FC5
Response:
0x80: Slave ID 0
0x0 : Function code 4 (Read Analog Input Register)
4
0x02: The number of data bytes to follow (2 bytes)
0x157C: The contents of register:
0x0060(READ_VOUT). 157C
= 5500
16
10
= 55.00V
0x0D03:
sending the Lo byte
CRC16 Error Check. Please be aware that CRC
0x80: Slave ID 0
0x0 : Function code 6 (Preset Single Register)
6
0x0000: The Data Address of the register
0x0001: The value to write
0x561B:
sending the Lo byte
CRC16 Error Check. Please be aware that CRC
first
.
Response:
The normal response is an echo of the query, returned after the register
contents have been written.
6.3.7.3 Write Single Register (FC=06)
The request message specifies the register reference to be written.
For example: the master writes PSU ON to analog output holding
register of 0x0000 (OPERATION) for salve 0
Request:
0x80
0x04
02
0x157C
0 0D03
x
0x80
0x06
0x0000
0x0001
0 561B
x
6