Jump to content

Another name for "LabVIEW 2 Globals"


Recommended Posts

QUOTE(Donald @ Oct 5 2006, 02:50 AM)

I can confirm that one of the answers on the NI LabVIEW certification exam is "Functional Global"...

Lv Punk thx also for the shortcut to the mails of Stephen Mercer. Very good explanation why they changed the Obtain Queue primitive.

FWIW, I prefer Funtional Global partly because it's sort of the only Global that is really "functional" instead of dysfunctional...

LV2 is historically correct but not very helpful and the others, well, I guess I just don't like them, again FWIW.

Link to comment
  • 8 months later...

QUOTE(pbrooks100 @ Jan 10 2006, 09:12 AM)

Intelligent Globals = Action Engine?

:blink: Does anyone else like the term "Action Engine"?

I've always called them Functional Globals.

I've read somewhere (might be Ben's post) that FG's are actually a sub-class of Action Engines. Where AE actually have functions within the loop / case structur; thus, when coding, I have my FG folder and my AE folder. The trash folder is also handy ;)

Link to comment

QUOTE(pbrooks100 @ Jan 10 2006, 09:12 AM)

Intelligent Globals = Action Engine?

:blink: Does anyone else like the term "Action Engine"?

I've always called them Functional Globals.

I've read somewhere (might be Ben's post) that FG's are actually a sub-class of Action Engines. Where AE actually have functions within the loop / case structur; thus, when coding, I have my FG folder and my AE folder. The trash folder is also handy ;)

Link to comment
  • 8 months later...

When the concept was first introduced to me it was presented as a "Functional Global Variable" and I've added my vote to the poll under that category. I must admit, though, that the term "Action Engine" was more appealing to me since it seems much more descriptive of the broader subject (of which Functional Globals are only a subset.)

The term "Functional Global Variable" may be unappealing to some because it seems to emphasize the noun Variable and tack on Global and Functional as adjectives to classify Variable, and the concept really isn't a variable at all. If this describes your view of the term consider this explanation: A "Functional Global Variable" isn't a variable, it's a Function--a Function that can be used as a Global Variable. In this sense the noun is "Function" and "Global Variable" describes the type of function.

Perhaps I can convince all of you to start calling these things "Global Variable Functions". ;)

Link to comment

QUOTE (oosterwal @ Jul 25 2008, 01:25 PM)

The term "Functional Global Variable" may be unappealing to some because it seems to emphasize the noun Variable and tack on Global and Functional as adjectives to classify Variable, and the concept really isn't a variable at all. If this describes your view of the term consider this explanation: A "Functional Global Variable" isn't a variable, it's a Function--a Function that can be used as a Global Variable. In this sense the noun is "Function" and "Global Variable" describes the type of function.

Perhaps I can convince all of you to start calling these things "Global Variable Functions". ;)

Very good point. Earlier this week I asked a coworker of mine what I should be calling the design pattern employed by Functional Global Variables, but used for another purpose. So are these Global Functions, or what do we call them? (Different methods implemented in a Case structure, acting on a set of variables stored in uninitialized shift registers of a While loop)

I guess they're precursors to very simple LV classes.

Link to comment

QUOTE (LV_FPGA_SE @ Jul 26 2008, 12:54 AM)

Very good point. Earlier this week I asked a coworker of mine what I should be calling the design pattern employed by Functional Global Variables, but used for another purpose. So are these Global Functions, or what do we call them? (Different methods implemented in a Case structure, acting on a set of variables stored in uninitialized shift registers of a While loop)

I guess they're precursors to very simple LV classes.

In OO terminology they would classify as a singleton design pattern. Because that's basically what they are: a class of which only one object can be instantiated.

An advantage of this particular singleton implementation is that we don't have to pass a class reference around. :) Disadvantage ofcourse is that reads are always serialized and we have to wire and set the method selector everywhere we call a 'method' of the class.

Link to comment

QUOTE (Jeffrey Habets @ Jul 26 2008, 12:43 PM)

In OO terminology they would classify as a singleton design pattern. Because that's basically what they are: a class of which only one object can be instantiated.

An advantage of this particular singleton implementation is that we don't have to pass a class reference around. :) Disadvantage ofcourse is that reads are always serialized and we have to wire and set the method selector everywhere we call a 'method' of the class.

Thanks for the OO terminology lesson. To get around setting the method, I normally create a separate wrapper VI for each of the methods, that only expose the necessary inputs and outputs for the method. This becomes my API/function palette. The singleton VI is normally not exposed to the user.

Link to comment

QUOTE (Jeffrey Habets @ Jul 26 2008, 12:43 PM)

In OO terminology they would classify as a singleton design pattern. Because that's basically what they are: a class of which only one object can be instantiated.

An advantage of this particular singleton implementation is that we don't have to pass a class reference around. :) Disadvantage ofcourse is that reads are always serialized and we have to wire and set the method selector everywhere we call a 'method' of the class.

Not quite. I can instantiate only one instance of the class *with that VI*. I could easily write another VI with its own uninitialized shift register that gives me a second instance of the class. Or I could have the class out on a wire and fork it off to many locations. A singleton guarantees that there is one and only one in memory *ever*. There's a shipping example that shows how to enforce that -- see examples\lvoop\singleton.

The closest approximation of this to C++ code is function static data -- a variable declared inside a function using keyword "static".

I think that the best name for these remains "functional globals". They are global variables implemented using a function.

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.