LabVIEW Idea Exchange

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

Right-clicking a terminal to create a constant should not assign the terminal's name to the constant

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

One of the handy features of LabView is to create a constant by right-clicking an input terminal of a VI or function and selecting "Create Constant". The newly created constant ends up being labeled (albeit the label is invisible) to whatever name the terminal has. For example, right-clicking the bottom terminal of the Multiply block assigns the constant to "y".

 

This seems nice and pretty much innocuous, until you start copying that constant and pasting it on other areas of the diagram. Particularly if you created the constant by right-clicking an input terminal that has a more specific name, for example, something like "Ignition State". If you paste that constant around and then try to search (using Edit/Find and Replace) for the text "Ignition State", it'll be everywhere and at places that don't make sense.

 

Automatic assignment of the terminal's name may be "ok" for controls and indicators, but should not happen for constants (specially because, for constants, the label is by default hidden). That said... as another member suggested, the label shoudl at least be visible by default and highlighted (ready do be edited) at creation.

6 Comments
Matthew_Kelton
Active Participant

As I mentioned in your original forum thread, I don't think I like the idea of constants automatically having no label.  Darin's idea of having the label be editable upon creation would be OK, but then I would get frustrated constantly re-hiding the labels, since I mostly don't view the labels.

 

I think your specific issue can be handled by selecting the More Options on your search and telling LabVIEW to not look in hidden items.

MGiacomet
Member

Yes, this "solves" the search issue, but the diagram still is peppered with (hidden) labels that don't make sense. I much rather fix problems at their root.

 

Thanks for the idea, though

RavensFan
Knight of NI

I kind of disagree with this and think the constants should be labelled.

 

First, if you were making a control or indicator the same way, you'd want a label.  A constant is just the 3rd type of entity out of control, indicator, label.

 

Second, the label does make sense for the the instance of the constant that was originally created.  The problem you are having is not the original constant.  It is that you are reusing that constant by copying and dragging/dropping all over the diagram.  The solution is to go back to the palettes and drop the pure/default constants.

MGiacomet
Member

Sorry, but the "solution" is not "go to the palettes and drop the pure/default constants", because in many cases you want the constant to be, for example, an enum that is provided by the VI you are using. For example, by right clicking the "operation" terminal of the "Open/Create/Replace File" VI and selecting Create/Constant you end up with an enum with "open/replace/create/etc." that doesn't exist as a "pure constant" in any palette.

 

Back to my original point...

 

For example, let's say that somewhere in a VI you need to initialize the following variable (could be a VI, etc.):

 

 

You right click the input terminal and end up with this:

the boolean automatically labeled (hidden) "Pgm Mode". Ask yourself: "Does it need to be labeled? Can't I tell by looking at the variable itself?"

 

 

Now let's say you decide to change the variable to this:

Ask yourself: "Will I remember to change the label of the boolean? Does the label of the boolean still make sense?"

 

 

Furthermore... Lets assume you have the above and decide to do this:

Ask yourself: "Does the label of the boolean constant make sense anymore? What would you label it (GUI ON or Save Data)?"

 

 

As I stated initially, simple constants shouldn't take the name of the terminal automatically, as you can tell their "label" by hovering with the mouse on the wire. As it has been suggested, at least they should come up with the label in the editable mode, so a person can decide to accept or change the label. Otherwise, it just leads to confusion and extra work during maintenance.

SteenSchmidt
Trusted Enthusiast

I use the auto naming feature of constants when created from terminals far more often than not. Constants should almost always be labeled - one of the most common exceptions to this rule would probably be Booleans in exactly your use case, MGiacomet. But almost everywhere else constants should be labeled.

 

I would hate this feature to disappear.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.