LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

functional global with multiple clusters

Hi All,

 

I'm investigating using functional globals (same thing as action engines?) in my application. I have 3 main cluster typedefs that my subVI's mostly read from, and I want to dewire it a bit.

 

Would this mean that I should have 3 individual action engines? 

 

Would each AE have to have a set operation for a particular cluster element? (assuming that I wanted to set that one individually and wanted to avoid bundling outside of the AE)

 

THanks!

 

LB

0 Kudos
Message 1 of 4
(2,610 Views)

A functional global can do so much more than just reading and writing.  You can easily have it support three cluster inputs and three outputs.  You can also have a enum as a method input, which could define what input should have its values stored.  Or if it should be saving, or loading to disk.  

 

You can also have three separate functional globals if that seems like a better design.  Is one part of the code ever going to want to know more than just one cluster?  

 

One minor reason you might want three separate globals, is because in 99.9% of the cases you want the VI to not be reentrant.  This means you can only call this VI one at a time.  So your code may hault in one place, while it waits to run the VI with different inputs, when it is running in another part of the code.  Generally this doesn't matter too much since functional globals generally run quickly.  Unless you are doing something like talking to hardware.

0 Kudos
Message 2 of 4
(2,592 Views)

Thanks,

 

I can have 3 cluster inputs, and 3 cluster outputs, but it gets tricky when i want to change elements of each cluster (does that  mean that I have to have these FG's support a bunch more input parameters for each cluster?) That gets busy quick...

 

In addition, does that  mean that i have to have 3 sets in the ENUM and 3 gets? (for each cluster)

0 Kudos
Message 3 of 4
(2,589 Views)

It really depends on how correlated those 3 clusters are. If they aren't correlated at all, I would suggest separating them into 3 AE like you said. And yes in this case each of them has its own set of instructions.

 

Here is an excellent explanation of AE vs. FG:

 

http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/td-p/503801

Message 4 of 4
(2,586 Views)