LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT startup application with C code DLLs deployment problem

Hi!

I work with LV  8.2  at host PC and LV RT 8.2 at PXI RT 8186 controller.

I have made VI which uses some C code from one of my DLLs. For making DLL I used CVI. My VI with DLL is working good when deployed on RT directly from developer interface. So I wanted to make startup apllication out of that VI. I used build application tool (Build Specifications) at Project Manager.

Target destination directory for startup application was set as c:\ni-rt\startup.  Looking at Generate Preview before engaging build,  startup.rtexe was listed to go at c:\ni-rt\startup folder and DLL was automaticaly added through include if referenced option into  c:\ni-rt\startup\data folder.

There where no build errors and startup.rtexe was sucessfully built and saved at my procject's destination folder at my host PC. After that I tryed deploying that application at my RT target and I would get : Failled to deploy error.

When I  look at  c:\ni-rt\startup   folder on rt target, after failed deployment,  I can see application files copied (strartup.rt exe to:\ni-rt\startup, and DLL to :\ni-rt\startup\data), and also in ni-rt.ini file I can see expected changes. But when I start my PXI with that startup application it doesn't seem to work at all.

After making several different builds using different destination and support directory options for my VIs, and differently placed checkmarks under Advanced Build Application project properties,  got the same result. Every build was good, but deployment failed.

So after that, I removed DLL calls from my VI and tryed to build startup application, and got good build exe and sucsessfull deployment on RT target and application worked good.

So to summarize it:
                            - I have VI  with some C code used throgh DLL calls using Call Library Functon Node
                            - Path off DLL in that Call Library Function Node is absolute (exe: D:\monitoring\communication\myTCP.dll) at my host PC
                            - DLL is used for establishing TCP/IP communication and it is made with CVI compiler and CVI libraries
                            -I get built application without any error
                            -build automatically includes depending DLL
                            -when running startup application with DLL it doesnt seem to work good (I tryed including some write file VIs to it and it didnt write anything)
                            -when building and running startup applications without DLL calls everything works OK

Is there anything else I have to include in my build besides the dll that I am using in my VI? Has anybody have any idea how to deal with this problem?

 





0 Kudos
Message 1 of 9
(5,463 Views)

Hi PhantomMenace,

We should start by making sure that the DLL is deployable on a Real-Time system.  Here is the link to the RT DLL verifier:

http://digital.ni.com/public.nsf/allkb/0BF52E6FAC0BF9C286256EDB00015230

If you DLL checks out from there then we can continue to debug.  Have a good day.

Brian K.
0 Kudos
Message 2 of 9
(5,431 Views)
HI!

My DLL is deployable on a Real-Time System because my application works on RT when I start it directly from LV on host PC.

I run cheks on my DLL with the RT DLL verifier and got message: "Your DLL is good, but has some bad stubs."

One thing I forgot to mention is that my DLL was made (compiled for RT target) with CVI 7.1., and now I am trying to run LV startup application with it on rt target with LV RT 8.2. I know that there where some changes regarding LV CVI and CVI Run-Time Module between versions 7.1 and 8.0, but I would expect the backward compatibility. Or should I try just to recompile my dll with CVI 8.0 and see if anything happens?
0 Kudos
Message 3 of 9
(5,409 Views)

Hi PhantomMenace,

Is there a way you can make a VI that calls a single function of the DLL and nothing else?  Also could you please give the full text of the error.

As for recompiling, I don't believe you should have to.  For testing purposes it would be interesting to see if that changes anything.

Brian K.
0 Kudos
Message 4 of 9
(5,389 Views)

I'm having the EXACT same problem as the original poster in this thread.  Is there a solution to this issue?

I know my application works when directly deployed on the RT target (PXI-8186); however, I get a "failed to deploy" error after I build an RT Application which makes these external library function calls.  It seems like something is not linking up or that there's an issue in the directory structure of the RT-App and RT-OS.

I'm desperate to solve this issue ASAP as my prototype is due tomorrow and this is the final step in full deployment of the prototype.

Thanks!

-Mike

0 Kudos
Message 5 of 9
(4,589 Views)
Hi Mike,
I would try to FTP your DLL to the data folder on your RT target to ensure it is accessible when you application runs.  Also ensure your DLL is included in the source files when you are configuring your application with you project explorer. 
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 6 of 9
(4,554 Views)
Hi Mike,

When you build a CVI DLL for real-time (i.e. you selected the Real-time only option for Run-time support in the Target Settings dialog), that DLL is statically linked to cvi_lvrt.dll located in the windows\system32 directory.  This means that your DLL plus this DLL must be present on the RT target for your application to run. To get the cvi_lvrt.dll to the RT target, you can add it as a support file in your RT application. This will install the cvi_lvrt.dll to the ni-rt\startup\data directory and allow your application to load and run.

Hope this helps!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 7 of 9
(4,546 Views)
Jonathan, putting in that cvi_lvrt.dll into my support files helped a problem I was having today. This thread came up in my serch.

Now I am able to deploy, but when it does a reboot to start the startup.exe., I get an error about lvalarms.dll, it has a Missing Export 'SetProcessAffinityMask' from kernel.dll

Of course, I have a timed loop in my application and reading elsewhere this may have something to do with it. I am going to try a regular while loop to see if this helps, but in my final RT application, I will want to be using the timed loops for their priority settings.

Any thoughts,  Mike T
0 Kudos
Message 8 of 9
(4,157 Views)
Hi Mike,
You should be able to use timed loops in your final application.  I think the problem is arising from a Windows API function that is not suppoorted in the Real-Time operating system.  I would suggest using the DLL verification executables to see if your DLL is compatible with the RT-OS.  Recompiling your dll without using the "SetProcessAffinityMask" function should eliminate the error message.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 9 of 9
(4,139 Views)