LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get delayed pulse train

hello,

i am using Labview 7 and a PCI 6014 interface card. i want to generate delayed pulse train. for this purpose i am generating a analog waveform using 'function generator.vi'. i supply this waveform to a counter and to generate delay i am using 'finite pulse train(daq-stc).vi'. when i set trigger mode to 'no trigger', the VI works fine. But if i supply generated waveform to the counter gate(i.e. setting trigger mode to external), i see for sometime pulses missing are missing. I have also tried several other VI's(like 'delayed pulse easy.vi' and 'cont pulse train easy.vi'), but facing same problem. Can you please tell me how can i solve this problem.

regards,

Abhijeet
0 Kudos
Message 1 of 9
(4,045 Views)
Hello Abhijeet,
To generate a delayed pulse train, you can use two counter operations. One counter will generate a delayed single pulse. The other counter will generate a triggered pulse train. You can use the pulse from the first counter to trigger the pulse train. I've put together a VI that does exactly this. The application is saved for LabVIEW 7.0. Give this a try and see how it works. Hope this helps!
-Alan A.
0 Kudos
Message 2 of 9
(4,032 Views)
Hello Alan,

Thank you for your quick response. Actually the VI you have sent is not compatible with the card PCI-6014, also i need two delayed pulse trains. For this purpose i need a source from which i can generate pulse train of around 15 Hz and supply it to two counters where i can get delay. I am able to do this but for some moment i see some pulses are missing. why is it happening?

Regards,

Abhijeet
0 Kudos
Message 3 of 9
(4,022 Views)
Hello Abhijeet,
I guess I'm a little unsure of how you are generating your delayed pulse trains. Could you post your code? Also, how do you know you are missing pulses?
-Alan A.
0 Kudos
Message 4 of 9
(4,011 Views)
hello Alan,

Ok! here i explain my code. My requirement is to supply contineous 5V pulses at around 10Hz to a camera. After some time of the rising edge of pulse to the camera, i want to trigger Laser-1 and after some time of rising edge of the pulse to the Laser-1, i want to trigger Laser-2. In PCI 6014 there are only two counters which i am using for two Lasers(for delay generation). For Pulse train generation i am using 'function generator.vi'which is basically a waveform generator, but to get pulse train i set offset equal to amplitude. I supply this pulse train to two counters. To generate delay from the counters i am using 'Delayed pulse easy(9513).vi' which i have put into while loop. To see the output i am using 2-channel oscilloscope vi where i see some pulses missing. Also I obsereved pulses missing when i supply the output to the Lasers(Lasers stops firing for moment).

I am attaching a timing diagram which is explains my application and a labview code where i have combined three VIs (one 'function generator.vi' and two 'delayed pulse easy(9513).vi').

Thank you,

Abhijeet
0 Kudos
Message 5 of 9
(4,003 Views)
hello Alan,

Here i am attaching a timing diagram. Please see the attachment.

Thank you

Abhijeet
0 Kudos
Message 6 of 9
(4,003 Views)
Abhijeet,
I've written a LabVIEW program that should do what you want. Because your device (PCI-6014) and version of LabVIEW (7.0) are both compatible with NI-DAQmx, I used DAQmx VIs as opposed to Traditional DAQ VIs. This program sets up an analog output task to output a square wave at 10Hz. Then it sets up two counters to output a pulse based on a certain number of ticks of the analog output sample clock. Finally, there is an analog input task to acquire the three signals created. The external connections you need to make are: analog out 0 to analog in 0; counter out 0 to analog in 1; counter out 1 to analog in 2. The program assumes that the device is named "Dev1". Hope this helps!
-Alan A.
0 Kudos
Message 7 of 9
(3,975 Views)
Hello Alan,

Thank you very much for sending me a code for generating delayed pulse trains. The code is working fine. I have one question, if I am not wrong, in the code we divide each pulse into 100 divisions called ticks. And these ticks are used to set delays. Is it possible to increase number of divisions/ticks to 1000 or 10,000 so that I can set delay more accurately.

Regards,

Abhijeet
0 Kudos
Message 8 of 9
(3,898 Views)
Abhijeet,
Yes, the program uses the AO Sample Clock as the source of the ticks. You can make that sample rate anything you want (as long as you do not exceed the max output sample rate). You might want to try using a different type of timing with the DAQmx Timing VI, maybe try 'Sample Clock' as opposed to 'Use Waveform'. Then you could explicitly set the AO sample clock.
-Alan A.
0 Kudos
Message 9 of 9
(3,868 Views)