LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I load a dll to cRIO-908x ( OS:PharLap )

Solved!
Go to solution

Hei,

 

 I have created the dll with the Microsoft Visual studio 2010 and I want to imported to cRIO-908x. According to some documentations it is possible, but whenever I try to use it with the "call library function node"

it gives me this:

"LabVIEW:  Failed to load shared library dll_5.dll:Exampledll:C. Ensure that the library is present on the RT target. Use MAX to install NI software or FTP to transfer custom libraries to the RT target."

 

 

So, what am I missing?

 

 

 

Thanks fot the help

0 Kudos
Message 1 of 30
(6,802 Views)
Did you put the DLL on the Target?

Remember it has its own processor and hard drive!
Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 2 of 30
(6,787 Views)

No, I didn't 🙂 I try it to loaded via IP\TCP. But when I try to show the Library node where the dll is on ftp:\192.168.xx.xx\... then pop-up window (from the library function node)  doesn't allow me to save the path.

 

Is there any document or page where this is explained?

0 Kudos
Message 3 of 30
(6,773 Views)

Remember that VIs you run under an RT target execute on the target!

 

So, you can reference files on it's hard drive by using local paths like C:\somefolder\somdll.dll

 

What you need to do is:

1. Use FTP to put the DLL on the target (ftp:\192.168.xx.xx\...)

2. Run the VI on the target pointing to its local C:\ path ( C:\....)

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 4 of 30
(6,751 Views)

This is the closest document I can find that describes the process:

 

KB 3HUDA1QT http://digital.ni.com/public.nsf/allkb/2EA49B05E67DDECF86256F9A006FB315

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 5 of 30
(6,748 Views)

VS 2010 created DLLs may not be compatible with the Pharlap ETS systems as used on NI Realtime targets. The issue is mostly related to the different C runtime library that each Visual Studio C ++ release comes with.

 

The Pharlap OS provides the standard W2K MSVCRT.DLL (also used by Visual C++ 6.0) interface and NI has ported the MSVCRT 7.1 and MSVCRT 9.0 to Pharlap for support of the Visual C++ 7.1 (VS .Net 2003) and 9.0 (VS 2008) runtime.

 

A DLL compiled with Visual Studio 2010 (MSVC 10.0) will normally attempt to link to MSVCR100.DLL and that is not available on the Pharlap system. You might be able to work around that by specifying in the C compiler options of your project to compile for multithreaded runtime instead of multithreaded DLL runtime. Makes your DLL bigger but prevents the issue of depending on the C runtime DLL to be availalbe on the target system. However that doesn't always work since the C runtime of newer Visual C compilers also tends to link to WinAPIs that are only available in newer Windows versions, which often will not be available in the Pharlap WinAPI emulation.

 

You can check your DLL with one of the tools on this page to see if it imports unsupported or stub functions from the WinAPI. I still use VC 6.0 for DLLs targeted for Pharlap RT systems for exactly these reasons. 

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 30
(6,737 Views)

LabVIEW 2014 RT actually added support for the Visual Studio 2010 Runtime for PharLap targets, but I'm having trouble finding our public documentation on it (LabVIEW 2013 SP1 actually has an install option for this as well).

 

This is mentioned in the What's New in VeriStand 2014 document: http://zone.ni.com/reference/en-XX/help/372846H-01/veristand/whats_new/

 

Here's a screenshot of the RT installation window:

Visual Studio Runtime Support.png

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 7 of 30
(6,728 Views)

Good to know. I'm not on the work machine so don't have LabVIEW 2014 installed here and only saw the MSVC 9 Runtime support here.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 30
(6,717 Views)

Hei,

 

thanks for the support. So far I have done this:

 

1.Saved the dll on the cRIO, path: C:\DLL

Created also a folder on PC, path: ftp://192.168.39.21/DLL

 

Tried to run VI, the same error. 

 

2. Changed the compiler options from Multi-thread DLL to Multi-thread runtime. This creates a completly new dll on different location. Putted the new dll on cRIo and PC. Specified both the paths for it.

 

Still the same error.

 

3. Looked on cRIO to see which dll is present. Haven't found any W2K MSVCRT.DLL. So, this means that it isn't compatible with Visual C++ 6.0?  However, I found msvcp71.dll and msvcp90.dll. Below is the picture:

 

 

Capture.JPG

 

Does it then support VS .Net 2003 and VS 2008 runtime? 

 

 

0 Kudos
Message 9 of 30
(6,683 Views)

What version of LabVIEW are you using?

 

Based on your screenshot you're either:

-Using LabVIEW 2013 or older (in which case the 2010 runtime isn't supported)

-Using LabVIEW 2014 and the 2010 runtime isn't installed on the target (use the add/remove software wizard from MAX to add it)

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 10 of 30
(6,678 Views)