LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What are the default values for "default if unwired"?

How do you know what the default value for an object will be...if using a "use default if unwired" with an event case?

 

Is there a listing somewhere of what default values will be?

 

Thank you,

 

cayenne

0 Kudos
Message 1 of 14
(16,889 Views)

The default value is the default for the datatype of the wire.  For numerics it is zero. For strings it is an empty string. For booleans it is False. The only situation where you may find "unusual" default values is for customized controls where you set a default value for an typedefed cluster.

 

I am not sure if there is a listing but for any datatype dropping a control on the front panel will display the default value. On the block diagram selecting Create Constant will generate a constant with the default value.

 

Lynn

Message 2 of 14
(16,887 Views)

Personally, I would highly recommend disabling this on every single tunnel coming out of an event structure (with the possible exception of the tunnel going to the loop's stop terminal). If you use this option, you are almost guaranteed to forget to wire a required value into a tunnel at some point in the future when you add a new case.

 

More generally, I think that this option should not be the default for these tunnels. You can see more about this here and I would suggest voting it up if you agree with it - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Output-tunnels-from-event-structure-should-default-to-...


___________________
Try to take over the world!
Message 3 of 14
(16,871 Views)

I agree with it and also whenever I pass wire through the tunnel I take care to unmark the option.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 14
(16,869 Views)

I fully agree with tst here.  The only time I use the default if unwired is the loop termination tunnel.  Disable it.  That will save you many headaches from logical errors.


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 5 of 14
(16,849 Views)

Just in case the OP is refering to a LVOOP class with the term "Object" the class browser will show  the data members default values if they are not the default default for the datatype. 

No I'm not intentionally trying to confuse the issue.  But it is "clear as crystal dipped in mud."


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 14
(16,842 Views)

@tst wrote:

Personally, I would highly recommend disabling this on every single tunnel coming out of an event structure (with the possible exception of the tunnel going to the loop's stop terminal). If you use this option, you are almost guaranteed to forget to wire a required value into a tunnel at some point in the future when you add a new case.

 

More generally, I think that this option should not be the default for these tunnels. You can see more about this here and I would suggest voting it up if you agree with it - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Output-tunnels-from-event-structure-should-default-to-...


VERY much agreed!  Disabling the "default if unwired" option makes absolutely certain that you have considered the correct value for every case.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 14
(16,818 Views)

"Create Control" on that terminal, the value of that control is what the default is for the terminal.

 

Sometimes it's a useable value (index array), other times the VI won't run with the default values.

 

The rare times I do that with a VI I put the default in ()'s in the control name, like the "Error In (No Error)" wire. :dunno

0 Kudos
Message 8 of 14
(16,810 Views)

I don't use such simplistic rules (e.g. "Always do this...", "Never do that.").  When I create a tunnel, I use that lump of gray matter in my head to decide what mode it should be.

Although always disabling "default if unwired" won't lead to any real trouble, in general, blindly following simplistic rules will lead to grief.

 

0 Kudos
Message 9 of 14
(16,794 Views)

@paul_a_cardinale wrote:

I don't use such simplistic rules (e.g. "Always do this...", "Never do that.").  When I create a tunnel, I use that lump of gray matter in my head to decide what mode it should be.

Although always disabling "default if unwired" won't lead to any real trouble, in general, blindly following simplistic rules will lead to grief.

 


Yes, there are exceptions.  And we have to evaluate that instance by instance. But as a general rule of thumb, it is best not to have default if unwired tunnel.

 


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 10 of 14
(16,791 Views)