LabVIEW Idea Exchange

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

Local Variable Manager in "Edit" Menu of VI

Status: Declined

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

I would like to have "Local Variable Manager" menu option in Edit menu of  VI.

It will be usefull to rename local variables, change representation of numerical local variables and view number of instances.

 

VI

 

Local variables manager window will be like as shown below.

 

v2.JPG

 

One can rename local Variable(Control/Indicator),find terminal,indicator/control on right clicking name, can change numeric representation of control or indicator.

 

Prashant Patel

PBP
Labview 6.1 - 2019
8 Comments
Mads
Active Participant

Kudos. Let me suggest a couple of changes to the idea though: Give the manager a tree based view where you can see the Reads and writes as subnodes of the control, then add a preview of the surrounding block diagram so that if you click on an instance you see a picture of where it is on the block diagram in a picture next to the tree control.

 

This would enable you to quickly browse through and evaluate the use of locals in the VI.Smiley Happy

Knight of NI

The only real reason why one would need to use this is if you use local variables a lot. While I do not believe that local variables are evil, I do believe that's a bad way to program LabVIEW. It reinforces the text-based paradigm of programming and local variables have other more serious issues such as data copies (increasing memory footprint), and being (probably) the #1 reason for race conditions.

 

While in concept the idea is sound, I would not support this idea because of the above.

Mads
Active Participant

Sure, locals can and are misused a lot, but saying that this means they should be painful to administrate is a bit like advocating security through obscurity.

 

Personally I would probably use this to refactor old/other people's code, and generally make sure the use of locals are kept to a minimum anyway. It would give you better control of whatever use of locals there are, good or bad.

SteveChandler
Trusted Enthusiast

There are some other ideas dealing with editing control properties including names and numeric representation. Here is one, here is another, another and another. I like the idea in general but would not want it to be limited to only control names and representations. I don't know if any of them include counting the number of local variables so this may not exactly be a duplicate. But any of the other more general property managers can, should and probably would include that if implemented.

=====================
LabVIEW 2012


AristosQueue (NI)
NI Employee (retired)

> is a bit like advocating security through obscurity.

 

Well, yes, but putting locals behind a cryptographically secure password probably isn't an option. 🙂

Mads
Active Participant

The point is that making parts of the IDE less efficient to avoid having to teach people to program properly is a very bad way to handle the whole issue (the pitfalls of locals, sequence structures, you name it).

 

People still have to (/should) learn and understand good programming. If they only do the right thing by accident (i.e. through planned obscurity) you not only risk that people never really know why they do things in a certain way, but in the process you also make LabVIEW unnecessarily harder to use for those who already have the knowledge to use the technology appropiately.

 

Sure, you can make locals less visible etc. to at least reduce the rise of bad habits, but you should still make good tools available for the appropriate use of them. If they are not worth that, remove them alltogether instead. 

Manzolli
Active Participant

Maybe this window can help good program practices, like showing how many local variables of an object (control or indicator) are in the current VI. Some variable can be hidden, like in cases. The window can show the local variables  grouped by "owner", by type, by number of occurrences, etc.

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
Darren
Proven Zealot
Status changed to: Declined

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