Click here to Skip to main content
15,904,655 members

Comments by Member 4417892 (Top 12 by date)

Member 4417892 11-Nov-11 7:07am View    
Just did :)
Member 4417892 11-Nov-11 6:02am View    
The code is as follows:

using System.Text;
using System.Windows.Forms;
using DotNetSiemensPLCToolBoxLibrary;
using DotNetSiemensPLCToolBoxLibrary.Communication;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library.Interfaces;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library.Pdus;
using DotNetSiemensPLCToolBoxLibrary.DataTypes.Blocks.Step7V5;
using DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx;
public bool Connect(string ip, int port, int rack, int slot)
{
try
{
// Thread.Sleep(2000); //Sleeps otherwise it wont connect sometimes
PLCConnectionConfiguration conf = new PLCConnectionConfiguration(); ;

conf.ConfigurationType = LibNodaveConnectionConfigurationType.RegistrySavedConfiguration;


myConn = new PLCConnection("FHA");
myConn.Connect();

return true;
}
catch (Exception e)
{
Error = e.Message;
return false;
}
}
The error comes when I am calling the Connect method in myConn.
As you see I aint touching much of XML, but I am pretty sure the error happens within the .dll where it probably uses some sort of XML for something I dont know.
Member 4417892 11-Nov-11 5:46am View    
This is where I get the error:
PLCConnection myConn = new PLCConnection("Con");
myConn.Connect();
Member 4417892 11-Nov-11 5:41am View    
I am not even reading or writing any XML, the library dll seems to cause the error when I call it functions.

I have read the whole forum thread, and also tried to see if I could implement it in my code, and I am pretty sure I can't handle it that way.
Member 4417892 2-Nov-11 4:26am View    
Stupid me!
Thanks, making it static ofcourse solved it all :)