LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean to identify index array order

To whom it may concern,
 
The following VI basically selects the following elements in the array every second. The index array is set up to select elements from 1 through 4 incrisingly, and then go back down to 1 and remain at 1 until the user stops the VI. What I'd like to do is have two boolean indicators, one labeled "count up" and one labeled "count down" that will turn on and remain on depending on where the VI is in the numerical sequence. So basically the "count up" boolean will be on for the first for seconds while numbers 1-4 are being pulled out of the array, and then the "count down" boolean will come on for the remaining of the sequence. Could anybody help me?
 
Thanks in advance!
 
Jordi
0 Kudos
Message 1 of 5
(3,028 Views)
Well this was fun... NOT... see attached example.  The things that make this exercise more difficult... NOT repeating the top element (max index) AND pinning the index at 0 after the count down.

Paul
Message 2 of 5
(3,005 Views)

Well, I'm sorry if this wasn't fun for you, the VI works really well though.

Thanks

0 Kudos
Message 3 of 5
(2,999 Views)
Your welcome... I should have put in a smiley... I always like a challenge.  Glad it works for you.

Paul
Message 4 of 5
(2,994 Views)
I think all this can be done with much less code. 🙂
  • Looping every 1000ms eliminates the elapsed time check.
  • Just use autoindexing with a small tweak to run through the array and retain the last valid element once we run out.
  • The count-up and count-down LEDs should be compared individually so both are off if the value is constant. There are three valid states (increase, decrease, constant)

Here's a quick draft. Modify as needed.

Depending on your requirements, you might want to initialize the shift register with a suitable value.

Message Edited by altenbach on 07-09-2007 01:57 PM

Download All
0 Kudos
Message 5 of 5
(2,976 Views)