05-05-2009 02:22 AM
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.
05-05-2009 03:13 AM
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) .
05-10-2009 01:05 AM