Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Generation in C - Speed issues

I'm working with NI PCI-6561 using C language (VS2010). My task is to stream data continuously from memory (12 channels, ~16MHz). I've modified "ContinuousGeneration-StreamFromMemory" example for my needs. Everything works perfectly on my dev PC (SandyBridge, i7), but I have problems with my program to run on industrial PC (axiomtek fab101 PCI backplane, Ivy Bridge, i5). It works only if I reduce clock speed to 4Mhz. Even at 8Mhz I have buffer underrun errors. Any ideas how I can improve my program? NI docs tells about DMA mode, but I can't find an example how to use it using C.

0 Kudos
Message 1 of 5
(3,485 Views)

Hi Megarem,

 

This isn't a complete example, but here is the information on how to set the data transfer mechanism in DAQmx in the C API:  http://digital.ni.com/public.nsf/allkb/C326F7D33CA6DB0E86256DFE008043B7

This should give you the function and arguments that you will need to set it to DMA mode.  Hopefully this will help with the performance!

Ashley G.
Senior Applications Engineer | RF & Wireless Communications
0 Kudos
Message 2 of 5
(3,442 Views)

I'm using HSDIO API. There are DMA attributes in the docs (NIHSDIO_ATTR_DIRECT_DMA_ENABLED, NIHSDIO_ATTR_DIRECT_DMA_WINDOW_ADDRESS, NIHSDIO_ATTR_DIRECT_DMA_WINDOW_SIZE). The problem is I do not know how to properly create DMA address window. It's not a regular memory.

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

You may have already seen this, but here is a bit of a walkthough on doing DMA from the Digital Waveform Generator/Analyzer Help http://zone.ni.com/reference/en-XX/help/370520K-01/hsdio/direct_dma/  It indicates that the memory address is provided by your Direct DMA-compatible data source. From what you've said, though, it seems like that is not the case for you?  Since creating a DMA address or window is not an NI-specific task, there are not NI specific resources on doing so. Searching help documentation for the OS that you are using may be the next best step.

 

From the NI side of things though, what exactly are the buffer underrun errors you mentioned? We may be able to help troubleshoot that specific error and see if it can be addressed from multiple angles.

Ashley G.
Senior Applications Engineer | RF & Wireless Communications
0 Kudos
Message 4 of 5
(3,390 Views)

The error is "The data being written to the streaming waweform cannot keep up with the output..." NI support answered me what it may be the bad PCI bus implementation of the industrial PC board.

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