From f07bcafc07356c8af31bf2211b7b3374471114c2 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Tue, 10 Feb 2026 16:08:42 +0100 Subject: [PATCH] Better Error management --- .../Configurations/src/app_states.marte | 10 +- .../src/thread1/state_management.marte | 113 +++++++++++++----- 2 files changed, 85 insertions(+), 38 deletions(-) diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/app_states.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/app_states.marte index c998fc0..e52e968 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/app_states.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/app_states.marte @@ -221,7 +221,7 @@ GoWaitHVON_PREP_GAM, GoWaitHVON_SDN_GAM, GoWaitHVON_SDN_PREP_GAM, - GoErrorGAM, + GoErrorHVGAM, ChoiceGAM, EPICSThSyncGAM, EPICSOutputGAM @@ -289,7 +289,7 @@ PXIErrorGAM, FromWaitHVONToWaitStandby, FromWaitHVONToWaitPermit, - GoErrorGAM, + GoErrorHVGAM, ChoiceGAM, EPICSThSyncGAM, EPICSOutputGAM @@ -355,7 +355,7 @@ PXIErrorGAM, FromWaitHVONToWaitStandby, FromWaitHVONToWaitPermit, - GoErrorGAM, + GoErrorHVGAM, ChoiceGAM, EPICSThSyncGAM, EPICSOutputGAM @@ -425,7 +425,7 @@ PXIErrorGAM, FromWaitHVONToWaitStandby, FromWaitHVONToWaitPermit, - GoErrorGAM, + GoErrorHVGAM, ChoiceGAM, EPICSThSyncGAM, EPICSOutputGAM @@ -487,7 +487,7 @@ PXIErrorGAM, FromWaitHVONToWaitStandby, FromWaitHVONToWaitPermit, - GoErrorGAM, + GoErrorHVGAM, ChoiceGAM, EPICSThSyncGAM, EPICSOutputGAM diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/state_management.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/state_management.marte index 7d155f8..cff2582 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/state_management.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/state_management.marte @@ -1,5 +1,6 @@ #package jada_gyro.RTApp + +Data = { +DDB1 = { Signals = { @@ -38,6 +39,31 @@ } //# From any state to Error state. +GoErrorGAM = { + Class = JAMessageGAM + Operation = "OR" + InputSignals = { + PXI_FAULT = { + DataSoruce = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 1 + } + PLC_ITL = { + DataSource = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 1 + } + } + +Event = { + Class = Message + Destination = StateMachine + Function = GoError + } + } + + //# From any state to Error state. + +GoErrorHVGAM = { Class = JAMessageGAM Operation = "OR" InputSignals = { @@ -71,6 +97,12 @@ Comparator = "EQUALS" Value = 1 } + PXI_FAULT = { + DataSource = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 1 + } MIS_ITL = { DataSource = EPICSCAInput Type = uint32 @@ -101,41 +133,11 @@ Comparator = "EQUALS" Value = 1 } - GYA_APS_FLT = { - DataSource = DDB1 + PXI_FAULT = { + DataSource = DDB1 Type = uint8 Comparator = "EQUALS" - Value = 0 - } - GYA_BPS_FLT = { - DataSource = DDB1 - Type = uint8 - Comparator = "EQUALS" - Value = 0 - } - MHVPS_OV = { - DataSource = DDB1 - Type = uint8 - Comparator = "EQUALS" - Value = 0 - } - MHVPS_OC = { - DataSource = DDB1 - Type = uint8 - Comparator = "EQUALS" - Value = 0 - } - MHVPS_FLT = { - DataSource = DDB1 - Type = uint8 - Comparator = "EQUALS" - Value = 0 - } - MIS_ITL = { - DataSource = EPICSCAInput - Type = uint32 - Comparator = "EQUALS" - Value = 0 + Value = 1 } PLC_ITL = { DataSource = DDB1 @@ -250,6 +252,12 @@ Comparator = "EQUALS" Value = 1 } + MIS_ITL = { + DataSource = EPICSCAInput + Type = uint32 + Comparator = "EQUALS" + Value = 0 + } } +Event = { Class = Message @@ -320,6 +328,19 @@ Comparator = "EQUALS" Value = 1 } + MIS_ITL = { + DataSource = EPICSCAInput + Type = uint32 + Comparator = "EQUALS" + Value = 0 + } + + PLC_ITL = { + DataSource = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 0 + } } +Event = { Class = Message @@ -378,6 +399,19 @@ Comparator = "EQUALS" Value = 1 } + MIS_ITL = { + DataSource = EPICSCAInput + Type = uint32 + Comparator = "EQUALS" + Value = 0 + } + + PLC_ITL = { + DataSource = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 0 + } } +Event = { Class = Message @@ -407,6 +441,19 @@ Comparator = "EQUALS" Value = 1 } + MIS_ITL = { + DataSource = EPICSCAInput + Type = uint32 + Comparator = "EQUALS" + Value = 0 + } + + PLC_ITL = { + DataSource = DDB1 + Type = uint8 + Comparator = "EQUALS" + Value = 0 + } } +Event = { Class = Message