diff --git a/AuroraDevices/AuroraIO/Vendor/AJINEXTEK/AjinIO.cs b/AuroraDevices/AuroraIO/Vendor/AJINEXTEK/AjinIO.cs index af71ad8..fd2a3ca 100644 --- a/AuroraDevices/AuroraIO/Vendor/AJINEXTEK/AjinIO.cs +++ b/AuroraDevices/AuroraIO/Vendor/AJINEXTEK/AjinIO.cs @@ -496,17 +496,17 @@ namespace AuroraIO.AJINEXTEK public override bool ReadDoBit(int index) { //현재 사용하지 않아서 추후 구현 - return true; + //return true; - // [추후 구현] return true 스텁 의존 코드 확인 후 아래로 교체 (ReadDiBit(int) 패턴) - //uint data = 0; - // - //int err = (int)CAXD.AxdoReadOutport(index, ref data); - //if (err != (int)AXT_FUNC_RESULT.AXT_RT_SUCCESS) - //{ - // throw new Exception(string.Format("ERR_IO_FAIL_TO_GET_BIT;ERROR CODE:{0}", err)); - //} - //return Convert.ToBoolean(data); + //[추후 구현] return true 스텁 의존 코드 확인 후 아래로 교체(ReadDiBit(int) 패턴) + uint data = 0; + + int err = (int)CAXD.AxdoReadOutport(index, ref data); + if (err != (int)AXT_FUNC_RESULT.AXT_RT_SUCCESS) + { + throw new Exception(string.Format("ERR_IO_FAIL_TO_GET_BIT;ERROR CODE:{0}", err)); + } + return Convert.ToBoolean(data); } public override bool ReadDiBit(int index) { diff --git a/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs b/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs index 1d2047e..76b0f0b 100644 --- a/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs +++ b/WeldingComponents/WeldingCommon/Views/Recipes/UCScannerObjectTeachingControlBoxViewModel.cs @@ -171,16 +171,6 @@ namespace WeldingCommon.Views private void OnMonitoring(object sender, EventArgs e) { - // Guide Beam: DI 결선 없음 → 가이드빔 제어 DO 17 명령 비트를 그대로 표시 - // (기존 _Laser.GetPilotLaserStatus()는 DO 3=GuideLaserEnable 을 봤으나, 현장 가이드빔 제어선은 DO 17) - // IO 미연결 가드는 현장PC에서 동작 안 해 주석 (개발PC에서 주석 해제) - //if (_IODevice == null || !_IODevice.IsConnected()) { - // IsGuidBeam = false; - //} else { - // IsGuidBeam = _IODevice.ReadDO(17); - //} - IsGuidBeam = _IODevice.ReadDO(17); - // [기존 소스 보존] Laser 디바이스 기반 Pilot 상태 (DO 3=GuideLaserEnable) — 일부 Laser 미구현 시 항상 false //if (_Laser.GetPilotLaserStatus()) { // IsGuidBeam = true; @@ -189,6 +179,10 @@ namespace WeldingCommon.Views //} try { + // Guide Beam: DI 결선 없음 → 가이드빔 제어 DO 17 명령 비트를 그대로 표시 + // (현장 가이드빔 제어선은 DO 17). IO 미연결 시 ReadDO 예외 → 아래 catch 에서 처리(앱 종료 방지) + IsGuidBeam = _IODevice.ReadDO(17); + // 시뮬 아님 + IO보드 없음 → _iOUnit == null → ReadDI에서 NRE로 꺼짐. - 현장PC 아닌 경우 개발PC에서 주석 해제 (시뮬안하고 레시피 들어갔을 때 프로그램 종료 방지) // IsConnected()가 _iOUnit null/미연결을 체크하므로, 미연결이면 폴링 스킵(꺼짐 방지). //if (_IODevice == null || !_IODevice.IsConnected()) @@ -210,6 +204,7 @@ namespace WeldingCommon.Views { Log.E($"[OnMonitoring] DI 읽기 실패: {ex.Message}"); IsLaserReady = false; + IsGuidBeam = false; } // TODO: PRIBAT_L1, PRIBAT_L2 는 Blow 의 상태 check 가 들어 있음. 장비 한정이므로 이를 check 하는 것을 modelItem 이나 setting 으로 빼서 진행되도록 함.