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: 

Controlling SubVI connectors

I have a subVI which outputs data to an indicator on my mainVI. When the subVI doesn't return a value, the mainVI reads the connector as zero. Is there anyway I can config my subVI to remove the connector when no value is returned?
0 Kudos
Message 1 of 9
(2,876 Views)
Perhaps you could use a CASE structure to evaluate if the value returned is ZERO. If not, then display it, otherwise, do nothing.

I hope that answers your question.

Shan Pin Koh
0 Kudos
Message 2 of 9
(2,876 Views)
A good thought - but sometimes the return value actually is zero.
0 Kudos
Message 3 of 9
(2,876 Views)
Same idea as Shan Pin Koh, but set the value to NaN instead.....

Shane

sarah schrieb in Nachricht
<506500000005000000D02E0000-991728092000@quiq.com>...
>A good thought - but sometimes the return value actually is zero.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 6 of 9
(2,876 Views)
So how do you actually know if the return value is invalid? Perhaps infinity? If infinity, use Shane's idea of NaN. If not, put the condition of the return value into the CASE statement.
0 Kudos
Message 8 of 9
(2,876 Views)
How about adding another output terminal to the sub-vi... a bool "Valid Output"??
Then you can include a valid 0 value.

Dave

"sarah" wrote in message news:506500000005000000D02E0000-991728092000@quiq.com...
> A good thought - but sometimes the return value actually is zero.
0 Kudos
Message 9 of 9
(2,876 Views)
Sarah,
Even if you configure your subVI another way (remove connector/wire??), you will still probably read Zero for a "No Value Received" on your main VI indicator.
You also probably don't really want to remove your connector/wire, but you may want to display a better value than Zero if no data is received.
On your main.VI, I'd consider a simple Select.vi from the Comparison palette. Wire in a compare for Zero values, and output either the real value if >0 or "".
Good Luck, Doug
0 Kudos
Message 4 of 9
(2,876 Views)
If you also get valid Zero values, you'll want to compare for "Is Number".
0 Kudos
Message 5 of 9
(2,876 Views)
What do you mean when you say that the sub-vi doesn't return a value? It alays has to return something. In your sub-vi if you don't want to send a value out try setting the output to a value that you wouldn't otherwise get (like a negative number, or a really high number). Then check for that in your main vi and update your indicator based on that.

Brian
0 Kudos
Message 7 of 9
(2,876 Views)