Jump to content

Sub-VI and default value


Recommended Posts

Hi everybody,

I have 2 very basic questions about Labview.

1: I have created a VI with a "while loop" and I have a control and an indicator inside and it works. After that, I use this VI as a sub-VI in another program. And now, I doesn't work. I mean, I can't modify the control value dynamically. I think I should use some Local Variable, or something like that. Could you help me please ?

2:Is it possible to Reset a control (for exemple, a numeric control) to its Default Value, while the programming is running ?

Thanks for your answer

Link to comment

Hi foxone,

I'm pretty new to LabVIEW, so I hope what I'm saying here isn't completely wrong.

1. Could you please post your VI? Then I could have a look on it and it would be clearer for me to understand what exactly isn't working as it should be. :)

2. Yes, just right-click on your control and select "reinitialize with default value" (or something similar, I'm working here with the German version of LabVIEW).

Regards, Niko

Link to comment
Hi everybody,

I have 2 very basic questions about Labview.

1: I have created a VI with a "while loop" and I have a control and an indicator inside and it works. After that, I use this VI as a sub-VI in another program. And now, I doesn't work. I mean, I can't modify the control value dynamically. I think I should use some Local Variable, or something like that. Could you help me please ?

2:Is it possible to Reset a control (for exemple, a numeric control) to its Default Value, while the programming is running ?

Thanks for your answer

To modify a subvi dynamically you need to disconnect the input terminal from the connector pane.

post-584-1143301771.png?width=400

When a subvi is called all input values that are connected to the connector pane will be set to the incomming value or the default value.

Here is a quick example.

post-584-1143302326.png?width=400

Link to comment
  • 1 month later...

mballa makes a good point about controls with no connection on the connector pane. I often make a control with no connection in subVI GUIs where the subVI gets called multiple times, and on the 2nd and following calls, I want the control to start out with the value that the user last left it with.

Also, you probably want to modify the VI properties of your subVI. Hit ctrl-I, select Appearance, and check "show front panel when called" and "close afterwards if originally closed".

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.