diff --git a/ITC81DB_2H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs b/ITC81DB_2H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs index d4fbcc1..928c50d 100644 --- a/ITC81DB_2H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs +++ b/ITC81DB_2H/Controls/CenterEquipment/ControlCenterEquipFunctionSetting.cs @@ -536,8 +536,7 @@ namespace ITC81DB_2H.Controls foreach (FileInfo file in files) { - if (file.Name.EndsWith(".txt") == true || file.Name.EndsWith(".jpg") == true) - this.listBoxDataList.Items.Add(file.Name); + this.listBoxDataList.Items.Add(file.Name); } this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString(); @@ -679,13 +678,17 @@ namespace ITC81DB_2H.Controls } else { - after = this.labelEquipmentID.Text = myKeyPad.StringValue; + if (int.Parse(this.labelEquipmentID.Text) != myKeyPad.IntValue) + { + this.ParentForm.ParentForm.Update30000ModbusItem(); + after = this.labelEquipmentID.Text = myKeyPad.StringValue; - this.ParentForm.ParentForm.SystemConfig1.EquipmentID = myKeyPad.IntValue; - this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); + this.ParentForm.ParentForm.SystemConfig1.EquipmentID = myKeyPad.IntValue; + this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); - if (before != after) - this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.EquipmentID, "", before, after); + if (before != after) + this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.EquipmentID, "", before, after); + } } } } @@ -1115,22 +1118,10 @@ namespace ITC81DB_2H.Controls foreach (FileInfo file in files) { - if (file.Name.Contains("Exception") == false) - { - if (file.Name.EndsWith(".txt") == true || file.Name.EndsWith(".jpg") == true) - { - this.FileCopy(file, filePath + file.Name); + this.FileCopy(file, filePath + file.Name); - this.listBoxDataList.Items.Remove(file.Name); - file.Delete(); - } - //else if (file.Name.Contains("Checklog") == true) - //{ - // this.FileCopy(file, filePath + file.Name); - - // file.Delete(); - //} - } + this.listBoxDataList.Items.Remove(file.Name); + file.Delete(); } this.labelFileCount1.Text = this.listBoxDataList.Items.Count.ToString(); diff --git a/ITC81DB_2H/Forms/FormMain.cs b/ITC81DB_2H/Forms/FormMain.cs index 07fdd1a..29a30ff 100644 --- a/ITC81DB_2H/Forms/FormMain.cs +++ b/ITC81DB_2H/Forms/FormMain.cs @@ -25,8 +25,8 @@ namespace ITC81DB_2H.Forms public partial class FormMain : Form { #region Field - public static string DisplayVersion = "3.3.3"; - public static string ReleaseDate = "2024.08.06"; + public static string DisplayVersion = "3.3.4"; + public static string ReleaseDate = "2024.08.09"; private SmartSplash SmartSplashProgramLoad; public bool IsCommunicationLogOpen; @@ -5485,23 +5485,17 @@ namespace ITC81DB_2H.Forms madeData[madeDataIndex + i] = length4Value[1 - i]; break; case _30000_ModbusAddress._41_ProductName: - case _30000_ModbusAddress._42_ProductName: - case _30000_ModbusAddress._43_ProductName: - case _30000_ModbusAddress._44_ProductName: - case _30000_ModbusAddress._45_ProductName: - case _30000_ModbusAddress._46_ProductName: - case _30000_ModbusAddress._47_ProductName: - case _30000_ModbusAddress._48_ProductName: - case _30000_ModbusAddress._49_ProductName: - case _30000_ModbusAddress._50_ProductName: - for (int i = 0; i < 20; i++) + for (int i = 0; i < productName.Length; i++) madeData[madeDataIndex + i] = productName[i]; break; default: break; #endregion } - madeDataIndex += 2; + if (j == (int)_30000_ModbusAddress._41_ProductName) + madeDataIndex += 20; + else + madeDataIndex += 2; } #endregion } @@ -5892,23 +5886,17 @@ namespace ITC81DB_2H.Forms madeData[madeDataIndex + i] = length4Value[1 - i]; break; case _30000_ModbusAddress._41_ProductName: - case _30000_ModbusAddress._42_ProductName: - case _30000_ModbusAddress._43_ProductName: - case _30000_ModbusAddress._44_ProductName: - case _30000_ModbusAddress._45_ProductName: - case _30000_ModbusAddress._46_ProductName: - case _30000_ModbusAddress._47_ProductName: - case _30000_ModbusAddress._48_ProductName: - case _30000_ModbusAddress._49_ProductName: - case _30000_ModbusAddress._50_ProductName: - for (int i = 0; i < 20; i++) + for (int i = 0; i < productName.Length; i++) madeData[madeDataIndex + i] = productName[i]; break; default: break; #endregion } - madeDataIndex += 2; + if (j == (int)_30000_ModbusAddress._41_ProductName) + madeDataIndex += 20; + else + madeDataIndex += 2; } #endregion } @@ -7110,7 +7098,7 @@ namespace ITC81DB_2H.Forms if (this.IsOPCModbusUsing == false) return; - byte[] productName; + //byte[] productName; if (this.UpdateValue > 999999999) this.UpdateValue = 0; @@ -7183,18 +7171,41 @@ namespace ITC81DB_2H.Forms this.Current30000ModbusData.Speed = this.CurrentWeightData.ProductionSpeed; this.Current30000ModbusData.MetalDetectionCount = (UInt32)this.CurrentWeightData.MetalDetectionCount; this.Current30000ModbusData.DoubleEntryCount = (UInt32)this.CurrentWeightData.DoubleEntryCount; - + try { - productName = new UTF8Encoding().GetBytes(this.CurrentProductItem.Name); - for (int i = 0; i < productName.Length; i++) - this.Current30000ModbusData.ProductName[i] = productName[i]; + byte[] productName = new UTF8Encoding().GetBytes(this.CurrentProductItem.Name); + // 로그 + //if (this.IsCommunicationLogOpen == true) + //{ + // this.smartFileCommunicationLog.WriteString(string.Format("Update30000ModbusItem ({0:yyyy-MM-dd HH:mm:ss}): {1}, {2}", DateTime.Now, BitConverter.ToString(productName), productName.Length)); + //} + if (productName.Length > 20) + { + for (int i = 0; i < 20; i++) + this.Current30000ModbusData.ProductName[i] = productName[i]; + } + else + { + for (int i = 0; i < productName.Length; i++) + this.Current30000ModbusData.ProductName[i] = productName[i]; + for (int i = productName.Length; i < 20; i++) + this.Current30000ModbusData.ProductName[i] = 0x20; + } + + // 로그 + //if (this.IsCommunicationLogOpen == true) + //{ + // this.smartFileCommunicationLog.WriteString(string.Format("Update30000ModbusItem ({0:yyyy-MM-dd HH:mm:ss}): {1}, {2}", DateTime.Now, BitConverter.ToString(this.Current30000ModbusData.ProductName), this.Current30000ModbusData.ProductName.Length)); + //} } catch { - productName = new UTF8Encoding().GetBytes(this.SystemConfig1.ProductNumber.ToString() + "_Name"); + byte[] productName = new UTF8Encoding().GetBytes(this.SystemConfig1.ProductNumber.ToString() + "_Name"); for (int i = 0; i < productName.Length; i++) this.Current30000ModbusData.ProductName[i] = productName[i]; + for (int i = productName.Length; i < 20; i++) + this.Current30000ModbusData.ProductName[i] = 0x20; } this.ChildFormMainDisplay.MainModbus.UpdateData(this.Current30000ModbusData); @@ -7952,7 +7963,7 @@ namespace ITC81DB_2H.Forms cpClientThread.Start(); - this.IsUsingTimerEthernetPing(true); + //this.IsUsingTimerEthernetPing(true); } catch { @@ -8201,11 +8212,21 @@ namespace ITC81DB_2H.Forms } public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, string msg) { - this.smartTCPMultiServer.SendStringASCIIID(client.strID, msg); + if (this.smartTCPMultiServer.SendStringASCIIID(client.strID, msg) == true) + { + // 로그 + if (this.IsCommunicationLogOpen == true) + this.smartFileCommunicationLog.WriteString(string.Format("Ethernet Send ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, msg)); + } } public void EthernetServerSendMessage(SmartTCPMultiServer.CLIENTSINFOS client, byte[] bytes) { - this.smartTCPMultiServer.SendByteByClientID(client.strID, bytes); + if (this.smartTCPMultiServer.SendByteByClientID(client.strID, bytes) == true) + { + // 로그 + if (this.IsCommunicationLogOpen == true) + this.smartFileCommunicationLog.WriteString(string.Format("Ethernet Send ({0:yyyy-MM-dd HH:mm:ss}): {1}", DateTime.Now, Encoding.Default.GetString(bytes, 0, bytes.Length))); + } } #endregion diff --git a/ITC81DB_2H/Forms/FormMainDisplay.cs b/ITC81DB_2H/Forms/FormMainDisplay.cs index 9c65582..fb90987 100644 --- a/ITC81DB_2H/Forms/FormMainDisplay.cs +++ b/ITC81DB_2H/Forms/FormMainDisplay.cs @@ -672,6 +672,8 @@ namespace ITC81DB_2H.Forms value = pItem.LotNo; if (this.labelLotNo.Text != value) this.labelLotNo.Text = value; + + this.ParentForm.Update30000ModbusItem(); } public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status) { diff --git a/ITC81DB_2H/Program.cs b/ITC81DB_2H/Program.cs index 443962a..b431dd8 100644 --- a/ITC81DB_2H/Program.cs +++ b/ITC81DB_2H/Program.cs @@ -24,10 +24,9 @@ namespace ITC81DB_2H } catch (Exception ex) { - FormMain.Exception(ex); + MessageBox.Show(ex.ToString()); - DialogFormMessage myMsg = new DialogFormMessage(1); - myMsg.ShowDialog(); + FormMain.Exception(ex); } } } diff --git a/ITC81DB_2H/Version.txt b/ITC81DB_2H/Version.txt index d393da3..282df05 100644 --- a/ITC81DB_2H/Version.txt +++ b/ITC81DB_2H/Version.txt @@ -13,6 +13,14 @@ ±âº»Çü ÄÁº£¾î °íÁ¤¹Ð¼¾¼­ °è·®±â */ +@ Ver 3.3.4 by CJY + - 2024.08.09 + - Ver 3.3.3 Modify + - Program.cs : ¿¡·¯Ã¢ ¹Ù·Î ¶ç¿ì°Ô ¼öÁ¤ + - (¹ö±×¼öÁ¤)Ç°¸ñ¸í 20byte Á¦ÇÑÇϵµ·Ï ¼öÁ¤ + - (¹ö±×¼öÁ¤)±â´É¼³Á¤ Backup ´©¸£¸é ÆÄÀÏ ¸®½ºÆ® ¸ðµÎ ¹é¾÷µÇ°Ô ¼öÁ¤ + - (¹ö±×¼öÁ¤)Ç°¸ñ¸í Ç¥½ÃµÇ´Â ºÎºÐ ¹ö±× ¼öÁ¤(Transfer_22_Modbus_Read_TCP, RTU) + @ Ver 3.3.3 by CJY - 2024.08.07 - Ver 3.3.2 Modify diff --git a/ITC81DB_2H/bin/Release/ITC81DB_2H.exe b/ITC81DB_2H/bin/Release/ITC81DB_2H.exe index df196b3..1df626a 100644 Binary files a/ITC81DB_2H/bin/Release/ITC81DB_2H.exe and b/ITC81DB_2H/bin/Release/ITC81DB_2H.exe differ diff --git a/ITC81DB_2H/obj/Release/ITC81DB_2H.exe b/ITC81DB_2H/obj/Release/ITC81DB_2H.exe index df196b3..1df626a 100644 Binary files a/ITC81DB_2H/obj/Release/ITC81DB_2H.exe and b/ITC81DB_2H/obj/Release/ITC81DB_2H.exe differ