LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Periodically call a child vi

I need to periodically call a child vi. One the first call i need to make it child and in subsequent call need to assertain if any event had occured. Basically a non blocking vi. But for a child vi, the front panel disappears once 1st execution is completed. Labview also crashes if i dont explicity close the front panel programatically. Does anyone know a way around this?
0 Kudos
Message 1 of 4
(2,732 Views)
> I need to periodically call a child vi. One the first call i need to
> make it child and in subsequent call need to assertain if any event
> had occured. Basically a non blocking vi. But for a child vi, the
> front panel disappears once 1st execution is completed. Labview also
> crashes if i dont explicity close the front panel programatically.
> Does anyone know a way around this?

We don't use the term child VI. Do you mean a subVI, or a VI whose
window has been made a child of another VI window.

Some advanced customers have use the SDK calls to reparent one VI to
another, but be aware that when LV changes certain window attributes, it
recreates the host window or HWND. This means that the reparenting can
be invalidated. This can be avoided if the VI
is reserved first, either
by making it a static subVI, or by getting its strict VI Server
reference up front. Also, as you have noticed, if you leave the windows
attached like this and LV tries to recreate its windows with new style
bits, it gets odd events from windows that it doesn't handle well.

If you are looking to make child windows, you should probably use
someone elses VIs that handle most of these details rather than starting
from scratch. Search the various web sites such as Georg Zhou's.

Greg McKaskle
0 Kudos
Message 2 of 4
(2,732 Views)
Greg,
I am actually trying to develop a shell that would call a vi dynamically and make it child to a exisiting VI. I want to call the dynamic vi, make it a child and after that periodically make calls to this vi just to see if any event has occured (just the press of a update or cancel button). I am able to make a the vi child (without any title bar, scroll bar, menu bar) and give it an appearance as if it is a part of the main application vi itself. But once vi that is currently made child completes one execution, the front panel disappears! subsequent calls dont bring up front palel. I dont know much of windows programming. But i want to make a call to the child vi approximately every 100ms. Is there a way to do it?

>>This can be avoided if the VI
is reserved first,
>>either by making it a static subVI, or by getting
>>its strict VI Server reference up front.

I will try to findout if i can get a VI server reference to a vi that needs to b called dynamically. If i get this, will the problem of front panel disappearing after 1st call be avoided?

anand.
0 Kudos
Message 3 of 4
(2,732 Views)
> it is a part of the main application vi itself. But once vi that is
> currently made child completes one execution, the front panel
> disappears! subsequent calls dont bring up front palel. I dont know
> much of windows programming. But i want to make a call to the child vi
> approximately every 100ms. Is there a way to do it?
>
>


>>
>
> I will try to findout if i can get a VI server reference to
> a vi that needs to b called dynamically. If i get this, will the
> problem of front panel disappearing after 1st call be avoided?
>

I think that getting a strict VI Server reference will force the VI into
the correct mode. As for the rest of what you describe,
this is a
windows specific topic, and it will require a bit of experience in
windows programming. As I mentioned before, you might want to look for
existing VIs that deal with the details.

Greg McKaskle
0 Kudos
Message 4 of 4
(2,732 Views)