diff --git a/Machines/ILSOS_PrismaticScanner/EquipmentSetup.cs b/Machines/ILSOS_PrismaticScanner/EquipmentSetup.cs index 74d4756..9c9ce87 100644 --- a/Machines/ILSOS_PrismaticScanner/EquipmentSetup.cs +++ b/Machines/ILSOS_PrismaticScanner/EquipmentSetup.cs @@ -159,6 +159,8 @@ namespace ILSOS_PrismaticScanner () => _plc, PLCMxComponentConfig.GetDefaultConfig(), device => new UCPLCDevice() { DataContext = new UCPLCDeviceViewModel(AuroraEnv, _plc) }); + + AlarmManager.Init(AuroraEnv); #region Common에 있는 Device를 등록한다. 26.04.06 @@ -186,10 +188,62 @@ namespace ILSOS_PrismaticScanner registry.Register(MotorIds.AxisZ, () => motorZ, new ACSMotorConfig(MotorIds.AxisZ), motor => new UCACSMotor(AuroraEnv.DeviceManager, motor.DeviceId)); + + // ── 26.04.06 NDY 추가: DevGroup 적용 ────────────────────────────── + foreach (var device in registry.GetDevices()) + { + if (device.DeviceId == DeviceIds.ACS || + device.DeviceId == MotorIds.AxisX2 || + device.DeviceId == MotorIds.AxisY1 || + device.DeviceId == MotorIds.AxisY2 || + device.DeviceId == MotorIds.AxisZ) + { + device.DevGroup = "ACS"; + } + } + // ────────────────────────────────────────────────────────────────── + + // ── 26.04.06 NDY 추가: 인터락 ───────────────────────────────────── + // TODO: PLCControllerPrismaticScanner에 IsDoorOpen, IsEMO 있는지 확인 필요 - 없는 것 확인 완료 + //PLC_DOOR_INTERLOCK = 6, // ← 도어 인터락 + //PLC_EMO_STATUS = 7, // ← EMO + AddMotionInterlockCheck(_plc); + // ────────────────────────────────────────────────────────────────── #endregion } + // 인터락 + private void AddMotionInterlockCheck(PLCControllerPrismaticScanner plc) + { + var motorIds = new[] { + MotorIds.AxisX2, + MotorIds.AxisY1, + MotorIds.AxisY2, + MotorIds.AxisZ + }; + foreach (var motorId in motorIds) + { + try + { + var motor = AuroraEnv.DeviceManager[motorId] as ACSMotor; + if (motor == null) continue; + + //motor.AddInterlockCheck(("MotorInPos", + // () => !motor.ReadInposition())); + //motor.AddInterlockCheck(("IsDoorOpen", + // () => plc.ReadBit(PLCControllerPrismaticScanner.eBitInput.PLC_DOOR_INTERLOCK).data)); + //motor.AddInterlockCheck(("IsEMO", + // () => plc.ReadBit(PLCControllerPrismaticScanner.eBitInput.PLC_EMO_STATUS).data)); + + //*** 인터락은 이정인 선임께 ACSMotor에 AddInterlockCheck가 있는지 확인 후 진행 + } + catch (Exception ex) + { + Log.W($"AddMotionInterlockCheck [{motorId}] 실패: {ex.Message}"); + } + } + } public override void RegisterRecipes(RecipeRegister register) { register(CommonRecipeIds.ScannerObjectTeaching, new ScannerObjectTeachingRecipe(),