diff --git a/Configurations/RTApp-2-Uart.cfg b/Configurations/RTApp-2-Uart.cfg new file mode 100644 index 0000000..eb04748 --- /dev/null +++ b/Configurations/RTApp-2-Uart.cfg @@ -0,0 +1,395 @@ ++StateMachine = { + Class = StateMachine + +INITIAL = { + Class = ReferenceContainer + +START = { + Class = StateMachineEvent + NextState = "STATE1" + NextStateError = "ERROR" + Timeout = 0 + +ChangeToState1Msg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = State1 + } + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + } + +STATE1 = { + Class = ReferenceContainer + +GOTOSTATE2 = { + Class = StateMachineEvent + NextState = "STATE2" + NextStateError = "ERROR" + Timeout = 0 + +PrepareChangeToState2Msg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = State2 + } + } + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + +ERROR = { + Class = StateMachineEvent + NextState = "ERROR" + NextStateError = "ERROR" + } + } + +STATE2 = { + Class = ReferenceContainer + +GOTOSTATE3 = { + Class = StateMachineEvent + NextState = "STATE3" + NextStateError = "ERROR" + Timeout = 0 + +PrepareChangeToState3Msg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = State3 + } + } + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + +ERROR = { + Class = StateMachineEvent + NextState = "ERROR" + NextStateError = "ERROR" + } + } + +STATE3 = { + Class = ReferenceContainer + +GOTOSTATE1 = { + Class = StateMachineEvent + NextState = "STATE1" + NextStateError = "ERROR" + Timeout = 0 + +PrepareChangeToState1Msg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = State1 + } + } + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + +ERROR = { + Class = StateMachineEvent + NextState = "ERROR" + NextStateError = "ERROR" + } + } + +ERROR = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareChangeToErrorMsg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = StateError + } + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + +RESET = { + Class = StateMachineEvent + NextState = "STATE1" + NextStateError = "STATE1" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareChangeToState1Msg = { + Class = Message + Destination = TestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = State1 + } + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + } +} +$TestApp = { + Class = RealTimeApplication + +Functions = { + Class = ReferenceContainer + +GAMTimer = { + Class = IOGAM + InputSignals = { + Counter = { + DataSource = Timer + Type = uint32 + } + Time = { + Frequency = 2 + DataSource = Timer + Type = uint32 + } + } + OutputSignals = { + Counter = { + DataSource = DDB1 + Type = uint32 + } + Time = { + DataSource = DDB1 + Type = uint32 + } + } + } + +GAMWF1 = { + Class = WaveformGAM::WaveformPointsDef + Points = {-1000 1000} + Times = {0 10000} + InputSignals = { + Time = { + DataSource = DDB1 + Type = uint32 + } + } + OutputSignals = { + Reference1 = { + DataSource = DDB1 + Type = float32 + } + } + } + +GAMWF2 = { + Class = WaveformGAM::WaveformPointsDef + Points = {1000 -1000} + Times = {0 10000} + InputSignals = { + Time = { + DataSource = DDB1 + Type = uint32 + } + } + OutputSignals = { + Reference1 = { + DataSource = DDB1 + Type = float32 + } + } + } + +GAMWF3 = { + Class = WaveformGAM::WaveformSin + Amplitude = 10.0 + Frequency = 0.1 + Phase = 0.0 + Offset = 1.1 + InputSignals = { + Time = { + DataSource = "DDB1" + Type = uint32 + } + } + OutputSignals = { + Reference1 = { + DataSource = "DDB1" + Type = float32 + } + } + } + +GAMDisplay = { + Class = IOGAM + InputSignals = { + Time = { + DataSource = DDB1 + Type = uint32 + } + Reference1 = { + DataSource = DDB1 + Type = float32 + } + } + OutputSignals = { + Time = { + DataSource = LoggerDataSource + Type = uint32 + } + Reference1 = { + DataSource = LoggerDataSource + Type = float32 + } + } + } + +SerialOutGAM = { + Class = IOGAM + InputSignals = { + Reference1 = { + DataSource = DDB1 + Type = float32 + } + } + OutputSignals = { + SerialOut = { + DataSource = UartOutDS + Type = float32 + Trigger = 1 + } + } + } + } + +Data = { + Class = ReferenceContainer + DefaultDataSource = DDB1 + +DDB1 = { + Class = GAMDataSource + } + +LoggerDataSource = { + Class = LoggerDataSource + } + +Timings = { + Class = TimingDataSource + } + +Timer = { + Class = LinuxTimer + SleepNature = "Default" + Signals = { + Counter = { + Type = uint32 + } + Time = { + Type = uint32 + } + } + } + +UartOutDS = { + Class = UARTOutput + PortName = "/dev/ttyS0" //Name of the UART port, Mandatory + //PortName = "/dev/ttyLoopWr" //Name of the UART port, Mandatory + BaudRate = 9600 // 10.851 µs / Byte + //115200 //BAUD UART rate + Timeout = 200000 //Maximum time to wait for data + CPUMask = 8 //Affinity of the CPU of where to read data from + SerialTimeout = 1000 + Signals = { + SerialOut = { + Type = float32 //Mandatory. Only type that is supported. + OutputRange = 10.0 //Mandatory. The channel Module Output Range in volt. + } + } + } + } + +States = { + Class = ReferenceContainer + +State1 = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1 = { + Class = RealTimeThread + CPUs = 0x1 + Functions = {GAMTimer GAMWF1 SerialOutGAM GAMDisplay} + } + } + } + +State2 = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1 = { + Class = RealTimeThread + CPUs = 0x1 + Functions = {GAMTimer GAMWF2 GAMDisplay} + } + } + } + +State3 = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1 = { + Class = RealTimeThread + CPUs = 0x1 + Functions = {GAMTimer GAMWF3 GAMDisplay} + } + } + } + } + +Scheduler = { + Class = GAMScheduler + TimingDataSource = Timings + } +}