LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load 3 columms CSV (time, detector1, detector2) file by using "FileSelectPopUp"?

Dear all

 

      Any one have an idea how to load 3 columms CSV (time, detector1, detector2) file by using "FileSelectPopUp"? and then proceed to write "time", "detector1" and "detector2" to separate arrays and then plot its. 

 

     I would like to open a file and plot the data by using a PopUp witout modifying the LabWindow code every time when we want to open a new file.

  

     My raw data is look like and I used Labwindows 8. 

 

11.86,382,0
11.87,449,0
11.88,375,0
11.89,415,0
11.9,401,0 

  

     Any suggestion would be appreciated.

 

0 Kudos
Message 1 of 3
(3,434 Views)

FileSelectPopup permits you to select the file to be handled by your application and does nothing more: it's up to you to open the file selected and read it appropriately by means of function in the Formatting and I/O library (OpenFile, ReadLine, Scan or sscanf, CloseFile) or function in the Inpu/Output class of the ANSI C library (fopen, fgets, sscanf or Scan, fclose).

 

An alternative option, if all of your file follows the structure that you have described, is the use of FileToArray () function: a complex instruction that does all the matter for you (opening and reading the file to an array of doubles) : searching in the examples shipped with the product you should be able to locate arrayfile.prj example which makes use of this command (and the symmetrical ArrayToFile) and can help you in understanding how to use it besides looking at the online help (alternatively you may look at this one) .

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,431 Views)
Thank you very much for you suggestion. I will try to do like you said.
0 Kudos
Message 3 of 3
(3,384 Views)