Question

I have an issue with getting data from PLC to PC. I have S7-200 and CP 243-1 communication module.

I need to read data from PLC. I have read a lot about libnodave library and tried to write an app for myself for communication and downloaded sample in Vb link on template.

In my app I get exception error

Cannot download DLL "libnodave.dll". Module not found.

But in references of project I added libnodave.net.dll... I have no idea.

All my attempts failed and maybe somebody know how to use libnodave or other libraries for communication PC with PLC Siemens S7-200. Thanks in advance.

Regards.

Was it helpful?

Solution

Just a wild shot, but is the libnodave.dll a native DLL and libnodave.net.dll a wrapper for this DLL?

Then you need to make sure that libnodave.dll is found on the search path. Ideally, you copy that DLL to the output folder of your project, so that both libnodave.dll and libnodave.net.dll are in the same folder. You can do this automatically by adding the native DLL to the root of your project (not referencing it, adding it like a normal existing file), setting its build type to "none" and "copy always". This will make sure the DLL is always copied to the bin/debug or bin/release folder.

As you can not add native DLLs as references to a .NET project, chances are the developers created a .NET wrapper that can be added, but can't be used standalone. It will call functions in the native DLL by P/Invoke.


From the "link on template" page you linked:

You need copy libnodave.net.dll file in the your PC and add references in the VB.NET project properties. This implements a bridge layer between libnodave.dll and applications written in MS .Net languages.

This means that my above guess seems to be right. You need both DLLs. The page continues to say:

Also copy libnodave.dll in the same directory where is exe file is located.


PS: Please make sure to use to correct bittyness for your project. The native DLL might be 32-bit, so you might have to set the target platform from "Any CPU" to "x86" to make it work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top