From 92e292f4ac970eddb3a196d4cc8f963a496c8f32 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Wed, 28 Jan 2026 18:02:14 +0100 Subject: [PATCH] improving sync --- .../Configurations/src/app_states.marte | 36 +- .../Configurations/src/data/pxi.marte | 45 ++ .../src/thread1/error_state_gams.marte | 55 -- .../src/thread1/preprogrammed_waveform.marte | 4 +- .../src/thread1/thread_data_broker.marte | 182 +++++- .../Configurations/src/thread3/datasync.marte | 590 ++++++++++++++++++ .../src/thread3/error_state_gams.marte | 44 ++ .../Configurations/src/timers.marte | 47 -- 8 files changed, 857 insertions(+), 146 deletions(-) delete mode 100644 EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/error_state_gams.marte create mode 100644 EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/datasync.marte create mode 100644 EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/error_state_gams.marte 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 3d9a46c..00bbdd2 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 @@ -6,7 +6,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM GoErrorGAM GoWaitStandbyGAM ChoiceGAM MCPSGAM GCPSGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM GoErrorGAM GoWaitStandbyGAM ChoiceGAM MCPSGAM GCPSGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -16,7 +16,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM NI6528_0_WriterGAM } + Functions = { FastTimerGAM NI6528_0_ReaderGAM HVPSsOffGAM NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -27,7 +27,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM MCPSGAM GCPSGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoDisabledGAM GoWaitReadyGAM GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM MCPSGAM GCPSGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoDisabledGAM GoWaitReadyGAM GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -37,7 +37,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM HVPSsOffGAM NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -48,7 +48,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitPermitGAM GoWaitStandbyFromReadyGAM GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitPermitGAM GoWaitStandbyFromReadyGAM GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -58,7 +58,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM HVPSsOffGAM NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -69,7 +69,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM GoWaitReadyFromWaitPermitGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitHVONGAM GoWaitHVON_PREP_GAM GoWaitHVON_SDN_GAM GoWaitHVON_SDN_PREP_GAM GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM WFRecordGAM PreProgrammedGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM GoWaitReadyFromWaitPermitGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM GoWaitHVONGAM GoWaitHVON_PREP_GAM GoWaitHVON_SDN_GAM GoWaitHVON_SDN_PREP_GAM GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -79,7 +79,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM HVPSsOffGAM NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -91,7 +91,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM FHPSSetpointGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -101,7 +101,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMRealTimeStateMachine NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMRealTimeStateMachine NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -112,7 +112,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -122,7 +122,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMSDNRealTimeStateMachine NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMSDNRealTimeStateMachine NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -133,7 +133,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM PreProgrammedGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM PreProgrammedGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -143,7 +143,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMRealTimeStateMachine NI6528_0_WriterGAM } + Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMRealTimeStateMachine NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } @@ -154,7 +154,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM CCPSWaveformGAM PreProgrammedGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } + Functions = { SyncThreadConsumerGAM StateGAM CCPSWaveformGAM PreProgrammedGAM FHPSRampupGAM ChoiceGAM EPICSOutputGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM FastStatesSync FromWaitHVONToWaitStandby FromWaitHVONToWaitPermit GoErrorGAM } CPUs = 0x100 } +Thread2 = { @@ -164,7 +164,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMSDNRealTimeStateMachine } + Functions = { FastTimerGAM NI6528_0_ReaderGAM FastEpicsInputGAM FastStopRequestGAM ModeLimitGAM GAMSDNRealTimeStateMachine SyncThreadProducerGAM } CPUs = 0x400 } } @@ -175,7 +175,7 @@ Class = ReferenceContainer +Thread1 = { Class = RealTimeThread - Functions = { Timer1kHzGAM StateGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM ExitedHVArmedInjectionRFONGAM ResetPSsGAM ResetErrorGAM ChoiceGAM EPICSOutputGAM CCPSWaveformGAM } + Functions = { SyncThreadConsumerGAM StateGAM PXI6368Error03GAM PXI6368Error04GAM PXI6259ErrorGAM PXIErrorGAM ResetErrorGAM ChoiceGAM EPICSOutputGAM CCPSWaveformGAM } // REMOVED: GoErrorGAM (redundant), FHPSSetPointGAM and FHPSRumpUpGAM // TODO: Discus about the removal CPUs = 0x100 @@ -187,7 +187,7 @@ } +Thread3 = { Class = RealTimeThread - Functions = { FastTimerGAM NI6528_0_ReaderGAM NI6528_0_WriterGAM} + Functions = { FastTimerGAM NI6528_0_ReaderGAM HVPSsOffGAM NI6528_0_WriterGAM SyncThreadProducerGAM } CPUs = 0x400 } } diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/data/pxi.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/data/pxi.marte index dd86b4f..30016b5 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/data/pxi.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/data/pxi.marte @@ -21,9 +21,15 @@ PCF_FLT_6368_ERRNO_03 = { Type = uint32 } + GYA_APS_READY = { + Type = uint8 + } GYA_APS_FLT = { Type = uint8 } + GYA_BPS_READY = { + Type = uint8 + } GYA_BPS_FLT = { Type = uint8 } @@ -36,6 +42,15 @@ MHVPS_FLT = { Type = uint8 } + MHVPS_READY = { + Type = uint8 + } + ECPC_MOD = { + Type = uint8 + } + FAST_TRIP = { + Type = uint8 + } PLC_ITL = { Type = uint8 } @@ -45,12 +60,24 @@ PLC_READY = { Type = uint8 } + PLC_ON = { + Type = uint8 + } PLC_PERMIT = { Type = uint8 } + PLC_OP_SELECTED = { + Type = uint8 + } + PLC_CC_OP_SELECTED = { + Type = uint8 + } PLC_SYNCMODE = { Type = uint8 } + TRIGGER = { + Type = uint8 + } APS_HVON = { Type = uint8 } @@ -66,6 +93,24 @@ MHVPS_HVON = { Type = uint8 } + BEAM_ON_STAT = { + Type = uint8 + } + HVARMED = { + Type = uint8 + } + HVINJECTION = { + Type = uint8 + } + RFON = { + Type = uint8 + } + ELAPSED_TIME = { + Type = uint32 + } + BEAM_ON_TIME = { + Type = uint32 + } } } +DDB3 = { diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/error_state_gams.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/error_state_gams.marte deleted file mode 100644 index ec94a85..0000000 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/error_state_gams.marte +++ /dev/null @@ -1,55 +0,0 @@ -#package jada_gyro.RTApp.Functions - -//# Reset HVPS outputs. ToDo: Fix to access NI d.s. -+ResetPSsGAM = { - Class = ConstantGAM - OutputSignals = { - MHVPS_HVON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - BPS_HVON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - BPS_SWON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - APS_HVON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - APS_SWON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - // here - } -} -//# Update status. ToDo: Fix to access NI d.s. -+ExitedHVArmedInjectionRFONGAM = { - Class = ConstantGAM - OutputSignals = { - HVARMED = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - HVINJECTION = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - RFON = { - DataSource = DDB1 - Type = uint32 - Default = 0 - } - } -} diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/preprogrammed_waveform.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/preprogrammed_waveform.marte index b5dc3a4..27af941 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/preprogrammed_waveform.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/preprogrammed_waveform.marte @@ -64,8 +64,8 @@ Type = float32 } RFON = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + DataSource = DDB1 + Type = uint8 } } OutputSignals = { diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/thread_data_broker.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/thread_data_broker.marte index 5690558..a9d35d6 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/thread_data_broker.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread1/thread_data_broker.marte @@ -4,55 +4,189 @@ +FastStatesSync = { Class = IOGAM InputSignals = { - BEAM_ON_STAT = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + PXI6528_Status_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } - HVARMED = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + GYA_APS_READY_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } - HVINJECTION = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + GYA_APS_FLT_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } - RFON = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + GYA_BPS_READY_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } - BeamONTime = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + GYA_BPS_FLT_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } - RFONTime = { - DataSource = RealTimeThreadAsyncBridge - Type = uint32 + MHVPS_OV_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + MHVPS_OC_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + MHVPS_FLT_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + MHVPS_READY_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + ECPC_MOD_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + FAST_TRIP_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_ITL_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_STANDBY_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_READY_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_ON_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_PERMIT_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_OP_SELECTED_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_CC_OP_SELECTED_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + PLC_SYNCMODE_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + TRIGGER_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + BEAM_ON_STAT_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + HVARMED_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + HVINJECTION_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + RFON_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + BEAM_ON_TIME_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } + } + RFON_TIME_SAMPLES = { + DataSource = DDB1 + Ranges = { { 0 0 } } } } OutputSignals = { + PXI6528_Status = { + DataSource = DDB1 + } + GYA_APS_READY = { + DataSource = DDB1 + } + GYA_APS_FLT = { + DataSource = DDB1 + } + GYA_BPS_READY = { + DataSource = DDB1 + } + GYA_BPS_FLT = { + DataSource = DDB1 + } + MHVPS_OV = { + DataSource = DDB1 + } + MHVPS_OC = { + DataSource = DDB1 + } + MHVPS_FLT = { + DataSource = DDB1 + } + MHVPS_READY = { + DataSource = DDB1 + } + ECPC_MOD = { + DataSource = DDB1 + } + FAST_TRIP = { + DataSource = DDB1 + } + PLC_ITL = { + DataSource = DDB1 + } + PLC_STANDBY = { + DataSource = DDB1 + } + PLC_READY = { + DataSource = DDB1 + } + PLC_ON = { + DataSource = DDB1 + } + PLC_PERMIT = { + DataSource = DDB1 + } + PLC_OP_SELECTED = { + DataSource = DDB1 + } + PLC_CC_OP_SELECTED = { + DataSource = DDB1 + } + PLC_SYNCMODE = { + DataSource = DDB1 + } + TRIGGER = { + DataSource = DDB1 + } BEAM_ON_STAT = { DataSource = DDB1 - Type = uint32 } HVARMED = { DataSource = DDB1 - Type = uint32 } HVINJECTION = { DataSource = DDB1 - Type = uint32 } RFON = { DataSource = DDB1 - Type = uint32 } ELAPSED_TIME = { DataSource = DDB1 - Type = uint32 } BEAM_ON_TIME = { DataSource = DDB1 - Type = uint32 } } } diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/datasync.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/datasync.marte new file mode 100644 index 0000000..0636cd5 --- /dev/null +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/datasync.marte @@ -0,0 +1,590 @@ +#package jada_gyro.RTApp + ++Data = { + +SynchThread = { + Class = RealTimeThreadSynchronisation + Timeout = 0xFFFFFFFF + Signals = { + PXI6528_Status = { + // PXI 6528 Board Status + Type = uint32 + } + GYA_APS_READY = { + Type = uint8 + } + GYA_APS_FLT = { + Type = uint8 + } + GYA_BPS_READY = { + Type = uint8 + } + GYA_BPS_FLT = { + Type = uint8 + } + MHVPS_OV = { + Type = uint8 + } + MHVPS_OC = { + Type = uint8 + } + MHVPS_FLT = { + Type = uint8 + } + MHVPS_READY = { + Type = uint8 + } + ECPC_MOD = { + Type = uint8 + } + FAST_TRIP = { + Type = uint8 + } + PLC_ITL = { + Type = uint8 + } + PLC_STANDBY = { + Type = uint8 + } + PLC_READY = { + Type = uint8 + } + PLC_ON = { + Type = uint8 + } + PLC_PERMIT = { + Type = uint8 + } + PLC_OP_SELECTED = { + Type = uint8 + } + PLC_CC_OP_SELECTED = { + Type = uint8 + } + PLC_SYNCMODE = { + Type = uint8 + } + TRIGGER = { + Type = uint8 + } + BEAM_ON_STAT = { + Type = uint8 + } + HVARMED = { + Type = uint8 + } + HVINJECTION = { + Type = uint8 + } + RFON = { + Type = uint8 + } + BEAM_ON_TIME = { + Type = uint32 + } + RFON_TIME = { + Type = uint32 + } + } + } + +DDB1 = { + Signals = { + PXI6528_Status_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + GYA_APS_READY_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + GYA_APS_FLT_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + GYA_BPS_READY_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + GYA_BPS_FLT_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + MHVPS_OV_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + MHVPS_OC_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + MHVPS_FLT_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + MHVPS_READY_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + ECPC_MOD_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + FAST_TRIP_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_ITL_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_STANDBY_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_READY_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_ON_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_PERMIT_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_OP_SELECTED_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_CC_OP_SELECTED_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + PLC_SYNCMODE_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + TRIGGER_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + BEAM_ON_STAT_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + HVARMED_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + HVINJECTION_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + RFON_SAMPLES = { + Type = uint8 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + BEAM_ON_TIME_SAMPLES = { + Type = uint32 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + RFON_TIME_SAMPLES = { + Type = uint32 + NumberOfElements = 20 + NumberOfDimensions = 1 + } + } + } + +DDB3 = { + Signals = { + BEAM_ON_TIME = { + Type = uint32 + } + RFON_TIME = { + Type = uint32 + } + } + } +} ++Functions = { + +SyncThreadProducerGAM = { + Class = IOGAM + InputSignals = { + PXI6528_Status = { + DataSource = DDB3 + } + GYA_APS_READY = { + DataSource = DDB3 + } + GYA_APS_FLT = { + DataSource = DDB3 + } + GYA_BPS_READY = { + DataSource = DDB3 + } + GYA_BPS_FLT = { + DataSource = DDB3 + } + MHVPS_OV = { + DataSource = DDB3 + } + MHVPS_OC = { + DataSource = DDB3 + } + MHVPS_FLT = { + DataSource = DDB3 + } + MHVPS_READY = { + DataSource = DDB3 + } + ECPC_MOD = { + DataSource = DDB3 + } + FAST_TRIP = { + DataSource = DDB3 + } + PLC_ITL = { + DataSource = DDB3 + } + PLC_STANDBY = { + DataSource = DDB3 + } + PLC_READY = { + DataSource = DDB3 + } + PLC_ON = { + DataSource = DDB3 + } + PLC_PERMIT = { + DataSource = DDB3 + } + PLC_OP_SELECTED = { + DataSource = DDB3 + } + PLC_CC_OP_SELECTED = { + DataSource = DDB3 + } + PLC_SYNCMODE = { + DataSource = DDB3 + } + TRIGGER = { + DataSource = DDB3 + } + BEAM_ON_STAT = { + DataSource = DDB3 + } + HVARMED = { + DataSource = DDB3 + } + HVINJECTION = { + DataSource = DDB3 + } + RFON = { + DataSource = DDB3 + } + BEAM_ON_TIME = { + DataSource = DDB3 + } + RFON_TIME = { + DataSource = DDB3 + } + } + OutputSignals = { + PXI6528_Status = { + DataSource = SynchThread + } + GYA_APS_READY = { + DataSource = SynchThread + } + GYA_APS_FLT = { + DataSource = SynchThread + } + GYA_BPS_READY = { + DataSource = SynchThread + } + GYA_BPS_FLT = { + DataSource = SynchThread + } + MHVPS_OV = { + DataSource = SynchThread + } + MHVPS_OC = { + DataSource = SynchThread + } + MHVPS_FLT = { + DataSource = SynchThread + } + MHVPS_READY = { + DataSource = SynchThread + } + ECPC_MOD = { + DataSource = SynchThread + } + FAST_TRIP = { + DataSource = SynchThread + } + PLC_ITL = { + DataSource = SynchThread + } + PLC_STANDBY = { + DataSource = SynchThread + } + PLC_READY = { + DataSource = SynchThread + } + PLC_ON = { + DataSource = SynchThread + } + PLC_PERMIT = { + DataSource = SynchThread + } + PLC_OP_SELECTED = { + DataSource = SynchThread + } + PLC_CC_OP_SELECTED = { + DataSource = SynchThread + } + PLC_SYNCMODE = { + DataSource = SynchThread + } + TRIGGER = { + DataSource = SynchThread + } + BEAM_ON_STAT = { + DataSource = SynchThread + } + HVARMED = { + DataSource = SynchThread + } + HVINJECTION = { + DataSource = SynchThread + } + RFON = { + DataSource = SynchThread + } + BEAM_ON_TIME = { + DataSource = SynchThread + } + RFON_TIME = { + DataSource = SynchThread + } + } + } + //# Synchronise Thread 1 to Thread 3 using SynchTread data source + //# Thread 1 will be executed every 20 cycles of Thread 3 + +SyncThreadConsumerGAM = { + Class = IOGAM + InputSignals = { + PXI6528_Status = { + DataSource = SynchThread + Samples = 20 + Frequency = 1 + } + GYA_APS_READY = { + DataSource = SynchThread + Samples = 20 + } + GYA_APS_FLT = { + DataSource = SynchThread + Samples = 20 + } + GYA_BPS_READY = { + DataSource = SynchThread + Samples = 20 + } + GYA_BPS_FLT = { + DataSource = SynchThread + Samples = 20 + } + MHVPS_OV = { + DataSource = SynchThread + Samples = 20 + } + MHVPS_OC = { + DataSource = SynchThread + Samples = 20 + } + MHVPS_FLT = { + DataSource = SynchThread + Samples = 20 + } + MHVPS_READY = { + DataSource = SynchThread + Samples = 20 + } + ECPC_MOD = { + DataSource = SynchThread + Samples = 20 + } + FAST_TRIP = { + DataSource = SynchThread + Samples = 20 + } + PLC_ITL = { + DataSource = SynchThread + Samples = 20 + } + PLC_STANDBY = { + DataSource = SynchThread + Samples = 20 + } + PLC_READY = { + DataSource = SynchThread + Samples = 20 + } + PLC_ON = { + DataSource = SynchThread + Samples = 20 + } + PLC_PERMIT = { + DataSource = SynchThread + Samples = 20 + } + PLC_OP_SELECTED = { + DataSource = SynchThread + Samples = 20 + } + PLC_CC_OP_SELECTED = { + DataSource = SynchThread + Samples = 20 + } + PLC_SYNCMODE = { + DataSource = SynchThread + Samples = 20 + } + TRIGGER = { + DataSource = SynchThread + Samples = 20 + } + BEAM_ON_STAT = { + DataSource = SynchThread + Samples = 20 + } + HVARMED = { + DataSource = SynchThread + Samples = 20 + } + HVINJECTION = { + DataSource = SynchThread + Samples = 20 + } + RFON = { + DataSource = SynchThread + Samples = 20 + } + BEAM_ON_TIME = { + DataSource = SynchThread + Samples = 20 + } + RFON_TIME = { + DataSource = SynchThread + Samples = 20 + } + } + OutputSignals = { + PXI6528_Status_SAMPLES = { + DataSource = DDB1 + } + GYA_APS_READY_SAMPLES = { + DataSource = DDB1 + } + GYA_APS_FLT_SAMPLES = { + DataSource = DDB1 + } + GYA_BPS_READY_SAMPLES = { + DataSource = DDB1 + } + GYA_BPS_FLT_SAMPLES = { + DataSource = DDB1 + } + MHVPS_OV_SAMPLES = { + DataSource = DDB1 + } + MHVPS_OC_SAMPLES = { + DataSource = DDB1 + } + MHVPS_FLT_SAMPLES = { + DataSource = DDB1 + } + MHVPS_READY_SAMPLES = { + DataSource = DDB1 + } + ECPC_MOD_SAMPLES = { + DataSource = DDB1 + } + FAST_TRIP_SAMPLES = { + DataSource = DDB1 + } + PLC_ITL_SAMPLES = { + DataSource = DDB1 + } + PLC_STANDBY_SAMPLES = { + DataSource = DDB1 + } + PLC_READY_SAMPLES = { + DataSource = DDB1 + } + PLC_ON_SAMPLES = { + DataSource = DDB1 + } + PLC_PERMIT_SAMPLES = { + DataSource = DDB1 + } + PLC_OP_SELECTED_SAMPLES = { + DataSource = DDB1 + } + PLC_CC_OP_SELECTED_SAMPLES = { + DataSource = DDB1 + } + PLC_SYNCMODE_SAMPLES = { + DataSource = DDB1 + } + TRIGGER_SAMPLES = { + DataSource = DDB1 + } + BEAM_ON_STAT_SAMPLES = { + DataSource = DDB1 + } + HVARMED_SAMPLES = { + DataSource = DDB1 + } + HVINJECTION_SAMPLES = { + DataSource = DDB1 + } + RFON_SAMPLES = { + DataSource = DDB1 + } + BEAM_ON_TIME_SAMPLES = { + DataSource = DDB1 + } + RFON_TIME_SAMPLES = { + DataSource = DDB1 + } + } + } +} diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/error_state_gams.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/error_state_gams.marte new file mode 100644 index 0000000..a799c1c --- /dev/null +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/error_state_gams.marte @@ -0,0 +1,44 @@ +#package jada_gyro.RTApp.Functions + +//# Reset HVPS outputs. ToDo: Fix to access NI d.s. ++HVPSsOffGAM = { + Class = ConstantGAM + OutputSignals = { + MHVPS_HVON = { + DataSource = DDB3 + Default = 0 + } + BPS_HVON = { + DataSource = DDB3 + Default = 0 + } + BPS_SWON = { + DataSource = DDB3 + Default = 0 + } + APS_HVON = { + DataSource = DDB3 + Default = 0 + } + APS_SWON = { + DataSource = DDB3 + Default = 0 + } + HVARMED = { + DataSource = DDB3 + Default = 0 + } + HVINJECTION = { + DataSource = DDB3 + Default = 0 + } + RFON = { + DataSource = DDB3 + Default = 0 + } + BEAM_ON_STAT = { + DataSource = DDB3 + Default = 0 + } + } +} diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/timers.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/timers.marte index c209972..8e4bc4e 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/timers.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/timers.marte @@ -1,22 +1,6 @@ #package jada_gyro.RTApp +Data = { - //# Fast cycle timer - +Timer1kHz = { - Class = LinuxTimer - SleepNature = "Busy" - SleepPercentage = 40 - ExecutionMode = RealTimeThread - CPUMask = 0x100 - Signals = { - Counter = { - Type = uint32 - } - Time = { - Type = uint32 - } - } - } //# Timer used for publsihing SDN data +TimerSDN = { Class = LinuxTimer @@ -50,16 +34,6 @@ } } // Add signals to existing ddb - +DDB1 = { - Signals = { - Time = { - Type = uint32 - } - Counter = { - Type = uint32 - } - } - } +DDB2 = { Signals = { Time = { @@ -82,27 +56,6 @@ } } +Functions = { - //# Timer for thread 1 - +Timer1kHzGAM = { - Class = IOGAM - InputSignals = { - Counter = { - DataSource = Timer1kHz - Frequency = 1000 // Hz - } - Time = { - DataSource = Timer1kHz - } - } - OutputSignals = { - Counter = { - DataSource = DDB1 - } - Time = { - DataSource = DDB1 - } - } - } //# Timer for SDN thread. +TimeSDNGAM = { Class = IOGAM