I recompiled the Snap 7 DLL's and authored a small test project using the code that was outlined in the Snap7 manual on page 85:
Using Snap7;
byte[] MyDB32 = new byte[256];
static S7Client MyClient;
static void SymplyGet()
{
MyClient = new S7Client();
MyClient.ConnectTo(“192.168.10.100”,0,2);
MyClient.DBRead(32, 0, 16, MyDB32);
MyClient = null;
}
I added the snap7.net.cs file to my project. When I go to add the snap7.dll as a reference I keep getting the same error:
A reference to "c:\users\jkelly\dev\snap7-full-1.30\snap7-full-1.3.0\build\bin\win64\snap7.dll" could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Has anyone had this problem? Up to now I have been working with Snap 7 in Linux but I need to write an app for Windows now using C#.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I recompiled the Snap 7 DLL's and authored a small test project using the code that was outlined in the Snap7 manual on page 85:
Using Snap7;
byte[] MyDB32 = new byte[256];
static S7Client MyClient;
static void SymplyGet()
{
MyClient = new S7Client();
MyClient.ConnectTo(“192.168.10.100”,0,2);
MyClient.DBRead(32, 0, 16, MyDB32);
MyClient = null;
}
I added the snap7.net.cs file to my project. When I go to add the snap7.dll as a reference I keep getting the same error:
A reference to "c:\users\jkelly\dev\snap7-full-1.30\snap7-full-1.3.0\build\bin\win64\snap7.dll" could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Has anyone had this problem? Up to now I have been working with Snap 7 in Linux but I need to write an app for Windows now using C#.
Hi James,
you don't need (but moreover cannot) add a binary dll as a reference to a .net project.
just copy snap7.dll (the correct one 32 or 64 bit) into the path of your executable.
I added a new chapter into the manual (pag.262) and online about .net environment
http://snap7.sourceforge.net/dotnet.html#key_concepts
It will work as well as under linux ;)
Let me know..