04-07-2023 09:42 AM
Hi, so I want these indicators (boolean and boolean 2) to go true and off consecutively as I have achieved and I want when the "boolean 2" is true, while the boolean 3 is true (square), the loop to stop and to exit.
Unfortunately, that doesnot happen. Why?
How to achieve my need?
An example would be appreciated.
Solved! Go to Solution.
04-07-2023 10:00 AM - edited 04-07-2023 10:02 AM
What is with all the references, property nodes and local variables?
Please explain in more detail what exactly you are trying to achieve here...
04-07-2023 10:54 AM - edited 04-07-2023 10:57 AM
@RTSLVU wrote:
What is with all the references, property nodes and local variables?
Please explain in more detail what exactly you are trying to achieve here...
So, this is a smaller and simpler example of a .vi that I am working on, that "autoindexes" an array of more boolean indicators that light up one by one using those property nodes inside just a case structure that's in a loop. I want when the last one is true AND the adjacent (square) indicator that is NOT part of the autoindexed array, are both true, then the loop stops.
So, just imagine instead of just 2 "circle" indicators (at the screenshot I posted) there are like 50 circle indicators, one on top of the other and light up one by one and there is only a "square" indicator that is not part of the autoindexed array (that changes value of the indicators). So when the last circle indicator lights up AND the square is light up then loop stops. I don't know how much better can I explain this.
I want the lights to just flash on and off using an autoindexed array not like what you have done.
04-07-2023 11:14 AM - edited 04-07-2023 11:17 AM
@Seiryuu90 wrote:
I want the lights to just flash on and off using an autoindexed array not like what you have done.
Your code has NO array of boolean indicators anywhere (compare with your thread subject!). If your problem is different, then you need to show us the real code of that.
Explain exactly what the starting condition is, how the user interacts (if at all) and what you like to see as a function of elapsed time.
I also recommend to learn about dataflow and race conditions. LabVIEW is a fully parallel language, so reading local variables and writing value properties in parallel is a prime example of a race condition. Whatever happens last wins.
04-07-2023 11:18 AM
@Seiryuu90 wrote:
So, this is a smaller and simpler example of a .vi that I am working on, that "autoindexes" an array of more boolean indicators that light up one by one using those property nodes inside just a case structure that's in a loop. I want when the last one is true AND the adjacent (square) indicator that is NOT part of the autoindexed array, are both true, then the loop stops.
So, just imagine instead of just 2 "circle" indicators (at the screenshot I posted) there are like 50 circle indicators, one on top of the other and light up one by one and there is only a "square" indicator that is not part of the autoindexed array (that changes value of the indicators). So when the last circle indicator lights up AND the square is light up then loop stops. I don't know how much better can I explain this.
I want the lights to just flash on and off using an autoindexed array not like what you have done.
Sorry, I don't understand what you are trying to say here...
04-07-2023 11:20 AM - edited 04-07-2023 11:22 AM
Here is a screenshot of my code.
The only input is just the button presses "left" and "right" that the user presses to change value of the booleans 31,32,33,34,35.
04-07-2023 11:25 AM
@Seiryuu90 wrote:
Here is a screenshot of my code.
OMG!
Good luck with that...
04-07-2023 11:31 AM
@Seiryuu90 wrote:
Here is a screenshot of my code.
Take a step back! Do some basic tutorials, put a 1D or 2D array of booleans in a shift register and operate on the values according to your rules. Code will probably fit on half a postcard. No references, no locals, no inner loops!
04-07-2023 11:48 AM
Thank you for your advice but my question is pretty specific. How to measure the value of a boolean of an array of references (as you said) when it is used in a while loop by autoindexing so that I can use it in boolean logic? I want just when value of the last of each reference arrays is TRUE and the value of an external boolean indicator is true then the loop stop.
04-07-2023 11:58 AM - edited 04-07-2023 12:14 PM
@Seiryuu90 wrote:
Thank you for your advice but my question is pretty specific. How to measure the value of a boolean of an array of references (as you said) when it is used in a while loop by autoindexing so that I can use it in boolean logic? I want just when value of the last of each reference arrays is TRUE and the value of an external boolean indicator is true then the loop stop.
If you want the "last value" and test if it is true or false, just use an output tunnel on the FOR loop that is set to last value, instead of autoindexing. Then AND that with the external boolean and wire to the stop condition.
You really (really!!!!!) need to start over. There should be absolutely no need for references and local variables at all! This is just all complete Rube Goldberg!