LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to multitask a subvi?

Highlighted
LabView 5.1.1
WinNT 4.0

Hello. I'm trying to call the same VI twice hoping that it would open up 2
front panel but doesnt work. I already tried the following:

- set the reentrant
- use the Open VI Reference and then use Run VI invoke method (wait until
done=false).
- change the VI title so that it would think the window is not yet opened.

....but none of them worked. If you have any idea how to run a single VI
more than once running at the same time (hence, multitasked), could you
indicate the steps in here?

TIA
John
0 Kudos
Message 1 of 4
(1,001 Views)
John Cruz wrote:

> LabView 5.1.1
> WinNT 4.0
>
> Hello. I'm trying to call the same VI twice hoping that it would open up 2
> front panel but doesnt work. I already tried the following:
>
> - set the reentrant
> - use the Open VI Reference and then use Run VI invoke method (wait until
> done=false).
> - change the VI title so that it would think the window is not yet opened.
>
> ...but none of them worked. If you have any idea how to run a single VI
> more than once running at the same time (hence, multitasked), could you
> indicate the steps in here?
>
> TIA
> John

I beleive there is only one way to do this.
Open a reference to the VI (Test1.vi for example).
Use the invoke node Save Instrument Method
and save a copy as Test2.vi.
Invoke Test1.vi, invoke Test
2.vi
You may want to delete Test2.vi after you are done.

If you find that you want to do this all the time
with the same VI you could just save a copy and
invoke each one.
Hope this helps
Kevin Kent
Message 2 of 4
(1,001 Views)
Thanks Kevin for the tip. It worked great! The only concern I have is,
will it still be able to copy the file if it is bundled inside the
executable (through appl builder)?

John
http://www.johncruise.com

"Kevin B. Kent" wrote in message
news:38C6C099.1A9C8EE9@usa.alcatel.com...
> John Cruz wrote:
>
> > LabView 5.1.1
> > WinNT 4.0
> >
> > Hello. I'm trying to call the same VI twice hoping that it would open
up 2
> > front panel but doesnt work. I already tried the following:
> >
> > - set the reentrant
> > - use the Open VI Reference and then use Run VI invoke method (wait
until
> > done=false).
> > - change the VI title so that it would think the window is not yet
opened.
> >
> > ...but none of them worked. If you have any id
ea how to run a single VI
> > more than once running at the same time (hence, multitasked), could you
> > indicate the steps in here?
> >
> > TIA
> > John
>
> I beleive there is only one way to do this.
> Open a reference to the VI (Test1.vi for example).
> Use the invoke node Save Instrument Method
> and save a copy as Test2.vi.
> Invoke Test1.vi, invoke Test2.vi
> You may want to delete Test2.vi after you are done.
>
> If you find that you want to do this all the time
> with the same VI you could just save a copy and
> invoke each one.
> Hope this helps
> Kevin Kent
>
0 Kudos
Message 3 of 4
(1,001 Views)
John Cruz wrote:

> Thanks Kevin for the tip. It worked great! The only concern I have is,
> will it still be able to copy the file if it is bundled inside the
> executable (through appl builder)?

You can use the bundled VI as the source but (obviously) you
can not save the destination back into the EXE.
Here are some things to keep in mind
1) The path is different from development to EXE
(I believe you have to add one more level in the dir)
2) You can save the 2nd VI anywhere, but a temp dir would do nicely
3) PLEASE clean up the copied VIs when you are done
(I hate this about Windows programs)
4) Again if you only need one extra copy of 1 or 2 VIs, I would suggest
hardcoding it that way, and save yourself some trouble.
Glad I was fin
ally helpful
Kevin Kent

>
>
> John
> http://www.johncruise.com
>
>
>
> > > TIA
> > > John
> >
> > I beleive there is only one way to do this.
> > Open a reference to the VI (Test1.vi for example).
> > Use the invoke node Save Instrument Method
> > and save a copy as Test2.vi.
> > Invoke Test1.vi, invoke Test2.vi
> > You may want to delete Test2.vi after you are done.
> >
> > If you find that you want to do this all the time
> > with the same VI you could just save a copy and
> > invoke each one.
> > Hope this helps
> > Kevin Kent
> >
0 Kudos
Message 4 of 4
(1,001 Views)