ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spawn a process in Labview 7.1

Hello All,

I would like to learn how to launch a stand alone vi that will detach itself from the calling programso that the calling program is free to call another vi.  Can someone suggest a way to do this?

Thanx,
Karl
0 Kudos
Message 1 of 49
(5,171 Views)
The basis way to do this is to write the VI you want to launch multiple instances of and save it as a VI template (file extension *.vit). To launch multiple instances, open a reference to the template VI and use the Run VI method to start it running. Once the template is running, close the reference. Simply repeat this process for each copy you want running independently.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 49
(5,159 Views)
Hello Mike,

I have tried as you suggest and get the following error message:
Error 1000 occurred at Invoke Node in Step and Measure_Full_AUTO_V1.2.1.4.vi

LabVIEW:  The VI is not in a state compatible with this operation.

I am not sure if this refers to the calling program or the called program.

Thanx,
Karl


0 Kudos
Message 3 of 49
(5,159 Views)

Could you post your code so I can look at it?

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 49
(5,156 Views)
Sure,

Actually I neglected to use the call by reference node.  With call by reference I get the error attached
0 Kudos
Message 5 of 49
(5,154 Views)
0 Kudos
Message 6 of 49
(5,160 Views)

The problem is that you have Wait until Done set to true. This causes the code to wait until the new instantiation of the template finishes. Actually, delete both boolean constants, the default values will work fine.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 49
(5,153 Views)

Oh yes, also use the Run VI method not the call by reference. You shouldn't have them both and the call by reference won't do what you want.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 8 of 49
(5,155 Views)
Hello Mike,

I have tried this and it seems the program runs in the backround somehow.  The caller is not detached and I do not see the front pannel of the called program.

Karl
0 Kudos
Message 9 of 49
(5,145 Views)

Oh.... So you want to see the front panel too... You can either do it in your caller VI by calling the Open FP method after running the called VI. Or you can put code in the called VI to make it open its own front panel if it needs to.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 49
(5,132 Views)