LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording analog input data to a file

Hi,
I am performing a triggered Analog input acquisition (ACH0,ACH1,ACH2)based on a TTL trigger on PFI0 pin(using PCI 6052E DAQ board).How can I write the data to a file such that it can be easily read in Matlab or Excel. I tried using a '.bin' and '.xls' format in the file dialog when writing data to file but could not get any meaninful data when I tried to read it in Matlab or Excel.Can you suggest the file formats and the procedure to record the data being acquired from the three analog i/p channels ACH0,ACH1 and ACH2.

Shiv
0 Kudos
Message 1 of 3
(2,833 Views)
Shiv,

Refer to the example shipped with LabVIEW for I/O interfaces>>Analog Input>>dataloggers>> and Continuous Acquisition to spreadsheet file or binary file.
The spreadsheet file is a txt file that can be read by Excel or Matlab while you will need a binary file reader to read the .BIN file.
Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 2 of 3
(2,833 Views)
Hi Shiv,

Excel can only read ASCII text files, it usually can't read binary files of an arbitrary nature. You can convert your data into a text file during acquisition, so that the text file is created from the start, or you can convert your data as an entire file during post-processing.

To convert a binary number to a string, use "Convert Number to Decimal String.VI" This string can then be written to a file. If you de-limit the values with tabs, then excel should be able to read it quite easily. This conversion takes time, so you may want to do this during post-processing.

Another approach would be to port the data directly to Matlab or Excel using either the Matlab script node, or the Report Generation Toolkit for Microsoft Office.
0 Kudos
Message 3 of 3
(2,833 Views)