LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create time delay between two square signal waveforms

Hello. I am trying to create a time delay between two square signal waveforms having the same frequency, however, I cannot do that. I try to implement what I found in the forum here and here. What could the problem be?

Egemen
0 Kudos
Message 1 of 15
(4,835 Views)

I would use the phase input to the square wave. Give each waveforms either a time or phase input by adding it to your cluster. If you choose time, then calculate the phase (time*frequency*360= phase in deg).

 

Also, the reset signal needs to be true to set the phase in that VI.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 2 of 15
(4,773 Views)

Thank you Josh. I have limited knowledge about signals and their manipulations. What is phase for signal? Is there any reinforcement that I can consult about signals/waveforms?

 

How can I implement your suggestion?

 

What is the problem with the vi that I sent? I really do not understand. Changing to for the second waveform does not affect it, why?

Egemen
0 Kudos
Message 3 of 15
(4,725 Views)

Hi newbie,

 

I cannot open your VI at the moment but all many of those signal generation functions have a "Phase" input:

 

Two square waves with 90° phase shift in between:

check.png

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(4,712 Views)

I got it GerdW, thank you. How could I manipulate the phase to make a time delay? For instance, I want to generate the first signal immediately as the vi runs, but I want to start generation of the second signal after let's say 10 ms after the first one starts. How could I do it via manipulating of phases? Is there an equation (relation) between phase and time delay?

Egemen
0 Kudos
Message 5 of 15
(4,682 Views)

Hi Egemen,

 

Is there an equation (relation) between phase and time delay?

Yes: sample rate…

 

I want to start generation of the second signal after let's say 10 ms after the first one starts. How could I do it via manipulating of phases?

When you want to start one waveform laterthan the other I would just prepend some additional samples (with value=zero) to the 2nd waveform…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 15
(4,679 Views)

Hi GerdW,

 

What is the equation of sampling rate in which I can use phase as a parameter? I do not know this equation. I am a newbie at generating signals, trying to learn.

 

How can I determine the time by use of empty samples? How can I determine the sample number of these empty values?

 

Egemen
0 Kudos
Message 7 of 15
(4,672 Views)

Hi Egemen,

 

Basic equation1:

time = #samples / samplerate (units: [s] = [S] / [S/s])

 

Basic equation2:

phase = #samples / samplerate / period  (units: [unitless] = [S] / [S/s] / [s])

 

This is basic physics!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(4,667 Views)

Thank you GerdW.

 

Josh, I do not think that I can solve my problem with manipulating with phase parameter. It is a period, so its changes affect in just one cycle. I need shifting the second signal far away, let say 5 cycle forward from the first one. How can I do that shifting?

 

By the way, I just realized that the waveform graph "ignore time stamp" function is on, I think that's why I saw them coincident.

Egemen
0 Kudos
Message 9 of 15
(4,618 Views)

Hi Egemen,

 

as I wrote in message #6: prepend as many samples as you need to…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 15
(4,614 Views)