From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 6534 for repeated pattern

I am trying to use a PXI-6534 to output a 16-bit repeated pattern initiated by an external trigger.

My environment is:
Win 2000 SP4
Visual C++ 2005 (V8)
NIDAQ Legacy V7.4.2

I can successfully operate the 6534 by reloading the pattern buffer each time, using the same code that worked for the 6533. However, when I modify the code to preload the pattern, the pattern is never output. Since there does not seem to be any example code that addresses this application, I am posting this message.

The code that works is similar to this (less error detection):

Init_DA_Brds(mwPatternDevice, &wBoardCode);
DIG_Grp_Config(mwPatternDevice, mkwPatternGroup, 2, 0, 1);
Set_DAQ_Device_Info(wPatternDevice, ND_DATA_XFER_MODE_DIO_GR1, ND_UP_TO_1_DMA_CHANNEL);  Set_DAQ_Device_Info(wPatternDevice, ND_DATA_XFER_MODE_DIO_GR2, ND_UP_TO_1_DMA_CHANNEL); 
DIG_Block_PG_Config(mwPatternDevice, mkwPatternGroup, 1, 0, mwStimBase, mwStimCtr, 1);
DIG_Trigger_Config(mwPatternDevice, mkwPatternGroup, 1, 0, 0, 0, 0, 0, 0);
loop:
DIG_Block_Out(mwPatternDevice, mkwPatternGroup, mpwPattern, mwPoints);
do { // while jRemaining
    <wait for external trigger via other hardware>
    DIG_Block_Check(mwPatternDevice, mkwPatternGroup, &jRemaining);  if (iStatus != noTransferInProgError)     NIDAQYield(1);
    } while (jRemaining && mbRunning);
goto loop;

The code as modified for the 6534 looks like this:

Init_DA_Brds(mwPatternDevice, &wBoardCode);
DIG_Grp_Config(mwPatternDevice, mkwPatternGroup, 2, 0, 1);
DIG_Block_PG_Config(mwPatternDevice, mkwPatternGroup, 1, 0, mwStimBase, mwStimCtr, 1);
DIG_Trigger_Config(mwPatternDevice, mkwPatternGroup, 1, 0, 0, 0, 0, 0, 0);
DIG_Block_Out(mwPatternDevice, mkwPatternGroup, mpwPattern, mwPoints);
loop:
do { // while jRemaining
    <wait for external trigger via other hardware>
    DIG_Block_Check(mwPatternDevice, mkwPatternGroup, &jRemaining);  if (iStatus != noTransferInProgError)     NIDAQYield(1);
    } while (jRemaining && mbRunning);
goto loop;

Note that I removed the transfer mode calls and moved the block_out call to outside the loop. The loop runs, but the pattern is not actually output from the board.




0 Kudos
Message 1 of 2
(2,907 Views)

Hi Charles Hamm,

In order to repeatedly generate the same block of data, you must set ND_PATTERN_GENERATION_LOOP_ENABLE in the Set_DAQ_Device_Info function to ND_ON. There are a couple restrictions when looping from the onboard memory. If you are using 8-bit data, the buffer size must be a multiple of 4. If you are using 16-bit data, the buffer size must be an even number. There are no restrictions for 32-bit data.

This information can be found in the NI 653x User Manual for Traditional NI-DAQ at the top of page 2-12.

Please post if you have any questions. Have a great day!

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 2 of 2
(2,876 Views)