This is the nidaq code I have this must be converted to NIDAQmx is this possible
// reset counter1
GPCTR_Control(iDevice, ND_COUNTER_1, ND_RESET);
// use counter 1 as puls generator to trigger counter 0
GPCTR_Set_Application(iDevice, ND_COUNTER_1, ND_SINGLE_PULSE_GNR);
// write delay counter1, note this delay is not used.
GPCTR_Change_Parameter(iDevice, ND_COUNTER_1, ND_COUNT_1,ulLOWcount);
// write pulse length counter1
GPCTR_Change_Parameter(iDevice, ND_COUNTER_1, ND_COUNT_2,ulHIGHcount);
// set gpctr0 as output channel of pulse of counter1
// To output a counter pulse, you must call Select_Signal.
Select_Signal(iDevice, ND_GPCTR0_OUTPUT, ND_GPCTR0_OUTPUT, ND_LOW_TO_HIGH);
// reset counter2
GPCTR_Control(iDevice, ND_COUNTER_0, ND_RESET);
// use counter as triggered puls generator1
GPCTR_Set_Application(iDevice, ND_COUNTER_0,ND_SINGLE_TRIG_PULSE_GNR);
// set channel other counter output to be used as trigger
GPCTR_Change_Parameter(iDevice, ND_COUNTER_0, ND_GATE,ND_OTHER_GPCTR_OUTPUT);
// write delay after external trigger
GPCTR_Change_Parameter(iDevice, ND_COUNTER_0, ND_COUNT_1,ulLOWcount2);
// write pulse length
GPCTR_Change_Parameter(iDevice, ND_COUNTER_0, ND_COUNT_2,ulHIGHcount2);
// set gpctr1 as output channel of pulse of counter2
// To output a counter pulse, you must call Select_Signal.
Select_Signal(iDevice, ND_GPCTR1_OUTPUT, ND_GPCTR1_OUTPUT, ND_LOW_TO_HIGH);
// arm counter2 (delay counter)
GPCTR_Control(iDevice, ND_COUNTER_0, ND_PROGRAM);
// program ADC to wait for trigger
iStatus = DAQ_Config(iDevice,1,0);
//Configure DAQ to look for Start Trigger from GPCTR1 Ouput routed via PFI_0 //ND_GPCTR1_OUTPUT
iStatus = Select_Signal(iDevice,ND_IN_START_TRIGGER,ND_GPCTR0_OUTPUT, ND_LOW_TO_HIGH); // changed output to gate
iStatus = DAQ_Start(iDevice,iChan,iGain,piBuffer,ulCount,ND_INTERNAL_1_MHZ,2);
// arm counter 1 (puls generator)
iStatus = GPCTR_Control(iDevice, ND_COUNTER_1, ND_PROGRAM);
while ((iDAQstopped != 1) && (iStatus == 0)) {
iStatus = DAQ_Check(iDevice, &iDAQstopped, &ulRetrieved);
}
iStatus = DAQ_VScale(iDevice, 1, iGain, dGainAdjust, dOffset,ulCount, piBuffer, pdVoltBuffer);
// CLEANUP - Don't check for errors on purpose.
iStatus = DAQ_Clear(iDevice);
iStatus = GPCTR_Control(iDevice, ND_COUNTER_1, ND_RESET);
iStatus = GPCTR_Control(iDevice, ND_COUNTER_0, ND_RESET);