03-06-2014 03:53 PM
Hi
What's the problem in using non-default values on front panel controls in subVIs? What's the better practice?
03-06-2014 03:58 PM
03-06-2014 04:31 PM
Hello H. Mz,
If I understand your question correctly, you're referring to the general recommendation to "Set a useful default value" for subpanel controls rather than leaving them as the default for the data type. The wording here is perhaps confusing, but in this case the "default value" refers to the value stored as part of the VI's source and is the value that the control populates with when it is loaded.
In general, you want to set the default values for your controls so that they:
- Cause appropriate "default" behavior to happen if the terminal is flagged as not required. This is probably the most important reason.
- Resemble actual inputs (if your sub VI will only only work with a value between 1 and 100, don't set the default to 999).
- Allow the VI to run as a standalone function with a meaningful result.
If you can elaborate on what you mean by "default values" we might be able to offer better advice. Also, there is rarely a single best practice that covers every possible situation. What are you attempting to do? What is the scenario you have in mind that caused you to ask this question?
Best Regards,
03-07-2014 02:12 AM
Hi
'non-default' -- That's what I'm also trying to figure out. I was going through my CLD result feedback, and in the style section it says "non-default values on front panel controls in subVIs". I usually don't set any default values for controls in subVIs and leave them empty (I wire a constant in the main VI to avoid problems, where the value of control is not specified). As I understand using non-empty values in the subVIs are an additional memory burden.