Configuring the CONTROL and DATABUF Parameters
Original instructions
Overview
The CONTROL and DATABUF output parameters define the operation performed by the MBP_MSTR function block. For the EtherNet/IP protocol, the structure of the CONTROL and DATABUF output parameters remains the same for every explicit messaging service.
Configuring the Control Parameter
The Control parameter consists of 9 contiguous words, as described below:
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, confirm that the response offset value is greater than the request length CONTROL[7].
CONTROL[4]
Slot
High byte = slot location on backplane
Low byte = 0 (not used)
CONTROL[5]1
IP address
High byte = byte 4 of the IP address (MSB)
Low byte = byte 3 of the IP address
CONTROL[6]1
High byte = byte 2 of the IP address
Low byte = byte 1 of the IP address (LSB)
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 data buffer 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 simultaneously 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, the response data overwrites part of the request.
The format of the data buffer’s CIP request and CIP response is described, below.
NOTE: Structure both the request and response 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 to be delivered in the explicit message request—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 status1
...
Response Data
Byte array
Response data from request, or additional detected error data if General Status indicates a detected error
1. Refer to The CIP Networks Library, Volume 1, Common Industrial Protocol at section 3-5.6 Connection Manager Object Instance Detected Error Codes;