LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I dont understand PWM code

Hi 

 

While searching abount PWM control using labview, I found this VI.

 

But I can't understanding this mean 'Steps in a Cycle' and 'Cycle time PWM'

 

Please someone explain about this code.

 

 

 

0 Kudos
Message 1 of 2
(2,092 Views)

Hi odoria,

 


@odoria wrote:

While searching abount PWM control using labview, I found this VI.

But I can't understanding this mean 'Steps in a Cycle' and 'Cycle time PWM'

Please someone explain about this code.


Where do you found this code?

 

A PWM signal is basically a square signal with fixed frequency and variable duty. In this VI you find a "discrete slow" version of PWM: you set the frequency by changing "cycle time" and divide one cycle into a number of steps. The duty determines how many of those steps are set to LOW or HIGH…

 

The VI itself is crowded and overly complicated. No need to create an array of just one boolean and replace the boolean value inside: simple handle the boolean and use BuildArray before DAQmxWrite…

 

A little bit simpler:

check.png

Best regards,
GerdW


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