Expected Behavior
In the following examples, assuming that FirstScan is initially True, I would expect both Output1 and Output2 to be set to True:
Current Behavior
Output2 is not set because FirstScan is re-evaluated before each coil assignment. The generated ST code is almost identical for all cases:
IF FirstScan THEN
Output1 := TRUE; (*set*)
END_IF;
IF FirstScan OR FirstScan THEN
FirstScan := FALSE; (*reset*)
END_IF;
IF FirstScan THEN
Output2 := TRUE; (*set*)
END_IF;
Steps to Reproduce
-
Create ladder diagrams like in the examples above.
-
Compile and run or examine generated ST code
Possible Solution (Not obligatory)
One option would be to limit what can be drawn, e.g., no branch joins after a coil or function, or no sequential coils.
Context
The behaviour is unintuitive and not consistent with other PLC softwares, including OpenPLC Editor v1.x.
Your Environment
- Version : 4.1.4
- Operating System and version : Windows 11
Expected Behavior
In the following examples, assuming that FirstScan is initially True, I would expect both Output1 and Output2 to be set to True:
Current Behavior
Output2 is not set because FirstScan is re-evaluated before each coil assignment. The generated ST code is almost identical for all cases:
Steps to Reproduce
Create ladder diagrams like in the examples above.
Compile and run or examine generated ST code
Possible Solution (Not obligatory)
One option would be to limit what can be drawn, e.g., no branch joins after a coil or function, or no sequential coils.
Context
The behaviour is unintuitive and not consistent with other PLC softwares, including OpenPLC Editor v1.x.
Your Environment