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 |
---|---|---|
|
Operation |
|
|
Detected error status |
Holds the event code (read-only). |
|
Data buffer length |
Data buffer length, in words |
|
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 |
|
Slot |
High byte = slot location on backplane |
Low byte = 0 (not used) |
||
|
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) |
||
|
Request length |
Length of the CIP request, in bytes |
|
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 |
CIP Request: Request
size: set in |
CIP Response: Starting
position: set in Response size:
reported in 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.
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 |
|
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; |