LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT Startup Application: Using external DLLs

I'm having an issue deploying a start-up application on my PXI-8186 RT system under LabView 8.2.
 
I've developed a main VI and a number of sub-VIs which function perfectly in the development environment (i.e. deploy to the memory of the RT target).  This main VI and some sub-VIs call functions from 2 different custom DLLs, which I've created via CVI/LabWindows.  As I said, I know that these work perfectly under the development system.
 
I've gone through the steps of the Real-Time Application builder and created a startup.exe file.  When I aks the Project Manager to deploy this exectutable, I received a "Failed to Deploy" error.  Although no error code or information is given, I've tracked this error down to the external DLL calls.
 
My question:
 
What is the proper procedure for calling external DLLs in an RT Startup Application?  Is there a specific directory that these files muct be in?  Is there some sort of setting in the Application Builder Tool that I am missing?
 
Has anyone done this before?
 
I have tried doing a Source Distibution and setting the startup VI manually via the ni-rt.ini file on the PXI-8186, but this generated a similar error (or gave me a "bad" state, indicating a corrupted VI).  The last option I tried was to create a VI Server VI which calls the "main" VI, allowing it to run independently.  I then build this VI into a startup application, and since it doens't contain any DLL calls, it should be fine.  However, I cannot seem to get this to work either.
 
I'm against a pretty tight deadline here and would greatly appreciate any thoughts on the matter.  Thanks.
 
-Mike
 
P.S. on a separate issue, I'm having trouble getting a remote web panel loaded to control my VI... it seems to take forever.  Thoughts on this as well are appreciated.
0 Kudos
Message 1 of 6
(3,964 Views)
There are severe limitations in using VI server and external DLL in LV RT OS.
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 6
(3,956 Views)
Yes, I'm starting to figure that out, André.  It's quite strange though that it works perfectly well when deployed to memory instead of built as an application.  The "Call External Library" function works just fine unless it's deployed as a stand-alone.  This would seem to be a major bug IMO.
 
I suppose the solution is: don't use external code in LV RT for stand-alone applications.  Months of development is down the drain now.


Message Edited by mschmit on 12-10-2007 08:37 AM
0 Kudos
Message 3 of 6
(3,954 Views)
Hi Mike,

have you added the DLL as supported file? This must be done. The DLL has to be in the same directory as the executable is.
Maybe this causes the error. Well, I have never tried this with RT, but a try should it be worth.
Here you have a link for more information according to dlls. I hope they help you:
http://digital.ni.com/manuals.nsf/websearch/8D930295FFBF9F7686256D2C00624728

Greetings,
Mona


Message Edited by RMathews on 12-12-2007 10:13 AM
Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
0 Kudos
Message 4 of 6
(3,893 Views)


mschmit wrote:
Yes, I'm starting to figure that out, André.  It's quite strange though that it works perfectly well when deployed to memory instead of built as an application.  The "Call External Library" function works just fine unless it's deployed as a stand-alone.  This would seem to be a major bug IMO.
 
I suppose the solution is: don't use external code in LV RT for stand-alone applications.  Months of development is down the drain now.


Message Edited by mschmit on 12-10-2007 08:37 AM

When you deploy an executable to an RT target, LabVIEW will copy all the compiled VIs and external references to a RAM disk and execute it from there. When installing the executable however a physical exe file is copied to the target file system. If that executable makes use of DLLs you must make sure that those DLLs are also installed there. LabVIEW can usually track down external dependancies but depending on how you specified the library path it assumes that those libraries are already present on the target system, which in your case they aren't. DLLs having been specified by a full path are usually automatically tracked and added to the build, those specified only with the library name are not. Make sure you add the DLL explicitedly as support file to the build in your build specification and preferably install it in the same folder where the executable itself is.
 
Rolf Kalbermatter

 
Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 6
(3,885 Views)
I had same problem with LabView 8.5 on PXI-8106 RT.

You can copy "cvi_lvrt.dll" from "C:\Windows\system32" into directory "C:\ni-rt\system" of the target and reboot.
You can also added "cvi_lvrt.dll" into project. In this case, LabView RT application has to be configured "Run as startup" or "Set as start-up".
0 Kudos
Message 6 of 6
(3,303 Views)