Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple channel using pci 6731

I'm using pci 6731 under VxWorks. I used two DACs and the DAQ-STC-driven mode to output waveform. There was no multiple channel example in the mhddk. I also found that the examples in the ddk support all types of 67xx except 6731. So I tried to write the programme and not sure it was correct. I used the following programme to config the board:
 //Setting options for DAC 0
 board->AOConfiguration.setDACSEL(board->AOConfiguration.kDACSELDAC0);
 board->AOConfiguration.setPolarity(board->AOConfiguration.kPolarityBipolar);
 board->AOConfiguration.flush();
 board->AOLaterSinglePointUpdates.setDAC0LaterEnable(0);
 board->AOLaterSinglePointUpdates.flush();
 board->AOTimed.writeDAC0Timed(1);
 board->AOTimed.flush();
 board->AOImmediate.setDAC0Immed(0);
 board->AOImmediate.flush();
 board->AOWaveformGeneration.writeDacnum(board->AOWaveformGeneration.kDacnumDAC0);

 //Setting options for DAC 1
 board->AOConfiguration.setDACSEL(board->AOConfiguration.kDACSELDAC1);
 board->AOConfiguration.setPolarity(board->AOConfiguration.kPolarityBipolar);
 board->AOConfiguration.flush();
 board->AOLaterSinglePointUpdates.setDAC1LaterEnable(0);
 board->AOLaterSinglePointUpdates.flush();
 board->AOTimed.writeDAC1Timed(1);
 board->AOTimed.flush();
 board->AOImmediate.setDAC1Immed(0);
 board->AOImmediate.flush();
 board->AOWaveformGeneration.writeDacnum(board->AOWaveformGeneration.kDacnumDAC1);

The DAQ-STC is configed as follow:

 ...
 theSTC->AO_Personal.setAO_FIFO_Enable(1);
 theSTC->AO_Personal.setAO_Number_Of_DAC_Package(tSTC6731::tAO_Personal::kAO_Number_Of_DAC_PackagesSingel_DAC_mode);
 theSTC->AO_Personal.setAO_TMRDACWR_Pulse_Width(theSTC->AO_Personal.kAO_TMRDACWR_Pulse_WidthAbout_2_TIMEBASE_Periods);
 theSTC->AO_Personal.writeAO_BC_Source_Select(theSTC->AO_Personal.kAO_BC_Source_SelectUC_TC);
 ...
 theSTC->AO_Mode_1.writeAO_Continuous(tSTC6731::tAO_Mode_1::kAO_ContinuousIgnore_BC_TC);
 theSTC->AO_BC_Load_A.writeRegister((unsigned)(NumberOfBuffers-1));
 theSTC->AO_Command_1.writeAO_BC_Load(1);
 theSTC->AO_UC_Load_A.writeRegister((unsigned)(PointsPerBuffer));
 theSTC->AO_Command_1.writeAO_UC_Load(1);
 theSTC->AO_UC_Load_A.writeRegister((unsigned)(PointsPerBuffer-1));
 ...
 theSTC->AO_Mode_1.writeAO_Multiple_Channels(1);
 theSTC->AO_Output_Control.writeAO_Number_Of_Channels(1);/*2 channels*/
 ...
 theSTC->AO_Command_1.writeAO_LDAC0_Source_Select(0);
 theSTC->AO_Command_1.writeAO_DAC0_Update_Mode(1);
 theSTC->AO_Command_1.writeAO_LDAC1_Source_Select(0);
 theSTC->AO_Command_1.writeAO_DAC1_Update_Mode(1);
 ...
 theSTC->AO_Mode_2.setAO_FIFO_Retransmit_Enable(1);
 ...
The question is that no matter what I write to the FIFO, all the channels output the same waveform. I just want the channels to output different signals, for example, the channel 0 output a sine wave and the channel 1 output square. I don't know where is the mistake in my programme and how the 6731 manages it's FIFO. Any help would be very much appreciated.

0 Kudos
Message 1 of 1
(6,519 Views)