This post is for the same application that will be using waveform sequencing. I have tried your functions as written, but haven't had any more luck getting both cards to acquire data simultaneously.
I do have a couple questions about the specifics of these functions, but it may be easier for you to just see what I'm doing and maybe point out what I need to change. My current code looks like the following :
//////ATTEMPT TO ROUTE TRIGGER AND CLOCK TO SLAVE CARD FROM MASTER CARD WHERE 1 IS THE MASTER AND 2 IS THE SLAVE//////
/* Configure PFI 6 Trigger to RTSI 1 */
Select_Signal(1, ND_OUT_UPDATE, ND_PFI_6, ND_LOW_TO_HIGH);
Select_Signal(1, ND_RTSI_1, ND_OUT_UPDATE, ND_LOW_TO_HIGH);
/* Configure Counter 0 Output to RTSI 0 */
Select_Signal(1, ND_GPCTR0_OUTPUT, ND_RTSI_0, ND_LOW_TO_HIGH);
/* Now you want to have your AI start trigger and sample clock come from those 2 RTSI lines for both boards. */
Select_Signal(2, ND_IN_SCAN_START, ND_RTSI_0, ND_LOW_TO_HIGH);
Select_Signal(2, ND_IN_STAR_TRIGGER, ND_RTSI_0, ND_LOW_TO_HIGH);
//////THE FOLLOWING IS A CLASS METHOD THAT IS CALLED ONCE FOR EACH CARD WITH ALL PARAMETERS IDENTICAL EXCEPT FOR THE CARDNUMBER WHICH IS CALLED FOR cardNumebr = 1 AND THEN cardNumber = 2 where 1 is the master and 2 is the slave//////
iStatus = SCAN_Setup(this->cardNumber, this->numberOfChannelsToAcquire, this->channelsToAcquire, this->channelGains);
iRetVal = NIDAQErrorHandler(iStatus, "SCAN_Setup", iIgnoreWarning);
iStatus = Timeout_Config(this->cardNumber, lTimeout);
iRetVal = NIDAQErrorHandler(iStatus, "Timeout_Config", iIgnoreWarning);
//////THEN BOTH CARDS ARE ARMED, SLAVE FIRST. THIS IS ALSO A CLASS FUNCTION THAT RECEIVES IDENTICAL PARAMETERS FOR BOTH CARDS EXCEPT FOR cardNumber.//////
iStatus = SCAN_Op( this->cardNumber,
this->numberOfChannelsToAcquire,
this->channelsToAcquire,
this->channelGains,
this->dataBuffer,
this->numberOfChannelsToAcquire * this->samplesPerChannel,
0, //This parameter is not used by simultaneous sampling devices
this->sampleRate
);
iRetVal = NIDAQErrorHandler( iStatus, "SCAN_Op", iIgnoreWarning);
//////THE NEXT STEP IS TO RETREIVE THE DATA FROM THE CARDS//////
//Organize the converted values according to channel
iStatus = SCAN_Demux(this->dataBuffer, this->samplesPerChannel * this->numberOfChannelsToAcquire, this->numberOfChannelsToAcquire, 0);
iRetVal = NIDAQErrorHandler(iStatus, "SCAN_Demux", iIgnoreWarning);
//Scale integer values to voltage values according to each channel's gain setting
for(int i=0;i{
iStatus = DAQ_VScale(this->cardNumber, 0, this->channelGains[i], 1//dGainAdjust
, 0//dOffset
, this->samplesPerChannel
, &this->dataBuffer[samplesPerChannel * i]
, &data[samplesPerChannel * i]);
}
iRetVal = NIDAQErrorHandler(iStatus, "DAQ_VScale",iIgnoreWarning);
The variables for my default case are as follows:
cardNumber = 1 or 2 depending on the call. 1=master, 2=slave.
numberOfChannelsToAcquire = 4
channelsToAcquire = [0,1,2,3]
channelGains = [0,1,2,3]
lTimeout = 180 //10 second time out
dataBuffer is an array of data type i16 that is (numberOfChannelsToAcquire * samplesPerChannel) elements long.
samplesPerChannel = 250
sampleRate = 20000 //2kS/s
On the last Select_Signal function, did you mean ND_IN_START_TRIGGER ? I know that PXI busses have a STAR trigger, so I thought I'd ask, but ND_IN_START_TRIGGER is not a valid constant. Also - you wrote "1" for each function.. are all of those functions for the master card?
Hopefully this helps. Before you wrote I was trying :
//Set as the master card, and send it's clock signal to all other slave boards.
Select_Signal(1,ND_RTSI_CLOCK, ND_BOARD_CLOCK,ND_DONT_CARE);
//Set as slave board, and recieve clock signal from master
Select_Signal(2,ND_BOARD_CLOCK, ND_RTSI_CLOCK,ND_DONT_CARE);
//Send trigger from the master card
Select_Signal(1,ND_RTSI_1,ND_IN_START_TRIGGER,ND_LOW_TO_HIGH);
//Recieve trigger from the master card
Select_Signal(2,ND_IN_START_TRIGGER,ND_RTSI_1,ND_LOW_TO_HIGH);
Select_Signal(1,ND_IN_START_TRIGGER,ND_PFI_0,ND_LOW_TO_HIGH);
This code resulted in the slave card timing out, but the master would trigger off of PFI0. When you wrote PFI 6 in your example code, was that because I need to use PFI 6? Or can I use PFI 0.
Thank you again for your help,
infrared