Understanding scan cycle and rung execution order

Then my next guess is that the backwards jump to [Q2:] is still, inexplicably, being executed from the [LT] instruction, even though the EN input rung of the LT instruction is FALSE.

As a diagnostic, set up another integer that is cleared at the same time as the index, and increment that other integer in each pass of the loop i.e. before the [NEQ]; I suspect its value at the time of the HALT will be greater than 13. Because even if the jump back to [Q2:] is occurring even though the LT's input rung EN is False, the [ADD] should not be executing, so the index would stay at 13 until the watchdog timeout.


Brilliant! The jump continued towards infinity.


I found the following in the help file:


When the status of the left link is 1, a jump is made to a label (in the current section).

To generate an unconditional jump, the jump object must be placed directly on the left power rail.

To generate a conditional jump, a jump object is placed at the end of a series of contacts.


Emphasis mine. The jump wasn't conditional because it was set to a boolean output rather than connected to a contact. It looks like the LT is keeping its output energized even though the network is de-energized and the project is set to "don't Maintain output links on disabled Elementary Functions". Seems buggy, but now it works.

Screenshot 2022-08-22 141552.png Screenshot 2022-08-22 141915.jpg
 
The jump wasn't conditional because it was set to a boolean output rather than connected to a contact. It looks like the LT is keeping its output energized even though the network is de-energized and the project is set to "don't Maintain output links on disabled Elementary Functions". Seems buggy, but now it works.


Nice find.


Seems weird (i.e. a bug, or at least unexpected) that the jump would happen unconditionally, but the coil will take the hint from the output rung of the [LT] OUT rung and assign a 0 to [LESS] when the [EN] of the [LT] instruction is TRUE even though the result of the [LT] instruction itself is TRUE.
 
I get a halt when I place a zero at position 13 on Control Expert. Any ideas where I went wrong?


Attached a pair of screenshots and the program ZEF in a ZIP.




It halts as when it goes to index 13 it jams there for infinite time.
You have NE-instruction before adding.

With value 0 it don't anymore add index on loop and watchdog timer halts PLC.
 
Brilliant! The jump continued towards infinity.


I found the following in the help file:





Emphasis mine. The jump wasn't conditional because it was set to a boolean output rather than connected to a contact. It looks like the LT is keeping its output energized even though the network is de-energized and the project is set to "don't Maintain output links on disabled Elementary Functions". Seems buggy, but now it works.




Control expert ladder behaves differently than FBD-code. I have had problems with trigger contacts on ladder. Trigger output will hold output on even that it should be one scan pulse.



Try indexing with FBD code if it makes difference on PLC.
 
It halts as when it goes to index 13 it jams there for infinite time.
You have NE-instruction before adding.

With value 0 it don't anymore add index on loop and watchdog timer halts PLC.


Yes, he already figured that out. And the solution was to insert a logically unnecesary NO contact between the LT and the jump.

But the question I have is this: why does the jump occur from the LT instruction when the OUT rung, from the LT instruction to the jump (Q2), is FALSE?

The OUT rung of the LT instruction that feeds the jump must be FALSE, because the input rung of the LT instruction is also FALSE, because that LT input rung in turn is fed by the NE instruction output rung which evaluated to FALSE.

That seems like a bug to me, especially when the output rung of the NO instruction, that feeds the Q2 jump on the solution OP came up with, is FALSE, yet it inhibits the jump. But perhaps it is only a feature ;).
 
Last edited:
Only just noticed this post, cannot understand the screenshots, where are the variables ? all I see is what looks like actual values but no symbols is this the way it works in monitoring ?, very weird.
Also, I would have done the compare for the last array as a separate rung after that logic, like you say, perhaps the compare with a jump label as it's output is a bug.
 
Control expert ladder behaves differently than FBD-code. I have had problems with trigger contacts on ladder. Trigger output will hold output on even that it should be one scan pulse.



Try indexing with FBD code if it makes difference on PLC.


That's what I thought, but I didn't bother mentioning it because the result was the same. The project setting that I think is most relevant applies to all languages.

Screenshot 2022-08-23 122051.png Screenshot 2022-08-23 122131.png
 
But the question I have is this: why does the jump occur from the LT instruction when the OUT rung, from the LT instruction to the jump (Q2), is FALSE?

The OUT rung of the LT instruction that feeds the jump must be FALSE, because the input rung of the LT instruction is also FALSE, because that LT input rung in turn is fed by the NE instruction output rung which evaluated to FALSE.

That seems like a bug to me, especially when the output rung of the NO instruction, that feeds the Q2 jump on the solution OP came up with, is FALSE, yet it inhibits the jump. But perhaps it is only a feature ;).


My best guess is that when the HALT occurs the PLC stops updating the diagram. It appears to continue showing the correct values for each variable. I've added a new screenshot that I believe shows the LT is still calling for a jump.

Screenshot 2022-08-23 123051.png
 
Only just noticed this post, cannot understand the screenshots, where are the variables ? all I see is what looks like actual values but no symbols is this the way it works in monitoring ?, very weird.


During online monitoring it does not show the tag, but the value of it.


Some platforms show both and this one takes a shortcut.
 
Only just noticed this post, cannot understand the screenshots, where are the variables ? all I see is what looks like actual values but no symbols is this the way it works in monitoring ?, very weird.
Also, I would have done the compare for the last array as a separate rung after that logic, like you say, perhaps the compare with a jump label as it's output is a bug.


Yes, the variable names are hidden during monitoring (animation) for integers and floats. In Control Expert you can either hover the cursor on the variable or temporarily disable animation for that section.


I'm still not sure why the LT still energizes the output. Maybe a disabled EF won't de-energize its output links/rungs until the next scan, which never happens due to the jumps? I've added screenshots to show that disabling the EN/LT still works outside of the loop, and to show the discrepancy between the visibly de-energized rung and the energized jump.

Screenshot 2022-08-23 123435.png Screenshot 2022-08-23 123803.png Screenshot 2022-08-23 141532.png Screenshot 2022-08-23 141554.png Screenshot 2022-08-23 141633.png
 
I'm still not sure why the LT still energizes the output.


It's not the LT command's output, it's regarding this quote:
When the status of the left link is 1, a jump is made to a label (in the current section).

To generate an unconditional jump, the jump object must be placed directly on the left power rail.

To generate a conditional jump, a jump object is placed at the end of a series of contacts.


The LT output doesn't matter because this platform considers it an unconditional jump and jumps whatever the status of the line is.
 
It's not the LT command's output, it's regarding this quote:

The LT output doesn't matter because this platform considers it an unconditional jump and jumps whatever the status of the line is.


I think that quote just served as a hint for me to intervene with contacts. My further experiment showed that during the jumps that led to a HALT, the LT will energize anything that's linked to it, even a simple coil. This leads me to believe that because the LT was executed at least once in this scan, its calculated output will be sent out on that rung regardless of its current execution state:
attachment.php



During regular execution outside of any jumps, there's no problem enabling and disabling this EF:
attachment.php



attachment.php
 

Similar Topics

I'm trying to understand how the PLC will scan this "For" loop. will the "PhoneNb" variable not increment until all instructions within the "For"...
Replies
0
Views
1,661
I am using Allen Bradley PLC for Ethernet/IP communication. I send any explicit msg request (Get attribute or Set attribute), I observed packet...
Replies
0
Views
69
Took a new job and the controls schemes are fairly old and I'm used to Allen Bradley and Siemens. I'm looking to replace a pair of Superior...
Replies
1
Views
105
Hello Team, I am desperate for some help with an assessment I have as part of a Level 3 general engineering course. I am in a role that is much...
Replies
9
Views
345
Good day is there somewhere i can see the situation and compatibility regarding different firmware revisions. I have a 2711-K5A5, series H and...
Replies
4
Views
212
Back
Top Bottom