Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

X series counter triggered pulse generation

Dear all,

Win7 64-bit, NIDAQmx 9.5.1., PCIe-6353

I am attempting to do very simple things with counters on a X-series board, without success. Can anyone help? Thanks a lot.

(code simplified for the sake of clarity)

1) TTL-triggered single pulse generation
What works:
After task creation, I call
DAQmxCreateCOPulseChanTicks(myTask, "Dev2/ctr2", 0, "/Dev2/100MHzTimebase", DAQmx_Val_Low, 100, 3000, 5000);
DAQmxCfgImplicitTiming(myTask, DAQmx_Val_Finite_Samps, 1);
and I start the task, no problem, one pulse is generated
What I'd like to do is to trigger the pulse repeatedly on PFI1 so I add:
DAQmxCfgDigEdgeStartTrig(myTask, "/Dev2/PFI1", DAQmx_Val_Rising);
DAQmxSetStartTrigRettrigerable(myTask, True);
I put a periodic voltage from 0 to 5V on PFI1. No triggering, the voltage amplitude falls by half. When I replace DAQmx_Val_Rising by DAQmx_Val_Falling, the pulses come out, but back to back and never synchronized with the voltage on PFI1. All function calls are successful. I must be doing something wrong, but what?

2) Buffered pulse generation. I want to use the 100MHz timebase (i.e., 10 ns / tick) to output very short pulses, most of them with a duration of 20 ns when high and 20 ns when low (when repeated, this gives a pulse frequency of 25 MHz). I load the counter with an array of values using DAQmxWriteCtrTicks. NI-DAQmx complains when the interval values in the High and Low tick buffers are equal to 2 (which is what I want, since this is the value needed to get a duration of 20 ns). Is this a limitation of NI-DAQmx, i.e., you cannot have pulse tick counts equal to 2? If this is the case, is there a way to output 25 MHz from a PCIe-6353?

Best regards.




2) TTL-triggered multiple
0 Kudos
Message 1 of 3
(2,949 Views)

Hello, Victor65!

 

For your first question, you may find it useful to reference the examples found in:

 

National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse

 

In particular, "Dig Pulse Train Cont-Pause Trig" will illustrate a during-run trigger, while "Dig Pulse Train-Cont-Dig Start" will show how to tigger via a digital signal. Combining these two should get you where you need to go.

 

For your second question, could you post a screenshot of the error you are getting? this will help us narrow down a solution.

 

Thanks!

 

 

 

 

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 2 of 3
(2,935 Views)
Hi Will,

Thanks for your suggestions.

It turns out that for reasons best known to the hardware, (1) works now !??? Don't ask me why.

As for (2), looks like I am able to output 25 MHz on the counter output, with
DAQmxCreateCOPulseChanTicks(myTask, "Dev2/ctr2", 0, "/Dev2/100MHzTimebase", DAQmx_Val_Low, 0, 2, 2);

I'm OK now. Beats me why in the case of buffered generation High and Low ticks array values cannot be equal to 2.


0 Kudos
Message 3 of 3
(2,930 Views)