LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How close Vi progammatically?

Hi,
I have a base package of LV 6.1(not application builder)
I want close the vi in execution ,but i don't want utilize the command exit
(close lab view).
I want close the vi but not lab view.
Thank's for answer
Nicola
0 Kudos
Message 1 of 6
(3,326 Views)
Nicola,

Go into 'Applicaton Control' and use 'Open VI Reference'. Right click on
the vi reference (output) in your diagram and look in the methods and
properties menus. These commands may be what you're looking for.
Remember to use 'Close VI Reference' when you're done.

If this doesn't help, provide some more detail in your post. I'm not sure
if you want to abort execution, remove it from memory, or just hide its
front panel.

-kevin

In article , "NICNews"
wrote:

> Hi,
> I have a base package of LV 6.1(not application builder) I want close
> the vi in execution ,but i don't want utilize the command exit (close
> lab view).
> I want close the vi but not lab view. Thank's for answer Nicola
>
>
0 Kudos
Message 2 of 6
(3,326 Views)
I'm not 100% sure of what you want, but have you thought of using "Stop"? This primative "Stops the VI in which it executes, just as if you clicked the "Abort Execution" button in the toolbar." I've attached an example of it's use.

Like my answer? Give it a rating!

Christopher G. Relf
Certified LabVIEW Developer

Christopher.Relf@mBox.com.au
Int'l Voicemail & Fax: +61 2 8080 8132
Aust Voicemail & Fax: (02) 8080 8132
---
EULA
1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessarily associated with anyone else including, but not limited to, my employer(s).
2) This email has NOT been scanned for virii - attached file(s), if any, are provide
d as is. By copying, detaching and/or opening attached files, you agree to indemnify the sender of such responsibility.
3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 3 of 6
(3,319 Views)
"crelf" wrote in message
news:506500000005000000A5A00000-1031838699000@exchange.ni.com...
> I'm not 100% sure of what you want, but have you thought of using
> "Stop"? This primative "Stops the VI in which it executes, just as if
> you clicked the "Abort Execution" button in the toolbar." I've
> attached an example of it's use.


There's also the exit vi which closes down the program. But I'm not sure if
that was included pre-6.1.
0 Kudos
Message 4 of 6
(3,319 Views)
I completely understand your question, and have an answer. The confusion comes with whether a VI is open, Resident in memory, and loaded in memory.

For those that do not understand his question, LabVIEW (before ActiveX) could only statically load VIs. To completely remove any instance of an "Open" (loaded or not loaded in memory), would persist in memory until LabVIEW was completely closed.

To answer your question, if you open a VI using "Call VI by Reference" methods, then you can programatically "Close" the VI by closing its ActiveX reference.

I did an experiment, where I called (from a master) a top level VI (slave), opened it, and loaded it into memory. I then stopped the execution of my slave, upon which the ActiveX reference to the slave VI was c
losed in the master. I then changed the names of one of the sub-vis in windows explorer for the slave application. The theory was if the slave's sub-vi was still "open but not loaded in memory", the slave would run like normal. If the slave was reloading the VI, the renamed VI would then be missing.

The result was that the renamed VI could not be found, thus proving that when the slave vi is called, all VIs associated with it are uloaded and removed from memory!

However, there is one caveat that is still confusing. If you open any of the sub-vis directly (say from windows explorer), and perform the test, the VI will only load into memory when called and remove itself from memory, and remain open when closed programatically. I will assume the VIs that were manually opened stay open because the subVI was run on a different instance than the instance generated in LabVIEW.

For details on implementing this method see the "Calling a VI by Reference" in the Developer Zone Tutori
als.
0 Kudos
Message 5 of 6
(3,319 Views)
> For those that do not understand his question, LabVIEW (before
> ActiveX) could only statically load VIs. To completely remove any
> instance of an "Open" (loaded or not loaded in memory), would persist
> in memory until LabVIEW was completely closed.
>

Actually, dynamic loading of VIs has been around for awhile, initially
it was the Instrument Control VIs, poor choice of names, that allowed
this, and it was replaced with the VI server which has several access
points, TCP, internal, and ActiveX.

All VIs are in memory as long as either the panel is open, a static
caller is in memory, or a dynamic reference is still valid. References
are valid as long as the VI chain that opened them is still running and
nobody has closed the reference.

In o
therwords, there are just a couple things that keep a VI in memory,
but it is an OR of these, and it isn't possible to kick things out if
other things need it too.

If this wasn't clear, please clarify the question.

Greg McKaskle
0 Kudos
Message 6 of 6
(3,319 Views)