Function Code 16 ($10) – Write Multiple Registers
Example 1
Assume the desired setting for digital outputs on the Galil slave in descending order from 15-0 are as
follows:
0101010110101010
And that the command issued from the Galil Master is MBm= ,16,2,4,array[], where array[] contains
[$40A0,$0000,$4040,$0000].
The Modbus request and response packets would form as follows if MI 0 is set:
Master Request
Slave Response
32-Bit Floating Point
Field Name
Hex
Field Name
Hex
Function
$10
Function
$10
Starting Address Hi
$00
Starting Address Hi
$00
Starting Address Lo
$02
Starting Address Lo
$02
Quantity Outputs Hi
$00
Quantity of Registers Hi
$00
Quantity Outputs Lo
$04
Quantity of Registers Lo
$04
Byte Count
$08
RegVal0 High
$40
$A0
$00
RegVal0 Low
$00
RegVal1 High
$40
$40
$00
RegVal1 Low
$00
As a result, the Galil slave will have analog output 1 set to 5V and analog output 2 set to 3V.
Example 2
Assume the desired setting for digital outputs on the Galil slave in descending order from 15-0 are as
follows:
0101010110101010
And that the command issued from the Galil Master is MBm= ,16,2,2,array[], where array[] contains
[$FFFF,$9999,$6666,$3333].
The Modbus request and response packets would form as follows if MI 1 is set:
Master Request
Slave Response
32-Bit Floating Point
Field Name
Hex
Field Name
Hex
Function
$10
Function
$10
Starting Address Hi
$00
Starting Address Hi
$00
Starting Address Lo
$02
Starting Address Lo
$02
Quantity Outputs Hi
$00
Quantity of Registers Hi
$00
Quantity Outputs Lo
$02
Quantity of Registers Lo
$02
Byte Count
$04
RegVal0 High
$FF
RegVal0 Low
$FF
RegVal1 High
$99
RegVal1 Low
$99
Chapter 3 Communication ▫ 36 RIO-47xxx Rev. 1.0r