Hi all,
I am familiar with the general PLC paradigm of hardware IO and how it relates to the scan cycle:
* hardware inputs are read, copied into memory (here, the X or WX locations)
* the scan processing happens
* values in output locations (Y, WY) are used to update physical outputs on HW
and the associated consequences. For example, an input changes during the middle of the scan processing, I will not see the 'new' input value in the X* register until the next scan. But, changes in internal registers (C, V, N, D, R, etc) do show up during the same scan. Obviously this is a very simplified outline of the scan cycle, and there are funny behaviors when it comes to other constructs, the type of the ladder (program vs subroutine, say), and advanced features like stages; locations get cleared when the subroutine ends, etc.)
My question here is: how do the modbus registers MC, MI, MHR, MIR fit into this? specifically: do they only change "outside" of the scan, i.e. during the hardware read/write cycles?
Let's say a Modbus packet to write a coil comes in during the middle of the scan. Does the value get updated in the MC register during the HW input read cycle (before top of scan, like X or WX)? or does the MC register get updated immediately (like an internal register)?
In this example I'm only really concerned with Modbus/TCP, if it makes a difference. I would expect that RTU would behave the same from this software perspective, but you never know.
Thanks!