- M221 acting as Modbus Master or Modbus TCP Client and sending a read request:
When executing the Read_Var function block with the parameter ObjType defined as %I, according SoMachine/Machine Expert - Basic Help:
ObjType: | The type of objects to read can be:
| The types of Modbus read function codes are:
|
Depending on the type of slave and the slave address, an internal bit should be a %M or %Q; an input bit should be a %I or %S, an input register should be a %IW or a %SW and an internal register should be a %MW or a %QW.
If the Slave device or Modbus Server supports the Modbus request FC02 and provides the content of its %Ix values within the response, then the M221 will find within the %MW reception table (defined by the parameter IndexData) the values of %I inputs of the device.
- M221 acting as Modbus Slave or Modbus TCP Server and receiving a read request:
When receiving a read Modbus request with a Modbus function code 02, the M221 behaves same as it received a read Modbus request with a Modbus function code 01. In consequence, it will provide into the response the content of its %Mx internal bits area.
Explanation:
The M221 does not support read %I request, but instead of rejecting the function code FC02, it has been decided to provide the same response content as when receiving Modbus function code FC01 (also to have the same behavior as a Twido PLC application) with %M values.
Note:
The above explanations are valid for both Modbus RTU and Modbus TCP/IP communications.