Does anyone know if there is documentation which outlines the "rules" governing the forcing of variables in online mode? I have noticed that forcing some variables within a POU are not always passed along throughout the POU/project. The Codesys manual does not list any rules or exceptions to forcing of variables but it is apparent to me that there are. Has anyone else noticed this? I am using Codesys ver. 2.3.6.1.
Thanks
Mike Metzer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Forcing rules are quite simple. If you force some variables a force-list is created and this list is executed twice in every PLC - cicle. First time after reading inputs and the second time after the IEC-Program are executet just bevore outputs are written.
The PLC Cycle is:
read inputs
execute force list
execute the IEC-Program
execute force list
write outputs
See also attached diagram.
So you can cange the variables in your PLC Program as often as you assign a value to them
Thank you for the reply. Can that type of operation really be considered a global force? When debugging a program, if I want a variable forced to a given state, I want it to remain in that state and not be affected during the code execution. Is this how a force executes in other platforms (rslogix, step 7, etc.)?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anyone know if there is documentation which outlines the "rules" governing the forcing of variables in online mode? I have noticed that forcing some variables within a POU are not always passed along throughout the POU/project. The Codesys manual does not list any rules or exceptions to forcing of variables but it is apparent to me that there are. Has anyone else noticed this? I am using Codesys ver. 2.3.6.1.
Thanks
Mike Metzer
Forcing rules are quite simple. If you force some variables a force-list is created and this list is executed twice in every PLC - cicle. First time after reading inputs and the second time after the IEC-Program are executet just bevore outputs are written.
The PLC Cycle is:
read inputs
execute force list
execute the IEC-Program
execute force list
write outputs
See also attached diagram.
So you can cange the variables in your PLC Program as often as you assign a value to them
CoDeSys Training (1).pdf [51.72 KiB]
Thank you for the reply. Can that type of operation really be considered a global force? When debugging a program, if I want a variable forced to a given state, I want it to remain in that state and not be affected during the code execution. Is this how a force executes in other platforms (rslogix, step 7, etc.)?
Thanks