From d11907dc3c47893477b41186ddba330c08d62af6 Mon Sep 17 00:00:00 2001 From: ksj09406 Date: Wed, 9 Sep 2026 18:04:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=A0=84=20=EC=85=80=EC=9D=98=20LBAD?= =?UTF-8?q?=20=ED=8C=90=EC=A0=95=EA=B0=92=EC=9D=B4=20=EB=82=A8=EC=95=84?= =?UTF-8?q?=EC=9E=88=EC=9C=BC=EB=A9=B4=20=EC=9D=B4=EB=B2=88=20=EC=85=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=8C=90=EC=A0=95=EC=9D=84=20=EB=AA=BB?= =?UTF-8?q?=ED=96=88=EC=9D=84=20=EB=95=8C=20=EA=B7=B8=EB=8C=80=EB=A1=9C=20?= =?UTF-8?q?=EC=9E=AC=EC=A0=84=EC=86=A1=EB=90=98=EB=AF=80=EB=A1=9C=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=ED=95=98=EB=8A=94=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80=20LBAD=5FJudge=20=3D=20string.Em?= =?UTF-8?q?pty;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Machines/ILSOS_KS/Sequences/SeqAutoRunKS.cs | 50 +++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/Machines/ILSOS_KS/Sequences/SeqAutoRunKS.cs b/Machines/ILSOS_KS/Sequences/SeqAutoRunKS.cs index 6a1d102..3d3b420 100644 --- a/Machines/ILSOS_KS/Sequences/SeqAutoRunKS.cs +++ b/Machines/ILSOS_KS/Sequences/SeqAutoRunKS.cs @@ -372,7 +372,7 @@ namespace ILSOS_KS.Sequences > sb[SEQ_SEND_EVENT_SENDER].Send(EVENT_TRIGGER_SAVE_FILE) > sb[SEQ_CHECK_BEFORE_OR_AFTER] > sb[SEQ_BEFORE_WELD_MOVE_OBJECT] > sb[SEQ_READY_SCANNER_LIST]); - // RCC NG인 경우 + // RCC NG인 경우 sb.Flows(sb[SEQ_BEFORE_WELD_MOVE_OBJECT] > sb[SEQ_CHECK_PAGENO]); sb.Flows(sb[SEQ_CHECK_RCC_MODE] @@ -382,11 +382,11 @@ namespace ILSOS_KS.Sequences > sb[SEQ_AFTER_WELD_CHECK_BEAD] > sb[SEQ_REQUEST_UNLOAD_CELL]); // 사전 검사 프로세스 추가 - sb.Flows(sb[SEQ_CHECK_LOAD_COMPLETE] + sb.Flows(sb[SEQ_CHECK_LOAD_COMPLETE] > sb[SEQ_KS_WAIT_VISION] //> sb[SEQ_SET_SCOUT_FLYING_VISION_SEQ] > sb[SEQ_DO_ID_SCOUT_FLYING_VISION_SEQ] > sb[SEQ_GET_SCOUT_FLYING_VISION_SEQ] - //> sb[SEQ_SEND_EVENT_SENDER].Send(EVENT_TRIGGER_SAVE_FILE) > sb[SEQ_CHECK_BEFORE_OR_AFTER] > sb[SEQ_AFTER_WELD_CHECK_BEAD] - > sb[SEQ_KS_COMPLETE_VISION] + //> sb[SEQ_SEND_EVENT_SENDER].Send(EVENT_TRIGGER_SAVE_FILE) > sb[SEQ_CHECK_BEFORE_OR_AFTER] > sb[SEQ_AFTER_WELD_CHECK_BEAD] + > sb[SEQ_KS_COMPLETE_VISION] > sb[SEQ_CHECK_PAGENO]); @@ -458,7 +458,7 @@ namespace ILSOS_KS.Sequences { _PLC.WriteBit((int)eBitOutput.PC_WELD_COMPLETE, true); Log.I(string.Format($"[PLCInterface]SET PC_WELD_COMPLETE True")); - + Thread.Sleep(200); _InterfaceStartTime = DateTime.Now; @@ -1212,7 +1212,7 @@ namespace ILSOS_KS.Sequences string directory = Path.GetDirectoryName(ExcelFile); AsyncLog.I($"{Count} SaveExcelFile.... {directory}{fileName}"); - } + } #endregion Mat matLeftTop; @@ -1761,7 +1761,7 @@ namespace ILSOS_KS.Sequences // } // nRecipeNo = _RecipeManager.ActivatedRecipe().Id; - //} + //} #endregion @@ -1796,6 +1796,10 @@ namespace ILSOS_KS.Sequences _PLC.WriteBit((int)eBitOutput.PC_LBAD_RESULT_NG, false); Log.I(string.Format($"[PLCInterface]SET PC_LBAD_RESULT_NG False")); + // 이전 셀의 LBAD 판정값이 남아있으면 이번 셀에서 판정을 못했을 때 그대로 재전송되므로 여기서 초기화한다. + Status.GetProcessingWeldingData().LBAD_Judge = string.Empty; + Log.I(string.Format($"[PLCInterface]CLEAR LBAD_Judge")); + _InterfaceStartTime = DateTime.Now; while (!context.Stopped) @@ -2285,7 +2289,7 @@ namespace ILSOS_KS.Sequences string s3 = recipeNo.ToString(); string s4 = _ModelNo.ToString(); - string LBADSendBcrId = _BcrID; + string LBADSendBcrId = _BcrID; if (LBADSendBcrId == "" || LBADSendBcrId.Equals(null)) LBADSendBcrId = T1.ToString("HHmmss"); @@ -2333,7 +2337,7 @@ namespace ILSOS_KS.Sequences double dExecuteListTime = _Scanner.GetTime(); Log.I(string.Format($"ExecuteList Time : {dExecuteListTime * 1000} msec")); - + _PLC.WriteBit((int)eBitOutput.PC_WELD_REQEUST_ACK, false); Log.I(string.Format($"[PLCInterface]SET PC_WELD_REQEUST_ACK False")); _PLC.WriteBit((int)eBitOutput.PC_WELD_READY, false); @@ -2410,7 +2414,7 @@ namespace ILSOS_KS.Sequences //return (int)Math.Round(decValue * 100m, MidpointRounding.AwayFromZero); return (int)Math.Round(decValue * 100m); } - + public static short[] IntArrayToCatShortArray(int[] intArray) { short[] shortArray = new short[intArray.Length]; @@ -2698,7 +2702,7 @@ namespace ILSOS_KS.Sequences UpdatePLCMemoryAreaRecipe((int)eWordOutput.Line_LaserPower1, recipe); - + Log.I($"Channel 0: {ResultDataList[0]}, Channel 1: {ResultDataList[1]}, Channel 2: {ResultDataList[2]}, Channel 3: {ResultDataList[3]}"); @@ -2783,8 +2787,8 @@ namespace ILSOS_KS.Sequences for (int i = 0; i < _weding.Count; i++) { // NG 일경우 - if (_weding[i] == 2) - { + if (_weding[i] == 2) + { return false; } } @@ -2821,7 +2825,7 @@ namespace ILSOS_KS.Sequences string fileName = System.IO.Path.GetFileName(fullPath); string dirPath = Path.GetDirectoryName(fullPath); - + if (!string.IsNullOrEmpty(dirPath)) { Directory.CreateDirectory(dirPath); @@ -2854,17 +2858,17 @@ namespace ILSOS_KS.Sequences // switch (_PageNoRcc) // { // case 0: if (bead_result_info.Count != 24) // 변경 -> 36 - // { - // Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); - // } + // { + // Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); + // } // break; // case 1: if (bead_result_info.Count != 21) { Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); } break; // case 2: if (bead_result_info.Count != 24) // 변경 -> 36 - // { - // Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); - // } + // { + // Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); + // } // break; // case 3: if (bead_result_info.Count != 21) { Log.I($"[INFO] WeldingInfoSendPLC: Err -> {string.Join(", ", bead_result_info)} \n Count : {bead_result_info.Count}"); } break; @@ -3042,7 +3046,7 @@ namespace ILSOS_KS.Sequences // } // // 검사 결화 화면 띠운다.. // popup.Show(); - // popup.UpdateImages1(_WeldingImage[0], new OpenCvSharp.Rect(1153, 1296, 7000, 8156)); // + // popup.UpdateImages1(_WeldingImage[0], new OpenCvSharp.Rect(1153, 1296, 7000, 8156)); // // popup.UpdateImages2(_WeldingImage[1], new OpenCvSharp.Rect(1153, 1296, 7000, 8156)); // 6918 // popup.UpdateImages3(_WeldingImage[2], new OpenCvSharp.Rect(1153, 1296, 7000, 8156)); // 6918 // popup.UpdateImages4(_WeldingImage[3], new OpenCvSharp.Rect(1153, 1296, 7000, 8156)); // 6918 @@ -3269,7 +3273,7 @@ namespace ILSOS_KS.Sequences // 필요한 값을 사용하세요 Log.I($"Channel 0: {ResultDataList[0]}, Channel 1: {ResultDataList[1]}, Channel 2: {ResultDataList[2]}, Channel 3: {ResultDataList[3]}"); } - + judgeFlag = tt.nResultFlag; Log.I(string.Format($"[LBAD] stReceiveData[0] {tt.nResultFlag} ")); @@ -3365,7 +3369,7 @@ namespace ILSOS_KS.Sequences } // 검사 결과 화면 표시 popup.Show(); - popup.UpdateImages1(_WeldingImage[0], new OpenCvSharp.Rect(1153, 896, 7000, 8156)); // + popup.UpdateImages1(_WeldingImage[0], new OpenCvSharp.Rect(1153, 896, 7000, 8156)); // popup.UpdateImages2(_WeldingImage[1], new OpenCvSharp.Rect(1153, 896, 7000, 8156)); // 6918 popup.UpdateImages3(_WeldingImage[2], new OpenCvSharp.Rect(1153, 896, 7000, 8156)); // 6918 popup.UpdateImages4(_WeldingImage[3], new OpenCvSharp.Rect(1153, 896, 7000, 8156)); // 6918