From a312e4ec8acababac0c780911f4ed779762dcbcf Mon Sep 17 00:00:00 2001 From: NohDoyeon241104 Date: Thu, 18 Jun 2026 20:32:35 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=A0=88=EC=8B=9C=ED=94=BC=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20IO=20=EB=AF=B8=EC=97=B0=EA=B2=B0=20=EC=8B=9C=20null?= =?UTF-8?q?=20=EA=B0=80=EB=93=9C=20(OnMonitoring)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 시뮬 모드가 아니고 IO보드가 없으면 IODevice._iOUnit이 null이라 OnMonitoring의 ReadDI(11/15)에서 NRE 발생(현장 PC에서 레시피 메뉴 진입 시). IsConnected()로 미연결을 선검사해 폴링을 스킵, 프로그램이 꺼지지 않도록 함. Co-Authored-By: Claude Opus 4.8 --- .../UCScannerObjectTeachingControlBoxViewModel.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs b/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs index 0b86682..dd853f5 100644 --- a/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs +++ b/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs @@ -179,8 +179,14 @@ namespace WeldingCommon.Views } try { + // 시뮬 아님 + IO보드 없음 → _iOUnit == null → ReadDI에서 NRE로 꺼짐. + // IsConnected()가 _iOUnit null/미연결을 체크하므로, 미연결이면 폴링 스킵(꺼짐 방지). + if (_IODevice == null || !_IODevice.IsConnected()) + { + IsLaserReady = false; + } // 변경 후 (260618: IO 결선 변경 12&24 → 11&15) - if (_IODevice.ReadDI(11) && _IODevice.ReadDI(15)) + else if (_IODevice.ReadDI(11) && _IODevice.ReadDI(15)) { IsLaserReady = true; } @@ -188,7 +194,7 @@ namespace WeldingCommon.Views { IsLaserReady = false; } - + } catch (Exception ex) {