LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Storage of Analog Output

Hi all,

 I am attaching my labview code with this post. My problem is that the code runs correctly with "write to lvm file" applette. Without this aplette the waveform shows a continuous graph. But when I add this applette to store the data, the waveform gets broken. It updates after every 100 - 200 sec. Eventhough I used X-scrollbar, I am not able to access the data onc3e it gets updated.

Is there any other method to store the data from DAQ.?

I tried to store it spreadsheet, and also used write to TDM file. But in vain. I have been trying this out since 4 days. I don't know where am I wrong. Please help me out.
0 Kudos
Message 1 of 3
(2,609 Views)
Storing data as text takes a long time.  LVM, TDM, and ASCII are all text.  The overhead of creating the and storing the data is taking longer than the DAQ card is taking for each set of data.  As a result, you are getting data overruns on the DAQ card - look at the error out output of the DAQ Assistant while the problem is occurring.  Fortunately, there are two things you can do to make things better.  You should probably do both.
  1. Do not use a text format.  You can either use raw binary using the VIs from the File I/O palette or NI-Hierarchical Waveform Storage (NI-HWS).  NI-HWS is the easier of the two.  If you do not have NI-HWS, you can get it with almost any of the measurement device drivers (e.g. NI-SCOPE).  Make sure you open the file before you run the loop and close it after the loop exits.
  2. Do your file storage in a parallel loop to your data acquisition.  This is called a producer/consumer architecture.  You can find examples in the LabVIEW examples.  Use a queue to pass data from the acquisition loop to the storage loop.  This will allow your data acquistion to run at full speed, relatively independent of the file storage (they still use the same processor).

Using these two methods will allow you to write data to disk at hardware limited speeds.

Note that there are a few other things you could do to make your code simpler.

  1. Since your processing is the same for all channels, there is no need to break the data up into individual channels before processing.  The processing blocks can handle multiple input waveforms.
  2. There is no need to query for the current time six times outside the loop and six times inside (you can wire an output to multiple inputs).  This also will reduce the number of calculations you need to set the timestamps.
  3. You can convert your dynamic data into an array of waveforms subtract the starting timestamp from the original  in a FOR loop - no need to query for the current time inside the loop, the DAQ Assistant already gives you this information.  This will get rid of the incorrect dt value, duplication of Y values, and dubious timestamps.

Good luck.  Let us know if you need more help.

0 Kudos
Message 2 of 3
(2,594 Views)
Dear DFGray,

     Thanx for the help. I don't have NI-SCOPE and NI-HWS installed on my PC. And also I am short of time. So, I used the same code. It ran continously for 6 sec. That what I needed the most. I made some changes in the code. Used mathematical operations instead of formula palette. It code gave me the results continuously for 6 sec.

    Anyways, thank you very much for your help.
0 Kudos
Message 3 of 3
(2,570 Views)