LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My approach to local variables....

Solved!
Go to solution

My other typedef is a clusters of references to UI controls.

 

I end up throwing three big types around: local vars - (basic system info), gui UI stuff, and a cluster of activeX containers for teststand integraiton. 

 

This vastly deminishes wires, improves readability and effectively abstracts. 

 

So now instead of passing multilple things  everyone can tap off of these three generic types. 

0 Kudos
Message 11 of 40
(1,828 Views)

Dude, this is rediculous. 

 

I don't have like 600 local variables here. At the end of the day things that multiple VI's need that the user doesnt care about need to be stored somehwere that's not an excel file. 

 

 

0 Kudos
Message 12 of 40
(1,805 Views)

Dude.  I'm not a teenager.

 

Take some lessons in LabVIEW.  If you want something to store data easily that multiple locations can access that can minimize many of the problems that local variables can cause, use a functional global variable, also known as action engine.

 

Action Engine Nugget

 

You asked for an opinion on the way you are using local variables.  Why? To get some sort of validation?  You won't get it here.  If you don't like the response that it is a poor programming practice the way you are abusing them, then don't bother asking the question.

Message 13 of 40
(1,798 Views)
Global variables offer no scope control bro
0 Kudos
Message 14 of 40
(1,793 Views)

Again.  I'm not a teenager   BRO.

 

 

For someone who thinks they know so much about software architecture with terms like "scope control" "classes" "'abstraction" "minimalism",  I'd think you'd actually try to use something better than the lowest level of programming of local variables.

0 Kudos
Message 15 of 40
(1,789 Views)
You're right, everyone knows that global variables are def higher level and a better idea than local. Thanks dude
0 Kudos
Message 16 of 40
(1,789 Views)

I never said globals were better than locals.  Someone else did.  DUUUUDDDDEEEE

Message 17 of 40
(1,787 Views)

"I'm creating a relatively big program, and I like to use offscreen indicators / controls as "local variables". "

What happens if you have multiple writers of these "local variables"? Total disaster, race conditions, and impossible to debug properly. Why do you argue if you are not here to learn good LV practice, but prove that you are doing the right way?

I remember the old joke about the driver on the motorway when he hears in the radio that someone drives in the wrong opposite side. So he just says: someone? EVERYONE! 🙂 

Message 18 of 40
(1,770 Views)

@LennyBogzy wrote:

I want to hear some feedback about this approach.

 

I'm creating a relatively big program, and I like to use offscreen indicators / controls as "local variables". 

 

I'm thinking of turning this into a cluster - typedef, called "local variables" which I can then wire into differnet VI's, and it cleans up the code quite a bit (but adds overhead and makes it less obvious what's going on ). 

 

What do you guys/gals think about this approach? 

 


You're trolling, right?

Using offscreen controls as data storage is an awful idea.

 

Clumping data together as a cluster is a good idea though. What you can do is to create an AE (Action Engine) with this cluster and use that.

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 19 of 40
(1,749 Views)

If you prefer references over FGV, you could check Data value reference functions.

--
Marko H

OptoFidelity - Enabling Smarter Future

Tampere - Espoo - Oulu - Cupertino - Redmond - Zhuhai

0 Kudos
Message 20 of 40
(1,743 Views)