From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square wave generation

Solved!
Go to solution

Hi,

I am trying to generate a square wave as per below attached graph.

I tried using square wave pt by pt VI. But graph is not generating as per requirement. I think timing which i am giving is wrong. Could anyone please help me with solutions?

Graph is Duty cycle vs time.

 

Regards

0 Kudos
Message 1 of 8
(6,188 Views)

Instead of attaching the image, please attach your code.

 

Is there any specific reason on why you are using the point by point VI?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 8
(6,172 Views)

Hi,

 

you should not expect solutions...

 

When your VI doesn't follow the requirements you made something wrong. Maybe you attach your VI?

 

Hint: use a For loop on your input array, add up time and create a XY plot using this time scale...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(6,169 Views)

Hi,

 

Please find below code. There is no specific reason for using the point by point VI.

 

 

Regards

Sagar S

0 Kudos
Message 4 of 8
(6,149 Views)

Hi,

 

Thank You for the reply. I tried xy graph but it is not generating as square wave.

 

Regards

Sagar

0 Kudos
Message 5 of 8
(6,145 Views)
Solution
Accepted by topic author $agar

You are trying to generate a square wave based on a while loop and system timer which would not give you the waveform what you expect. Try using Square Wave.vi by configuring the number of samples upfront, which would give you a perfect square wave of your interest.

-----

The best solution is the one you find it by yourself
Message 6 of 8
(6,125 Views)

Hi,

 

Thank you for the reply. I tried with Square Wave.vi . But the desired wave form is not generating.

 

Please take a look.

 

 

0 Kudos
Message 7 of 8
(6,121 Views)

Thank You. It works.

 

Regards

Sagar

0 Kudos
Message 8 of 8
(6,106 Views)