LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vi call in cluster

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

 

0 Kudos
Message 1 of 7
(2,766 Views)
You could place a VI server reference in your cluster (such as a type specifier VI refnum) and set its value based on the VI that's supposed to run. You will need to do that part programmatically. You'll need to call the VI yourself, though. The cluster isn't going to do it on its own, even if it has the enticement of a hot cup of java. Smiley Wink
0 Kudos
Message 2 of 7
(2,756 Views)
I'd probably use a LVOOP object with dynamic dispatch.
0 Kudos
Message 3 of 7
(2,744 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 7
(2,727 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(2,710 Views)

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

 

0 Kudos
Message 6 of 7
(2,700 Views)
What don't you know how to do? Place a VI reference in a cluster, instantiating the reference, or call a VI using the VI Server? Examples ship with LabVIEW showing you how to use the VI Server to call VIs dynamically.
0 Kudos
Message 7 of 7
(2,694 Views)