04-09-2007 06:07 AM
Well it looks like my concern about addinga section on performance was un justified.
Thank you for point out the placement of control and how they affect the performance.
Others have touched on the idea of passing an array through a VI (hopefully by reference) to allow the buffer to be "inspected" by the sub-VI. After the sub-VI completes another function can use the same buffer.
Christian wrote;
"
Also the "Numeric out" should be renamed to "mean out" and should produce e.g. NaN in all actions except "calculate mean".
"
Good point! ...
unless the AE also offers a "Min" and "Max" function (which this examples does not).
Ben
04-09-2007 07:28 AM
04-09-2007 07:34 AM
Very nicely-done nugget! FG's and AE's are *very* useful constructs indeed.
Most of my apps involve heavy doses of data acq and I almost always implement an AE around each data acq task (or small set of closely-coupled tasks). This sets me up with 1 common interface to each logical unit of hardware. It has proved to be a pretty effective strategy for re-use as well. The data acq tasks naturally turn into pretty self-contained modules needing relatively little modification from app to app. (Sometimes none at all.)
Like altenbach mentioned, I also almost always use the "First Call?" primitive in any FG to guarantee some kind of initialization. Typically, if the first call performs a "Read" action, I'll catch that fact and provide sensible initialization values. Depending on the FG in question, I may just pass through the default inputs, or I may use special values like NaN, "<undefined>" enum values, or even assert the error cluster -- depending on how crucial it is to have initialized *explicitly*.
-Kevin P.
04-09-2007 08:13 AM
04-09-2007 08:19 AM
04-09-2007 09:14 AM
Hi All,
I will try to reply to the replies in chronological order as time permits.
Tomi,
Now that this Nugget is out of my head I will look into harnessing the LVOOP ideas you have been pushing. I'll reply back with this.
Aristos,
I WILL have to follow-up on your link. Concidering how much time I spend with AE's your comments are very tempting!
I will reply to the other posting when I get a break.
Thank you!
Ben
04-09-2007 10:52 AM
Tomi Stephan and others,
To get my head around how to think LVOOPishly, I appreciate a little help.
In my Action Engines...
Should I understand the data in the USR to be a class or is the cluster that defines the USR contents that I should think of as a "Class"?
If I perform an action that modifies the USR, is that a "method"?
If I just read out the "average" is that a "property"?
Ben
04-09-2007 10:56 AM
04-09-2007 11:48 AM
04-09-2007 12:05 PM
I haven't had time to take a look for Stephens example so I will not talk for Stephen but only for myself. The USR could be but would not neet to be an object in LabVOOP. It can as well be anything else such like in pre-LabVOOP LabVIEW. The more relevant question is if the USR containst the class type the VI (method) belongs to or something else. However the story is too long to be replied here wihtout much too many references to undefined issues. I'd rather go on my introduction to LabVIEW object-oriented programming in my blog at expressionflow. When the time is right I'll talk about functional globals and action engines in contexto of object-oriented programming.Should I understand the data in the USR to be a class or is the cluster that defines the USR contents that I should think of as a "Class"?