LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Duty cycle adjust

Hello all,

 

I'am working on a Pulse Width modulation VI which should automatically adjust the Duty cycle via a Sinus.

When i turn on the VI the Duty cycle doesn't adjust automatically, is there any possibility how to adjust the Duty cycle automatically without stopping the task? 

 

I've attached the VI.

 

Thanks very much!

 

 

0 Kudos
Message 1 of 15
(18,147 Views)

Hi Liggias,

 

I didn't install LabVIEW 2015 yet.

Could you sent the VI in version 2014?

 

Best regards.

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 2 of 15
(18,144 Views)

Hello,

 

I've saved the VI as LV12 version. I hope you can open this 🙂

 

Thanks

0 Kudos
Message 3 of 15
(18,129 Views)

Hi Liggias,

 

When i turn on the VI the Duty cycle doesn't adjust automatically, is there any possibility how to adjust the Duty cycle automatically without stopping the task?

Right now your VI waits on a user event (value change of Frequency) before it will update the PWM output.

Either get rid of the event structure - or create events when needed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(15,708 Views)

Hello GerdW,

 

Thanks for your time, but I am quite new to LabVIEW so I do not understand exactly what you mean. Could you please elaborate?

 

Thanks in advance

0 Kudos
Message 5 of 15
(15,683 Views)

Hi Liggias,

 

"quite new" forces me to recommend all th FREE online courses offered by NI for LabVIEW beginners… 😄

 

The event structure in your VI waits until one of the events happen. Then - only then - new parameters are set for your PWM task!

 

Why don't you open the simple PWM example from LabVIEW Example Finder?

Best regards,
GerdW


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

Hey GerdW,

 

This VI comes from the labview example Finder.

I just want the duty cycle to be adjusted in a sine, from 1% to 99% and then back to 1% etc. If i put a formula which generates numbers from 0.01 to 0.99 in this VI, is it possible to link it to the Duty cycle knob so that the event will change and the values will be changed?

 

Thanks

 

0 Kudos
Message 7 of 15
(3,947 Views)

Hi Liggias,

 

LabVIEW basics: controls are data sources, indicators are data sinks. Did I mention the LabVIEW Basics courses?

 

Once you change your "duty knob" to be an indicator you can connect the output of your formula to this indicator…

Best regards,
GerdW


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

Yes take the free training.  Also I did something similar with 8 slot cDAQ chassis using one of the front BNC connectors.  Here is my example doing a hardware timed frequency sweep using it.  It could be modified to do a duty cycle sweep.  This can also be done with a buffered analog or digital out, either stopping and restarting the task, or updating the values on the buffer but that method would only work on a duty cycle sweep, not frequency because the number of points in the buffer can't change.

 

https://decibel.ni.com/content/docs/DOC-32352 

0 Kudos
Message 9 of 15
(3,923 Views)

Hello GerdW,

 

I do know that if i change a control to be an indicator that i could connect a formula to it, i'm not that new..

I already tried this days ago but the values won't change, and i have no idea why. The formula works but the duty cycle stays at one number, while it should variate between 1% and 99%. 

0 Kudos
Message 10 of 15
(3,917 Views)