LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP- New VI function does not seem to work in Built Application

Solved!
Go to solution

My Application is designed to coordinate several (16) separate test stations from one control. The test stations can run independently. I have a Test Manager application that launches independently running Test Runner VIs when the user has selected a test to run and the conditions to run it with. There can be 0 to 16 Test Runner VIs running at any given time. Each Test Runner VI uses the same template Test Runner.VI code but is given a unique Name based on a randomly generated GUID. I use a sequence of the New VI function, VI.FP.Open and VI.Run VI to create the VI based upon the template, give it a unique name and then launch it to run independently. See JPG fragment attached.

 

This design works perfectly well when used in the LabView 2010 development environment. But it does not work when I build the Test Manager as an EXE application. There are no errors generated, but the new VI is not launched and I think that one of the functions in the sequence never returns. I am not sure if the New VI is created or not.

 

Does anyone know how to modify this so that New VIs can be created, uniquely named and launched, that will work properly no matter whether the creating VI is running in either development (for debugging) or as a built application?

 

Does the sequence New VI function, VI.FP.Open and VI.Run VI work when used in a Built application? Is there some other method that will work to serve this need?

 

Is there a function in LabView that will launch an exe file like WinExec does? Perhaps I can use that.

 

THANKS MUCH for any advice.

0 Kudos
Message 1 of 5
(2,560 Views)

Are you using any paths in your VI?

 

I do see the Application Directory in the image you posted.  Do you have other paths?

Do you use the same computer that you developed with to run the executable?

 

You can create indicators for the paths and confirm that they are okay.  Do you automatically close the front panel when closing the application?

If so, you can disable that portion of the code, re-build the code and look at the paths and any error message.

 

 


@dbaechtel wrote:

My Application is designed to coordinate several (16) separate test stations from one control. The test stations can run independently. I have a Test Manager application that launches independently running Test Runner VIs when the user has selected a test to run and the conditions to run it with. There can be 0 to 16 Test Runner VIs running at any given time. Each Test Runner VI uses the same template Test Runner.VI code but is given a unique Name based on a randomly generated GUID. I use a sequence of the New VI function, VI.FP.Open and VI.Run VI to create the VI based upon the template, give it a unique name and then launch it to run independently. See JPG fragment attached.

 

This design works perfectly well when used in the LabView 2010 development environment. But it does not work when I build the Test Manager as an EXE application. There are no errors generated, but the new VI is not launched and I think that one of the functions in the sequence never returns. I am not sure if the New VI is created or not.

 

Does anyone know how to modify this so that New VIs can be created, uniquely named and launched, that will work properly no matter whether the creating VI is running in either development (for debugging) or as a built application? You can query if it is running as an application or as development. 

 

Does the sequence New VI function, VI.FP.Open and VI.Run VI work when used in a Built application? Is there some other method that will work to serve this need?  Yes they should

 

Is there a function in LabView that will launch an exe file like WinExec does? Perhaps I can use that. Building an executable should be fine.  It's most likely something silly and you'll end up saying D'Oh! 

 

 


 

 

0 Kudos
Message 2 of 5
(2,552 Views)
Solution
Accepted by topic author dbaechtel

"New VI" is scripting.  That's why it's blue. Scripting is explicitly not accessible in runtime.

 

what you want is "Open VI Reference" on a VI that is set to re-entrant execution, with the proper options set in the VI's properties and wired to the Open VI ref node's Options input (you want 0x08 for reentrant with reserved data spaces).  You could use a .vit, but that's not what they are for.

 

Take the time to read through the help file for Open VI reference, it'll be worth it.

 

other comments:  

 

Use the fp.open method, not the property.

"Auto Dispose Ref" = True acts more like a standard VI call: LV will automatically close the ref when the called VI goes idle.

 

-Barrett
CLD
Message 3 of 5
(2,547 Views)

If I use a Open Vi Reference function instead of the New VI function I get a 1043 error when I try to VI.FP.OPEN.

This works perfectly fine in LV2010 development mode but fails in runtime.

 

How do I launch a VI pragmatically in runtime mode from a Built application exe. ?

0 Kudos
Message 4 of 5
(2,539 Views)

That is why I suggested you use the method instead of the property.

 

try the help file for fp.open (property)

 

http://zone.ni.com/reference/en-XX/help/371361G-01/lvprop/vi_fp_winopen/

-Barrett
CLD
0 Kudos
Message 5 of 5
(2,527 Views)