LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal generation using trigger

Hello,

I am trying to design a VI that will generate a signal  (triangle wave, f=20Hz, A=400mV) using a trigger signal. I have a laser source that operates at 20kHz with a duty cycle of 90% and produces a trigger signal (f=20kHz, A=5V). Thus, the trigger signal stays at 5V for 90% per cycle and stays at 0 for the remaining 10%.
I want to generate a triangle signal that will be synchronous with the trigger signal, i.e. signal will be generated only when the trigger rises from 0V to 5V and it is zero when the trigger falls from 5V to 0V.

I have attached the VI that I designed. It generates the signal as soon as you run the VI, but the triagle wave does not drop to zero even though the the trigger signal does.

 

It must be a very straightforward problem, but somehow I am missing it. I would appreciate any suggestions.

 

Thank you

0 Kudos
Message 1 of 6
(2,651 Views)

Hi,

 

I'm not sure to really understand the behavior you're trying to get.

Could you send us a trace of the two signals (pulses and triangle) that you would like to have in order to better understand your needs?

 

Actually, it's normal that your triangle signal is generated all the time. The trigger only permits to start the generation. That is that the Task is waiting for a trigger signal before generatin datas physically, then, it uses the Waveform timing attributes to generate the waveform you selected.

 

By the way, i don't have the "Waveform Buffer Generation.vi", could you send it in your next post?

 

Please inform with more details about the signal you're trying to generate and we should be able to help you.

 

Regards,

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 2 of 6
(2,638 Views)


Hi Olivier,
Thank you for the reply. I am attaching an image file that will give you an idea of the behavior I am trying to generate. Please note that I have created these traces using an image editing software, and are not actual traces obtained from LabVIEW or any instrument. As mentioned before, I expect the triangle wave needs to begin being generated as soon as the trigger signal goes from 0V to 5V (leading edge) and should stop & drop to zero with the trailing edge of the laser trigger signal. In addition, as the laser operates independently from my program, I would like the program to wait until the next change in trigger signal level to begin generating the triangle wave. For example, if I start the program when the trigger signal is at point A, I want the program to generate no output until the next level change and then begin generating the wave at the next leading edge. However, the actual behavior is that the triangle wave does not stop when the laser drops from 5V to 0V, and also in case I start the program when the laser is at point A, the program still begins to generate the triangle wave at that instant. The only behavior I noticed is that if I disconnect the laser trigger signal from the trigger input port of the BNC-2110, the program stops generating triangle wave.
I was hoping that the pause property on the trigger node block will help me with stopping the triangle wave when the trigger signal drops from 5 to 0.
I have also attached the "Waveform Buffer Generation.VI". Please let me know if you need any more information.
Thanks

Download All
0 Kudos
Message 3 of 6
(2,625 Views)

Hi Abhi,

 

The signals you sent are effectively what I expected, but the frequencies you gave in your first post did not mention that kind of behaviorn because you said the riangle frequency was 20Hz for a 20kHz pulse train.

 

I don't have boards here to test a complete solution, so I will just give you clues to reach the expected behavior.

I think what you have to do is first generating a clock wich will serve as sample clock for your triangle generation.

This clock can be generated by a counter, and you can use this counter with a pause option, which should permit you to pause the generation during the trailing edge of your laser.

Then, for being sure to start only on a rising edge, use a trigger option.

 

Here are the examples you can use:

1- For generating a sample clock only when the laser pulse is high, use the "Gen Dig Pulse Train-Continuous-Pause trigger.vi" from the Generating digital pulses folder in the example finder utility.

2- Then, use the output of this counter as the sample clock source of your triangle signal generation.

3- You can use the "Cont Gen Voltage Wfm-Ext Clk-Dig Start.vi" example (which I think is the example you used for your first vi) for your voltage generation with an external clock (output of counter) and a start trigger on rising edge (laser pulse).

 

Hope you'll succeed to generate the signal you want with those informations.

 

Regards,

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 4 of 6
(2,622 Views)

Hi Olivier,

Thanks for such a quick reply. I will try this suggestion as soon as I can and will post results.

As for the frequencies,I just drew the waveforms by hand in an image editing software and  therefore do not represent these values. The trigger signal runs at 20kHz and triangle wave at 20Hz.

 

Abhi

0 Kudos
Message 5 of 6
(2,619 Views)

so you will have a really slow slope during the time the laser pulse is high. You will only get a little piece of your triangle signal.

What is the need for that? Why do you need to have the triangle 0V when the pulse is low?

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 6 of 6
(2,610 Views)