LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Controlling" an indicator

Solved!
Go to solution

Hi all, 

 

Do anyone know how to "control" an indicator? I had try out it by using local variable, but the "control" seen not dominating the "indicator".

Picture below is to make clear of my question. As from the picture, there is 2 control in the begining which is x and y, the answer of x + y is indicate in the local variable x+y (local variable of control 1).  The (control 1) is connected to another indicator, how can i make (control 1) dominate the (indicator) which is it own local variable?

Untitled2.png

 

 

Thankyou very much. 

0 Kudos
Message 1 of 8
(2,344 Views)

YukiWongg,

 

There are several different ways to accomplish what you want.  However, the first thing to do is determine why you want two different bits of code controlling the same indicator?

 

Are you trying to set the indicator up with an initial value?

Do you want the user to be able to override the calculated value for the indicator?

Do certain conditions dictate which value you want the indicator to display?

 

There is no "one-click" way to get what you want.  As it is whichever piece of code happens to run last on your block diagram will determine what the value of the indicator is.  You've created a textbook example of a race condition.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 8
(2,339 Views)

Chris,

 

Thanks for your reply, the VI above is just a simple example to make clear of my question. 

what i try to do is to set the indicator up to an initial value and enable user to modify it in order to observe the difference of a "controller performance" by increasing the value and decreasing the value of the "indicator".

 

Thank you very much. 

0 Kudos
Message 3 of 8
(2,335 Views)

Its is still not clear what you are trying to achieve. If you want to change the value of an indicator yo could have wired the value to the indicator. In the place where you are mentioning as Indicator is really a control. Try explaing little deltailed what exactly you want to achieve.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 8
(2,329 Views)

P Anand, 

 

I am actually developing a program to automatic calculate the parameter of controller and indicate the response on the graph. i want to make the calculated parameter to be modified in order to observe how the response of the system going behave by increase or decrease the value of the parameter. Is that clear or much more confuse now ?

0 Kudos
Message 5 of 8
(2,324 Views)
Solution
Accepted by topic author YukiWongg

Hi Yuki,

 

you really should try to obey the DATAFLOW. A simple solution might be:

check.png

Best regards,
GerdW


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

In addition to what GerdW posted (which is probably the best solution), if you want to have an intial value, just throw a sequence structure in there.  In the first frame perform you calculation and set that value to a local variable for the CONTROL (not the indicator).  Then in a while loop you can wire the control to the indicator.  You're control will display the calculated value and then the indicator will be updated to reflect that, or any value the user changes the control to be.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 8
(2,299 Views)

Thankyou GerdW and Chris for the solution, your helps are appreciated.

 

Hopefully LV could develop the "one-click" way to get what i want :P. It might be useful for me 😄

0 Kudos
Message 8 of 8
(2,290 Views)