Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Two pulse trains with fixed phase delay using USB-6216

Solved!
Go to solution
I need to generate two continous pulse trains with the 2nd pulse train at a fixed delay from the first. Can this be done with the USB-6216?
0 Kudos
Message 1 of 6
(4,220 Views)
Solution
Accepted by Tsquared

Yes it can.


You will have to set up a dummy analog input task, and then set both counter tasks to use ai/StartTrigger as their start trigger.  Your first counter will start immediately, but for your second counter task specify a value for the "initial delay" terminal of the DAQmx Create Channel VI.

 

This "initial delay" will be in seconds, and will be the delay after receiving the start trigger that the second pulse train begins. 

 

Eric S.
AE Specialist | Global Support
National Instruments
Message 2 of 6
(4,191 Views)

Hi,

 

I am trying to output two 10Hz pulse trains with a variable phase delay of 0.1ms resolution.

Can it be done on NI-6229 and what is the max phase error between the two pulse trains?

 

rgds

 

0 Kudos
Message 3 of 6
(3,862 Views)

You might try to set up counter 0 and 1 for re-triggerable single pulse generation.  Configure channel1 to use a start delay (this would be your phase delay).  Then use the FREQ_OUT output to generate a trigger at 10Hz.  Route the FREQ_OUT to the START trigger of both channel 0 and channel 1.  You then might be able to vary the phase delay dynamically in software without having to stop the task. If the DAQmx driver doesn't allow you to modify the start delay (which may be very likely) while the task is active,  this this idea will not work.  Try using the DAQmxSetTrigAttribute() function to set the DAQmx_StartTrig_Delay attribute. The resolution of the phase delay depends on the counter source.

 

0 Kudos
Message 4 of 6
(3,854 Views)

yeokiwi,

 

Do you need the phase delay to be varied on the fly while the pulse trains are being continuously generated?  Do you need the pulse trains to be perfectly square (exactly 50% duty cycle) or are you only concerned with the leading edge of each pulse?

 

You can probably do what you need with your board.  The *variability* in phase delay will be very small, probably something like 50 parts per million based on the board's internal timebase spec.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(3,852 Views)

Hi all,

 

Thanks for the help.

 

I did it with the use of ai/starttrigger and a dummy analog input. The starttrigger will start the first pulse train and the next pulse train will start at a predetermined phase delay.The output is very accurate after some minor adjustment to the Initial Delay. I can easily get a phase delay of 0.1us resolution.

 

rgds

0 Kudos
Message 6 of 6
(3,845 Views)