キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/18
5,396件の閲覧回数

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.

メッセージ2/18
5,390件の閲覧回数

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 件の賞賛
メッセージ3/18
5,369件の閲覧回数

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.

メッセージ4/18
5,367件の閲覧回数

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 件の賞賛
メッセージ5/18
5,360件の閲覧回数

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 件の賞賛
メッセージ6/18
5,350件の閲覧回数

I have attached part of my example code.

 

Please let me know if u need further clarification.

 

Thanks

 

mhaque

すべてをダウンロード
0 件の賞賛
メッセージ7/18
5,323件の閲覧回数

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 件の賞賛
メッセージ8/18
5,314件の閲覧回数

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 件の賞賛
メッセージ9/18
5,309件の閲覧回数

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 件の賞賛
メッセージ10/18
5,300件の閲覧回数