LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square wave with different off and on time

Solved!
Go to solution

Hi everyone, can someone please help me in generating a square wave which has user defined ON and OFF states. For example, user might want a signal to be on for 4 seconds and off for 2 seconds. I think it would be really easy but I am unable to program it.

0 Kudos
Message 1 of 6
(1,108 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

help me in generating a square wave which has user defined ON and OFF states. For example, user might want a signal to be on for 4 seconds and off for 2 seconds.


Use the SquareWaveform function in the waveform signal generation palette!

You can set a "duty [%]" for the square waveform!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,092 Views)

Yeah I know about the duty cycle but it is in %. I want to turn on the signal for some seconds and then turn it off for some seconds.

 

0 Kudos
Message 3 of 6
(1,087 Views)
Solution
Accepted by topic author Pukhtun_Yum

You can calculate Duty Cycle and Frequency using the below formula,

 

Duty cycle = On time / (on time + off time)

Frequency = 1 / (on time + off time)

 

Typically signal generation libraries take in Frequency and Duty Cycle for the timing characteristics

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 6
(1,082 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

Yeah I know about the duty cycle …


So you don't have problems with using LabVIEW, but with applying simple math!?

 

You should ask your math teacher in school… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(1,075 Views)

I think you are over here to taunt others instead of helping them.

 

I did not know about the formula for duty cycle which @santo has mentioned in the above post, that was all I wanted. 

0 Kudos
Message 6 of 6
(1,070 Views)