06-22-2012 11:40 AM
Hi all,
i want to launch a subvi asynchronously. It works in LabView IDE, but not if i create an executable and include the subvi as always included doesn't work the same.
How can be possible doing this at runtime?
I get an error code 7 in error output of open vi reference block in attached pic.
Thanks in advance
06-22-2012 03:01 PM
This is why
http://digital.ni.com/public.nsf/allkb/FD7DE8BC8FFC256C862565F4006BE363
07-13-2012 09:57 AM
Thanks for the answer, but still i have problems with that.
Still i don't understand, in runtime system, the path has to be the same of the executable?
Supposing that my app is in the following location
"c:\myappdirectory\application.exe"
and the subvi i want to launch asynchronously is named "subdecode.vi"
Just to understand: in run time system, what is the correct path to pass as input
i've tried with fixed path just to be sure what i put as input with this:
"c:\myappdirectory\subdecode.vi"
but still i'm getting error 7...
What has to be the correct path to pass as input to OpenViReference ?
Thanks.
07-13-2012 10:43 AM - edited 07-13-2012 10:44 AM
The vi in question is located within the executable. You need to treat the executable as a folder for the path.
Using the example in the link snowpunter gave:
"C:\MyApplication.exe\Application.vi" would be the path for "Application.vi" that is included and compiled within "MyApplication.exe".
Since the path to a VI will be different for development and runtime, you need to account for this in your code. The first illustration in the article linked above shows this method. (personally, I use disable diagram structures with "RUNTIMEENGINE==TRUE" instead of the AppKind property)
Edit: Keep refering to that article, it's good.
07-13-2012 11:22 AM
I've done the path as in attached pics, as the application.exe is the folder in which there is the subvi, but doesn't work ...
07-13-2012 11:29 AM
Ok, sorry now it works!
i got the decode.vi in subvi folder...
so i tried to put application.exe\subvi\decode.vi and now it works!
before i put simply application.exe\decode.vi and i was wrong!
Thanks!