LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Tschepetto

Referenced Comment

Status: New

It would be useful to have something like a referenced comment. You can place this comment in the block diagrams of several VIs of a project, and by editing one instance of this comment, it will change all instances at one time.

 

Example:

 

The comment describes the channel list of an application:

 

Comment:

AI_00: Torque [Nm]

AI_01: Pressure [bar]

AI_02: ValvePosition [%]

[...]

 

You place this comment in the DAQ-VI. But it would be helpful to have the identical comment in the MeasFile-VI and/or in the VI that combines the channel and scaling informations to a 2D-string array, so you can present all these informations together (e.g. in a multi cloumn list box or something else).

 

When you later add some new channels e.g., it will be annoying to edit all these comments step by step, something like a 'comment type def' would be a practical solution.

4 Comments
PaulG.
Active Participant

I've been known to use an array of a typedef enum to serves this function. These arrays are scattered about in different block diagrams. Each new comment or reference becomes an item in the enum. I'm usually creating an enum with these items anyway. But this idea is a little more refined. Kudos.

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
AristosQueue (NI)
NI Employee (retired)

LV 2015 now supports that any URL you type into a diagram constant becomes a clickable link. Does that satisfy this requirement to single-source documentation? Any other solution is going to necessitate the creation of some sort of source code file that is specifically a comment (similar to a typedef file, as noted by PaulG, but for a comment specifically). I acknowledge that the use case does come up from time to time, but not frequently. I just can't imagine the use case being large enough to warrant that level of effort. 

AristosQueue (NI)
NI Employee (retired)

PS: I also need to note that the need to replicate a code comment like that is a code smell that indicates a poor software design somewhere -- probably a missing abstraction so that only one VI needs to care about that mapping and everyone else downstream just uses some enum or object that hides the mapping details. Yes, sometimes we build systems that need this, but we should always be cautious when we find ourselves needing it that maybe there's a better way entirely to remove this burdensome linkage.

Mr._Bob
Member

1) If this were possible, then what would happen if the comment grew to the point that it covered half of your block diagram? Cleanup?

2) I thought property nodes for text-related items (labels, captions, plot legends etc.) were only valid for the front panel.