void SendConnection_OnDisconnected(Core.Communication.Connection connection) { DisplayText.Color = Color.Red; // PLC object text Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection dropped for ID " + SendConnection.Id + " on IP " + SendConnection.Ip.ToString() + " and port " + SendConnection.Port.ToString(), Color.Red); SendConnection.AutoConnect = true; plcConnected = false; string obj = this.GetType().Name; if (this.GetType().Name == "MHEController_Multishuttle") { if (OnPLCStateChange != null) { OnPLCStateChange(this, new PLCStateChangeEventArgs(null, MultiShuttlePLC_State.Unknown_00)); } } else if (this.GetType().Name == "CasePLC_Datcom") //TODO change the name of this assembly { if (OnPLCStateChange != null) { OnPLCStateChange(this, new PLCStateChangeEventArgs(CasePLC_State.NotReady, null)); } //PLC_State = CasePLC_State.NotReady; } else { Log.Write("ERROR in SendConnection_OnDisconnected, cant find controller type", Color.Red); } }
protected virtual void Connection_OnConnected(Core.Communication.Connection connection) { DisplayText.Color = Color.LightGreen; // PLC object text Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection established for ID " + ControllerConnection.Id.ToString() + " on IP " + ControllerConnection.Ip.ToString() + " and port " + ControllerConnection.Port.ToString(), Color.DarkGreen); plcConnected = true; PLC_State = ATCPLCStates.Disconnected; }
protected virtual void Connection_OnDisconnected(Core.Communication.Connection connection) { DisplayText.Color = Color.Red; // PLC object text Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection dropped for ID " + ControllerConnection.Id + " on IP " + ControllerConnection.Ip.ToString() + " and port " + ControllerConnection.Port.ToString(), Color.Red); // ControllerConnection.AutoConnect = true; plcConnected = false; PLC_State = ATCPLCStates.Disconnected; }
void Connection_OnDisconnected(Core.Communication.Connection connection) { DisplayText.Color = Color.Red; // PLC object text Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection dropped for ID " + RecieveConnection.Id + " on IP " + RecieveConnection.Ip.ToString() + " and port " + RecieveConnection.Port.ToString(), Color.Red); RecieveConnection.AutoConnect = true; plcConnected = false; object obj = this.GetType(); // PLC_State = CasePLC_State.NotReady; }
void Connection_OnConnected(Core.Communication.Connection connection) { if (RecieveConnection.State == Experior.Core.Communication.State.Connected && SendConnection.State == Core.Communication.State.Connected) { DisplayText.Color = Color.LightGreen; // PLC object text Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection established for ID " + RecieveConnection.Id.ToString() + " on IP " + RecieveConnection.Ip.ToString() + " and port " + RecieveConnection.Port.ToString(), Color.DarkGreen); plcConnected = true; } else { plcConnected = false; } }
protected override void Connection_OnDisconnected(Core.Communication.Connection connection) { Experior.Core.Communication.TCPIP.Connection thisConnection = connection as Experior.Core.Communication.TCPIP.Connection; Experior.Core.Environment.Log.Write(DateTime.Now.ToString() + " " + this.Name + " connection dropped for ID " + thisConnection.Id + " on IP " + thisConnection.Ip.ToString() + " and port " + thisConnection.Port.ToString(), Color.Red); if (DespatchConnection.State == Core.Communication.State.Disconnected && ControllerConnection.State == Core.Communication.State.Disconnected) { DisplayText.Color = Color.Red; // PLC object text } else { DisplayText.Color = Color.Orange; // PLC object text } plcConnected = false; PLC_State = ATCPLCStates.Disconnected; }
protected override void Received(Core.Communication.Connection connection, string telegram) { }