Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Pattern Output from a Binary File

hello!
I am searching for an example of Continuous Pattern Output from a Binary File (or from a buffer) in c. It's a labview example, but I need in c language.
I found DOdoubleBufPatternGen653x.c , but I can't do continuous output.
thanks

0 Kudos
Message 1 of 5
(3,581 Views)
The example you are looking at is not doing continuous pattern output because it contains a While loop which terminates after a number of iterations. If you modify the condition iLoopCount < iHalfBufsToRead for the While loop, that example will run in continuous mode.
 
AlessioD
National Instruments
Message 2 of 5
(3,568 Views)
I have another question.
I'm not sure if I really need double buffer. I just want to do digital output of a buffer which size (about 20.000.000) and data is known, at the maximum speed.
Which is the maximum buffer size for DIG_Block_Out()? Is it 2^32-1?
If it is, I think I can send my 20M buffer without problem, isn't it?
In DOdoubleBufPatternGen653x, is suggested, before doing Align_DMA_Buffer(), to keep buffer smaller than 4k, so what to do? Can I send or not a 20M buffer?
Do I need to split in smaller parts, say 4k, and send my 20M buffer in blocks of 4k?
I don't want delays between two 4k buffer sending If I need to split my buffer.

Thanks,
Simone
0 Kudos
Message 3 of 5
(3,566 Views)
The Double buffer mechanism, detailed in the Traditional Daq Manual (Start>>PRograms>>National Instruments>>NI-DAQ), automatically takes care of any delay that may occur when splitting the whole dataset into smaller buffers. Assuming you have a large dataset of 20MBytes to write, Double buffering allows you to define the size of the chunks of data you want to transfer at a time, say 1 MB. This means that the driver will keep on copying data from the 20MB to the 1MB buffer
in a circular fashion and it will return an error whenever data is overwritten or delays occur (buffer empty).
With this being said, if you only need to write a single 20 MB buffer, you may want to do a Single Buffered Generation.
Take also a look at this document
 
 
AlessioD
0 Kudos
Message 4 of 5
(3,527 Views)

Hello! I have a question, very similar to Simone's one. I use Single Buffered Generation with a buffer size of about 64 Megabytes and I have no problems (at 20 MHz).

I'd like to have the maximum size of the buffer possible, experimentally I found the value of 67*10^6 bytes, if I use larger sizes the program (written in c++ using tradional Ni-Daq on a 6533 board) give me a DIG Block Out error -10444. It says that I have no more system memory, or no more memory on the device, or insufficient disk space.

The first and the third suggestion are clearly false, any advice on how to enlarge the buffer size? Is it possible?

Thanks

 

Leonardo

 
0 Kudos
Message 5 of 5
(3,494 Views)