LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with autoindexing array of boolean indicators.

Solved!
Go to solution

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?

hmmmm.png

 

 

How to achieve my need?
An example would be appreciated.

 

0 Kudos
Message 1 of 31
(1,559 Views)

What is with all the references, property nodes and local variables?

 

Please explain in more detail what exactly you are trying to achieve here...

 

BlinkStop.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 31
(1,553 Views)

@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...

 

BlinkStop.png


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.

0 Kudos
Message 3 of 31
(1,533 Views)

@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.

0 Kudos
Message 4 of 31
(1,525 Views)

@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... 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 31
(1,515 Views)

Here is a screenshot of my code. arrow keys indicators.png

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.

buttons.png

0 Kudos
Message 6 of 31
(1,511 Views)

@Seiryuu90 wrote:

Here is a screenshot of my code. 

 


OMG!

 

Good luck with that...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 31
(1,505 Views)

@Seiryuu90 wrote:

Here is a screenshot of my code. 


  • There is still no array of Booleans (an array of references in something else)
  • We have no idea how the front panel looks like and how the indicators are arranged..
  • You are still violating all rules of dataflow and the code is peppered (i.e. fully drowned in...!!!!) with race conditions!
  • ...

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!

0 Kudos
Message 8 of 31
(1,502 Views)

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.

0 Kudos
Message 9 of 31
(1,496 Views)

@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!

 

 

Message 10 of 31
(1,479 Views)