LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding the Invoke Node

Solved!
Go to solution

In the past, to create some organization, I would create some VIs and then call them from other VIs just by running it as a sub VI where I might pass it a value and the Sub-VI might return a value. Pretty basic stuff and honestly, pretty useful. 

 

However, now I have discovered the subpanel and would like to use it in conunction with other VIs. To my understanding, in order to run and pass data to and from the VI being run in the subpanel, I need to use the invoke node. I'm a little unsure on how to use them though. It's not real clear on how I can pass data to and from the subpaneled VI.

 

Any help on suggestions or explinations would be great. Thank you.

0 Kudos
Message 1 of 17
(3,409 Views)

I would advise against using invoke nodes to communicate with VIs you have running inside of subpanels.  Use a Queue or Notifier or User Events to send data to the VI instead.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 17
(3,389 Views)

Thanks for the reply.

 

Do you have any recomendations on resources or tutorials on how to either impliment a queue, notifier, or user events?

 

 

0 Kudos
Message 3 of 17
(3,383 Views)

I would be repeating what crossrulz said...

 

However, I suspect you were trying to say "Property Node"  and maybe using a reference...

 

A large influence will be how you are calling the sub-vi in the subpanel.  Can you show us part of that code?

 

 

EDIT:  I just saw you reply..

 

You can use the "Find Examples..." inside the help menu.  There must be 10,000 examples of Queues & Notifers in this forum.  A simple search should provide lots of hits.  These are easy to implement.  Much easier than it appears..

 

To learn more about LabVIEW, I suggest you try looking at some of these tutorials.

0 Kudos
Message 4 of 17
(3,382 Views)

I really don't have too much to show right now, I'm just trying to get an understanding of how exactly do what I'd like to do.

 

What I'm trying to do is essentially have one of a few different VIs display in the subpanel. There doesn't need to be much interaction between the two and it can all be done serially, so maybe queue and the other suggestions are not even the most appropriate course of actions. 

 

I would just like to be able to call the VI, pass a few values, perform the function of the Sub-VI from within the subpanel (without doing anything in the higher level VI), and then have the subpaneled-VI return a few values to the higher level VI, then carry on from there. Is queue, etc. the best option?

0 Kudos
Message 5 of 17
(3,365 Views)

If you put a VI into a subpanel, it should be a GUI VI that is in constant run mode.  Subpanels are not meant for quick VIs that you simply pass a little data into and get an answer.

 

It would be beneficial for you to make up a quick example of what you want.  Then we can much better direct you to success.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 17
(3,361 Views)

What you are describing honestly sounds just like a normal sub VI with terminals wired. You can just pass data in and out.

 

One thing you might want to try is just select a portion of your code, something without a control in it and go to "Edit" -> "Create SubVI".  This will automatically create a SubVI with the terminals already wired.

 

As for queue etc, you may want to give this a cursory read:  http://www.ieee.li/pdf/viewgraphs/labview_design_patterns.pdf.  It is a bit more "high level", but it may help you figure out what direction you want to go.

 

-M

0 Kudos
Message 7 of 17
(3,357 Views)

@crossrulz wrote:

If you put a VI into a subpanel, it should be a GUI VI that is in constant run mode.  Subpanels are not meant for quick VIs that you simply pass a little data into and get an answer.

 

It would be beneficial for you to make up a quick example of what you want.  Then we can much better direct you to success.


That is all true. However, I'm simplifying things a bit to make it easier. I'll try to elaborate. I have a few different products I'd like to test, let's say 5. So the user would open up the same application to test all five of the units, however one of the first things they would do would be to is select which product they'd like to test. This selection would cause the appropriate VI to be loaded into the subpanel. The test would then start and the user would get/give feed back from the UI from the subpaneled VI. The test would complete, the subpaneled VI would pass some information about the test back up to the main VI, and then the main VI would write that information to a database. I hope this is making sense.

 

In reality what I want to is not very different from just a standard Sub-VI call, I'd just like to have the GUI displayed. 

0 Kudos
Message 8 of 17
(3,348 Views)

That displays the sub-VI in a new window though, I'm trying to avoid that. I'd like to display the VI from within the subpanel on the main VI. If I have to do a queue to do it, then so be it, but it just seems a bit overkill for what I'm trying to do.

0 Kudos
Message 10 of 17
(3,333 Views)