LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error loading DLL using code interface node and application builder

I am using LabView 7.0 and am loading a DLL built in C.  From within the development environment everything is fine.  However when I build an executable, it must be run on the target machine in the same directory as on the development machine.  This is because the development environment "adds" the fully qualified path to the DLL (even if you put the dll name in with out the path).
 
How can I get LV to not add the dll's path and look in the application directory for the dll.  Is this a LabView 7.0 bug?
0 Kudos
Message 1 of 4
(3,094 Views)


@dpatch wrote:
I am using LabView 7.0 and am loading a DLL built in C.  From within the development environment everything is fine.  However when I build an executable, it must be run on the target machine in the same directory as on the development machine.  This is because the development environment "adds" the fully qualified path to the DLL (even if you put the dll name in with out the path).
 
How can I get LV to not add the dll's path and look in the application directory for the dll.  Is this a LabView 7.0 bug?


You do not say which version of LabVIEW you are using. But in general unless you have the DLL in one of the system locations (Windows or System32 directory) You will want to have the DLL included with your app. However LabVIEW by default will put any support files into a seperate data directory when building an application. You can override that in the build settings for your project, by specifying a different location for the DLL to be moved to when building the executable or DLL. I regularely change my DLLs to be in the executables directory instead of the data directory (and usually don't have a data directory in my applciations at all but several other ones).

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 4
(3,087 Views)
I am not sure what you meant when you said that I did not give the version of LV that I was using.  I think if you re-read you will see that I mentino it twice!  I believe the solution you mention is in a later version of LV...maybe 8.0+  However, as I mentioned, I am using version 7.0.  In this version if you enter only the DLL name in the Code Interface Node, LV will add the FQPN of the calling VI.  I believe I read that in version 8.0 you can specify the path of the DLL at run-time.  You can not do this is version 7.
0 Kudos
Message 3 of 4
(3,071 Views)


@dpatch wrote:
I am not sure what you meant when you said that I did not give the version of LV that I was using.  I think if you re-read you will see that I mentino it twice!  I believe the solution you mention is in a later version of LV...maybe 8.0+  However, as I mentioned, I am using version 7.0.  In this version if you enter only the DLL name in the Code Interface Node, LV will add the FQPN of the calling VI.  I believe I read that in version 8.0 you can specify the path of the DLL at run-time.  You can not do this is version 7.

Sorry, I must have been with my mind a little of line. Yes you said 7.0 and I have to admit that I only currently use 7.1.1. and a bit of 8.2 actively so I'm not 100% sure if this applies to 7.0 as well. I think that the DLL path feature for the CLN is actually a 8.2 feature unless you want to use obscure and unreleased features.
In LabVIEW 7.1.1 I have found that LabVIEW will NOT include DLLs that are located in the system or Windows directory when you enter just the DLL name without path and the application builder will take this into account when resaving the VIs to disk for the application distribution.
DLLs outside of this locations are a bit of a mystery sometimes. I have been successful in just entering the DLL name sometimes but in general it wants the full path and tends to autocomplete it. The application builder will then include that DLL in the build, copy it to the destination you specify (if you don't change the defaults it will go into the data directory) and then adjust for that in the build application. I thought that 7.0 wasn't really much different in that respect.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 4
(3,065 Views)