diff --git a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JAConditionalSignalUpdateGAM/JAConditionalSignalUpdateGAM.cpp b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JAConditionalSignalUpdateGAM/JAConditionalSignalUpdateGAM.cpp index b7bd23b..edba4c5 100644 --- a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JAConditionalSignalUpdateGAM/JAConditionalSignalUpdateGAM.cpp +++ b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JAConditionalSignalUpdateGAM/JAConditionalSignalUpdateGAM.cpp @@ -292,12 +292,12 @@ bool JAConditionalSignalUpdateGAM::Execute() { if (state) { needsReset = true; MARTe::uint32 i; - for (i = 0u; i < numberOfOutputSignals; ++i) { + for (i = 0u; i < numberOfOutputSignals; i++) { *outputSignals[i] = outputs[i].value; } } else { MARTe::uint32 i; - for (i = 0u; i < numberOfOutputSignals; ++i) { + for (i = 0u; i < numberOfOutputSignals; i++) { *outputSignals[i] = outputs[i].defaultValue; } } 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 0dc8563..c998fc0 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 @@ -53,7 +53,7 @@ +DANThread = { Class = RealTimeThread CPUs = @cpus_dan - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } } +ReferenceGenerationThread = { Class = RealTimeThread @@ -118,7 +118,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -187,7 +187,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -259,7 +259,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -326,7 +326,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -396,7 +396,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -458,7 +458,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -523,7 +523,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { @@ -589,7 +589,7 @@ } +DANThread = { Class = RealTimeThread - Functions = { CurrentTimeDIO, DANDIOPublisherGAM } + Functions = { WaitForDioSignals, DANDIOPublisherGAM } CPUs = @cpus_dan } +ReferenceGenerationThread = { 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 ceb47a2..4de00d5 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 @@ -539,6 +539,26 @@ } } } + + +//# PXI NI6528 Digital input datasource +//# TODO: configure it ++NI6528_1_DIO = { + Class = NI6528 + DeviceName = "/dev/pxi6528" + BoardId = 0 // TODO: check if not 1 + Signals = { + //# P5.6 O.22 PXI_FLT + DO5 = { + Type = uint8 + PortId = 5 + InversionMask = 0xFF + } + } +} + + + //# Direct HW accesses. Follwing device/port assignment must be consistent with actual wiring. //# NI6259.0 //# APS_SWON BoardId=0, PortId=3.0 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 be23154..7d155f8 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 @@ -147,7 +147,7 @@ +Event = { Class = Message Destination = StateMachine - Function = GoError + Function = GoWaitStandby } } //# Go to wait standby 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 index 9191f50..641c0f0 100644 --- 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 @@ -6,6 +6,9 @@ Class = RealTimeThreadSynchronisation Timeout = 100 Signals = { + DiTime = { + Type = uint32 + } PXI6259_Status = { Type = uint32 } @@ -146,6 +149,9 @@ +SyncThreadProducerGAM = { Class = IOGAM InputSignals = { + Time = { + DataSource = DDB3 + } PXI6259_Status = { Alias = Status DataSource = NI6259_DIO_P0 @@ -251,6 +257,9 @@ } } OutputSignals = { + DiTime = { + DataSource = SynchThread + } PXI6259_Status = { DataSource = SynchThread } diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/pxi_io_gams.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/pxi_io_gams.marte index e8d94d5..118b6d6 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/pxi_io_gams.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread3/pxi_io_gams.marte @@ -162,11 +162,26 @@ CCPS_IN_OPERATION = { DataSource = DDB3 } - PXI_FLT = { - DataSource = DDB3 - } //! implicit: Placeholder for spare output NONE_DO23 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 2 + NumberOfDimensions = 1 + Default = { 0, 0 } + } + NONE_DO5_1_Before = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 6 + NumberOfDimensions = 1 + Default = { 0, 0, 0, 0, 0, 0 } + } + PXI_FLT = { + DataSource = DDB3 + } + //! implicit: Placeholder for spare output + NONE_DO5_1_After = { DataSource = DDB3 Type = uint8 Default = 0 @@ -182,6 +197,11 @@ DO5 = { DataSource = NI6528_0_DIO } + DO5_B1 = { + Alias = DO5 + DataSource = NI6528_1_DIO + Trigger = 1 + } } } // //# INPUTs: StateMahine Value, NI6528P3Value and NI6528P4Value diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread4/adc_2_dan.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread4/adc_2_dan.marte index 6956be4..c27447f 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread4/adc_2_dan.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread4/adc_2_dan.marte @@ -130,7 +130,7 @@ } +FastAnalogDAN = { Class = "DAN::DANSource" - NumberOfBuffers = 10000 + NumberOfBuffers = 100 CPUMask = @cpus_fdan StackSize = 10000000 DanBufferMultiplier = 10000 //10s at 1kHz loop (1M with 1k samples) diff --git a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread5/dio_dan_writer.marte b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread5/dio_dan_writer.marte index c4227df..c00630a 100644 --- a/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread5/dio_dan_writer.marte +++ b/EC-GN-JA-PCF-IN/src/main/resources/qst-gyrotron-fast-controller/Configurations/src/thread5/dio_dan_writer.marte @@ -6,14 +6,161 @@ Class = GAMDataSource AllowNoProducers = 1 Signals = { - CurrTime = { - Type = uint64 + DiTime = { + Type = uint32 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PXI6528_Status = { + Type = uint32 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + GYA_APS_READY = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + GYA_APS_FLT = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + GYA_BPS_READY = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + GYA_BPS_FLT = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + MHVPS_OV = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + MHVPS_OC = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + MHVPS_FLT = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + MHVPS_READY = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + ECPC_MOD = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + FAST_TRIP = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + CRIO_RV1 = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + CRIO_RV2 = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + CRIO_RV3 = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_ITL = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_STANDBY = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_READY = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_ON = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_PERMIT = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_OP_SELECTED = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_CC_OP_SELECTED = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + PLC_SYNCMODE = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + TRIGGER = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + BEAM_ON_STAT = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + HVARMED = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + HVINJECTION = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + RFON = { + Type = uint8 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + BEAM_ON_TIME = { + Type = uint32 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 + } + RFON_TIME = { + Type = uint32 + NumberOfElements = @dan_ratio + NumberOfDimensions = 1 } } } +DANDIODataSource = { Class = "DAN::DANSource" - NumberOfBuffers = 1000 + NumberOfBuffers = 100 CPUMask = @cpus_dio StackSize = 10000000 DanBufferMultiplier = 200 //10s at 20Hz @@ -23,10 +170,9 @@ NumberOfPostTriggers = 0 Signals = { DI_Time = { - Type = uint64 + Type = uint32 TimeSignal = 1 - AbsoluteTime = 1 - TimeSignalMultiplier = 1e-9 + AbsoluteTime = 0 } PXI6528_Status = { SamplingFrequency = @fast_clock @@ -207,26 +353,17 @@ } +Functions = { - +CurrentTimeDIO = { - Class = "IOExt::SystemClockGAM" - OutputSignals = { - CurrTime = { - DataSource = DDB5 - Type = uint64 - } - } - } - +DANDIOPublisherGAM = { + +WaitForDioSignals = { Class = IOGAM InputSignals = { - Time = { - DataSource = DDB5 - Alias = CurrTime + DiTime = { + DataSource = SynchThread + Samples = @dan_ratio + Frequency = 1 } PXI6528_Status = { DataSource = SynchThread Samples = @dan_ratio - Frequency = 1 } GYA_APS_READY = { DataSource = SynchThread @@ -341,6 +478,195 @@ Samples = @dan_ratio } } + OutputSignals = { + DiTime = { + DataSource = DDB5 + } + PXI6528_Status = { + DataSource = DDB5 + } + GYA_APS_READY = { + DataSource = DDB5 + } + GYA_APS_FLT = { + DataSource = DDB5 + } + GYA_BPS_READY = { + DataSource = DDB5 + } + GYA_BPS_FLT = { + DataSource = DDB5 + } + MHVPS_OV = { + DataSource = DDB5 + } + MHVPS_OC = { + DataSource = DDB5 + } + MHVPS_FLT = { + DataSource = DDB5 + } + MHVPS_READY = { + DataSource = DDB5 + } + ECPC_MOD = { + DataSource = DDB5 + } + FAST_TRIP = { + DataSource = DDB5 + } + CRIO_RV1 = { + DataSource = DDB5 + } + CRIO_RV2 = { + DataSource = DDB5 + } + CRIO_RV3 = { + DataSource = DDB5 + } + PLC_ITL = { + DataSource = DDB5 + } + PLC_STANDBY = { + DataSource = DDB5 + } + PLC_READY = { + DataSource = DDB5 + } + PLC_ON = { + DataSource = DDB5 + } + PLC_PERMIT = { + DataSource = DDB5 + } + PLC_OP_SELECTED = { + DataSource = DDB5 + } + PLC_CC_OP_SELECTED = { + DataSource = DDB5 + } + PLC_SYNCMODE = { + DataSource = DDB5 + } + TRIGGER = { + DataSource = DDB5 + } + BEAM_ON_STAT = { + DataSource = DDB5 + } + HVARMED = { + DataSource = DDB5 + } + HVINJECTION = { + DataSource = DDB5 + } + RFON = { + DataSource = DDB5 + } + BEAM_ON_TIME = { + DataSource = DDB5 + } + RFON_TIME = { + DataSource = DDB5 + } + } + } + + +DANDIOPublisherGAM = { + Class = IOGAM + InputSignals = { + DiTime = { + DataSource = DDB5 + Ranges = {{0, 0}} + } + PXI6528_Status = { + DataSource = DDB5 + } + GYA_APS_READY = { + DataSource = DDB5 + } + GYA_APS_FLT = { + DataSource = DDB5 + } + GYA_BPS_READY = { + DataSource = DDB5 + } + GYA_BPS_FLT = { + DataSource = DDB5 + } + MHVPS_OV = { + DataSource = DDB5 + } + MHVPS_OC = { + DataSource = DDB5 + } + MHVPS_FLT = { + DataSource = DDB5 + } + MHVPS_READY = { + DataSource = DDB5 + } + ECPC_MOD = { + DataSource = DDB5 + } + FAST_TRIP = { + DataSource = DDB5 + } + CRIO_RV1 = { + DataSource = DDB5 + } + CRIO_RV2 = { + DataSource = DDB5 + } + CRIO_RV3 = { + DataSource = DDB5 + } + PLC_ITL = { + DataSource = DDB5 + } + PLC_STANDBY = { + DataSource = DDB5 + } + PLC_READY = { + DataSource = DDB5 + } + PLC_ON = { + DataSource = DDB5 + } + PLC_PERMIT = { + DataSource = DDB5 + } + PLC_OP_SELECTED = { + DataSource = DDB5 + } + PLC_CC_OP_SELECTED = { + DataSource = DDB5 + } + PLC_SYNCMODE = { + DataSource = DDB5 + } + TRIGGER = { + DataSource = DDB5 + } + BEAM_ON_STAT = { + DataSource = DDB5 + } + HVARMED = { + DataSource = DDB5 + } + HVINJECTION = { + DataSource = DDB5 + } + RFON = { + DataSource = DDB5 + } + BEAM_ON_TIME = { + DataSource = DDB5 + } + RFON_TIME = { + DataSource = DDB5 + } + } OutputSignals = { DI_Time = { DataSource = DANDIODataSource 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 940a43c..02f2cd5 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 @@ -62,11 +62,14 @@ } +DDB3 = { Signals = { + Counter = { + Type = uint32 + } Time = { Type = uint32 } - Counter = { - Type = uint32 + AbsoluteTime = { + Type = uint64 } } } @@ -107,13 +110,16 @@ +FastTimerGAM = { Class = IOGAM InputSignals = { - Time = { - DataSource = FastTimer - } Counter = { DataSource = FastTimer Frequency = @fast_clock } + Time = { + DataSource = FastTimer + } + AbsoluteTime = { + DataSource = FastTimer + } PCF_FAULT = { DataSource = Th1Bridge } @@ -122,10 +128,13 @@ } } OutputSignals = { + Counter = { + DataSource = DDB3 + } Time = { DataSource = DDB3 } - Counter = { + AbsoluteTime = { DataSource = DDB3 } PCF_FLT = {