LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a DLL from LV

Hi!

 

I have a Wrapper DLL to call it from LV. This DLL calls another DLL which is a kind of communication Server. This DLL itself searches fore some Driver DLL to communicate with different Targets. All the DLLs are strored in the same directory. I got these DLL with a Tool to test, written in C++. I also wrote a little test programm in CVI which works fine.

 

When i try to call the Wrapper DLL in LV, it is able to call the DLL which is the communication Server, but this DLL is not able to call his drivers. I get an error and don't get it running in LV. I also tried out to store all the dll in Windows\System32, but it doesn't changes anything.

 Is there some aditional configuration for an execution directory i have to configure in LV or something like that?!?

 

Best Regards, Tobias

Message 1 of 6
(3,988 Views)

Hi Tobias,

 

 

as the Wrapper DLL you are calling from LabVIEW is executed in the directroy context of the LabVIEW application (C:\program files\National Instruments\LabVIEW x.y or equivalent), you might want to try placing the DLLs into the LabVIEW folder. Alternatively, you could add the path to the dll directory to the DOS/Windows Path variable, which can be accessed through Windows' advanced system control panel.

 

Please let me know if this solves your dll calling issues.

 

Best regards,

Sebastian 

Message 2 of 6
(3,944 Views)

Hi Sebastian!

 

Storing the DLLs in the LV Directory solves the problem, but this isn't a satisfactory solution for the problem. I have to create a llb and send it to users which include the vi in Signal Express. What would happen?!? Is there any chance to set the execution path in any way?

 

Adding the Path to the Path Variable doesn't change anything. Another Solution was creating an executeable with LV, but that doesn't help me with the LLB.

 

Regards Tobias

0 Kudos
Message 3 of 6
(3,930 Views)

Hi

I guess that what you need is an Application Runpath in the registry for your toplevel application, here possibly LabVIEW.exe. If you are not familar with the term Application runpath (app path) it is similar to the environment variable "Path", but specified to one executable file name. This is done in the Registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\[Your application name, here LabVIEW.exe] and in a string variable you add with the name "Path". This variable must be set to a comma separated list of full paths that you want the application to search for dll's in. Try to look at other applications path specifications in the App Paths key, and you will get the idea. Remember that it has to be set for the TOPLEVEL application, so if your VI is to be used from e.g. TestStand, the app paths must be set for SeqEdit.exe (TestStand's editor executable name) and not LabVIEW.exe since TestStand is the top application calling a VI step through LabVIEW.exe or lvrt.dll. If you make an executable from your VI with the application builder, your must set an similar app path for your application name.

Remember to include all paths for dll's called from your VIs.

Regards

Mik

0 Kudos
Message 4 of 6
(3,904 Views)

Hi mik-dk!

 

Thanks for your Infos!

 

But that also doesn't work for my dll Problem. I think that the from the wrapper called DLL searches only the execution directory, wich is the LV oder SignalExpress Directory. Only storing the DLLs in that folder solved my problem. 😞

 

Regards Tobias

0 Kudos
Message 5 of 6
(3,871 Views)

Hi everybody,

 

I have exactly the same problem. I am sorry I cant give a solution, but I found another way to get my application running...perhaps somebody knows how to automate this: As I wrote a large application, I manage my VIs in a LabView-Project. Let's assume the whole application files are in "c:\labview" and there's also a file called "c:\labview\test.ini" (or something like that). If I now delete this file and add it again to the project before opening my main-VI, it runs without problems...if I don't do this delete - and -add -thing, it doesn't run. I couldn't figure out what I really do, or how I can do this by LabView....but perhaps somebody else knows...

 

Hope to find a solution too,

 

Greetings

 

Christian


THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 6 of 6
(3,848 Views)