Chapter 9. Modbus/TCP Client
158
PACSystems* RX7i & RX3i TCP/IP Ethernet Communications User Manual
GFK-2224Q
Mask Write Register Request to a Modbus Server Device (3009)
The Mask Write Register Request to a Modbus Server Device COMMREQ is used to modify the contents of a
specified remote device register using a combination of an AND mask, OR mask and the current register’s
value. This function is used to set or clear individual bits in a register. The register is modified per the following
algorithm:
Register value = ((Current register value) AND (And Mask Value)) OR
((OR Mask Value) AND (NOT(And Mask Value)))
Command 3009, Example – Mask Write Register
Modify register at address 200 in the remote Modbus/TCP server and clear all bits except bit 0. Return the
COMMREQ Status word to %R10. Use channel 6, a channel previously opened with the Open Modbus/TCP Client
Connection COMMREQ.
Dec (Hex)
Word 1
00008 (0008)
Length of Channel command Data Block
Word 2
00000 (0000)
Always 0 (no-wait mode request)
Word 3
00008 (0008)
Memory type of CRS word (%R)
Word 4
00009 (0009)
CRS word address minus 1 (%R10)
Word 5
00000 (0000)
Reserved
Word 6
00000 (0000)
Reserved
Word 7
03009 (0BC1)
Mask Write Register to a Modbus/TCP Server Device
Word 8
00006 (0006)
Channel number (6)
Word 9
00022 (0016)
Modbus Function Code – Write Mask Register
Word 10
00200 (00C8)
Address in the Remote Device
Word 11
00001 (0001)
AND Mask
Word 12
00000 (0000)
OR Mask
Word 13
00001 (0001)
Unit Identifier
(Word 7) Channel Command Number:
Word 7 identifies the COMMREQ as a Mask Write Register operation on
remote Modbus/TCP device.
(Word 8) Channel Number:
Word 8 identifies the channel number previously allocated for communication with
the remote Modbus/TCP server.
(Word 9) Modbus Function Code:
Word 9 specifies Function Code 22, Mask Write Register.
(Word 10) Remote Device Address:
specifies the destination register in the remote device.
(Word 11) AND Mask:
Word 11 specifies the AND mask to be used in the Mask Write operation. For this
example, all bits are cleared except bit 0.
(Word 12) OR Mask:
Word 12 specifies the OR mask to be used in the Mask Write operation. In this example,
no bits are to be set.
(Word 13) Unit Identifier:
This field is typically used by Ethernet to Serial bridges to specify the address of a
Modbus Slave on a multi-drop link. The Modbus/TCP Unit Identifier is a special control code used in a
Modbus/TCP message block.
Summary of Contents for PACSystems RX7i
Page 45: ......
Page 80: ...Chapter 4 Configuration GFK 2224Q January 2017 67 ...
Page 81: ......
Page 122: ...Chapter 6 Programming EGD Commands GFK 2224Q January 2017 109 ...
Page 147: ......
Page 211: ......
Page 262: ...Chapter 13 Network Administration GFK 2224Q January 2017 249 ...
Page 263: ......