S7NetPlus / s7netplus

S7.NET+ -- A .NET library to connect to Siemens Step7 devices
MIT License
1.32k stars 586 forks source link

Select Hardware #451

Open OscarOrefice opened 1 year ago

OscarOrefice commented 1 year ago

https://github.com/S7NetPlus/s7netplus/blob/7f76d4fc5a840a52021f766d749f4cef39e1d675/S7.Net/PlcAsynchronous.cs#L49

I'm not a contributor but I propose to add the endpoint direct on the ethernet board, I use one panel PC with 3 ethernet and some times the local area address of customer it's in contrast with my machine area, if is possible to modify upper row with this suggest

TcpClient c=new TcpClient(new IPEndPoint(IPAddress.Parse("192.168.10.250"), 0);

scamille commented 1 year ago

It might be best to allow injecting a TcpClient factory. That way the user of the Plc class can decide how the TcpClient gets constructed if he needs to - like in your case.

OscarOrefice commented 1 year ago

maybe passing only the endpoint as a parameter, a small change but that adds a mode to the method