So I have a program for an Omron CJ1M PLC that I have to reverse engineer for a customer. This PLC is meant to control a water pump station.
There is a function block of interest which reads a reservoir level and some setpoints and sends pump start/stop signals accordingly. This FB also has a debounce counter which is defined as an internal UINT type variable, not tied to any FB input or output.
This debounce counter is pretty simple: increment when a level setpoint is reached and reset otherwise. Pumps don't start or stop until this debounce counter reaches a certain hard-coded value.
My confusion stems from the fact that this debounce counter is internal. Based on my understanding of FB's, internal variables don't usually retain their values between FB calls.
So wouldn't the debounce counter reset to zero every single time the FB is called? Unless Omron PLC's are smart enough to allocate static memory addresses to internal variables of each FB instance? I tried looking through the CX-P manuals but haven't found anything that explicitly states this.
There is a function block of interest which reads a reservoir level and some setpoints and sends pump start/stop signals accordingly. This FB also has a debounce counter which is defined as an internal UINT type variable, not tied to any FB input or output.
This debounce counter is pretty simple: increment when a level setpoint is reached and reset otherwise. Pumps don't start or stop until this debounce counter reaches a certain hard-coded value.
My confusion stems from the fact that this debounce counter is internal. Based on my understanding of FB's, internal variables don't usually retain their values between FB calls.
So wouldn't the debounce counter reset to zero every single time the FB is called? Unless Omron PLC's are smart enough to allocate static memory addresses to internal variables of each FB instance? I tried looking through the CX-P manuals but haven't found anything that explicitly states this.