LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Associating a string with a given numerical input

I need to access 10 different avi files by inputting a number between 0 and 9. For example, if I enter the inputs 4,3,6...then I want the program to play the 4th, 3rd, and then 6th avi file.
My question is how do I associate a string value (the avi address) to a given numerical input?
Also, is there an easier way to call these files using an array or something like that, as opposed to creating 10 different digital controls on the front panel?
Thanks.
0 Kudos
Message 1 of 4
(2,935 Views)
You can use/modify Extract Numbers.vi (from String Examples) to extract the numbers from 4,3,6 into an array.
0 Kudos
Message 2 of 4
(2,935 Views)
Hi dseaman,

It sounds like you're building a playlist. I suggest using a Listbox. You
can find it under 'List & Table' of your control tool pallette. You can
enter the actual names of the files in this Listbox and then select as
many of them as you like. The output will be an array (depending upon how
you configure it) of I32 values based your selection(s). Pass the array
data to your loop structure to run all the AVI's selected.

If you want to vary the order of each item (run 5 before 2), it may be
easier to user an array of enumerators or ringlists.

- Kevin

In article <50650000000800000044610000-1031838699000@exchange.ni.com>,
"dseaman" wrote:

> I need to access 10 different avi files by inputting a number between 0
> and 9. For example, if
I enter the inputs 4,3,6...then I want the
> program to play the 4th, 3rd, and then 6th avi file. My question is how
> do I associate a string value (the avi address) to a given numerical
> input?
> Also, is there an easier way to call these files using an array or
> something like that, as opposed to creating 10 different digital
> controls on the front panel?
> Thanks.
0 Kudos
Message 3 of 4
(2,934 Views)
You may modify the attached vi to suite your needs.

Regards
ian.f k
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 4 of 4
(2,935 Views)