LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating a control array

Thats all great guys! Thanks a lot....

Just one last question... is it possible to update values held in a control
array whilst a program is executing (other than manually!!), by loading them
from a spreadsheet file?

Cheers for any advice (As you see, I'm quite new to all this!)

"Randy H" wrote in message
news:506500000005000000FEC40000-1042324653000@exchange.ni.com...
> John,
>
> Sure. If the reading of the file is the first thing done in your
> program, then this will be an easy task. That is how LabVIEW loads. It
> stores a bunch of options in the LabVIEW.ini file. When LabVIEW first
> launches, it parses this file ans starts LabVIEW with the correct
> options. You would be doing something very similar.
> Also, the way you are
aproaching this is exactly what you would need
> to do if you build your VI into an executable. See
>
href="http://pong.ni.com/public.nsf/websearch/BCFF7D3335E256E286256509006772
3D?OpenDocument">this

> as an example.
>
> Randy Hsokin
> Applications Engineer
> National Instruments
> http://www.ni.com/ask
0 Kudos
Message 1 of 2
(2,524 Views)
Yes you can. There's a couple of routes you can go.
1) LabVIEW has the function Read From Spreadsheet File in the File I/O palette. This will import a spreadsheet saved as comma or tab separated text data (not native Excel).

2) Use ActiveX to read an Excel file. There's a shipping example called Write Table to XL that demonstratesm how to write to rows and columns. I've attached an example that reads a single cell. It's an example that I downloaded from somewhere I don't remember. Search the forum for other examples.

3) Treat the spreadsheet as a database and use either NI database connectivity toolkit or LabSQL (http://jeffreytravis.com) to run SQL queries on it.

Once you've read the data, it's then a matter of copying to the control by means of
a local variable or property node.
0 Kudos
Message 2 of 2
(2,524 Views)