08-12-2009 01:40 PM
I'm a few years late on this, but I would like to thank Ben for this nugget.
And i pay $$$$ to learn from professors that dont give this high quality type of explination.... why?
10-21-2009 10:06 AM
Inpost #25 of this thread I explained how to use an Action Engine to help manage control references in large apps and to keep our code cleaner. This image is discussed in that thread.
Ben
12-09-2009 11:15 AM
... and if you have read this far and still don't know what to think about AE's then you may want to follow this thread (on the other side ) where Daklu get up on his soap-box and declares AEs are an Anti-pattern.
Ben
04-13-2010 07:45 AM
In this thread, I posted a case study of how I use a GUI controller to keep my code clean using sub-VIs while also allowing access to FP object using a GUI Controller form of an Action Engine.
Ben
11-02-2010 01:13 PM
I'm fairly new to LV and this nugget explained how to do almost exactly what I'm trying to do. I do have one question however, and it's probably easy...
I am using an AE with three cases to control a VISA instrument, the cases (actions) are as follows:
Initialize - opens the VISA resource
Set Value - sets the users value on the VISA device
Clear Task - sets all the channels on the device to their off state and clears the VISA task
My question is, what do I do about the unwired terminal in the 'Clear Task' case? The terminal is expecting a VISA resource ID, but the purpose of the final case is to destroy that resource. I've looked for some sort of NULL constant to wire there but can't find one. If I tell it to 'use default if unwired', what is the default value?
Screenshots of the 3 cases are below, any advice is greatly appreciated. Thanks everyone for the info on this board.
11-02-2010 01:16 PM - edited 11-02-2010 01:17 PM
Right click the terminal and choose create constant. It should be an empty constant created.
11-02-2010 01:38 PM
Thanks for(imstuck). I didn't realize that's all it took to keep LV happy. Coming from a history of strongly typed text languages, I guess I'm used to explicitly telling the compiler what values I want where, so I wasn't sure if empty constants were really kosher here. I guess that's why LV makes things easy.
This is a great nugget and I think will let me do just what I want. Thanks again for the help.
11-02-2010 02:02 PM
@ScaledPilotGuy wrote:
Thanks for(imstuck). I didn't realize that's all it took to keep LV happy. Coming from a history of strongly typed text languages, I guess I'm used to explicitly telling the compiler what values I want where, so I wasn't sure if empty constants were really kosher here. I guess that's why LV makes things easy.
This is a great nugget and I think will let me do just what I want. Thanks again for the help.
You are very welcome and thank you for the kind words. I am glad it is continuing to help.
I am still accepting Kudos for this Nugget (since I just need two more for it to move into a tie for the top rated post) so please feel free to Kudos that first message.
Ben
11-02-2010 02:07 PM - edited 11-02-2010 02:11 PM
@Ben wrote:
SpoilerI am still accepting Kudos for this Nugget (since I just need two more for it to move into a tie for the top rated post) so please feel free to Kudos that first message.
Ben
Strong kudos beg 🙂 haha. That aside, this is such a great nugget because it gives an object oriented approach to LabVIEW, even if you don't use LVOOP. It allows you to keep things organized, and data stored to be accessed any "method" (action/case) in the "class" (subVI). But I guess this statement is nothing new, I just felt the need to reiterate it.
08-02-2011 07:44 AM
Steve Chandler wrote a very nice micro-nugget that can be found here expaning on the idea (posted by Jim Kring) of using wrappers to encapulate Action Engines.
He extends the idea by exploiting libraries and public and private scope.
Please click here to read more on this subject.
Ben