Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming data to disk from the NI 6534

I am utilizing the PCI 6534 card to continuously stream 32-bit input data to disk (at up to 4MB/s). I am developing the code in Labwindows/CVI. I have read all the available information on the NI website and looked at the available examples but still have a number of questions:
1. I am slightly confused about the recommendations for buffer management that are given in the app note "Maximizing the performance of the NI 6534 DIO". This is because for the buffered input operation for NIDAC C API, the app note mentions using DIG_Block_Check to determine pointers, but the user manual/examples use the DIG_DB_HalfReady command to check if the buffer is half full. I am using the latter, is this correct?
2. As per the double-buffered fl
owdiagram in 6534 user manual / example code I am using the DIG_Block_In command to initiate data transfer. My query is regarding the count parameter, and what value I should give this. My initial understanding of this parameter was that it meant the total number of groups to capture, so for continuous operation I believed that I needed to set this to a large value, which was the max number groups to acquire. However when I do this it produces an error that the number of groups to capture is greater than the buffer size. What does this value mean when using double-buffered functions and what is a realistic value to use when utilizing all 4 ports as inputs?
3. The available apps notes on streaming data to disk are quite vague on the size of buffer to use. Is there a good starting value. Does anyone have information on buffer sizes that achieved optimal results in their application?
4. There are a couple of examples of this application in LabView but I cannot find a good one for LabWi
ndows/CVI. Does anyone have a good example that they could send me? The NI Labwindows example are very simplistic and are not that helpful for streaming to disk.
0 Kudos
Message 1 of 3
(3,273 Views)
Hey Steven,

I would check out the DIdoubleBufPatternGen653x.C shipping example. This example will continue to read the digital inputs until it reaches the iLoopCount < iHalfBufsToRead. You could change this to be anything or nothing if you wanted it to run for ever, or at least until you called a break statement.

The tricky part is that you will be required to write this data to the file each time iHalfReady == 1. This means you need to have the file open and ready, so that you can just call sprintf or some write function, so that the data can be wrote to the file. 4MB/s is pretty fast for file IO, when your computer is already running at full blast.

piHalfBuffer will contain the newest data that needs to be written to the file. I would play around
with the buffer so that you are not getting errors about buffer over flows (meaning your computer was writting to the file, when it should have been getting information from the dio) yet small enough that you are not maxing out your ram (this will actually cause your program to run slower, because it will be to busy swapping out memory on the hard drive).

All the buffer is, is a spot on your computers memory that DAQ uses to transfer data to. Double buffer transfers are the fastest, because it allows you to be reading one buffer, while it is writing memory to the other half. Other wise you would have to continue to poll the buffer to see how much is full and just read it out as fast as you can.

I hope this helps.

Joshua
0 Kudos
Message 2 of 3
(3,271 Views)

Hello, I'm writing an application to do exactly what you have done. Did you finish the project already? The data I'm streaming to disk is 32-bit data at 20Mhz, what was your data rate? Would you mind sharing your project with me?

 

thanks,

joe

0 Kudos
Message 3 of 3
(3,057 Views)