From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI default value


@RavensFan wrote:

wiebe@CARYA wrote:

A control\indicator that is not connected to the connector pane doesn't reset it's value to default. Not even for different instances. At least not by default (you can turn this on).

 

Basically, a control\indicator on the front panel can be used just like a shift register... It retains it's value.


Please correct me if I'm wrong, but I think your statement only applies to an indicator.  If it applied to a control, you could never rely on a subVI using the default value of the control if you leave its terminal unwired in the higher level VI.


Bill, read carefully.  Wiebe is referring to a control that is not even on the connector pane.  Such a control can be updated via a local variable and it will effectively work as a shift register or feedback node, though not as efficient.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 18
(522 Views)

@crossrulz wrote:

@RavensFan wrote:

wiebe@CARYA wrote:

A control\indicator that is not connected to the connector pane doesn't reset it's value to default. Not even for different instances. At least not by default (you can turn this on).

 

Basically, a control\indicator on the front panel can be used just like a shift register... It retains it's value.


Please correct me if I'm wrong, but I think your statement only applies to an indicator.  If it applied to a control, you could never rely on a subVI using the default value of the control if you leave its terminal unwired in the higher level VI.


Bill, read carefully.  Wiebe is referring to a control that is not even on the connector pane.  Such a control can be updated via a local variable and it will effectively work as a shift register or feedback node, though not as efficient.


You're correct.  I missed that because I still had in mind the way the I interpreted the OP's original message.

0 Kudos
Message 12 of 18
(519 Views)

@RavensFan wrote:

@crossrulz wrote:

@RavensFan wrote:

wiebe@CARYA wrote:

A control\indicator that is not connected to the connector pane doesn't reset it's value to default. Not even for different instances. At least not by default (you can turn this on).

 

Basically, a control\indicator on the front panel can be used just like a shift register... It retains it's value.


Please correct me if I'm wrong, but I think your statement only applies to an indicator.  If it applied to a control, you could never rely on a subVI using the default value of the control if you leave its terminal unwired in the higher level VI.


Bill, read carefully.  Wiebe is referring to a control that is not even on the connector pane.  Such a control can be updated via a local variable and it will effectively work as a shift register or feedback node, though not as efficient.


You're correct.  I missed that because I still had in mind the way the I interpreted the OP's original message.


OP is a bit misleading, calling the control\indicator a terminal.... Hypothetically of course, but it fits the symptoms.

0 Kudos
Message 13 of 18
(515 Views)

wiebe@CARYA wrote:

OP is a bit misleading, calling the control\indicator a terminal.... Hypothetically of course, but it fits the symptoms.


Well, my first thought from reading the OP's post was "Shared Clones Reentrant" is being used with some type of storage.  Of course, this is a REALLY bad idea to use shared clone reentrant with a VI that has state information since it becomes a crapshoot for which instance will be called at a VI call location.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 18
(506 Views)

@RavensFan wrote:

...

 

I hate these threads where someone posts an ambiguous question,...


Ditto that!

 

Those are the threads where I will reply with ten words of less.

 

Re: Off Icon terminals

 

I have seen old code that did use the controls/and indicators as shift registers. Not nice.

 

Another unorthodox usage I have seen was a kind of "pre-processor" attempt. Using "control value >>> Set" method was used to set a value in a VI that was used latter. An example would be to change the language on the fly.

 

For what it is worth,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 18
(497 Views)

I have some VIs that have a 'debug' Boolean control that is not wired to the CP.

 

Default is false, and once I set it to true it will stay true. But when I build an executable, or next time I load my project, it's off again. Much better then a disable structure, as I usually hear from my customer that I forgot to put it back.

 

Of course we can't hardly blame beginners for using the wrong terminology, although it sometimes is very confusing.

0 Kudos
Message 16 of 18
(493 Views)

wiebe@CARYA wrote:

I have some VIs that have a 'debug' Boolean control that is not wired to the CP.

 

Default is false, and once I set it to true it will stay true. But when I build an executable, or next time I load my project, it's off again. Much better then a disable structure, as I usually hear from my customer that I forgot to put it back.

 

Of course we can't hardly blame beginners for using the wrong terminology, although it sometimes is very confusing.


I have taken a fondness to the Conditional Disable structures.

 

I never looked but I would think that can be manipulated via a build script.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 17 of 18
(490 Views)

@Ben wrote:

wiebe@CARYA wrote:

I have some VIs that have a 'debug' Boolean control that is not wired to the CP.

 

Default is false, and once I set it to true it will stay true. But when I build an executable, or next time I load my project, it's off again. Much better then a disable structure, as I usually hear from my customer that I forgot to put it back.

 

Of course we can't hardly blame beginners for using the wrong terminology, although it sometimes is very confusing.


I have taken a fondness to the Conditional Disable structures.

 

I never looked but I would think that can be manipulated via a build script.

 

Ben


There OK for some purposes. I do set some in my build script. Problem is they change the code, and trigger SCC changes, even if you revert them before saving.

0 Kudos
Message 18 of 18
(469 Views)