LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi's running with the FP closed

I need to call a VI dynamically, but the FP must remain closed as I would like the vi to run in the background, transparent to the user.
I am able to call the vi so that the FP is displayed, but when I use the option 'FP.Open' set to false, the vi doesn't seem to run.

Can anyone help?

Many thanks,

Dan
0 Kudos
Message 1 of 10
(3,501 Views)
If you need to have the vi run without a FP object being seen you can have the calling vi run modal(always on top)so that the called vi will execute but not be seen. Or you could resize the called vi to be very small. I know this doesn't answer your question of running a vi with the FP closed but it might offer a work-around.
0 Kudos
Message 2 of 10
(3,501 Views)
If you main vi from where you run sub-vi is running, sub vi will run also. You don't need to set "FP.Open" to false. If your sub-vi is displayed, it's seems that in it's Windows Appearance properties you selected "Open Vi when it called". Set it to false.
0 Kudos
Message 3 of 10
(3,501 Views)
I want add something to my answer:
the sub-vi must be closed before you run it.
0 Kudos
Message 4 of 10
(3,501 Views)
Thank you for your comment Nadav, but maybe I wasn't clear enough. The vi I want to run in the background is not actually a sub-vi, it is a standalone vi that I want to run in parallel with the calling vi. To achieve this it must be called dynamically using the application control vi's. I would like the vi to be called so that it runs without the FP being displayed, and also without the vi appearing on the task bar.
Maybe this is not possible, but I thought there may be a way.

If you have any further ideas, I am very grateful,

Dan
0 Kudos
Message 5 of 10
(3,501 Views)
> Thank you for your comment Nadav, but maybe I wasn't clear enough.
> The vi I want to run in the background is not actually a sub-vi, it is
> a standalone vi that I want to run in parallel with the calling vi.
> To achieve this it must be called dynamically using the application
> control vi's. I would like the vi to be called so that it runs
> without the FP being displayed, and also without the vi appearing on
> the task bar.
> Maybe this is not possible, but I thought there may be a way.
>
> If you have any further ideas, I am very grateful,


You don't mention what version of LV you are using, but the Application
Control VIs are pretty old, circa LV4.1. The updated way of doing this
allows for more control and lots more options too.
If you have the VI
server, then what you want to do is to open a reference to the VI, then
you can either use the Call by Reference or the Run method on the VI.
If using run, then make sure to keep the reference open until the VI
completes, either in the caller, or in the callee. In otherwords, you
can either have the called VI open a reference to itself to keep it in
memory, or you can arrange for the caller to keep the reference.

When a VI has no references to it and its panel is closed, it is
automatically aborted.

Greg McKaskle
0 Kudos
Message 7 of 10
(3,501 Views)
Hi Dan,
find attached example.
If you want to wait until the "independent" vi is done executing, wire a true constant to this parameter when calling "Run VI" method.
If you want to start the "independent" VI and don't wait for it to finish, you'll need:
- a reference to itself created inside its block diagram
- a synchronization method to assure that the "independent" has enough time to create its own reference to itself, before the "main" vi closes the reference used to call it

Hope this helps

p.s: my independent VI is writing the time into c:\temp\test.txt file in order to mark the end of its execution
0 Kudos
Message 6 of 10
(3,501 Views)
> I am able to call the vi so that the FP is displayed, but when I use
> the option 'FP.Open' set to false, the vi doesn't seem to run.

After caller.vi tells callee.vi to run, it probably is closing the VI
reference. If there are no other open references, then callee.vi is
unloaded from memory. Here's what you need to do:

Caller.vi
1. Open a VI reference to callee.vi
2. Run callee.vi
3. Pause a short time (maybe 200ms)
4. Close the reference.

Then in callee.vi the FIRST THING it should do is open a VI reference
to ITSELF. This will prevent it from being unloaded when caller.vi
closes the reference. After it does everything else, callee.vi should
then close the reference to itself.

Best regards,
Brian Renken
http://www.SearchVIEW.net/
0 Kudos
Message 8 of 10
(3,501 Views)
This vi does work as described. But first, you must go into the main-02 and set the vi to be opened to "indep-02.vi" and set the fp.open property to T. Then you must add a property node before the referece-close vi (I put it in the file writing frame) in indep-02 that sets the fp.open property for its own front panel to F, prior to closing its self-reference.
jc
Mac 10.4
LV7.1
CLD
Download All
0 Kudos
Message 9 of 10
(3,501 Views)
can someone convert to 6.0 please?

Thanks, Paul
0 Kudos
Message 10 of 10
(3,501 Views)