LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Time Delay Between 2 Waveforms

Hi,

Please bear with me while I explain what I’m trying to do 🙂   Basically, in the attached LabView file (“flow vis + trigger-m.vi”), I am generating 2 signals: a sinusoidal waveform (used to drive an actuator) and a square waveform (used as a TTL signal to trigger image capture on a CCD camera). Currently when I run the program using LabView 7, both signals are started simultaneously. I would like to introduce a time delay that can be manually specified in the VI, such that when the program is started (i.e. at time t0), the sinusoidal waveform also starts (i.e. at time t0) before the square waveform (i.e. at time t0 + delay time). In a practical sense, this means allowing the actuator to run for several seconds before capturing any images.

 

It sounds like it should be quite straightforward to do, but I’m not so sure how to progress. I have begun to modify the original VI (“flow vis + trigger-m_2.vi”, as attached), but would be much appreciative of any help or suggestions on how I can complete the VI to meet the above requirement.

 

Many thanks,

Mark

Download All
0 Kudos
Message 1 of 8
(4,458 Views)
Hi Mark,
you could create another square wave with the length of the delay you need. set the duty cycle to 0% to get the negative value of the amplitude or to 100% to get the positive value. Append these waveforms with "Append Waveforms", it's located in the analog waveforms palette.
Greets, Dave
Greets, Dave
0 Kudos
Message 2 of 8
(4,445 Views)
Hi Mark,
 
I've taken your VI and added some code to it that should do the work. Basically, I just added waveform samples to the beginning of the square waveform to create the delay based on your frequency and number of samples settings. I've attached the edited version. Let me know if you have any further questions.
 
Regards
Way S.
NI-UK Applications Engineer
0 Kudos
Message 3 of 8
(4,429 Views)

Hi Way S.,

Thanks for the edited VI, unfortunately however, I cannot open it as I am using an older version of LabView (Version 7.0). Is there any chance you can send me the modified VI again, created in LabView 7 instead of version 8.2?

Regards,

Mark

0 Kudos
Message 4 of 8
(4,417 Views)

Hi Mark,

Here you go. Let me know if this works.

Regards

Way S.

NI-UK Applications Engineer

 

0 Kudos
Message 5 of 8
(4,409 Views)

Hi Way S.,

Thanks for the VI again. I tried it but got an error message - I've attached a screenshot of the message. I initially specified a time delay of 1sec (although, realistically I would be looking more of the order of 20secs). Does the delay need to be defined according to the freqeuncy and/or number of samples? Please advise.

Best regards,

Mark

0 Kudos
Message 6 of 8
(4,392 Views)
Hi Mark,
 
I forgot that all analog waveforms generated needed to have the same number of samples in a single task. By introducing a delay into your square wave, I effectively added samples that waveform. So the same number of samples added to the square wave has to be added to your sine wave. I added code that extends the number of samples of your sine wave (# delay + square wave samples). Let me know if this works for you.
 
Regards
 
Way S.
NI UK Applications Engineer
Message 7 of 8
(4,383 Views)
Hi Way S.,
 
The VI is now working with the inputted time delay. Thanks very much - your help is gratefully appreciated.
 
Best regards,
Mark
0 Kudos
Message 8 of 8
(4,376 Views)