09-24-2018 02:39 PM
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
Solved! Go to Solution.
09-24-2018 02:52 PM
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.
09-24-2018 09:02 PM
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.