07-08-2016 10:33 AM - edited 07-08-2016 10:41 AM
Highlight execution essentially slows down the code and basically serializes things so you can see what is happening. Timing between things that would otherwise happen in parallel might change.
For your earlier image, I don't know what you did to get it behind the flat sequence. It may even be behind the while loop. Just delete it. Place a new stop button down and drag it into the flat sequence frame.
(you might be able to use your cursor keys to move the highlighted part up until you see it and it is no longer behind structures. Then drag and drop it in the frame.)
(OR if you do block diagram cleanup, it should bring it out so you can see it.)
07-08-2016 10:39 AM
Here is a picture of the whole loop. I cannot delete the stop button.
07-08-2016 11:26 AM
@jmaslek wrote:Thanks, that makes sesne.
Total beginner question: I am adding the flat sequence, but when I do, the stop hides behind it on the block diagram. Is there a way to change that?
I have a solution - don't do that! 😄
Actually, it's a little more than a joke because the flat sequence shouldn't be used unless there is no other way to enforce dataflow in the way you want it to happen.
07-08-2016 11:28 AM
07-08-2016 11:32 AM
I was referring to the loop stop, not the boolean below. It is the stop for the while, so I cannot add it.
I am just extremely confused as to how I can drive data flow through the loop so that the STOP executes last (in the inner loop)
07-08-2016 11:38 AM
You have to put the stop that stops your outer while loop inside the inner while loop.
That stop control gets read at the very beginning of your outer while loop iteration where it is probably still false. Your inner while loop runs until its conditions stop it. Your outer while loop will finish its iteration. Even if you have since pressed the master stop button, it has already been read and will not be read again until the outer while loop begins its 2nd iteration. Then the stop terminal will be read as True. But the inner while loop is going to start all over again. Only when that stops a second time, will the outer while loop stop.
07-08-2016 11:41 AM - edited 07-08-2016 11:45 AM
Hi jmaslek,
so you talk about the "stop terminal" of the loop? It's an important part of each WHILE loop: no, you cannot delete it!
Have you ever programmed before? Even in text-based programming languages WHILE loops always have a stop condition!
The loop will stop when "Input" is equal to "SAV\n". Maybe there is an additional condition inside the FALSE frame of the case structure, but as you only attach images instead of VIs or snippets we cannot tell…
In your last image you don't need the flat sequence structure inside the loop: right-click the sequence frame and remove the sequence…
07-08-2016 12:26 PM - edited 07-08-2016 12:30 PM
If you want to stop at any time, even if SAV is not receive, place the stop terminal in the inner loop and OR the condition for the inner loop termination, e.g. as follows.
If you want to stop after the inner loop completes normally, omit the "OR".
There are many ways to do that of course. It is not entirely clear to me why you even have the outer loop.
07-08-2016 12:36 PM - edited 07-08-2016 12:38 PM
The stop control (the thing represented on the Front Panel by a Button, and on the Block Diagram by an icon labelled "stop") goes inside the sequence, with its value tunnelled out to the Stop Indicator of the While Loop (and the Error Line running through it to sequence it).
BS