LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional terminal options?

Hi guys,

 

Sorry if this has been asked before, I couldn't phrase it in a way that produced results in the search.

 

I want to be able to have a conditional input on a SubVI. You can have the terminal being "Required", "Recommended" and "Optional" but I want one terminal to be "Required" and if that is true then another terminal will be "Required" but I don't want it to be "Required" for general use.... Is there a funciton that does this within labview?

 

Added a poor picture to try and demonstrate what I mean.

 

I could write some default things in the code to get around it not being wired, but thought it would be good to have this option?

 

Many Thanks

Pete

Pete
Systems engineer (CLAD LV2013)
0 Kudos
Message 1 of 5
(4,027 Views)

Hi Pete,

 

you have to check for default values…

 

Your proposal requires to recompile the VI in the run time environment which is NOT allowed!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(4,019 Views)

Is this for your programmers? If so, I would just make two VIs, one with the terminal required and one with it optional, just label the icon so the programmers can easily choose which VI to use (since they would be the only ones to see the code, anyway).

 

Is it for the users? If so, I'd make a parent VI in which the determining terminal leads to a case statement leading to one or the other of the above VIs. This would lead to a division of functionality into a VI and a subVI, but that may make things easier on you, anyway. One good thing about it is that you can make the subVIs have slightly different front pages where, in the one which needs no input that particular control is either invisible or just not there.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 3 of 5
(3,985 Views)

Thanks for the replys,

 

Camerond, yes it would be for programmers, I am creating a TDMS file definer that has all the property settings within it, for the file name I have two options, one where it pops up a window to ask for a filename suffix and one where it just needs a string input for the filename. There is a boolean input to select between the two but obviously the string control input is only needed in one case.

I was just curious if there was such a method more than anything. I will put it in comments so that the programmers that inherit the code will know what to do with it.

 

Thanks for you both for the advice

 

Pete

Pete
Systems engineer (CLAD LV2013)
0 Kudos
Message 4 of 5
(3,979 Views)

Why not just use a polymorphic VI and scrap the "true/false" input all together? That's way safer than depending on your programmers to read the labels on your controls on the connector pane. If they select instance 1, the terminal is required, if they select instance 2, it is not.

0 Kudos
Message 5 of 5
(3,969 Views)