Mask Write Register Request To A Modbus Server Device (3009) - GE RX3i User Manual

Pacsystems
Hide thumbs Also See for RX3i:
Table of Contents

Advertisement

Chapter 9. Modbus/TCP Client

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
Word 1
00008 (0008)
Word 2
00000 (0000)
Word 3
00008 (0008)
Word 4
00009 (0009)
13
Word 5
00000 (0000)
Word 6
00000 (0000)
Word 7
03009 (0BC1)
Word 8
00006 (0006)
Word 9
00022 (0016)
Word 10
00200 (00C8)
Word 11
00001 (0001)
Word 12
00000 (0000)
Word 13
00001 (0001)
(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.
158
PACSystems* RX7i & RX3i TCP/IP Ethernet Communications User Manual
(Hex)
Length of Channel command Data Block
Always 0 (no-wait mode request)
Memory type of CRS word (%R)
CRS word address minus 1 (%R10)
Reserved
Reserved
Mask Write Register to a Modbus/TCP Server Device
Channel number (6)
Modbus Function Code – Write Mask Register
Address in the Remote Device
AND Mask
OR Mask
Unit Identifier
GFK-2224Q

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rx7i

Table of Contents