Broken Arrow wrote:
Trouble said, in regards to his action engine....
Trouble wrote:
I think this is much better than passing a cluster from VI to VI and case to case inside my state machine...
Well, depends... If you can pass the cluster from VI to VI by using a wire, then you should use a wire.
As far as going from case to case inside a state machine, I don't see why you'd use an action engine other than wow factor, sense the state machine will accommodate a shift register and wire.
This code with some explaiantion may help illustrate
The VI I am showing you is a sub-VI that handles all of the work involved while collectiong data. It is only concerned with a sub-set of all of the controls and indicators on the top level GUI. So I needed a method to let this sub-VI get at all of the FP objects. That was handled by an Action Engine that holds all of my control refs along with some other functionality.
The VI that looks like it is labeled "GUI Cnt Get Refs" is a wrapper around an action engine that holds about 100-200 control references for controls on the FP of the top level VI. The Action used in that wrapper is "Get Refs" and returns a cluster that lets me choose via an unbundle by name. In the code above you can see that I am registering events for a handful of the objects that will be used while I am in collection mode. So this Action Engine lets me get at the GUI objects by choosing the right name from the cluster.
Hold it I'm not done!
THe VI just to the right that looks like it is labeled "GUI Cnt Collect" is yet another wrapper around the same Action Engine but it invokes a method "Set Collection Mode" that goes through all of the control refs on the FP of the top level GUI and hides shows, re-lables everything to make the GUI look like it is in Collection mode.
So using Action Engines (in wrappers) to store values or references that are not used in every case gives me the following benefits
1) I can get any any FP object from anywhere in my app.
2) Keeps my code cleaner such that only the data associated with the sub-VI is stored in a SR.
3) Let me encapsulate the pile of Fp property nodes
4) Clearly enunciate what FP objects I am working with
As always, just trying to help,
Ben