LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Abnormal diagram horizontal streching

I'm experiencing some problem with block "Cleanup Diagram", for some reason inside some block this's the result of a cleanup..

 

michelesantucci_0-1732705478636.png

 

0 Kudos
Message 1 of 12
(302 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(297 Views)

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):

michelesantucci_0-1732706770069.png

pretty much the same elements are 'cleaned up' properly and also here there are many (redundant) local variables.

 

0 Kudos
Message 3 of 12
(288 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(273 Views)

@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..

 

michelesantucci_0-1732705478636.png

 


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.

0 Kudos
Message 5 of 12
(244 Views)

Ctrl+Alt+L-mouse to reduce diagram size

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 12
(239 Views)

@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?

Message 7 of 12
(201 Views)

 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.

 

0 Kudos
Message 8 of 12
(114 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 12
(107 Views)

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

0 Kudos
Message 10 of 12
(71 Views)