LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i have a certain value (x) and i need to read the value (y) that belongs to x ( x from labview and y in excel )

example : i have temperature 273 K and i need the density belonged to the temperature. this density is located in excel data. how can i read it from labVIEW into excel ?
0 Kudos
Message 1 of 5
(2,367 Views)
You can use the Read from Spreadsheet File and Write to Spreadsheet File VI's. They are found in the the Functions Pallete behind the icon for File I/O that looks like a 3 1/2" floppy disk.

Once you have the file read in as an array, you may find the Match Pattern VI (in the String Pallette) to be helpful in extracting the value you want from the array.

The trick will be locating the density entry by using the temperature variable. There is no way to make suggestions without seeing the file format. Match pattern is a string function - this means it lacks understanding of mathematical qualities such as interger or decimal number with 2 places. It can be tricky doing what you want if the table of densities is variable in its presentati
on of numerical formats, as you will see.

Best regards,

Mike
0 Kudos
Message 2 of 5
(2,367 Views)
If the excel file is saved as a text file - either comma or tab separated, then these functions will work. To read/write a native excel file then you have to use ActiveX or treat the excel file as a database and use the ODBC driver to interface to it. There's a shipping example that shows how to write to excel from LabVIEW and many others are available here. To make a database query, you'll need NI's Database Connectivity Toolkit or Jeffrey Travis's open source LabSQL.
0 Kudos
Message 3 of 5
(2,367 Views)
Thanks both of you for ur time, that helped !
0 Kudos
Message 4 of 5
(2,367 Views)
I am intersted to see how you finally do this. If you get time, send the VI>

Thx,

Mike
0 Kudos
Message 5 of 5
(2,367 Views)