Davey Wombat
Member
I have always assumed that I was correct in thinking that the output image table is scanned and updated after the user code.
However, in a recent experiment I think I have proved myself wrong (or more likely I've overlooked something )
Have a look:
What I'm trying to do is toggle between Out0 and Out1 whenever bit "x" is true.
My way of thinking (wrong):
1 - Upon the first scan, Out1 is set and Out0 is reset -- this works.
2 - When bit "x" goes true, Out0 will latch and Out1 will unlatch.
3 - This is where I think the problem resides: Since Out0 has not yet been updated (at the end of the program scan), the second section of code should not execute. Correct?
4 - I have a sneaking suspicion that it does however because Out0 never becomes set!
There is obviously a major flaw in my thinking here so I would greatly appreciate it if someone could bring this to light!
Thanks!
However, in a recent experiment I think I have proved myself wrong (or more likely I've overlooked something )
Have a look:
x Out1 Out0
--[ ]----[oneshot]----[ ]----(L)
|
| Out1
|--(U)
x Out0 Out1
--[ ]----[oneshot]----[ ]----(L)
|
1st scan | Out0
---------[ ]--------------|--(U)
What I'm trying to do is toggle between Out0 and Out1 whenever bit "x" is true.
My way of thinking (wrong):
1 - Upon the first scan, Out1 is set and Out0 is reset -- this works.
2 - When bit "x" goes true, Out0 will latch and Out1 will unlatch.
3 - This is where I think the problem resides: Since Out0 has not yet been updated (at the end of the program scan), the second section of code should not execute. Correct?
4 - I have a sneaking suspicion that it does however because Out0 never becomes set!
There is obviously a major flaw in my thinking here so I would greatly appreciate it if someone could bring this to light!
Thanks!