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

Labview 2014

0 Kudos
Message 11 of 30
(2,725 Views)

@D_1 wrote:

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.

 

 


 

Just as under Windows you can't put DLLs simply anywhere in your filesystem and hope for the Pharlap OS to find them. Instead you need to install a DLL into C:\ni-rt\system   !

For VS 2010 you will most likely need to install the according support in MAX for your target.

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 30
(2,705 Views)

Hei,

 

I have added Visaul Studio 2010 Runtime support 1.1 on the cRIO.  Loaded the dll into "ftp://192.168.39.21/ni-rt/system" and also specified a folder on "C:\ni-rt\system" with DLL. Below are the pictures where I marked my dll (Array_project_2.dll) and MSVCR100.dll.

 

 

Capture.JPG             Capture2.JPG

 

 

But when I try to run cRIO I get the same error: Failed to load the shared library Array_project_2.dll. Ensure that the library is present on the RT target.

 

How  is it still possible that cRIO can't found the dll? What am I missing again?

thanks for the help

0 Kudos
Message 13 of 30
(2,674 Views)

Show us the Visual C project and source files!

Rolf Kalbermatter
My Blog
0 Kudos
Message 14 of 30
(2,661 Views)

Does your DLL call look like this in the RT VI?

rtdllcall.PNG

 

The error that you are getting sounds like it's being returned from the Call Library function node and that it cannot locate the DLL.

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 15 of 30
(2,654 Views)

_________________________________________________________________

Does your DLL call look like this in the RT VI?

rtdllcall.PNG

____________________________________________________________________

 

okey, maybe here is my trivial mistake. I didn't specify the path on the diagram, but in the function (double click on to it and where the pop-up window shows -> submenu: "Librarym name or path"). I tried both ways and when I specify the path on the diagram (as shown in your picture) the programs compiles and executes, but the return value of the function is always zero. While on the PC is working properly (returns actualy non-zero number). 

 

Here is also my C file. The function has 3 inputs: the array (type:array), the  length of the array (type:int) and a random number (type:int). It looks if the random number matches the element of the array. If yes it returns me the index of the array where the value did match else it returns zero.

 

Unbenannt.PNG

 

 

 

 

0 Kudos
Message 16 of 30
(2,637 Views)

One correction: The program compiles if a external path is provided but the error 7 is present which means that  labview still can't find the dll file.

0 Kudos
Message 17 of 30
(2,625 Views)
Solution
Accepted by topic author D_1

Configuring the DLL name only in the Call Library Node should be enough. No need to define the path on the diagram.

 

I would still like to have a look at the project settings, especially the linker settings. I don't think the problem is that LabVIEW doesn't find the DLL,  rather think that the DLL is somehow compiled and/or linked in a way that it can't be loaded on the target successfully. If the loading of a DLL fails that looks the same as if the DLL is not present.

 

NOTE: Try to compile your DLL with Release!!! The debug C runtime is non-redistributable and therefore NI is legally not allowed to create a C runtime in debug mode for the RT targets and distribute it. The only way to get a legal install of the debug C runtime is by installing the Visual C IDE on the system and that is not something that will succeed on a Pharlap OS.

Rolf Kalbermatter
My Blog
Message 18 of 30
(2,593 Views)

Okey, I will try. My project is attached.

0 Kudos
Message 19 of 30
(2,581 Views)

 

Now it works!! rolfk and Craig_ thanks a ton 🙂 Compiling the DLL with release solves the issue. 

0 Kudos
Message 20 of 30
(2,547 Views)