Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Ext trigger ignored when generating pulses with counter

I am trying to generate a pulse (or pulse train) triggered by an external lo-to-hi transition of a digital line. I tried NI's example from genDigPulseTrainCont-DigStart.c, verbatim. Here is an excerpt of their code:

char triggerSource[] = "/Dev1/PFI9";
...
DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateCOPulseChanFreq(taskHandle,chan,"",DAQmx_Val_Hz,DAQmx_Val_Low,delay,freq,duty));
DAQmxErrChk (DAQmxBaseCfgDigEdgeStartTrig(taskHandle,triggerSource,DAQmx_Val_Rising));
DAQmxErrChk (DAQmxBaseCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000));
DAQmxErrChk (DAQmxBaseStartTask(taskHandle));

I assumed that the last DAQmxBaseStartTask() call would arm the counter and make it wait for a rising edge on the PFI9 line before generating any pulses. Instead, the counter begins outputting pulses as soon as DAQmxBaseStartTask is called, ignoring any hardware triggers.

How do I configure a counter to generate pulses in response to an external TTL edge transition?

NI-DAQmx base v2.1 on Mac OSX, M6251 card.

Peter.
0 Kudos
Message 1 of 6
(3,732 Views)
 

Hello Peter,

Since you are using a shipping example provided with the driver, I would assume the code is correct.  I would make sure that the signal connected to PFI9 matches the specifications listed in the 6251 Specifications Sheet.  It is possible that the devices sees a trigger event and starts the task.  If you attach a ground signal to PFI9, does the counter output still start? 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 6
(3,707 Views)
Dear Browning:

The PFI input is manually tied to bit0 of the digital output port on the same board, so I assume proper TTL levels everywhere.

Peter.
0 Kudos
Message 3 of 6
(3,700 Views)
Dear Browning:

Just to confirm, I tied the PFI9 line to DGND on my BNC-2110 breakout box, and I assure you that the call to DAQmxErrChk (DAQmxBaseStartTask(taskHandle)) in the above code example (taken verbatim from your genDigPulseTrainCont-DigStart.c example file) starts the pulse generator with no possibility of any edges occurring at PFI9. (why don't you try it at your end.)

So what now?

Peter.
0 Kudos
Message 4 of 6
(3,693 Views)

Hello Peter,

I have been able to reproduce your issue here on my end.  I will report this to R&D to find out why this behavior could be occurring.  I will let you know anything I find out. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 5 of 6
(3,672 Views)

Hello Peter,

This was reported to R&D (# 4HAGBSON) for further investigation. If you could provide me with some more details of what you are wanting to do, I could help you find a workaround. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 6 of 6
(3,650 Views)