LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto I/O write

I am wanting to write my set point data (from a csv file read) every time my csv read loop automatically reads the next row of data. The csv file (I attached it) has three columns of data; set point, time, and tolerance (in that order). The rows have different values of this data. As the csv read function loops through each row, I want the set point data to be written as soon as the next row is read. (Each row is read after a boolean is set to true, from either a time amount or a tolerance). I set up a seperate set point write function (specific to my I/O device, a lakeshore 331) that has not been completely set up. I think it will help you come up with ideas if you look at my attached program. Any ideas are welcome.

 

Thanks,

 

Matt  

Download All
0 Kudos
Message 1 of 3
(2,307 Views)

MattEntner,

 

I would recommend you take a look at the example finder built within LabVIEW. There are many examples in there that show how to save data to particular files programmatically. You can even use them in your program if you wish (copy and paste, concepts, etc). In addition, take a look at the community examples found at ni.com/community, clicking on “find an example program” and searching for “csv” in the search bar.

 

The example finder in LabVIEW can be found by going to…

 

Help»Find Examples»Browse Tab»Fundamentals»File Input and Output»The file of your choice

 

Rob W.

Applications Engineer

National Instruments

Jonathan R.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,239 Views)

You are reading the CSV file in a loop.  In that loop just after the read, chain the error clusters from the CSV file line read and parse to a file write.  You can open the text file outside the loop, pass the file reference into the loop and then just  format the set point into a string and write the string to the text file.  Close the output file outside the loop.

 

Now in terms of interpreting what you didn't say, is that you want to transfer the set point to the lakeshore temperature controller.  In this case just have it open the visa reference before the loop, format the set point into the correct string (something like "SETP 1,%f" as a format string) then VISA write the string to the device.  Close the visa reference outside the loop.

  

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 3 of 3
(2,223 Views)