LabVIEW Idea Exchange

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

Cleanup should work from inside out

Status: New

The Block Diagram Cleanup utility was a great improvement when it came in LV 8.6. But it is far from perfect. In large or medium sized programs, structures tends to be very large, many times more than needed. Here is one example which is a part of a main program. If I use Cleanup on the hole program, the result is for this part:

 

untitled1.png

 

But if I mark the two inner case structures and press the Cleanup button, the result is:

 

untitled2.png

 

Then I select the “Exclude from Diagram Cleanup.” for the two inner case structures, mark the outer structure and press the Cleanup button again. The result is much more compact:

 

untitled3.png

 

Why cannot LabVEW do this automatically? If it starts with the inner structures and works outward, the result well be much better than today.

5 Comments
P@Anand
Trusted Enthusiast

I am not sure how does the Clean-up utility starts cleaning the code but NI has already provided the option for the user to configure the Cleanup utility in Tools>>Options>>Block Diagram>>Clean up Utility. I guess this would satisfy your need for a level also you can check my Idea for making the Cleanup utility better in Cleanup Diagram with Option

-----

The best solution is the one you find it by yourself
InfiniteNothing
Active Participant
I don't think any of the clean up options allow for avoiding the unnecessary horizontal spaces as shown above.
CLED (2016)
peos
Member

This post was established in 2013. There must have been six or seven updates since then, but auto cleanup has not improved in all this years. Does anybody know when this feature will be improved?

wiebe@CARYA
Knight of NI

>Does anybody know when this feature will be improved?

 

Who says it will be improved? With 10 kudos in 6 years, it doesn't seem to bother a lot of people.

 

Although auto-clean up seems trivial ("I see how to improve the code, why not automate it?"), code to do this (properly) is complex. Besides that, there's the "can't please them all" aspect ("what is good?").

 

You can give it a try yourself with scripting. I think it will be very, very hard...

 

So given the low kudo count and the resources needed, I'll stick to the alternative: clean up my own code. Or better, make it good from the beginning 😁.

AristosQueue (NI)
NI Employee (retired)

peos: There have been many improvements to the diagram cleanup tool in that interval. Those improvements haven't done anything for this particular situation. I don't work on that code, so I cannot say whether the situation can be improved or what would change if it were. I do know that you get different patterns depending on whether you clean the inner or outer because the system tries to optimize the inner for more conditions when the outer is selected. You've posted images where the results are bad. I know of others where the results of letting the whole thing get optimized are better.

 

Automatic diagram layout is a very hard problem in the general case -- I've seen presentations on it and been continually surprised by all the complexity involved. I know it doesn't run an algorithm to find the best layout... it runs a heuristic that just stops searching at some point because exhaustive search for best layout can take a very long time for a surprisingly small set of nodes. That means there will *always* be cases that get clipped wrong.

 

Research is ongoing in this area.