4

Establish Write Channel (2004)

The Establish Write Channel command requests that a channel be connected to a remote PLC and that data from the local PLC be transferred (periodically) to the remote PLC. The Command Block specifies the period, the number of writes to the server to perform, and the timeout allowed in waiting for each transfer to complete. The first write is performed immediately, regardless of the period specified.

Example Command Block

Establish a write channel (channel 6) to a remote PLC at IP address 3.0.0.1. Return the COMMREQ Status word to %R10. Write local PLC registers %R50-%R57 to remote PLC registers %R100-%R107. Repeat the write indefinitely once every 7 seconds with a timeout of 500 ms for each write.

The term local PLC is used here to identify the clientPLC-the PLC that initiates the communications request.

The term remotePLC is used here to identify the serverPLC-the PLC that respondsto the request.

 

Dec

(Hex)

 

Word 1

00017

(0011)

Length of Channel Command Data Block (17 - 25 words)

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

02004

(07d4)

Establish Write Channel Command number

Word 8

00006

(0006)

Channel number (6)

Word 9

00000

(0000)

Number of write repetitions (write indefinitely)

Word 10

00003

(0003)

Time units for write period (3=seconds)

Word 11

00007

(0007)

Number of time units for write period (every 7 seconds)

Word 12

00050

(0032)

Timeout for each write (500 ms)

Word 13

00008

(0008)

Local PLC - memory type from which to write data (%R)

Word 14

00050

(0032)

Local PLC - starting address from which to write data (%R50)

Word 15

00008

(0008)

Remote PLC - memory type at which to store data (%R)

Word 16

00100

(0064)

Remote PLC - starting address at which to store data (%R50)

Word 17

00008

(0008)

Remote PLC - number of memory units (8 registers)

Word 18

00001

(0001)

Remote PLC - PLC (node) address type (IP address)

Word 19

00004

(0004)

Remote PLC - PLC (node) address length in words (4)

Word 20

00003

(0003)

Remote PLC - register 1 of IP address (3)

Word 21

00000

(0000)

Remote PLC - register 2 of IP address (0)

Word 22

00000

(0000)

Remote PLC - register 3 of IP address (0)

Word 23

00001

(0001)

Remote PLC - register 4 of IP address (1)

Word 24 - 27

 

 

Remote PLC - Program Name (needed for access to remote %P

 

 

 

or %L) (zero terminated and padded)

Word 28 - 31

 

 

Remote PLC - Program Block (needed for access to remote %L)

 

 

 

(zero terminated and padded)

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

(Word 7) Channel Command Number: Word 7 requests that a write channel be set up. If the command is processed successfully, it will result in attempting the specified number of transfers from the client to the server.

GFK-1004B

Chapter 4 Programming Communications Requests

4-15

Page 103
Image 103
GE GFK-1004B user manual Establish Write Channel, Example Command Block