Overview

The CONTROL and DATABUF output parameters define the operations of the MBP_MSTR function block. For the EtherNet/IP protocol, the structure of the CONTROL and DATABUF output parameters remains the same for all explicit messaging services.

Configuring the Control Parameter

Use MSTR operation 14 or 270 to send generic Modbus requests on the network. (These operation codes are not available on the Modbus Plus port or embedded Ethernet port on the CPU.)

The CONTROL parameter register contains these consecutive words:

Register

Function

Description

CONTROL[0]

operation

  • 14 = unconnected

  • 270 = connected

CONTROL[1]

detected error status

Holds the event code (read-only).

CONTROL[2]

data buffer length

Data buffer length, in words

CONTROL[3]

response offset

Offset for the beginning of the response in the data buffer, in 16-bit words

Note: To avoid overwriting the request, make the response offset value greater than the request length CONTROL[10].

CONTROL[4]

routing register

Specify a network destination node during data transfer:

  • MSB: The most significant byte contains the source node address (for example, the slot number of the 140 NOE 771 •• or 140CRP31200 module). Exception: The value of the integrated Ethernet port on the CPU is 254 (FE h) regardless of the CPU slot number. Note: Only 1 Ethernet 140CRP31200 module can be used.

  • LSB: The least significant byte contains the destination node address (for example, MBP on the Ethernet Transporter (MET) mapping index for the 140 NOE 771 •• or the drop number for the 140CRP31200).

CONTROL [5]1

IP address

Each address contains 1 byte of the 32-bit IP address:

  • high byte = byte 4 of the IP address (MSB)

  • low byte = byte 3 of the IP address

  • high byte = byte 2 of the IP address

  • low byte = byte 1 of the IP address (LSB)

CONTROL [6]1

CONTROL[7]

request length

length of the CIP request, in bytes

CONTROL[8]

response length

length of the response received, in bytes

read only—set after completion

1. For example, the Control parameter handles the IP address 192.168.1.6 in the following order: Byte 4 = 192, Byte 3 = 168, Byte 2 = 1, Byte 1 = 6.

Configuring the Data Buffer

The DATABUF varies in size. It consists of contiguous registers that include—in sequence—both the CIP request and the CIP response. To avoid overwriting the request, confirm that the data buffer is large enough to contain both the request and response data.

Data Buffer:

Variable size: set in CONTROL[2]

CIP Request:

Request size: set in CONTROL[7]

CIP Response:

Starting position: set in CONTROL[3]

Response size: reported in CONTROL[8]

NOTE: If the response offset is smaller than the request size, response data overwrites part of the request.

The formats of the data buffer’s CIP request and CIP response are described in this table. (Both the request and response are structured in little endian order.)

Request

Byte offset

Field

Data Type

Description

0

Service

Byte

Service of the explicit message

1

Request_Path_Size

Byte

The number of words in the Request_Path field

2

Request_Path

Padded EPATH

This byte array describes the path of the request (including class ID, instance ID, etc.) for this transaction.

...

Request_Data

Byte array

Service-specific data in the explicit message request delivery (if none, this field is empty)

Response

Byte offset

Field

Data Type

Description

0

Reply Service

Byte

Service of the explicit message + 16#80

1

Reserved

Byte

0

2

General Status

Byte

EtherNet/IP General Status

3

Size of Additional Status

Byte

Additional Status array size—in words

4

Additional Status

Word array

Additional status

...

Response Data

Byte array

Response data from request, or additional detected error data if General Status indicates a detected error