Overview
The basic and advanced examples below demonstrate using continuous dynamic acquisition to fetch a user-defined, but quite large record of data all while continuously streaming the data to a binary file using the Win32 File I/O VIs.
Benchmarks with the recommended hardware below have been at about 100MB/s of data streaming to disk.
These examples use a producer/consumer architecture to efficiently transfer data from the onboard memory of the device into LabVIEW memory and then stream that data to disk. The producer loop continuously fetches data from onboard memory into the LabVIEW memory using DMA transfers. This data is placed into a queue in order to efficiently transfer the data to a parallel consumer loop where it is written file. If the sampling rate is low, the computer can fetch all the data from the device, so data is never overwritten. However, at faster sampling rates, the computer will not be able to fetch the data before it is overwritten by new data. This results in the "data overwritten" error.
The consumer loop continuously empties data from the queue and writes data to disk using the Win32 Write File.vi. The file is opened using the Win32 Open File.vi, which disables Windows caching during the write process, resulting in increased performance. However when Windows caching is disabled, data must be written to file in a multiple of the sector size of the disk (typically 512 bytes).
NI Recommended Hardware:
Software:
-
NI-HSDIO 1.5.1 or above
-
LabVIEW 8.0 or above
Included in this EPD are:
(Basic Version)
- niHSDIO (U32) Stream to Disk Queues Win32 File IO_Basic.vi
- supporting Win32 File IO VI's
(Advanced Version)
- niHSDIO (U32) Stream to Disk Queues Win32 File IO.vi
- Export Arb Sample Clock.vi (if generating an external clock for HSDIO)
- supporting Win32 File IO VI's
- file write/read benchmark utility VI's
- HSDIO streaming to memory benchmark utility