LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a csv file in Labview

I need to be able to read a 2D csv file and pull the data out by rows for use in an I/O write. I am working with a Lakeshore 331 temperature controller and need to be able to write parameters from a csv file to the temp controller. There are three columns of data; Set temp, Stabilization time, and Tolerance. I need to be able to switch between using tolerance data and a time switch to change a boolean to true. That true boolean needs to be able to be able to light a "Temp Stabilized Flag" and run a loop to the next row of data points were the previous row of written data points will be replaced by the following row. Basically, when one row of desired parameters is achieved, the program reads the next row of parameters and uses them as the standard until those parameter points are achieved. This process will continue until the entire list is exhausted. I am unable to find a way to read the csv by rows. My initial thought was to use the "Read Text" function and convert the string to the three seperate data points but I was unable to make that work. I have attached an example csv file, a rough draft file of what I need in order to write the data to the 331(which is entirely unfinished but provides a basic idea of where I am coming from), and my full project in case it helps. Please help me find a way to pull each row of data points individually in the previously mentioned cycle.

 

Thank  You,

 

Matt  

0 Kudos
Message 1 of 2
(3,075 Views)

I suggest you look at using the subVI Spreadsheet String to Array from the palette to convert the csv file to an array of parameters then you can use a for loop to index through the data elements one row at a time.  You may need to use an index primitive or internal loop to process the data.

 

If you check out the examples through the "Example Finder" you will most likely discover a good starting point for your problem.

 

happy Codeing

Wire Warrior

Wire Warrior

Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!
0 Kudos
Message 2 of 2
(3,061 Views)