05-06-2015 11:41 AM
Labview 2014
05-06-2015 06:03 PM
@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.
05-11-2015 08:26 AM - edited 05-11-2015 08:30 AM
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.
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
05-11-2015 09:44 AM
Show us the Visual C project and source files!
05-11-2015 09:52 AM
Does your DLL call look like this in the RT VI?
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.
05-11-2015 11:20 AM - edited 05-11-2015 11:23 AM
_________________________________________________________________
Does your DLL call look like this in the RT VI?
____________________________________________________________________
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.
05-11-2015 12:13 PM
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.
05-12-2015 05:17 AM - edited 05-12-2015 05:20 AM
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.
05-12-2015 05:57 AM
Okey, I will try. My project is attached.
05-14-2015 05:02 AM
Now it works!! rolfk and Craig_ thanks a ton 🙂 Compiling the DLL with release solves the issue.