Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving Buffer Notification on a 6534 with ND_PATTERN_GENERATION_LOOP_ENABLE

I'm trying to use the onboard memory on the PCI-6534 to continuously loop out the same pattern. I'd also however like to recieve callback notification every time it goes through the entire pattern. It's easy enough to make it loop using ND_PATTERN_GENERATION_LOOP_ENABLE if ND_DATA_XFER_MODE_DIO_GR1 is set to ND_UP_TO_1_DMA_CHANNEL, but then I never get my Config_DAQ_Event_Message #1 callback. If I set the xfer mode to ND_INTERRUPTS I get my callback, but it ignores me when I tell it to loop.

These can't be my only options, what am I missing?
0 Kudos
Message 1 of 4
(3,033 Views)
Hello,

I think I can answer what�s causing the effect you�re seeing, and a possible workaround. Usually a data buffer is accessed from the main PC memory using one of two methods: DMA or interrupts (via callbacks). So when the 6534 reaches the end of the buffer, either a DMA transfer or an interrupt is initiated to create the new buffer. However, when ND_PATTERN_GENERATION_LOOP_ENABLE is used, the 6534 loads a buffer from the main memory only once to fill its internal memory, and then it continues to loop on this internal memory buffer. After the memory is initially loaded, this pattern is internally stored and no additional memory transfers are required, which explains why your callback was not being executed when Looping was enabled.

The workaround fo
r this is to not enable looping and just set your buffer to the same buffer each time your callback is executed. The only thing to watch out for here is that this may cause a performance hit if your pattern is being clocked out at a fast rate, since there is much more overhead involved on the PC side when using interrupts.

Here are some links to examples of how to setup double buffered transfers. The only thing that needs to be modified in them is to change them from DMA mode, to interrupt mode, which you�ve already done successfully in your existing program.

http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DF1D56A4E034080020E74861&p_node=DZ52321&p_submitted=N&p_rank=&p_answer=&p_source=Internal

http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E12F56A4E034080020E74861&p_node=DZ52321&p_submitted=N&p_rank=&p_answer=&p_source=Internal

Hope this helps!

Ken S.
National Instruments
Message 2 of 4
(3,033 Views)
Unfortunately we're pushing all the way to 20MHz on the output; the reason we're using the 6534 instead of the 6533 is to ensure timing reliability at the full clock rate regardless of what else is happening on the bus.

So the card doesn't generate any signal upon looping? We're using the DIO to (among other things) control triggering on an A/D, I suppose the A/D could do the callback when it's seen the right sample count. It just seems like a backwards way to do it.
0 Kudos
Message 3 of 4
(3,033 Views)
Hello,

No, unfortunately, the 6534 does not generate the interrupt when looping from onboard memory, since no PC to 6534 memory transfers are needed in this mode.

Let me know if there is anything else I can help with or clarify. Have a great day!

Ken S.
National Instruments
0 Kudos
Message 4 of 4
(3,033 Views)