12-14-2014 06:23 AM
Hi All,
I am trying to run a vi asynchronously (at the press of a button) from a built executable. I am getting an error 7 and am not sure where I am going wrong. When I run the vi in the dev environment, it works.
I have set the vi to be always included in the build properties. and point to the builds\*.exe\data\ folder where the vi is included. (as suggested by the forums posts that I have read through)
I have attached the project that I am using, it's only a test so is a bit messy.
If anyone has any tips, I'd really appreciate it.
Thanks,
Greg
12-14-2014 08:57 AM
Hi Greg
Can you save it as LV2013
Are you back?
S
Steve
Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop
12-14-2014 09:14 AM
Greg,
One of the problems you might be having is that the path of the VI changes once it is built. Have you tried to use a property node and open the VI Reference by name. I normally use that way and it works fine to me.
12-14-2014 09:44 AM
I have fixed your problem mate, but it seems that I cannot upload files. Can you send me a private with your personal email address and I send you the code fixed.
In the end what I changed is the way you create you define the build, instead of having the VI in the data folder I defined a new destination called about, then in the source file settings I defined that the folder about must be located in the destination about, finally when you create the paths depending in the application type I made no difference.
I suppose that if you try to point to the data folder LabVIEW cannot find all the dependecines of your VI
****No need of email addresses I found the way to upload data
12-14-2014 10:08 AM
Thanks a lot Jarobit, really appreciate the help.
Had a look at the build properties and made the change to my version and worked perfectly.
Thanks,
Greg
12-14-2014 10:09 AM
Hi Steve,
Got a working answer from Jarobit.
Yip got back on Friday morning, need to try get head back into work mode now.
Cheers,
Greg
12-15-2014 03:57 AM
Another thing I have been using, if the goal is to have it asynchronous and not necessarily dynamically loaded you can use a static VI reference which then includes the VI as a proper dependency.
If you use a property node from the reference and feed it in as the name to the open reference node it avoids all of the dynamic linking trickiness.
Obviously if the goal is to dynamically load then disregard this.
12-15-2014 04:03 AM
You can also use a static link to something else that will be installed in the same directory (or a adjacent subdirectory), and then use that the get the base path for a search for the file to be dynamically loaded. That’s how I find dynamically loadable plugin classes; search based on the path of the statically-linked parent class.
12-15-2014 10:18 AM
Thanks James and James,
The static reference works but I need to pass data into the vi so running it dynamically works better.
I like that idea of having a static link and then using that to find plugins. It's not nessessary for this case but definitely will keep it in mind for the future.