02-22-2022 07:15 AM
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.
Solved! Go to Solution.
02-22-2022 08:19 AM - edited 02-22-2022 08:19 AM
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!
02-22-2022 08:22 AM
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.
02-22-2022 08:30 AM
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
02-22-2022 08:42 AM
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… 🙂
02-22-2022 08:49 AM
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.