LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

index array

The following VI is meant to select the next value in the index array (1,2,3,4 ...) every 10 seconds. Instead is starts with 1, then moves to 2 after 10s. , then the clock resets, and it goes back to 1. Is there something wrong with the shift register?
 
Thanks in advance
 
Valls
0 Kudos
Message 1 of 12
(4,166 Views)
A few things:
  1. You need to feed the value after the increment to the right shift register. (In your code, the left shift register always sees the same value!).
  2. Uset the elapsed time output instead of the complicated comparison
  3. Use a small delay to prevent the loop from spinning at a wastefully fast rate.
  4. Of course you also need some sort of stop condition once you run out of array, for example.
  5. ...
Here's a draft for points 1..3.

Message Edited by altenbach on 03-22-2007 09:42 AM

0 Kudos
Message 2 of 12
(4,158 Views)
Try this version of your vi.  You can read the first value rigth away with another shift register wired to the case structure and initialized to T.
0 Kudos
Message 3 of 12
(4,139 Views)

Thanks, that worked great! I just have one quick question. Instead of stopping the VI, I'd like the VI to continue running once it reaches the last value in the index array, instead of going back to 0. Do you know what I mean? Basically, select the next element in the array every 5 seconds just like it's doing now and when it gets to the last one I just wanted to remain there without stopping the VI automatically. Is that possible?

Thanks!

Valls

0 Kudos
Message 4 of 12
(4,138 Views)

I'm sorry but it doesn't let me open the file since it says it was written with LabView 9.1, and I'm using LabView 8.0.

Thanks anyway!

Valls

0 Kudos
Message 5 of 12
(4,132 Views)
Here it is for version 8.0
0 Kudos
Message 6 of 12
(4,128 Views)


@Valls wrote:

Thanks, that worked great! I just have one quick question. Instead of stopping the VI, I'd like the VI to continue running once it reaches the last value in the index array, instead of going back to 0. Do you know what I mean?


Use "In range and coerce" from the comparison palette.

0 Kudos
Message 7 of 12
(4,115 Views)
Thanks! that works perfectly
0 Kudos
Message 8 of 12
(4,108 Views)

I have a quick question about this VI: If I stop let's say at element #4, and I re-start the VI, 1 second has to elapse before the array goes back to 1. How could I modify the Vi so every time I would re-start it would automatically start from element #1?

Thanks

Valls

0 Kudos
Message 9 of 12
(4,099 Views)
The VI I mentioned previously is the one posted by ChillyWilly named Idex Array
0 Kudos
Message 10 of 12
(4,095 Views)