LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save continuously without loosing data

First, I want to encourage you to go read the tutorial Managing Large Data Sets in LabVIEW.  Using the techniques there, I have streamed data to disk at 12MB/sec on a 650MHz PIII (much more on a modern system).  You should be able to do what you want to do, provided you are not trying to do it on a laptop (disk drive probably cannot keep up).  There are some simple improvements you can make that will probably help a lot.
  1. You take the data using DBLs, then scale it and save it as I16.  This scaling and conversion takes a significant amount of time and is unnecessary.  Fetch your data as unscaled I16 and you will probably see quite a bit of speed increase.  You can save your scaling factors as the first two numbers in your binary file.  Or you can use NI-HWS for your data storage, which natively handles the scaling for you (you still want to fetch and save as I16 to avoid a factor of 4 increase in data size).
  2. You happen to be saving to disk at about the right chunk size.  The optimum is about 65,000 bytes - you have 60,0000 byte chunks.  However, this may not be the optimum chunk size to read from the DAQ device.  I don't know what this is.  For NI-SCOPE devices, it is about 300,000 bytes.  You can optimize both the read and write sizes by double buffering your acquisition.  You can roll your own with a producer-consumer architecture, or you can use NI-HWS, which automatically double-buffers and optimizes the write, leaving you to only have to worry about the read.
You will find it impossible to create a 1.5GByte RAM buffer in LV.  Due to memory fragmentation issues, the largest single array you can create in LV7.1 is a bit over 1GByte.  You can create an architecture with multiple arrays accessed as a single array and get up to about 1.4GBytes.  System considerations prevent you from getting any more.  You can compress your data into memory and get more (maybe).  It is a lot easier to stream to disk efficiently.

Take home message - streaming to disk, as you are trying to do, is within your PC's and LabVIEW's capabilities.  Let us know if you have further problems.
0 Kudos
Message 11 of 13
(968 Views)
I am not familiar with the scaling factors.  I found where I set the data aquisition to I16 unscaled.  You mentioned I can save the scaling factors as the first two elements as the first two numbers of the array, but I have not been able to figure out where the scaling factors are stored.  Can you tell me where I can view these scaling factors via inserting an indicator or is it an output from one of the NI-DAQmx vi's.

Thanks,

Azazel

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 12 of 13
(956 Views)
You can find your scaling coefficients in the DAQmx Channel property node.  Drop a property node.  Connect to your task.  Right click on the title bar of the property node and select DAQmx Channel from the DAQmx properties.  Go to general properties and you will find several options, depending on how accurate you want your final result to be.  Consult the documentation for details.
0 Kudos
Message 13 of 13
(928 Views)