A well documented program requires descriptive labels, but LabVIEW makes it difficult to show the label of diagram constants.
- If we change a control or indicator to a constant, the diagram constant retains the same label, but the label is now hidden. 😞
- Same if we right-click a terminal and create a constant. 😞
- If we place a diagram constant from the palette, the label is hidden by default. 😞
- ...
In 99% of my programs, virtually all diagram constants show their labels. They are a vital part of the code, document it clearly, and prevent coding errors.
.
IDEA: show labels of diagram constants by default
- If we convert a control or indicator to a diagram constant, keep the label and show it! 😄
- If we create a diagram constant from a terminal, keep the label and show it! 😄
- If we place a diagram constant from the palette, switch to label edit so we can start typing the label. (same as when placing a control on the FP!) 😄
Examples Scenarios to prove my point:
- Often I read from spreadsheet file and want to transpose, so I right-click the terminal and "create constant". I get a boolean diagram constant with the label hidden. I would prefer if it would show the "transpose?" labels! This way I can ensure that I did not accidentally used the "append" terminal instead of "transpose". Also, if I edit the program later, it is clear from the label where the boolean goes, even if the wire is mostly hidden.
- Often, shift registers are initialize with a diagram constant. I use the label of the diagram constant to hint at the content of the shift registers. Labels could be "insert point", "averaged data", "counter", "state", etc. etc. Code is clear and self-documenting. No need for extra diagram comments that might go elsewhere during a diagram cleanup.
- I might have a control, that (after debugging) will never change again and I thus convert it into a diagram constant. Also here, it should retain its original label and show it. ("Npts", "Frequency", etc.). Again, this keeps the code readable and clear.