Jump to content

Calling a SubVI


gnshmrthy

Recommended Posts

Hi Friends,

               I`m calling a VI by selecting the properties in windows apperance of " Show front panel when called" & " Close Afterwards if originally closed " and closing the VI using the invoke node of the reference. Is this a proper way to do it. even if I close the VI it`s still running in the memory is it only because I didn`t stop the VI or calling it wrongly.

 

 

post-29033-0-48963200-1385728885_thumb.p

 

 

 

 

post-29033-0-40527900-1385728891.png

Link to comment

I'm a little confused?  Is there a reason why you don't just call the subVI like normal?  What you are doing here is opening a reference to the VI by name.  This will only work if the VI is already loaded into memory, and depending on your setup it may not always be, especially if you build it into an EXE.  After the open you are closing the front panel.  But the front panel was never opened so it will generate an error unless you already have the front panel open for some reason.  All you did was open a reference to the VI it was never ran, so the code you are showing will not open the front panel.  If you are trying to run the VI asynchronously use the Start Asynchronous Call function is the easiest way.

Link to comment

Hi Hooovahh,

                  :oops:  I hope i`ve not shown a clear picture. I`ve more than 5 VI`s 1. welcome, 2. Configuration 3. selecting a database file 4. selecting a type of test 5. testing VI. On every VI i`ve enabled with the property of "show front panel when called" and i`m closing it in the initial stage of the another VI (example i`m running the welcome VI and on user event i`m calling a configuration VI and closing the front panel of welcome VI in the initial of the configuration VI and so on).  

Link to comment
Hi Hooovahh,

                  :oops:  I hope i`ve not shown a clear picture. I`ve more than 5 VI`s 1. welcome, 2. Configuration 3. selecting a database file 4. selecting a type of test 5. testing VI. On every VI i`ve enabled with the property of "show front panel when called" and i`m closing it in the initial stage of the another VI (example i`m running the welcome VI and on user event i`m calling a configuration VI and closing the front panel of welcome VI in the initial of the configuration VI and so on).  

That's great but doesn't answer my question.  Why aren't you just calling the subVI like normal?  Drop it on the block diagram using the Select a VI... from the block diagram.  If you can show some code, maybe a simplified version of what you are doing it may be easier.

Link to comment

You didn't post your VI's just pictures of them, but from what I see I think things should work correctly.  You have your "Select The Type of Test.vi" that has a UI and when you click "New Variant" it prompts the user for input, then calls the config VI.  With the config VI's settings the way you showed in the first post with Show When Called, and Close When done, then the config VI should pop up and show the UI, then when the config VI is done running it should close and return you back to the "Select The Type of Test.vi" UI.  Is this how you expect it to work?  Does it not work this way?

Link to comment

Hi Hooovahh,

                   Yeah you are correct, But here the Last VI is still running and only its front panel is closed. I hope because the while loop has not stopped the VI is still running.

 

When I try to call back the initial VI still an error pop`s up stating that the front panel is closed.

 

This time I`ve attached the code of the screenshot VI.

welcome.vi

Select the type of test.vi

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.