LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lock a part of the block diagram to desactivate the clean up

Hello,

I would like to clean up what is inside a while loop but after cleaning, the box of the while loop becomes big, is it possible to lock the size of the while loop or put the whole while loop in a box or rectangle with constant dimensions and clean up all what it is inside.

My aim for doing that is to make the block diagram as condensed and small as possible to avoid using the horizontal and vertical scroll to move in the block diagram.

 

Thanks,

 

0 Kudos
Message 1 of 6
(3,599 Views)

Congratulations -- you've discovered a useful LabVIEW Style "rule", namely "Make your Block Diagram Fit on a Single Screen".

 

I assume you know that you can select areas of your Block Diagram and Cleanup will work only in those areas.  If you have "cleaned up" the inside of a While Loop, and the loop itself is now too large, simply resize it (by dragging the corners or the sides).  Now you have created "empty space" outside of the loop -- can you move the rest of your code to "fill in the gaps"?  If you clean up other areas, and get everything down to more compact "units", you might find that a "Global Cleanup" will do good things.

 

However, I must confess that I never use the Cleanup tool -- I try to keep my code small and compact from the beginning.  The Second Rule of LabVIEW Style is -- Sub-VIs!  Whereever you have a big block of code that does something that you "don't need to see right here", put it in a sub-VI.  You can string a lot of 32-by-32 pixel boxes on a single screen without causing a lot of clutter.  If you do use a lot of sub-VIs, it is a good practice to (as often as possible) use the 4-2-2-4 connector pattern, even if you only have three inputs and two outputs, and always run the Error Line in on the lower left and out on the lower right.

 

Bob Schor

Message 2 of 6
(3,586 Views)

Thanks Bob,

I tried to partially clean inside the while loop but Labview forces the while loop to get bigger which makes the code more spread.

Do you know how to lock the size of the while loop.

Cheers,

Zied

0 Kudos
Message 3 of 6
(3,551 Views)

What you are asking in your message and what your subject says are too different things.

 

I see you also asked this quesiton in a different forum, but now that thread has been moved to the LabVIEW forum as well.  I'm enclosing the link to reference this thread back to that one.  http://forums.ni.com/t5/LabVIEW/block-diagram-limit-area-to-clean-it-up/m-p/3123577

 

As has been said, BD cleanup will clean up the code and will expand the area if it needs to to fit it in based on whatever style parameters are active at that time.  (And will also contract it if it can.)  It was never designed to squeeze everything into a predefined rectangle.  If it tried, it would be very likely to violate some or all the style parameters that are defined in the LabVIEW .ini settings.  So the answer to the question in your message is No.

 

Now the answer to the question is in your subject message is Yes.  If you do use BD clean up on a section of code, or let's say you go and tweak it further yourself, or just do everything yourself, you can lock down that section of code.  You can right click on a strucure like a while loop or event structure and set it so that future BD cleanup operations will leave it alone.

Message 4 of 6
(3,532 Views)

For what it's worth I have only used BD Cleanup a very few times, but each time I have I have had to spend as much time 'cleaning up' the 'cleaned up' code as I would if I had just done it myself. Thats why I've only used it a very few times! I find I can get much more compact and neatly arranged code if I do it myself. Just my twopenneth 🙂

0 Kudos
Message 5 of 6
(3,504 Views)

I find  BD cleanup is awesome for cleaning up any of the VI's I download off the forums to try to help people.  Anything BD cleanup does is better than those spaghetti bowls.

 

I'll also use if if I'm throwing together code.  Then I"ll BD clean it to straighten it up, sort it out, then go back and tweak it manually.

 

I don't have any reason to use it on code that I've cleaned up before and have tweaked as I've gone along while adding additional code.

0 Kudos
Message 6 of 6
(3,484 Views)