Reputation: 125
I am kinda new to LabView and the problem is the following: I want to stall just when values are different and not stalling after the update. The wrong way would be:
wrong way: new value different from old
wrong way: new value equals old
I highlighted it is the wrong way because the loop still stalls even in case false, that does not contain a stall structure.
Edit: link to code: download here
Upvotes: 2
Views: 360
Reputation: 56
In Labview 2018 you could also use the "Is Value Changed" function. The SubVI is just syntax suger, which is realized by the polymorphism of malleable VIs. The functionality is the same as Salome suggests.
Upvotes: 2
Reputation: 79
As Salome pointed out, I have recreated your requirement with Feedback nodes.
Let me know if you need any more assistance with it!
Upvotes: 2
Reputation: 221
I implemented the code in my LabVIEW and it seems to work just fine! If the values b_in and b_out are different, it waits the preset time, if they are the same, it doesn't wait. You could use the "Highlight Execution" button to test it in your code.
If you let it run in a loop, maybe there is a race condition. Local variables are predestined for that problem. I would use them as rarely as possible. If you run the case-structure in a loop, you should use shift-registers
instead.
There are some unclear points in the question, that can't be answered without further information, so please provide an edit for these:
(I will edit the answer if new information is provided)
Hope, I could help you :)
Upvotes: 2