LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clean up diagram destroys my code

I've got a large program on the block diagram that is in working order. When I press the clean up diagram button, labview goes haywire and destroys my code, stacking structures on top of one another and breaking wires.

Tell me there's a way to fix this.

-root


global variables make robots angry


0 Kudos
Message 1 of 10
(3,728 Views)
Ctrl+Z Smiley Very Happy
Cory K
Message 2 of 10
(3,725 Views)
The clean up diagram is not a panacea. It does have its limits, and your VI may very well be at or beyond its limits. You may wish to try only cleaning up parts of it. Perhaps your VI may need to be restructured?
0 Kudos
Message 3 of 10
(3,715 Views)

Whoa, wait a minute! Are you saying that there is an easy way to only clean up a section of a block diagram? or do you mean I should cut out a piece at a time, paste it into a blank diagram, clean that, and then paste it back into the original?

 

-root


global variables make robots angry


0 Kudos
Message 4 of 10
(3,700 Views)

I think partial block diagram cleanup is going to be an improvement in the next version of LV coming out in a few months.  In LV 8.6, you can only clean up the whole diagram at once.

 

Cut, copy, paste, clean, recopy is of course an option, but I wouldn't go through that much trouble.  If the block diagram is so bad that you are trying to clean it up, dealing with and reconnecting all the loose wire ends is going to be an even bigger problem.

 

I would check to see whether AutoGrow as been turned off on some of your structures.  If so, turn it on before cleaning up the diagram.  I know when I try to cleanup some VI's posted on the forums that use Stacked sequence structures, I try to replace them with flat sequence structures.  Of course that will blow out the diagram, but at least then you can see the order of execution and try to use block diagram cleanup to fix it up.  If autogrow is turned off on a loop, than the flat sequence will extend out the edge of a loop and become invisible.  Turn on AutoGrow, and the loop will grow as the stacked sequence is replaced with the flat sequence.

0 Kudos
Message 5 of 10
(3,684 Views)

Root,

 

Can you please post your VI that gets broken when you run diagram cleanup?

 

Chris M 

0 Kudos
Message 6 of 10
(3,666 Views)
I think an even more important point to consider is if your block diagram extends past your monitor, there are probably a lot of opportunities to modularize your code and use subVIs.  Then when you have subVIs you can use the cleanup tool just to organize the stuff inside one subVI without cutting pasting cutting pasting and reconnecting. 
0 Kudos
Message 7 of 10
(3,635 Views)

Root Canal wrote:

I've got a large program on the block diagram that is in working order. When I press the clean up diagram button, labview goes haywire and destroys my code, stacking structures on top of one another and breaking wires.

Tell me there's a way to fix this.

-root


 

Hi root,

 

In your opinion, would the diagram clean-up result in a digarm that is larger that 65K pixels wide?

 

If yes then that is what is probably confusing the diagram clean-up.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 10
(3,631 Views)

No, the diagram fits horizontally on two screens right now before cleanup. It's not particularly messy, I've got four loops running, one master loop. Naturally, I'm using subvis, I never use stacked sequences, and there aren't that many wires because I tend to bundle things by name into a cluster and use type definitions liberally. I have to sanitize the code before I send it, and I'm not at liberty to send the whole project, so I'm gonna continue to whittle the main block diagram down by converting portions I'm currently working on into subvis and I'll send a barebones version if it still exhibits the same behavior.

 

Anyone like to make an early bet as to whether my vi is corrupted?

 

-root

Message Edited by Root Canal on 06-05-2009 11:48 AM

global variables make robots angry


0 Kudos
Message 9 of 10
(3,611 Views)

I converted some case structures to subvis and clean up no longer scrambles the block diagram. I'm not sure what the solution is because I'm not sure what the problem was. The block diagram was two screens wide (about 2560 pixels wide), there aren't many wires and no stacked loops or anything like that. What is the maximum number of structures or elements that clean up can handle?

 

-root


global variables make robots angry


0 Kudos
Message 10 of 10
(3,582 Views)