I'm missing the feature of using macros in LabVIEW like in other languages. In text-based
languages a macro is a text replacement before compilation so in LabVIEW it should do the
same with g code.
I don't like the idea to put every single code into a sub VI just to clean up the code.
There are enough reasons to create sub VIs but the goal is to build logical / programmatical
units.
Consider a situation you are using long text in string constants enlarging the whole code
through this.
Consider a situation you are using many property-nodes within a while loop.
Use macros to avoid this.
So how to implement?
Macros are unique in every VI. Every VI should have named extra block-diagram layers to define these macros, one layer per macro. These layers are similar to a standard VI except they don't need / use a front panel to connect the controls. All controls are connected within the macro block diagram. The macro is used like a standard VI. It has a icon like a standard VI and is placed on the block diagram like a standard VI.
The macro code will be embedded virtual before compilation so the code will not be touched.
That's it - I think 🙂
Available in LabVIEW 2017 and later with the 'Malleable VIs' feature.