diff --git a/INT_LKD_2.suo b/INT_LKD_2.suo index b130bdf..d97b845 100644 Binary files a/INT_LKD_2.suo and b/INT_LKD_2.suo differ diff --git a/INT_LKD_2/Controls/System/ControlMenuSystemEthernet.cs b/INT_LKD_2/Controls/System/ControlMenuSystemEthernet.cs index 6a434b4..a8dff5d 100644 --- a/INT_LKD_2/Controls/System/ControlMenuSystemEthernet.cs +++ b/INT_LKD_2/Controls/System/ControlMenuSystemEthernet.cs @@ -282,8 +282,7 @@ namespace INT_LKD_2.Controls { if (this.ParentForm.ParentForm.SystemConfig.ETHERNET_OP_MODE == 1) { - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(true); + this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(true); this.groupBoxModbusSetting.Visible = true; this.labelModbusRole.Text = "Slave"; @@ -294,8 +293,7 @@ namespace INT_LKD_2.Controls } else if (this.ParentForm.ParentForm.SystemConfig.ETHERNET_OP_MODE == 2) { - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(true); + this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(true); this.groupBoxModbusSetting.Visible = true; this.labelModbusRole.Text = "Master"; @@ -307,20 +305,17 @@ namespace INT_LKD_2.Controls } else { - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(false); + this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(false); this.groupBoxModbusSetting.Visible = false; } } else { - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(false); + this.ParentForm.ParentForm.ChildFormMainDisplay.MainButtonModbusAdd(false); this.groupBoxModbusSetting.Visible = false; } - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.InitialEthernetIcon(); + this.ParentForm.ParentForm.ChildFormMainDisplay.InitialEthernetIcon(); } public void DisplayRefresh() @@ -461,7 +456,6 @@ namespace INT_LKD_2.Controls this.ParentForm.ParentForm.EthernetClientDisconnect(); afterOpMode = "Client"; - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); this.labelConnectedIP.Text = "-"; @@ -479,7 +473,6 @@ namespace INT_LKD_2.Controls this.ParentForm.ParentForm.SystemConfig.ETHERNET_OP_MODE = 0; afterOpMode = "None"; - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); this.buttonStartServer.Enabled = false; @@ -602,8 +595,7 @@ namespace INT_LKD_2.Controls if (this.timerServer.Enabled != false) this.timerServer.Enabled = false; - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); + this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); } else { @@ -612,8 +604,7 @@ namespace INT_LKD_2.Controls if (this.timerServer.Enabled != true) this.timerServer.Enabled = true; - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(true); + this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(true); } this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.TryEthernetStart, "Server"); @@ -626,8 +617,7 @@ namespace INT_LKD_2.Controls if (this.labelServerStatus.Text != ">Stop") this.labelServerStatus.Text = ">Stop"; - if (this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE == 10) - this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); + this.ParentForm.ParentForm.ChildFormMainDisplay.TimerServer(false); this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.TryEthernetStop, "Server"); } private void buttonSaveServer_Click(object sender, EventArgs e) diff --git a/INT_LKD_2/DataStore/ModbusData.cs b/INT_LKD_2/DataStore/ModbusData.cs index d6e40af..99bccad 100644 --- a/INT_LKD_2/DataStore/ModbusData.cs +++ b/INT_LKD_2/DataStore/ModbusData.cs @@ -33,6 +33,10 @@ namespace INT_LKD_2 public const int _18_9_IsLeak = 3027; public const int _19_10_IsProcessing = 3028; public const int _20_10_IsLeak = 3029; + public const int _21_11_IsProcessing = 3030; + public const int _22_11_IsLeak = 3031; + public const int _23_12_IsProcessing = 3032; + public const int _24_12_IsLeak = 3033; } public class _30000_ModbusData { @@ -77,19 +81,19 @@ namespace INT_LKD_2 public void Initialization() { this.CollectionIsProcessing = new Collection(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsProcessing.Add(0); this.CollectionIsLeak = new Collection(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsLeak.Add(0); this.CollectionIsProcessingHexa = new Collection(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsProcessingHexa.Add(this.CollectionIsProcessing[i].ToString("X8")); this.CollectionIsLeakHexa = new Collection(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsLeakHexa.Add(this.CollectionIsLeak[i].ToString("X8")); } @@ -97,12 +101,12 @@ namespace INT_LKD_2 { if(this.CollectionIsProcessingHexa.Count > 0) this.CollectionIsProcessingHexa.Clear(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsProcessingHexa.Add(this.CollectionIsProcessing[i].ToString("X8")); if (this.CollectionIsLeakHexa.Count > 0) this.CollectionIsLeakHexa.Clear(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 12; i++) this.CollectionIsLeakHexa.Add(this.CollectionIsLeak[i].ToString("X8")); } #endregion diff --git a/INT_LKD_2/Forms/FormMain.cs b/INT_LKD_2/Forms/FormMain.cs index fdc8e27..5d5717f 100644 --- a/INT_LKD_2/Forms/FormMain.cs +++ b/INT_LKD_2/Forms/FormMain.cs @@ -264,43 +264,40 @@ namespace INT_LKD_2.Forms } private void DefaultSetting2() { - if (this.SystemConfig.EQUIPMENT_LANE == 10) + // 이더넷 + if (this.SystemConfig.ETHERNET_OP_MODE == 1) { - // 이더넷 - if (this.SystemConfig.ETHERNET_OP_MODE == 1) + try { - try - { - if (string.Compare(this.smartConfigs.IPSettings.DeviceIP, "0.0.0.0") != 0) - this.EthernetServerStart(); + if (string.Compare(this.smartConfigs.IPSettings.DeviceIP, "0.0.0.0") != 0) + this.EthernetServerStart(); - this.ChildFormMainDisplay.TimerServer(true); - } - catch - { - - } + this.ChildFormMainDisplay.TimerServer(true); } - else if (this.SystemConfig.ETHERNET_OP_MODE == 2) + catch { - this.EthernetClientDisconnect(); - } - if (this.SystemConfig.ETHERNET_COMM_MODE != (int)Define.E_CommMode.f0_None) - { - switch (this.SystemConfig.ETHERNET_COMM_MODE) - { - case (int)Define.E_CommMode.f1_Modbus: - this.ChildFormMainDisplay.MainButtonModbusAdd(true); - break; - default: - break; - } } - - this.ChildFormMainDisplay.InitialEthernetIcon(); } - } + else if (this.SystemConfig.ETHERNET_OP_MODE == 2) + { + this.EthernetClientDisconnect(); + } + + if (this.SystemConfig.ETHERNET_COMM_MODE != (int)Define.E_CommMode.f0_None) + { + switch (this.SystemConfig.ETHERNET_COMM_MODE) + { + case (int)Define.E_CommMode.f1_Modbus: + this.ChildFormMainDisplay.MainButtonModbusAdd(true); + break; + default: + break; + } + } + + this.ChildFormMainDisplay.InitialEthernetIcon(); + } private void InitializeUserManager() { UserManager.UserListNewDataEvent += this.UserManager_UserListNewDataEvent; @@ -4209,6 +4206,26 @@ namespace INT_LKD_2.Forms for (int i = 0; i < 2; i++) madeData[madeDataIndex + i] = length2Value[2 - i]; break; + case _30000_ModbusAddress._21_11_IsProcessing: + length2Value = GetBytes(this.Current30000ModbusData.CollectionIsProcessing[10]); + for (int i = 0; i < 2; i++) + madeData[madeDataIndex + i] = length2Value[2 - i]; + break; + case _30000_ModbusAddress._22_11_IsLeak: + length2Value = GetBytes(this.Current30000ModbusData.CollectionIsLeak[10]); + for (int i = 0; i < 2; i++) + madeData[madeDataIndex + i] = length2Value[2 - i]; + break; + case _30000_ModbusAddress._23_12_IsProcessing: + length2Value = GetBytes(this.Current30000ModbusData.CollectionIsProcessing[11]); + for (int i = 0; i < 2; i++) + madeData[madeDataIndex + i] = length2Value[2 - i]; + break; + case _30000_ModbusAddress._24_12_IsLeak: + length2Value = GetBytes(this.Current30000ModbusData.CollectionIsLeak[11]); + for (int i = 0; i < 2; i++) + madeData[madeDataIndex + i] = length2Value[2 - i]; + break; default: break; #endregion @@ -4271,12 +4288,10 @@ namespace INT_LKD_2.Forms default: break; } - this.Current30000ModbusData.CollectionIsLeak[i] = (short)this.CurrentLeakDatas[i].Judgment.Result; } - if (this.SystemConfig.EQUIPMENT_LANE == 10) - this.ChildFormMainDisplay.ChildModbus.UpdateData(this.Current30000ModbusData); + this.ChildFormMainDisplay.ChildModbus.UpdateData(this.Current30000ModbusData); //this.DelegateModbusStatus(); // 로그 @@ -4484,8 +4499,7 @@ namespace INT_LKD_2.Forms private void UIServerStatus(bool status) { - if (this.SystemConfig.EQUIPMENT_LANE == 10) - this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(status); + this.ChildFormMainDisplay.UpdateEthernetStatusDisplay(status); } public void DelegateUISeverStatus(bool status) { @@ -5900,8 +5914,7 @@ namespace INT_LKD_2.Forms #region Modbus TCP if (this.smartTCPMultiServer.ClientInfoList != null) { - if (this.SystemConfig.EQUIPMENT_LANE == 10) - this.ChildFormMainDisplay.ChildModbus.UpdateReceiveCount(); + this.ChildFormMainDisplay.ChildModbus.UpdateReceiveCount(); //Console.Write("\n" + string.Format("Receive Modbus {0:yyyy-MM-dd HH:mm:ss}: {1}", DateTime.Now, Helper.ByteToHexString(readByte))); diff --git a/INT_LKD_2/INT_LKD_2.csproj b/INT_LKD_2/INT_LKD_2.csproj index 352ec15..4beeec9 100644 --- a/INT_LKD_2/INT_LKD_2.csproj +++ b/INT_LKD_2/INT_LKD_2.csproj @@ -45,23 +45,23 @@ Off - + False - bin\Release\InModbus.dll + C:\Program Files (x86)\Intech\InModbus_V2.0.9.1\InModbus.dll False - C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\SmartX_New_5.0.0.6_IEC1000_DOTNETCF3.5수동설치파일\SmartXNCommon.dll + C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\IEC1000\SmartXNCommon.dll False - C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\SmartX_New_5.0.0.6_IEC1000_DOTNETCF3.5수동설치파일\SmartXNFDCommon.dll + C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\IEC1000\SmartXNFDCommon.dll False - C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\SmartX_New_5.0.0.6_IEC1000_DOTNETCF3.5수동설치파일\SmartXN_IEC1000.dll + C:\Program Files (x86)\HNS\Embedded SmartX Component\V5.0.0.6_20221115\IEC1000\SmartXN_IEC1000.dll @@ -421,6 +421,9 @@ + + +