11-27-2024 05:08 AM
I'm experiencing some problem with block "Cleanup Diagram", for some reason inside some block this's the result of a cleanup..
11-27-2024 05:20 AM - edited 11-27-2024 05:20 AM
Hi Michele,
@michele.santucci wrote:
I'm experiencing some problem with block "Cleanup Diagram", for some reason inside some block this's the result of a cleanup..
And what is the problem?
Nobody said that Autocleanup will produce "nice" looking diagram.
All it does is enhancing really bad looking diagrams...
Why are there so many local variables in this small part of the code?
11-27-2024 05:24 AM - edited 11-27-2024 05:27 AM
> Why are there so many local variables in this small part of the code?
to avoid wires messing up with the soooo stretched diagram.
If the wires are short are pretty easy to follow .. with such a streching it becomes harder.
Anyway as you can see.. in the same Vi (another block):
pretty much the same elements are 'cleaned up' properly and also here there are many (redundant) local variables.
11-27-2024 05:47 AM
Hi Michele,
@michele.santucci wrote:
to avoid wires messing up with the soooo stretched diagram.
If the wires are short are pretty easy to follow .. with such a streching it becomes harder.
To avoid long wires you should use more subVIs!
Why do you need so many sequence frames? Why don't you "OBEY DATAFLOW!" to enforce dataflow?
This will also reduce the length of your wires...
11-27-2024 06:36 AM
@michele.santucci wrote:
I'm experiencing some problem with block "Cleanup Diagram", for some reason inside some block this's the result of a cleanup..
It is not clear if this is a flat or stacked sequence structure. If it is a stacked sequence structure there might be code in the other frame(s) which need the space.
Sometimes it helps to perform "Cleanup Diagram" multiple times or to select a structure and perform the cleanup only on this structure.
11-27-2024 07:02 AM
Ctrl+Alt+L-mouse to reduce diagram size
11-27-2024 10:26 AM
@michele.santucci wrote:
> Why are there so many local variables in this small part of the code?
to avoid wires messing up with the soooo stretched diagram.
If the wires are short are pretty easy to follow .. with such a streching it becomes harder.
Anyway as you can see.. in the same Vi (another block):
If the wires are short and terminate in local variables, we cannot "follow the wire" to see where the data comes from and where it is going and where it was modified last. There is no way to tell in what order locals are read or written unless you segment all code with sequence structures (as you do), making things even much uglier. This severely limits compiler optimizations because you prevent it from doing any parallelization while forcing it to shuffle data to the front panel and back.
And as has been said, diagram cleanup should never be used on reasonable code. It will make truly bad code slightly more readable, but will make any reasonably good code worse. I never ever use it on my own code, but sometimes use it on code downloaded from the forum.
In any case, a truncated picture is insufficient to make your point because we cannot really tell what else is there. Also note that cleanup is not idempotent, thus the result typically changes when applied several times in a row. What happens if you click cleanup twice or more?
11-29-2024 03:31 AM
> What happens if you click cleanup twice or more?
usually things get worse and worse...
I have to signal that something has changed in clean-up from 2013 to the current version because the latest works something better.
Anyway I got the basic problem, diagram "clean up" : just clean and in some case the concept of clean is not the same of readable or tidy.
The basic structural problems of these VI is their origin... I inherited them with a project coded by someone that had almost no coding experience or low technical skills, I'm pretty a newbie in LabView (I used it only in trough CVI several years ago) and I'm reclutant to undergo deep modifications to preserve what's working but in some case I think it will be mandatory.
11-29-2024 04:38 AM
Hi Michele,
@michele.santucci wrote:
I'm reclutant to undergo deep modifications to preserve what's working but in some case I think it will be mandatory.
I recommend to use (or setup) a SCC system (source code control), like SVN or GIT.
This will help you significantly to handle revisions/version of your code base!
12-02-2024 02:21 AM
Of course yes I was talking about this just some day ago with people working on the same project.
I usually work with git and tought to apply it to this project but I see it's not directly 'supported' (at least it's not by the 2013 version), there's something more LabView oriendted or directly supported within LabView?
Best regards,
Mike