03-30-2023 06:08 AM
Hello everyone, I'm having trouble with a particular looping statement.
I have numeric control that is connected directly to the first numeric indicator that shows what is my input.
I want to decrement the value of that and display the result on the second numeric indicator.
Btw, the decrement function is continuing until it reaches the range that I set (6.5 - 😎 or via turning off the Toggle Switch.
Can you help me to solve this problem?
I'm using 2016 version
03-30-2023 06:25 AM - edited 03-30-2023 06:25 AM
First of, all code outside of the loop is only executed once.
Second, the value in Numeric is passed to Numeric 4 only once, so you would have to set it before running the VI.
Third, the loop will only stop when you flip the switch.
03-30-2023 10:36 AM - edited 03-30-2023 10:37 AM
You simply need to start with some of the basic LabVIEW learning resource listed at the top of the forum. It seems you have not grasped the basic concepts of dataflow.
@AlphaPhi wrote:
I have numeric control that is connected directly to the first numeric indicator that shows what is my input.
I want to decrement the value of that and display the result on the second numeric indicator.
Btw, the decrement function is continuing until it reaches the range that I set (6.5 - 😎 or via turning off the Toggle Switch.
So please explain your requirements in simple terms. How does the program start? What is a typical control value? Is the user allowed to change the control while the loop is running or not? What are the termination requirements?
03-30-2023 11:02 AM - edited 03-30-2023 11:16 AM
See if this can give you some ideas for certain code simplifications.
If you want to "decrement a control" (as in your subject), you could use a local variable of the "start value" and write to it inside the loop, a reasonable use here. Of course if the start value is below the range, you probably want to increment instead. Right?