LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to check if all parameters are connected while running?

Hello,

i have a Vi with one input "Text" and another parameter "bool".

Is it possible to check if the bool-parameter was wired if called from another vi?

Reason:

If not wired i want to write only the text to a logfile

and if wired i want to write a text + the state of the boolean value.

 

So something like a property "ValueIsWired" that can be used then with a tru/false case to generate different outputs.

 

Thx

 

0 Kudos
Message 1 of 8
(2,488 Views)

Hey,

 

you could set the input of the sub VI to "recommended" and set the string you want to write if not wired as default (right click the control -> Data operations->make current value default ) for the control. So if it is wired it will take the string you wired, otherwise it will work with the default one.

 

Regards,

CMW

0 Kudos
Message 2 of 8
(2,485 Views)

Ahh, I missed the boolean, ...

 

but the idea remains with the default values.

Regards, CMW

Message 3 of 8
(2,484 Views)

As far I know there is no property available. You can do it in another way, instead of giving Boolean as terminal provide a variant input and check whether it is empty or not.

-----

The best solution is the one you find it by yourself
Message 4 of 8
(2,469 Views)

@OnlyOne wrote:

Hello,

i have a Vi with one input "Text" and another parameter "bool".

Is it possible to check if the bool-parameter was wired if called from another vi?

Reason:

If not wired i want to write only the text to a logfile

and if wired i want to write a text + the state of the boolean value.

 

So something like a property "ValueIsWired" that can be used then with a tru/false case to generate different outputs.

 

Thx

 


Default bool to False, only write State if True. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 8
(2,439 Views)

This is a case where I would not favor a boolean.  You can't tell if the value was wired with the default value or if it was unwired.  Luckilly, a signed integer terminal with a -1 default would offer better options.  (The Caller shoud probably never pass in a negative value)  You simply need more than two possible values.


"Should be" isn't "Is" -Jay
Message 6 of 8
(2,432 Views)

Hi,

 

I totaly agree with Jeff.

 

You usually use self defined default values(differents from the LV default value for every datatype) for sub-VIs for the case of unwiring these terminals.

The other possibility is using the recommended terminal setting.

 

For the boolean terminal, two values aren't enough. Many VIs use these '-1' default value for detecting a wired terminal.(-> timeout, DAQmx read).

 

Philipp

Message 7 of 8
(2,395 Views)

If you want to write the status flag, whether true or false, you'll need an extra input "include status".

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(2,386 Views)