LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating a square wave

using mathematical formula without using square wave function. Is it possible?

0 Kudos
Message 1 of 8
(3,795 Views)

@Alphasmsn wrote:

Is it possible?


Yes.

 

 

What I usually do is use a boolean that I toggle every so often.  I then use the Boolean to (0,1) function and multiply by the desired amplitude.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(3,791 Views)

I want to automatically generate square wave without manually toggle it.

0 Kudos
Message 3 of 8
(3,787 Views)

Who said anything about manual operation?  Setup a loop.  Every so many iterations, you toggle the boolean.  If you toggle every iteration, it looks like a triangle wave.  But it should be a good start for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 8
(3,780 Views)

I am new to Labview so I have no idea how to generate using booleen.

The vi shown generate a triangle waveform, but how can I convert it to a square wave?

0 Kudos
Message 5 of 8
(3,749 Views)

Hi Alpha,

 

simply change the plot settings in the VI shown above and you're done 😄

Best regards,
GerdW


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

@Alphasmsn wrote:

I am new to Labview so I have no idea how to generate using booleen.

The vi shown generate a triangle waveform, but how can I convert it to a square wave?


Yes, I told you that would be a triangle wave.  I also told you that you need to create code to toggle only every X number of iterations.  Think it through.  You can figure this out.  Post back with what code you have tried and what it isn't doing that you want it to.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(3,718 Views)

screenshot attached

0 Kudos
Message 8 of 8
(3,675 Views)