LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving data and measuring time

Hello Everyone,

I am currently working on a sound acqusition project using a GRAS 46AM  Microphone and NI PXI- 4462 Card. I can't save data to a TXT File and in Excel I can't save also because it's over the maximum number of rows. I need some ideas on how to save data to a TXT File, also I need to work with microseconds because I am sampling at 80 KHz. I need the data saved as TXT/Excel because I need to use it in MATLAB.

Thank you!

0 Kudos
Message 1 of 2
(433 Views)

@hati97 wrote:

Hello Everyone,

I am currently working on a sound acqusition project using a GRAS 46AM  Microphone and NI PXI- 4462 Card. I can't save data to a TXT File and in Excel I can't save also because it's over the maximum number of rows.

How much data are you trying to save?  How many channels, and for how many seconds?  Are you sampling in "continuous" mode?  Do you know how to "write to disk as fast as you acquire the data" so as not to miss any samples?

I need some ideas on how to save data to a TXT File, also I need to work with microseconds because I am sampling at 80 KHz. I need the data saved as TXT/Excel because I need to use it in MATLAB.

What is the format of your data samples?  Are you saving as an Integer (presumably I32) or a Float (presumably Dbl)?  How many samples are you acquiring at any one time?

 

I presume you know that Matlab is capable of reading "binary" data files, though you may need to do a little tweaking to be sure the bit/byte ordering is the same between the two systems.  Not having to format the files as text, but writing them as "raw" binary, can greatly increase the rate at which you spool the data to disk.  It might be an interesting exercise for you to generate "fake" data at 80KHz (do you know how to do this?  It involves something like a For Loop to generate 80 points at 1KHz, achieved by putting a Wait (1 ms) function inside the For loop, then wrapping this in a larger For or While loop(s) to approximate the sample size you plan to use, e.g. if you are going to write 2000 points at a time, concatenate the output from 25 80-point loops), and then see if you can spool it to disk both in Raw and in Text format(s).

 

Thank you!


If the above suggestions are helpful, try writing (and testing!) some code, then come back, ask more questions, and attach your VI.

 

Bob Schor

0 Kudos
Message 2 of 2
(405 Views)