03-04-2015 09:45 PM - edited 03-04-2015 09:51 PM
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.
03-04-2015 09:56 PM
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.
03-04-2015 10:00 PM
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.
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.
03-04-2015 10:05 PM
03-04-2015 10:08 PM
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.
03-04-2015 10:12 PM
03-04-2015 10:14 PM
I never said globals were better than locals. Someone else did. DUUUUDDDDEEEE
03-05-2015 12:15 AM
"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! 🙂
03-05-2015 03:59 AM
@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
03-05-2015 04:15 AM
If you prefer references over FGV, you could check Data value reference functions.