M221 is to act as an intermediator between the downstream field PLCs (i.e. M221), and the SCADA system, in an ethernet network :
In that regard :
Communication between the intermediator M221 and the downstream PLCs (M221) :
Such communication can be represented in 2 ways :
1. Implicit mode (synchronous) > IO scanner (master PLC and multiple slaves) :
- Exploiting slaves' Network objects (%IWM, and %QWM) area
- Or exploiting slaves' memory objects (%MW) area
The main determinant of the exploited area is the (matching of the downstream slave devices' "unit ID" values, to the "unit ID" values that are configured for those slaves in the master IO scanner's "remote devices" table). If :
- The "unit ID" value = "255", then slaves' Network objects (%IWM, and %QWM) area is exploited
- If not, then slaves' memory objects (%MW) area is exploited
2. Explicit mode (asynchronous) (client PLC and server(s) using "Read_VAR" and "Write_VAR" blocks) :
- Exploiting servers' memory objects (%M and %MW) area
- Exploiting servers' IO objects (%I, %Q, %IW, and %QW) area
In that regard :
- In Implicit mode (synchronous) > M221 acting as the ethernet IO scanner can poll max. of 16 slaves
- In Explicit mode (asynchronous) (master PLC and slave(s) using "Read_VAR" and "Write_VAR") > M221 acting as a client can only have 1 single connection at a time with 1 single downward server. Thus, to poll other servers, the M221 client needs to close that connection up and establish another new connection with another server. This is achieved by making sure that only 1 single "Read_VAR" or "Write_VAR" block is active at a time :
Thus, you need to create a communication state-machine scenario/chart, to check the previous successfully-done "Read_VAR" or "Write_VAR" block request, in order to execute the next one. In case of any error with one of the requests, then your state-machine scenario/chart should be able to handle that error, with regard to the next queue requests
- If mixed mode is intended (both implicit and explicit), then attention must be paid to the above considerations
____________________________________________________________________________________________________________________________________
Communication between the downstream PLCs (M221) and the intermediator M221 PLC :
If we suppose that the network has got multiple masters/clients to a single slave/server.
In that regard :
- The max. no. of IO scanners (masters) that single slave can reply to in implicit or explicit modes (synchronous or asynchronous) equals 8 (1 TCP connection/master). If any master opens more than 1 TCP connection; i.e. 2 TCP connections (1 implicit and another 1 explicit), then the total of masters that salve can reply to is reduced. Thus, the no. "8" above refers to the max. no. of TCP connections that single slave can reply to :
____________________________________________________________________________________________________________________________________
The intermediator M221 PLC simultaneous communication :
- The intermediator PLC can secure an implicit mode (synchronous) connection with the upstream SCADA, and an implicit mode (synchronous) connection with the downstream PLCs (M221) simultaneously (at the same time), while respecting the number of TCP connections (and using separated %MW for each side)
- The intermediator PLC can secure an implicit mode (synchronous) connection with the upstream SCADA, and an explicit mode (asynchronous) connection with the downstream PLCs (M221) simultaneously (at the same time), while respecting the number of TCP connections (and using separated %MW for each side)
- In other words, M221 can be a client and server over Modbus TCP simultaneously, respecting the number of connections for each (as already exposed above). Using implicit IO scanning, or explicit FBs does not make any difference, as both create TCP connections, and both use the same Modbus commands (in fact, IO scanning is just some "automated FBs"). So, the intermediatorPLC can be a Modbus TCP server/slave and client/master at the same time
Finally, you can refer to the attachments in this FAQ for more info about M221 object types, and supported Modbus function codes (Modbus and its associated function codes are explained in FA168406)