LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is an input unwired?

Some functions use a default value if left unwired. (For example, GPIB timeout) If I make an encapsulating VI, can I determine if one of my inputs is unwired? That way, I could use a case statement that wires the inputs together, or not, depending on whether my input was unwired or not.
0 Kudos
Message 1 of 4
(2,976 Views)
Hi,
you may compare just after the start of the VI
the value in your input with its (known to you) default value. Then use case structure. If input is equal to its default value you can treat this as unwired input.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 4
(2,976 Views)
Thanks for a reply.

The issue with that solution is that I don't know if the input was wired with the default value. If there is a limited range for the input, then I could default that to an illegal value and check. However, if all values are valid, then I can't really use a sentinal value.

For the GPIB timeout variable I mentioned, I could default the input to the current global variable value, but I can't do that "before" the VI would run.

My question is more of a "How would I..." issue rather than something that's keeping me from completing a program.

Bob Martin
0 Kudos
Message 3 of 4
(2,976 Views)
Although this may complicate your code, doubles offer a null value called Nan (not a number). This value only works with floating point numbers.

Jeremy
0 Kudos
Message 4 of 4
(2,976 Views)