LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

to get the index of array

In LabView7.1.

I have a string array. When user changes the index, the program will display (copy) the corresponding value in array to another indicator, for example,

index is 0, the first string in array displayed, if index is changed to 1 , the second string is displayed and so on.

How to monitor the index and get related value in the array ?

Thanks.

 

0 Kudos
Message 1 of 5
(2,688 Views)
You could probably put something together using a Event structure and some property nodes. 

But I guess I am not really sure what you are intending to do with this information, and/or use it.  Could you explain some more as to what you are trying to accomplish...


Kenny

0 Kudos
Message 2 of 5
(2,678 Views)
This is very basic LabVIEW.
 
First, things need to go in a loop so it keeps monitoring for index changes. You don't want to check for changes every nanosecond, so place a suitable delay in the loop (e.g. 100ms) or just wait for front panel activity as in the attached image.
 
If the array of strings never changes during runtime, its terminal does not need to be inside the loop, however, if the array is a control, place it also inside the loop.
 
Now just use "index array", one of the most basic array tools. 🙂
 
Of course you can get more fancy with e.g. an event structure (and you should!) if this is only a small part of the code and your program does much more. 😉

Message Edited by altenbach on 02-07-2007 12:38 PM

0 Kudos
Message 3 of 5
(2,670 Views)

feeling sheepish Smiley Surprised

Tried to over think the obvious ....

Kenny

0 Kudos
Message 4 of 5
(2,660 Views)
It works. Thank you very much.
0 Kudos
Message 5 of 5
(2,640 Views)