According to this question, it is possible to send a TCP/IP message from a PLC to a PC using ladder logic. What? I'm sure this makes sense to people from the PLC world, but I'm struggling to make sense of it coming from a C/C++ embedded systems world.
Can someone explain, or point to an explanation, of exactly where relative to the PLC such comms takes place? Is it from within the PLC scan cycle, in which case... how are waits, delays, timeouts, retries, etc handled without extending the scan cycle? Equally, is there any way in which such functionality is consistent with the electronic "power rails and switches" metaphor of ladder logic, or does that metaphor stretch to the point of breaking down?
It strikes me that there are tasks (not necessarily comms tasks) that would be hard to turn around inside the few milliseconds of a PLC scan cycle. Extending that cycle for the sake of such tasks seems untenable. So are there ways and means in the PLC world to get these tasks done outside the PLC scan cycle that somehow integrates their input/output/control into the PLC scan cycle? I suspect this is the case, but have not found anything that clearly states it.