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,132 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,116 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,113 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,093 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,089 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,069 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,065 Views)

Thank You. It works.

 

Regards

Sagar

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