LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LV to read from tables and exectue device

Hi,
I wanted to know if it is possible for LV to read from tables, find location of the commands at a particular line and column (not specified) and execute the corresponding command.
Thank you.
Bibin
0 Kudos
Message 1 of 7
(3,439 Views)
What sort of command are you talking about ?
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 7
(3,432 Views)
Yes.

Now, do you mean to read from a LabVIEW table control, a spreadsheet, a 2-D array, or what? LabVIEW can handle all of these. A little more information would help us to help you figure out how to read from your specific table and parse the information.

Thanks,
Bob
0 Kudos
Message 3 of 7
(3,431 Views)
On the top level VI, the user selects Device Under Test(DUT) = STAS and CH = 2 and hits the run button. Is it possible for LV to go into the table (in the attachment) find the DUT, find CH 2 and execute the corresponding command string?
The command is the Remote Interface Command for either an Arbitrary Wave form generator (Agilent 33250) or Digital Multimeter (Agilent 34401A). The format of the attached file is TAB delineated, but the file format can be changed if needed.
Thanks.
Bibin
0 Kudos
Message 4 of 7
(3,424 Views)
Hello bugsmashers,

To read this VI in LabVIEW you will have to read in the file and parse it as a string in your code with the standard File IO operations. There is no command in LabVIEW that will be able to just extract information from a single row or column without scanning and parsing the file.

Here is a link to an example that may help out; I have also attached a VI that may also help out with this.
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DDD756A4E034080020E74861&p_node=DZ52026


Thanks for contacting us!

Regards,

Travis M
Applications Engineer
National Instruments
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 5 of 7
(3,402 Views)
Reading the file and displaying it in a table is not a big issue. But may be you should use a multicolumn listbox to achieve you goal. Attached is an example that shows how to read the command file, build a listbox, and get the command from the user selected line. That might be a start for you.
Chilly Charly    (aka CC)
0 Kudos
Message 6 of 7
(3,390 Views)
And if you want to get a little more sophisticated, put everything into a database. With a couple of linked tables and a query, you can just retrieve the data you want. For a small text file, reading the whole thing is no big deal but if the file is going to be pretty large, it might take some time (and memory). The database would also give you a lot more flexibility in the long run. Access would be fine for a small number of users. Excel can be used too.
0 Kudos
Message 7 of 7
(3,389 Views)