S7NetPlus / s7netplus

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

Connection between plc and unity #463

Open TebyanAli36 opened 1 year ago

TebyanAli36 commented 1 year ago

i do plc connection from the docummentation it work but then suddenly stpod messeging the error : plcExecption: plc is not connected.

scamille commented 1 year ago

You should check if the plc object is still connected every time before performing some operations (read/write).

The plc object is automatically disconnected if there previously was a non-recoverable exception during communication.

scamille commented 1 year ago

https://github.com/S7NetPlus/s7netplus/blob/6aa0133081048131aa269d0d5b780ec7fe01028f/S7.Net/PLC.cs#L114