LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Invoke Nodes on VI

I'm trying to use an Invoke Node on VIs so i can call it from another VI, i tried a lot of exemples but none of them works, and its been hours of reading and reading but i havent found a solution, what im trying to achieve is that i want to call a VI from another VI,  is it that hard?!?!


*Invoke Node to call Control_Manual when you select Control Manual from Enum (VI: Panel_Frontal)


Also I want to close the SubVi when I'm done, pushing a button and re-direct to Panel_Frontal, after that i will call a second VI the same way like the first one, but i believe that if i get help, calling the second VI will be the same way.


Please I've been reading from10AM to 7:11PM and no results T.T

Download All
0 Kudos
Message 1 of 5
(3,821 Views)

I would start by doing a few simple LabVIEW tutorials and lear about dataflow.

 

  • Why does the "control manual" case have a case structure inside. The other case can never happen.
  • While the subVI is executing, the caller will stall, so the automatic case cannot execute until the subVi is complete.
  • Closing the panel will not stop the subVI, it will stop whenever the loop finishes.
  • You are never calling the subVI in the automatic case.
  • You don't need any open and close nodes in the subVI, just change the call setup to show the panel when called and close afterwards.
  • Your toplevel VI uses 100% CPU when it is not doing anything.
  • You don't need any local variables if done right.
Message 2 of 5
(3,807 Views)

Hello,

There are two possible approaches.

First is calling vi in block diagram with setting in File -> VI Properties -> Window Appearence -> Customize -> Show front pannel when called check box and optionally Close aftewards if originally closed. This approach will open vi and it´s front panel, but top level VI from you are call this VI will stay stuckt.

Second approach is calling vi asynchronously with option call and forget or call and collect. In LabVIEW examples there are examples for both (NI Example finder -> Programatically Controlling VIs -> Dynamically Loading and Calling VIs -> Asychronous Call ...). You can you choose appropriate case which suits your needs, based on if you want to return any data back to your main vi. Then if you want to send data between two independent running VIs try to use user events, queues, notifiesrs, fuctional global variablebles (FGV) or in worst case global variables. If you want to close vi by closing itself you have to pass reference which mean use Close reference VI after asynchronous call, because if you have open reference to VI somewhere else you will not be able to close it.

 

This is advice to futher. First of all You should follow steps which advice you and then move to something more advence.

---------------------------------------------------------------------------------------------------------
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 5
(3,767 Views)

altenbach escribió:

I would start by doing a few simple LabVIEW tutorials and lear about dataflow.

 

  • Why does the "control manual" case have a case structure inside. The other case can never happen.
  • While the subVI is executing, the caller will stall, so the automatic case cannot execute until the subVi is complete.
  • Closing the panel will not stop the subVI, it will stop whenever the loop finishes.
  • You are never calling the subVI in the automatic case.
  • You don't need any open and close nodes in the subVI, just change the call setup to show the panel when called and close afterwards.
  • Your toplevel VI uses 100% CPU when it is not doing anything.
  • You don't need any local variables if done right.

  • Why does the "control manual" case have a case structure inside. The other case can never happen.

I thought that i need to send a true for the VI to open, i saw an example, very basic

 

  • While the subVI is executing, the caller will stall, so the automatic case cannot execute until the subVi is complete
  • Closing the panel will not stop the subVI, it will stop whenever the loop finishes.
  • You are never calling the subVI in the automatic case.
  • You don't need any open and close nodes in the subVI, just change the call setup to show the panel when called and close afterwards.

in the example they use those nodes for opening and closing VIs

 

  • Your toplevel VI uses 100% CPU when it is not doing anything.
  • You don't need any local variables if done right.

Im using those local variables for the LEDs, turning them off or on

 

Where should i start for data flow?
Any example for opening Sub-Vi?

0 Kudos
Message 4 of 5
(3,714 Views)

Timothy_ escribió:

Hello,

There are two possible approaches.

First is calling vi in block diagram with setting in File -> VI Properties -> Window Appearence -> Customize -> Show front pannel when called check box and optionally Close aftewards if originally closed. This approach will open vi and it´s front panel, but top level VI from you are call this VI will stay stuckt.

Second approach is calling vi asynchronously with option call and forget or call and collect. In LabVIEW examples there are examples for both (NI Example finder -> Programatically Controlling VIs -> Dynamically Loading and Calling VIs -> Asychronous Call ...). You can you choose appropriate case which suits your needs, based on if you want to return any data back to your main vi. Then if you want to send data between two independent running VIs try to use user events, queues, notifiesrs, fuctional global variablebles (FGV) or in worst case global variables. If you want to close vi by closing itself you have to pass reference which mean use Close reference VI after asynchronous call, because if you have open reference to VI somewhere else you will not be able to close it.

 

This is advice to futher. First of all You should follow steps which advice you and then move to something more advence.


That's why i have not use those call options for the VI because every time i call it, it just closes and open again and again

0 Kudos
Message 5 of 5
(3,711 Views)