LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automatic counter in numerical control

Solved!
Go to solution

Hello
my problem is the following, I have a pwm output signal to control an engine, I want the duty cycle to automatically increase from 0-255 in the form of a ramp. i try it with an adder and selector but do not want to operate in a numerical control, it only works in a numerical indicator

PD: I'm new to Labview

 

Captura.PNG

0 Kudos
Message 1 of 3
(3,038 Views)

Use a shift register on your while loop and increment the value for each loop iteration.

 

You also have race condition in your code since you have both the control and the local variable in the loop. This should be avoided in your code. Use the wire itself.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 3
(3,035 Views)
Solution
Accepted by topic author NoTaiZa

Generally speaking, you read from controls and write to indicators. There are some instances when you may want to write back to a control (like if something happens programatically and you want to update the state of the UI with the new values). This sounds like your situation. 

 

There are a few ways to accomplish this (and you can find a few other forum threads about this exact question by searching, too). 

 

Start with this KB. It explains the differences between Local Variables and Property Nodes.

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LXrSAM

 

Other forum post with a similar question:

https://forums.ni.com/t5/LabVIEW/Using-the-same-numeric-control-to-read-and-write-values/td-p/622222

 

 

As a bonus - you don't need a separate numeric indicator to show the value of any numeric data type control/indicator (knob, slider, etc.). You can enable a 'digital display' that shows the current value as a number. Knob Digital Display.PNG

 

 

 

 

 

Nathan Murphy
0 Kudos
Message 3 of 3
(3,004 Views)