It is one possiblity. How noticed earlier that reset command with r_trig behaves differently depending if trigger is used on ladder or CFC and if used inside function block or not.Is there a way to view a statement list version of the program. That may show interpretation differences.
That says to me that the execution order determined by Codesys is unambiguously broken, because this is LD not CFC, and LD (Ladder) is a network-based editor, and in LD the top branch of two parallel branches must execute first, and that is obviously not happening here.Probably this
"The execution order in POUs is uniquely determined in text-based and network-based editors. In the CFC editor, however, you can position the elements freely, so the execution order is initially not unique."
Loading…
help.codesys.com
We don't need that: the lower branch of Rung 3 must have been executed before the upper branch of Rung 3 by the logic here, otherwise savehound2 could never equal fox.Is there a way to view a statement list version of the program. That may show interpretation differences.
On same link that posted earlierThat says to me that the execution order determined by Codesys is unambiguously broken, because this is LD not CFC, and LD (Ladder) is a network-based editor, and in LD the top branch of two parallel branches must execute first, and that is obviously not happening here.
We don't need that: the lower branch of Rung 3 must have been executed before the upper branch of Rung 3 by the logic here, otherwise savehound2 could never equal fox.
That statement, "The elements are sorted from top to bottom and left to right," at that link, when read in context, only applies to CFC (Continuous Function Chart), not to LD.On same link that posted earlier
"The elements are sorted from top to bottom and left to right."
Is codesys program execution order from top to bottom then right or from left to right then bottom?
As now it seem that it is like on old modicons on 70s and 80s.
It will execute correctly i.e. left-to-right; but this is only a minimal test case to demonstrate the problem.I agree it is odd. Curious what the result would be if you put the two move instructions in series instead of branched.
Don’t recall running into this issue before, but I’ll run some test cases today and see what I get. What version are you using?
Interesting @ Linux Mint, been contemplating making the jump.Thanks!
- CODESYS V3.5 SP19 Patch 6, downloaded a few days ago
- Window 10 "Enterprise Evaluation" Build 19041.vb_release.191206-1406 in a guest VM in VirtualBox
- Host OS is Linux Mint, which is a variant of Ubuntu, I think.
Thanks for finding that!CODESYS Group
content.helpme-codesys.com
"branches which are executed in succession from top to bottom"