Jump to content

Another name for "LabVIEW 2 Globals"


Jim Kring

Recommended Posts

For possibly the same reason that I sometimes get the *evil* idea to implement

if (username="xyz") {

integer wires are orange;

double wires are blue;

}

We all have temptations that we have to supress. :nono:

hmm ... somtimes the best ideas grow from such "evil" ideas :)

changing integer and double wire colour will not hurt so much. Most LV developers I know do not care about coercion dots [maybe you should make them 10x bigger with maximum contrast ? ;) ]

But changing the meaning of the stop condition in a while loop - THAT will cause much impact ;) , and to top that: change it each time you restart LV :ninja:

Link to comment
I think functional globals is a very poor term, because functional in context of programming languages refers to functional programming.

I agree, although a functional global is different to a LV2-style global in that it traditionally doesn't just hold data, but also can perform some sort of encapsulated function on it as well.

Link to comment

One time when I was teaching a LabVIEW class in California, I had to go to a ghetto car rental place (the only place open on Sunday that would rent a car to a 23 year old). I gave the guy my corporate credit card and he said, "National Instruments...what are you, some kind of musician?"

-D

Link to comment
  • 2 weeks later...
BTW - does anybody use such one USR (or LV2) global VI for several global variables, by using a variant as the shift-registered data, and with commands like "GetValue" and "SetValue", where the name of the appropriate global parameter is used as a variant attribute name, and the data is the variant attribute variant itself? I've found this to be quite powerful, and then only need one (or a handful) of globals for a large hierarchy of VI's.

This sounds like a great idea, care to explain more - by attaching a simple example? :worship: in advance.

Link to comment

In Belgium and the Netherlands we (CIT Engineering) most often use the acronym GLI - Intelligent (designed) Global Variable.

I believe that the acronym originates from Philips Natlab R&D center in Eindhoven (NL) and was introduced by the LabVIEW support group of Albert Geven.

I like the acronym because it is short and easy to understand, also for non-hardcore (= occasional) developers and students. Everybody understands that an intelligent global has to offer something extra over a standard global variable.

I wonder where 'functional' in Functional Global stands for. Does it refer to functional programming? Which is strange because functional programming tries to avoid mutal objects. Does anybody knows this?

Wikipedia learns me: Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes the application of functions, in contrast with imperative programming, which emphasizes changes in state and the execution of sequential commands.

Sources:

http://en.wikipedia.org/wiki/Functional_programming

http://en.wikipedia.org/wiki/Immutable_object

Link to comment
I wonder where 'functional' in Functional Global stands for. Does it refer to functional programming? Which is strange because functional programming tries to avoid mutal objects. Does anybody knows this?

"Functional" doesn't come from functional programming, but the fact that it's not just a global - it has some other sort of functionality inside. I'm not sure I'd use "intelligent" either, as the code and/or functionalty isn't necessarily intelligent... It's a quanry :)

Link to comment

Good to hear that 'functonal' doesn't come from Functional programming which was not obvious for me.

Crelf I expected your comment about intelligent design and you are right but I also guess that the fact the programmer of the good/bad code used LabVIEW is also a sign of intelligence :-) ?

I definitely do NOT like USR since this limits this style of globals to shift register based patterns:

1) For a non-LabVIEW person this is impossible to understand, most of my managers (that pay the projects) do understand intelligent or functional global but have no idea what a shift register is.

2) And what about queue based patterns?? The queue based designs are very hard to beat (by LabVIEW onluyy code) when you need to store/access a large amount (more than 10^6 samples) of data for an unknown number of objects at runtime? Do you want more details on queue based globals please check NI application note about handling large data objects in labview. The biggest problem with the queue based design is that the queues become invalid after the creating VI stops running... so harder to debug programs. (as far as i know there is no labview.ini setting for this behavior).

I've never seen any LabVIEW programmer/application using this design so please share your experiences with this design pattern. Maybe we need a new thread for this one?

I believe the variant design is not applicable for very large data sets or NI should have done miracles in LV8.20 regarding variant performance

sets but could be usefull to have a clean OO approach. I guess it is even harder to debug when things go wrong.

Link to comment
The biggest problem with the queue based design is that the queues become invalid after the creating VI stops running... so harder to debug programs. (as far as i know there is no labview.ini setting for this behavior).

This is not completely true. Queues do become invalid after all the VIs that reference a specific queue stop running, or a the Destroy option is used when releasing the queue.

There have been numerous discussions on Info-LabVIEW regarding the creation and persistance of LabVIEW queues, and recently as outlined in these two messages:

http://sthmac.magnet.fsu.edu/infolabview/I...3/10/14/24.html

http://sthmac.magnet.fsu.edu/infolabview/I...-08-05_005.html

Use the Advanced Search of Info-LabVIEW Archive located HERE, and search on queue for the year 2006. There's LOTS of info on this subject :book:

Link to comment
I definitely do NOT like USR since this limits this style of globals to shift register based patterns:

...And what about queue based patterns??

Or even a local which can also retain its value between runs?

OK, OK. Stop throwing those tomatoes! I know that locals are evil, memory-gobbling, cause-of-all-the-world's-troubles devices. Just bringing up the point, because there are cases where they're an interesting method for this.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.