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 |
---|---|---|
|
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, make the response offset value greater
than the request length |
|
routing register |
Specify a network destination node during data transfer:
|
|
IP address |
Each address contains 1 byte of the 32-bit IP address:
|
|
||
|
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 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 |
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, 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 |