charles hamm
2007-10-05 14:40:12 UTC
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 SP4Visual C++ 2005 (V8)NIDAQ Legacy V7.4.2I 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.
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.