LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Messed up block diagram

Hello,

 

Why do my block diagram mess up the layout? Objects are moving around on block diagram making some of the code ureadable. It's very annoying, don't know what causing it.

 

br,

paalbrokMessed up code.png

0 Kudos
Message 1 of 13
(4,645 Views)

You've added space through ctrl+drag? You have Autogrow activated on structures? Those will both cause such behaviours if you're uncareful.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 13
(4,621 Views)

Hi paalbrok,

 

there is a problem in YOUR VI - and all you attach is just a small part of it as simple picture…

Why don't you attach your VI?

 

Did you try AutoCleanup, atleast for parts of your blockdiagram?

What's the overall size of the blockdiagram? (tools -> profile -> VI metrics)

Best regards,
GerdW


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

Hi,

Picture is just an example of messed up code. Size of Block diagram is 7261 X 6060 pixels (width X height). I've suspected the size has something to do with it. Do you think this is the issue?

 

 

br,

paalbrok

0 Kudos
Message 4 of 13
(4,612 Views)

Hi paalbrok,

 

do you know the rule to have the blockdiagram limited to screen size?

Or do you use a monitor (wall) capable to display 8K images?

 

LabVIEW "should" handle block diagrams of your size - there used to be a rather hard limit of about 16000 pixels. But it isn't recommended to go beyond 2000 pixels…

 

- clean up the VI

- use (more) subVIs

- clean them up, too…

- read the style guide and use the VIAnalyzer (VI Analyzer is for free with LabVIEW Full or better…)!

Best regards,
GerdW


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

I'm familiar with the limitation regarding screen size. I'll clean up Block diagram and use more subVI's.

0 Kudos
Message 6 of 13
(4,595 Views)

Also, your Queue write has no timeout value wired...good luck trying to track that down if the queue fills up and the writes hand forever!.

0 Kudos
Message 7 of 13
(4,103 Views)

If you were writing C code, you wouldn't dump all your code into main(), so why would you dump all your LabVIEW code into one VI?  It may look different, but it's still a programming language and you should follow the same basic guidelines that you would use for any programming languages.  SubVIs are analogous to subroutines (or functions, to use the C paradigm).  Using the technique of breaking up your code into subVIs, you'll rarely have to remind yourself of the suggestion that block diagrams be limited to one screen size, because they will generally be much smaller than that.  One other benefit is that you can then easily reuse your code elsewhere.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 8 of 13
(4,097 Views)

@billko wrote:

If you were writing C code, you wouldn't dump all your code into main(), so why would you dump all your LabVIEW code into one VI?  It may look different, but it's still a programming language and you should follow the same basic guidelines that you would use for any programming languages.  SubVIs are analogous to subroutines (or functions, to use the C paradigm).  Using the technique of breaking up your code into subVIs, you'll rarely have to remind yourself of the suggestion that block diagrams be limited to one screen size, because they will generally be much smaller than that.  One other benefit is that you can then easily reuse your code elsewhere.


THAT is some of the best advice I have read here in ages. 

 

IMHO: NI needs to start very early on stressing people to use sub-vi's and proper program architectures instead of just throwing everything into one big loop (OBL). 

========================
=== Engineer Ambiguously ===
========================
Message 9 of 13
(4,083 Views)

@RTSLVU wrote:

@billko wrote:

If you were writing C code, you wouldn't dump all your code into main(), so why would you dump all your LabVIEW code into one VI?  It may look different, but it's still a programming language and you should follow the same basic guidelines that you would use for any programming languages.  SubVIs are analogous to subroutines (or functions, to use the C paradigm).  Using the technique of breaking up your code into subVIs, you'll rarely have to remind yourself of the suggestion that block diagrams be limited to one screen size, because they will generally be much smaller than that.  One other benefit is that you can then easily reuse your code elsewhere.


THAT is some of the best advice I have read here in ages. 

 

IMHO: NI needs to start very early on stressing people to use sub-vi's and proper program architectures instead of just throwing everything into one big loop (OBL). 


But instead, they will continue to advertise LabVIEW as being so easy to use, "even an engineer can use it".

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 13
(4,072 Views)