02-11-2010 06:27 PM
Is there a way to incorporate a VI call as part of a cluster?
As an analogy, in C you can make a function name as part of a structure.
A fairly common thing to do is create a table of structures and use a state to invoke a function from a cluster in the table.
The structure can then be used to call any function in the code.
I would like to have a cluster with an XY co-ordinate (for motion control) and then have the ability to invoke different VIs from that cluster based on what I want the system to do at that position.
For instance I might have a call to a laser function in one cluster, and a call to make coffee in another 🙂
Does LabView support this?
Any thoughts are appreciated
Thanks
02-11-2010 08:23 PM
02-11-2010 10:52 PM
02-12-2010 03:47 AM
If you encapsulate the cluster in a vi with a function control you'll have a functional global and an object of sorts.
That cluster would have the data and then some encapsulated functions implemented where you e.g. can start a vi according to a path or vi ref-attribute. Or you could simply have some set commands to call for the cluster.
Check out Functional Globals for some more ideas, dont know if it's really the solution but it should be similar.
/Y
02-12-2010 07:17 AM
I don't follow your request clearly but I will guess that you are either looking for an Action Engine or LVOOP.
Action Engines - Encapsulates data and related functions.
LVOOP - Is LabVIEW's version of OOP.
Do any of those options sound like what you are asking for?
Ben
02-12-2010 08:45 AM
Thinking about it some more, all I really need to do is put a reference to a VI in a cluster, and then use that reference to invoke the VI from whichever VI the cluster is passed to.
It seems like this is something that I should be able to do easily, I just don't know how.
Thoughts?
Thanks
02-12-2010 09:08 AM