Jump to content

How can I call a VI from another running VI (Frontpanel)


Recommended Posts

Hi Everybody,

I am new to labviews so to this forum.

Here we go, I am building a group of about 20 VIs, all differ from each

other, no SubVIs. The customer`s wish is to trigger every single VI seperatly

with a button from a "Menu VI". So the startup VI is only a "Menu", and to

save hardware and network resources, only the "triggered" VIs should open

and run.

What I tried so far: I placed a VI in the Backpanel of the "Menu VI",

pressing it calls the VI, ok.. cool. But its invisible on the Frontpanel

and it is treated as a SubVi. :blink:

My Qestion, how can I place a button (or similar) on the frontpanel to call

and execute another (standalone) VI?

thx in advance

keb

Link to comment

Hi Everybody,

I am new to labviews so to this forum.

Here we go, I am building a group of about 20 VIs, all differ from each

other, no SubVIs. The customer`s wish is to trigger every single VI seperatly

with a button from a "Menu VI". So the startup VI is only a "Menu", and to

save hardware and network resources, only the "triggered" VIs should open

and run.

What I tried so far: I placed a VI in the Backpanel of the "Menu VI",

pressing it calls the VI, ok.. cool. But its invisible on the Frontpanel

and it is treated as a SubVi. :blink:

My Qestion, how can I place a button (or similar) on the frontpanel to call

and execute another (standalone) VI?

thx in advance

keb

Link to comment

Hi Everybody,

I am new to labviews so to this forum.

Here we go, I am building a group of about 20 VIs, all differ from each

other, no SubVIs. The customer`s wish is to trigger every single VI seperatly

with a button from a "Menu VI". So the startup VI is only a "Menu", and to

save hardware and network resources, only the "triggered" VIs should open

and run.

What I tried so far: I placed a VI in the Backpanel of the "Menu VI",

pressing it calls the VI, ok.. cool. But its invisible on the Frontpanel

and it is treated as a SubVi. :blink:

My Qestion, how can I place a button (or similar) on the frontpanel to call

and execute another (standalone) VI?

thx in advance

keb

Link to comment

1. If you search the /examples folder (or better use the Find Example VIs tool you will find an example that does exactly what you ask for. You can then modify quickly should take you all of 2 minutes, 10 with mods to call your 20 VIs.

2. Do not cross post your question to multiple topics on LAVAs forum. Very bad form and may incur the wrath of the Vorpul Administrator...l

Link to comment

Thank you for the fast answers.

Sorry about the cross postings, will not happen again.

Ok, I tried a few things:

- configuration of VI property. Dont really help, either (Sub)VI will be loaded/run on startup or the user has to click it in the Backpanel to have the VI popup.

But how can I call it dynamically from the Frontpanel?

- Open VI reference. Still working on this one. Seems that it needs the VI server. That would be a restriction. I need to call the VIs one by one without the VI server. All VIs are located on one computer. My "Menu VI" handles all other VIs, I want to select any VI in the frontpanel and call it (action Button?).

- Examples like "Menu selection Demo" was my first attempt, but they are too komplex, I think.

I am looking for something like "Run URL on Button action (frontpanel) >> execute item, Path://*stringvariable*"

Is it so obvious or do I think too Actionscriptish??? :blink:

Link to comment
- configuration of VI property. Dont really help, either (Sub)VI will be loaded/run on startup or the user has to click it in the Backpanel to have the VI popup.

But how can I call it dynamically from the Frontpanel?

Err, I think we have a misconception here. I don't know what is the Backpanel, but if you are talking about the Diagram Block, keep in mind that's where the code goes. All the user sees is the Front Panel.

Now, in the FP you have to put a control for the user to select which VI he wants. You can put several buttons or a ring, or an enum... In the BD you have to check a value change in that control, and launch the selected VI (for example, a case structure and each VI in its case). Be sure the VIs are set to "show front panel when called".

And then, of course, you have to run the program ;-)

Saludos,

Aitor

post-1450-1141747124.jpg?width=400

Link to comment

Ok, I will try that out tonight and reply tomorrow if it worked out.

Whats bugging me is the while loop. The VIs that I design all run onto a C++ Skript (build in as a subVI) that is taking care of the data I/O. I hope the loop will not bug the C skript....

Thanks a lot so far!!

Link to comment

It is not exactly clear to me, what your problem is, but let me explain 2 cases:

1. If you want to have your sub-vi displayed, then press rmb on the vi-icon and select vi property. from there select category Window Appearance and then check either Top-level application window or dialog.

2. If you want to have different vi's running together pressing 2nd button while first vi still runs), then you will have to use the vi-server method to call your sub-vi's. For infos on this search this site, ni.com, and the lv-examples (check include ni.com examples in the example finder).

Didier

Link to comment
  • 3 months later...
But how can I call it dynamically from the Frontpanel?

- Open VI reference. Still working on this one. Seems that it needs the VI server. That would be a restriction. I need to call the VIs one by one without the VI server. All VIs are located on one computer. My "Menu VI" handles all other VIs, I want to select any VI in the frontpanel and call it (action Button?).

I have a similar scenario. I have a 'Generic' test Shell that I use, the operator chooses which Assembly needs to be tested and I then call that specific assembly's VI using Open VI Reference. I went a step further where many of the options available are the same with each assembly so the Tester/User controls them though the test shell. It works fairly well, I am in process of improving it since it was first written in 6.0.1 2 years ago.

The Open Reference is a nice feature, but to use the same reference for all of your VIs they need to have the same Connector pane and same Control/ Indicator types on the pane from what I have found

Link to comment
You don't need VI Server to call a VI Dynamically that I remember.

Since when? If you want to run a VI that isn't wired on the diagram of your VI you have to use one of the two VI Server methods to do it, either a "Call By Reference" node (strict typedef) or use the "RunVI" method (not strict). Actually, there is yet another method for some VIs, call LabVIEW using a system exec call and give it the path of the VI in the command line, but that is a hack and you can't get output data.

Link to comment
Since when? If you want to run a VI that isn't wired on the diagram of your VI you have to use one of the two VI Server methods to do it, either a "Call By Reference" node (strict typedef) or use the "RunVI" method (not strict). Actually, there is yet another method for some VIs, call LabVIEW using a system exec call and give it the path of the VI in the command line, but that is a hack and you can't get output data.

Sorry You are right.. I must have been thinking about something else when I typed that.. It has been a rough Friday..

I will correct and edit my prior post..

Aitor,

What I don't understand is what is making the VI Server your restriction?

I just realized what I was wanting to say before. While you need the VI Server to Dynamically Load the other VIs, they still are allowed to reside on the same machine. Sometimes when I see Server I forget that 'Server' has different meaning.

What i had to do when I built my App was be sure I included all of my Dynamically called VIs. this way when you choose them ( in your case with a button) they would then open up.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.