11-11-2025 09:36 AM
@joerg.hampel wrote:
Now, coming back to this discussion:
- Less experienced developers will not even know that it's possible to add controls to the Main.vi's connector pane. That makes it more difficult for them to understand code that uses this feature.
- If the "Start Module.vi" does not have any additional connector terminals added, I have no reason to believe that there's anything inside for me to look at, because it's a default scripted (templated) VI. In other words, I do not expect any program logic being added to that VI (like code that finds and reads configuration files and passes those to the Main.vi)
For those reasons, my recommendation still stands:
- If a request is good enough, don't add parameters to "Main.vi".
- If you add parameters to "Main.vi", make it so the same parameters are simply routed through from the "Start Module.vi" connector pane. That way, it will be more obvious what is going on.
- Do not add logic and module-specific code inside the "Start Module.vi"
Ah, this is the source of my confusion — it never occurred to me to add parameters to "Main.vi" without adding them to the "Start Module.vi", or doing anything other than routing the parameter straight through. Thanks for clarifying!
In my project using DCFG, I originally had a project level VI inside each module's Main.vi defining the config folder, but this coupled all of these modules to the project. I changed to passing the Config Folder through the Start Module.vi to decouple them (see below).
As I think about this more, I realize that this could be done with requests by using a Null Broadcast Events VI at this Register Events and starting DCFG with a request that contains the Config Folder. I doubt I'll change it in this project, as this works for me, but I will keep this conversation in mind for my next project.
What I've learned over the years: Anything that makes the code harder to read (usually, the things that make me feel very clever) will sooner or later come back to bite me.
Yeah, usually the more clever I think I am, the more I confuse my future self — especially when I have neglected documentation! Fortunately, I have gotten better in regard to the documentation.