LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean crossing question

Solved!
Go to solution

Hi Graham,

 

- Please remove those Rube-Goldbergs from your example! After doing so "1." will be the same as "5."…

- And please also replace those locals by wires, they just show bad programming style and introduce race conditions.

- Never delete labels from controls and indicators! You may hide them in the frontpanel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 31 of 32
(467 Views)

It really does not help to post bad code. It gives other beginners the wrong ideas, so please don't!

 

Most of your code is highly convoluted as we already said in your other thread.

 

SillyCrossing.png

 

("equal true" can be replaced by a wire and "equal false" is a negate).

Most of your other code is obscure, to put it mildly. Either use a feedback node and comparisons (as already shown in the other thread) or the boolean crossing ptbypt.

 

If you want to give negative example, add diagram comments and warnings!

 

And why are you introducing race conditions due to excessive and unnecessary use of local variables? Since there is no defined execution order, the outcome is not predictable. For each iteration of the loop, the local variables can be either read before or after the terminal has received data. None of your chart traces are guaranteed to be in sync with each other. Bad! Bad! Bad!

Message 32 of 32
(451 Views)