private void DisconnectBtn_Click(object sender, EventArgs e) { Client.Disconnect(); output.Text = "Disconnected"; TxtIP.Enabled = true; TxtRack.Enabled = true; TxtSlot.Enabled = true; ConnectBtn.Enabled = true; DisconnectBtn.Enabled = false; Status.Value = 0; Connected = false; }
private void CloseSockets() { //Console.WriteLine(DateTime.Now.ToLongTimeString() + " SiemensCom => CloseSockets : " + _destIP); lock (threading) { if (_s7client != null) { _s7client.Disconnect(); } _s7client = null; } Thread.Sleep(500); }