I connected my PC to a Siemens PLC with S7.NET library in a C# WPF app. There is a property, isConnected. If I connect to the PLC with plc.Open() the property return value becomes true. But, If I disconnect the PLC cable, the property value still true. Why?
private void checkPlcConnection()
{
Plc plc = new Plc(CpuType.S71200, "192.168.0.1", 0, 1);
plc.Open(); // Cable was connected when method called
while(true)
{
Thread.Sleep(1000);
Trace.WriteLine(plc.IsConnected); // True, after remove the cable still true
}
}