LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indicator value to be changed by user while program is running

I have a numeric indicator that gives the relative time in hours, minutes and seconds.

 

While the program is running I want to change the values and then press an OK button so that the values remain changed.

 

How can this be achieved?

 

mhaque

0 Kudos
Message 1 of 18
(3,845 Views)

You can't change an indicator of a running VI from the front panel directly. You must use another control to accept the value you want to set and then write the value to the indicator.

Message 2 of 18
(3,839 Views)

Although the event structure gets the job done, it cannot be used as part of a subVI.

 

Are there any other ways to change the indicator value?

 

Perhaps using a value change property node? I do not know much about property nodes since I am very new to LAbVIEW. Perhaps somebody can point me in the right direction.

0 Kudos
Message 3 of 18
(3,818 Views)

You didn't say anything about a subVI. Next time provide "little" details like that, as they change the answer dramatically.

 

What's the purpose of the subVI, and why are you using a subVI? Yes, you can use control references to access control/indicators of a parent VI from a subVI. Open the Example Finder (Help -> Find Examples) and search for "properties". Open the example called "Property Nodes". That example shows a reference to a graph being passed into a subVI.

Message 4 of 18
(3,816 Views)

Sorry Boss, when I get 10K hits I promise to provide all the "little" details. Still very new to LabVIEW as you can see.

 

My indicators are essentially an array of elapsed time. There are 12 arrays like this. I want the option of editing this array, taking away hours, adding hours, making it zero, etc.

 

I guess using the term "SubVI" is inappropriate (much like Britney Spear's music videos). Sorry about that.

 

Knight to the rescue?

 

mhaque

0 Kudos
Message 5 of 18
(3,809 Views)

Use a separate control and a button.  You type in the value you want into the control, click the button, and the value gets written to the indicator (or a local variable of the indicator if there is something else writing to the indicator).  You can use an event structure to capture the button event in order to update the indicator.

 

If you provide a sample of your code, we can understand better ways to fix your problem.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 18
(3,799 Views)

I have attached part of my example code.

 

Please let me know if u need further clarification.

 

Thanks

 

mhaque

Download All
0 Kudos
Message 7 of 18
(3,772 Views)

What I'm seeing is that you want the sub-vi to update the Timed Array if the control is off for an element.  If the control is on, you want to take the value from the Module A 4 Edit.  A simple selector function and For Loop will do this for you.  See the attached vi or the drawing below.

 

tbob[1]_BD.png

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 18
(3,763 Views)

Hi tbob

 

Thanks for your reply but it does not give me the desired results. I want the option of editing the "Timed Array" by using the "Module A4 edit" i.e taking away hours, adding hours, making it zero, etc. The boolean control is simply there to start/pause the stopwatch i.e elements in "Timed Array".

 

Let me know if u need further clarification.

 

mhaque

0 Kudos
Message 9 of 18
(3,758 Views)

If you press the control button for the first element, you can then edit first element the Module A4 Edit by typing right into the box.  When you click outside the box or press Enter, that value appears in the first element in the Timed Array box.  This is called editing to me.  You can add hours, take away hours, make it zero, all by typing whatever you want into the Module A4 Edit box. You must be more specific if this isn't what you want.

- tbob

Inventor of the WORM Global
0 Kudos
Message 10 of 18
(3,749 Views)