4

Close a Modbus/TCP Client Connection (3001)

The application programcloses a Modbus/TCP Client Connection by issuing the Close Modbus/TCP Client Connection COMMREQ. The Close COMMREQ closes the underlying TCP connection and frees the channel for other communication tasks.

An error response is returned if the channel number in the COMMREQ identifies a non-

Modbus/TCP Client connection or an inactive channel.

Command 3001 Example

Terminate the Modbus/TCP Client connection established on Channel 5. Return the COMMREQ Status word to %R10.

 

Dec

(Hex)

 

Word 1

00002

(0002)

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

03001

(0BB9)

Close Modbus/TCP Client Connection

Word 8

00005

(0005)

Channel number (5)

*Word 4 (CRS word address) is the only zero-based address in the Command Block. Only this value requires subtracting 1 from the intended address.

(Word 7) Channel Command Number: Word 7 requests the Close channel service.

(Word 8) Channel Command Number: Word 8 identifies a channel previously opened with a Open Modbus/TCP Client Connection request. An unallocated channel results in an error response.

4-10

TCP/IP Ethernet Communications for the Series 90™ PLC User's Manual– May 2002

GFK-1541B

Page 125
Image 125
GE GFK-1541B manual Close a Modbus/TCP Client Connection, Command 3001 Example