LabVIEW Idea Exchange

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

Create indicator should name intuitively

Status: New

When you have a control name containing 'in', creating an indicator should automatically name the indicator 'out'.  Currently the indicator name is appended with '2'.  This could be expanded to include control names where the name includes a default value, and the capitalization is matched, too:

 

name indicators.PNG

8 Comments
fabric
Active Participant

This would be a nice touch! Using "... in 2" for an indicator is a pretty embarrassing example of un-intelligent auto-naming!

 

Ideally this would also work when creating an indicator anywhere downstream from a control if the connection is unambiguous, e.g. wired through a structure or shift register.

AristosQueue (NI)
NI Employee (retired)

As far as your final option, our style guide (and there are many VIs that don't actually do this, but we're trying to get that style standard) we deliberately do not capitalize the "in" and the "out" so that it stands out from the rest of the name.

 

Also, we don't put "in" and "out" on a terminal unless it is attached to the conpane AND both the in and the out exist AND they have a direct relationship. In other words, there's no way to automatically do this because it depends on the functionality of the VI's diagram. Just because a function takes a string in and puts another string out does not mean those two strings are related directly.

 

> Using "... in 2" for an indicator is a pretty embarrassing example of un-intelligent auto-naming!

 

It is unintelligent and that is very deliberate. I am not convinced that NI can do anything to significantly improve the number of cases where we generate something useful. Currently the "2", "3", etc is easily detectible by analyzer programs to flag terms whose name you haven't properly thought about. That is likely to be the best we can do short of getting an artificial intelligence butler who knows what you the developer are working on and can help out. My opinion. If you could lay out more details about the conditions under which this rename would happen, maybe something better could be done in the short run in very limited conditions.

fabric
Active Participant

"If you could lay out more details about the conditions under which this rename would happen, maybe something better could be done in the short run...[until we release the butler]"

 

Just the simplest use case would give me a warm fuzzy feeling:

  1. I have some control called "blah-blah in". It may be connected to a conpane terminal, or it may not.
  2. I directly create an indicator from that control, OR I wire that control directly through a structure and create an indicator from the output tunnel, OR I wire that control into a shift register and create an indicator from the output. (This feature could support nested structures but I'd happily settle for singles...)
  3. My new control gets named "blah-blah out". If that name is already taken then use "blah-blah out 2" instead...

At least 90% of the time I want it to be called "blah-blah out". I really never want it to be called "blah-blah in 2" (which is your Jedi Mind Trick to make me change it, right? Smiley Wink). I'd rather LV made a sensible choice in unambiguous situations rather than making an intentional mess to compel me to clean it up.

 

 

AristosQueue (NI)
NI Employee (retired)

> (which is your Jedi Mind Trick to make me change it, right? :smileywink:)

 

I tend to think of it as an admission of our own insufficienies for which we humbly beg forgiveness because if we try to do better, we often screw it up.

 

Darren Nattinger and I pushed forward the conpane renames that now happen (as of LV 2011) when you do create subVI, but those took a long time to get right... there were a couple previous attempts that kept naming things in weird ways, retaining names we didn't want and stomping those we did want. It was harder to clean up after the "I thought I knew what I was doing" than the dead stupid that we had before. I'm just leary of getting into a similar situation with this.

 

I'm not saying we shouldn't improve it -- and with your clarification about the specific situation you think can be improved, I'll add kudos.

Michael_78
Active Participant

I think if a wire name ends with 'in' a created control should be labeled 'out'. It is probably right and will probably be wired to the conn. pane.   If the wire has passed through a structure the wire retains its name.  If it has passed through a function it gets a new name so the 'out' rename would not apply. 

 

The behavior should be selectable in the LabVIEW options for those who prefer the deliberate and obvious name to be applied for code inspection.

 

I am a lazy programmer (I prefer to say 'striving for efficiency') I would like LabVIEW to read my mind and code for me whenever possible Smiley Happy

RavensFan
Knight of NI

Of course some people may program in other languages besides English.  So there might be other word combinations than "in" and "out" that have to be handled.

AristosQueue (NI)
NI Employee (retired)

> Of course some people may program in other languages besides English.

 

Roughly 1/3 of our users, last I checked, and growing. 🙂 Don't worry... we'd keep them in mind if we do this.

acolbourn
Member

Same idea but have labview check when you change variable names.  If you change from in to out two times, on the third time it will have learned what to do.  This could work in any language or with any pattern because it's just comparing characters.  Alternatively you could have a copy with user formatting option.  You just fill in your own format like "out + counter" which would append the word out and increment by 1.