LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie Questions on Labview

Ugh!  What a mess.

Please explain why you think that spaghetti code is OK.

0 Kudos
Message 11 of 24
(181 Views)

@paul_a_cardinale wrote:

Ugh!  What a mess.

Please explain why you think that spaghetti code is OK.


Honestly, cause it's all I've got and I don't have time or resources to go through a full learning and development process (though I am doing what I can to learn). If I can get something that works and does what I want, I'll be golden. Also, I haven't been able to find anyone with expertise to sit down with at my organization, but am currently looking, so perhaps they'll be able to help me consolidate and streamline things. 🙂

0 Kudos
Message 12 of 24
(158 Views)

If you select the Consumer While Loop and press Ctrl+U you'll get something like this, which isn't great, but a big improvement:

Yamaeda_0-1771341590956.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
Message 13 of 24
(148 Views)

@Yamaeda wrote:

If you select the Consumer While Loop and press Ctrl+U you'll get something like this, which isn't great, but a big improvement:

 


Huh, was not aware of the ctrl+U. It didn't show up on the NI shortcuts page I found, so this is good to know! Thank you!

0 Kudos
Message 14 of 24
(143 Views)

Hi Je,

 


jecunningham@vt.edu wrote:

Huh, was not aware of the ctrl+U. It didn't show up on the NI shortcuts page I found, so this is good to know! 


When you hide the labels of LabVIEW nodes (like BuildWaveform or BundleByName) you will gain a lot more block diagram space: that's there's the context help to show you the names of LabVIEW nodes/functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 24
(135 Views)

jecunningham@vt.edu wrote:
Huh, was not aware of the ctrl+U. It didn't show up on the NI shortcuts page I found, so this is good to know! Thank you!

Rules of thumb:

 

  1. if ctrl+u improves the diagram, it was a horrible mess before. Throw it away and start over.
  2. if ctrl+u makes the diagram worse, the code was reasonable, so do a ctrl+z to go back.

 

The only scenario where I ever use it is on undecipherable code from the forum so I can at least try to understand. 😄 some of it.

Message 16 of 24
(128 Views)

@altenbach wrote:

jecunningham@vt.edu wrote:
Huh, was not aware of the ctrl+U. It didn't show up on the NI shortcuts page I found, so this is good to know! Thank you!

Rules of thumb:

 

  1. if ctrl+u improves the diagram, it was a horrible mess before. Throw it away and start over.
  2. if ctrl+u makes the diagram worse, the code was reasonable, so do a ctrl+z to go back.

 

The only scenario where I ever use it is on undecipherable code from the forum so I can at least try to understand. 😄 some of it.


I'm still new enough that I'm not completely certain what an improvement looks like. 😛

0 Kudos
Message 17 of 24
(126 Views)

jecunningham@vt.edu wrote:

@paul_a_cardinale wrote:

Ugh!  What a mess.

Please explain why you think that spaghetti code is OK.


Honestly, cause it's all I've got and I don't have time or resources to go through a full learning and development process (though I am doing what I can to learn). If I can get something that works and does what I want, I'll be golden. Also, I haven't been able to find anyone with expertise to sit down with at my organization, but am currently looking, so perhaps they'll be able to help me consolidate and streamline things. 🙂


Are you claiming that you don't know how to do things neatly?  That you've never learned how to arrange things without making a mess?

0 Kudos
Message 18 of 24
(116 Views)

@paul_a_cardinale wrote:

Are you claiming that you don't know how to do things neatly?  That you've never learned how to arrange things without making a mess?


There is a huge ramp between a new user who cannot really predict how a diagram will grow as features are added (and is unaware of the ctrl+drag function to make space as needed!) and a pedantic programmer who spends 95% of time perfectly aligning and spacing things. I am probably somewhere in-between. 😄

 

Unlike text programming where we always must start in the upper left corner, LabVIEW does not provide any handrails and code can start anywhere. A new user feels like getting airdropped into the Alaskan wilderness. 😄 I know how I felt in the mid nineties. There was no forum help, and <undo> did not exist yet (Motto: "Think twice, wire once") 😄

 

 

Message 19 of 24
(110 Views)

@altenbach wrote:

 

[...] a pedantic programmer who spends 95% of time perfectly aligning and spacing things. [...]

 


Each object needs to be eight pixels apart.  If there's a wire between them, the wire should just disappear when moved eight pixels.  Containing diagrams must border its contained objects by eight pixels all around.  It's not pedantry, it's what separates us from animals.

 

jcarmody_0-1771349769695.png

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 20 of 24
(104 Views)