Generation working and Compilation of MARTe components

This commit is contained in:
ferrog
2025-05-13 16:03:11 +00:00
parent 3a5e378d99
commit 4faee3802a
1571 changed files with 611466 additions and 0 deletions

View File

@@ -0,0 +1,396 @@
+StateMachine = {
Class = StateMachine
+INITIAL = {
Class = ReferenceContainer
+Start = {
Class = StateMachineEvent
NextState = "WAITSTANDBY"
NextStateError = "WAITSTANDBY"
+PrepareNextStateMsg = {
Class = Message
Destination = JAGyrotronRTApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = WaitStandby
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = JAGyrotronRTApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+WAITSTANDBY = {
Class = ReferenceContainer
+Stay = {
Class = StateMachineEvent
NextState = "WAITSTANDBY"
NextStateError = "WAITSTANDBY"
+StopCurrentStateExecutionMsg = {
Class = Message
Destination = JAGyrotronRTApp
Function = StopCurrentStateExecution
Mode = ExpectsReply
}
+PrepareNextStateMsg = {
Class = Message
Destination = JAGyrotronRTApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = WaitStandby
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = JAGyrotronRTApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
}
+JAGyrotronRTApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMSDNSubCommand = {
Class = IOGAM
InputSignals = {
Command = {
DataSource = SDNSubCommands
Type = uint16
NumberOfDimensions = 1
NumberOfElements = 64
Ranges = {{0 0}}
Frequency = 1
}
ESDNTime = {
DataSource = SDNSubCommands
Type = uint32
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNTimeDisplay = {
Alias = ESDNTime
DataSource = SDNSubCommands
Type = uint32
NumberOfDimensions = 1
NumberOfElements = 1
}
}
OutputSignals = {
Command = {
DataSource = Display
Type = uint16
}
ESDNTime = {
DataSource = DDB1
Type = uint32
}
ESDNTimeDisplay = {
DataSource = Display
Type = uint32
}
}
}
+GAMSDNSubWaveform = {
Class = IOGAM
InputSignals = {
GYA_FHPS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_MCPS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_CCPS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
MHVPS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_BPS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_APS_SP = {
DataSource = SDNSubWaveform
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
WaveformPacketIDFor1kHz = {
DataSource = SDNSubWaveform
Alias = WaveformPacketID
Type = uint16
}
}
OutputSignals = {
GYA_FHPS_SP = {
DataSource = DDB1
Type = float32
}
GYA_MCPS_SP = {
DataSource = DDB1
Type = float32
}
GYA_CCPS_SP = {
DataSource = DDB1
Type = float32
}
MHVPS_SP = {
DataSource = DDB1
Type = float32
}
GYA_BPS_SP = {
DataSource = DDB1
Type = float32
}
GYA_APS_SP = {
DataSource = DDB1
Type = float32
}
WaveformPacketIDFor1kHz = {
DataSource = DDB1
Alias = WaveformPacketID
Type = uint16
}
}
}
+GAMReply = {
Class = IOGAM
InputSignals = {
ESDNTime = {
DataSource = DDB1
Type = uint32
}
WaveformPacketID = {
DataSource = DDB1
Type = uint16
}
}
OutputSignals = {
ESDNTime = {
DataSource = SDNReply
Type = uint32
Trigger = 1
}
ReplyWaveformAck = {
DataSource = SDNReply
Type = uint16
}
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = {
Class = GAMDataSource
}
+Timings = {
Class = TimingDataSource
}
+Display = {
Class = LoggerDataSource
}
+SDNSubCommands = {
Class = SDN::SDNSubscriber
Topic = ECPC2SCUJA
Interface = lo
CPUs = 0x2
Locked = 1
Timeout = 1000 // TODO: change to 1 ms
Signals = {
Header = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 48
}
ESDNHeaderVersionId = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNHeaderSize = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNStatus = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNDoNotUse = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNTime = {
Type = uint32
NumberOfDimensions = 1
NumberOfElements = 1
}
Command = {
Type = uint16
NumberOfDimensions = 1
NumberOfElements = 64
}
}
}
+SDNReply = {
Class = SDN::SDNPublisher
Topic = SCUJA2ECPC
Interface = lo
CPUs = 0x8
Locked = 1
Signals = {
Header = {
Type = uint8
NumberOfElements = 48
}
ESDNHeaderVersionId = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNHeaderSize = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNStatus = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNDoNotUse = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNTime = {
Type = uint32
NumberOfDimensions = 1
NumberOfElements = 1
}
ReplyStatus = {
Type = uint16
NumberOfDimensions = 1
NumberOfElements = 1
}
ReplyWaveformAck = {
Type = uint16
NumberOfDimensions = 1
NumberOfElements = 1
}
}
}
+SDNSubWaveform = {
Class = SDN::SDNSubscriber
Topic = ECPC2SCUJAWF
Interface = lo
Locked = 1
Timeout = 1000 // TODO: change to 1 ms
Signals = {
Header = {
Type = uint8
NumberOfElements = 48
}
ESDNHeaderVersionId = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNHeaderSize = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNStatus = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNDoNotUse = {
Type = uint8
NumberOfDimensions = 1
NumberOfElements = 1
}
ESDNTime = {
Type = uint32
NumberOfDimensions = 1
NumberOfElements = 1
}
WaveformPacketID = {
Type = uint16
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_MCPS_SP = {
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_CCPS_SP = {
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
MHVPS_SP = {
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_BPS_SP = {
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
GYA_APS_SP = {
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1
}
}
}
}
+States = {
Class = ReferenceContainer
+WaitStandby = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
Functions = {GAMSDNSubCommand GAMSDNSubWaveform GAMReply}
CPUs = 0x1
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}

View File

@@ -0,0 +1,249 @@
// +LoggerService = {
// Class = LoggerService
// CPUs = 0x1
// StackSize = 32768
// NumberOfLogPages = 128
// +ConLogger = {
// Class = ConsoleLogger
// Format = "EtOoFmC"
// PrintKeys = 1
// }
// }
+StateMachine = {
Class = StateMachine
+INITIAL = {
Class = ReferenceContainer
+START = {
Class = StateMachineEvent
NextState = "RUNNING"
NextStateError = "ERROR"
+PrepareNextStateOnOurRTApp = {
Class = Message
Destination = MyDemoApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = State1
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MyDemoApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+RUNNING = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = RUNNING
NextStateError = ERROR
}
}
+ERROR = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = ERROR
NextStateError = ERROR
}
}
}
+MyDemoApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = Timer
Type = uint32
}
Counter = {
DataSource = Timer
Type = uint32
Frequency = 1 //in Hz. Cycle for one state execution.
}
RTThreadPerf = {
DataSource = Timings
Alias = "State1.Thread1_CycleTime"
Type = uint32
}
}
OutputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
Counter = {
DataSource = DDB1
Type = uint32
}
RTThreadPerf = {
DataSource = DDB1
Type = uint32
}
}
}
+PV2DDB1 = {
Class = IOGAM
InputSignals = {
AiValue = {
DataSource = EPICSCAInput
Type = float32
}
LongInValue = {
DataSource = EPICSCAInput
Type = uint32
}
StringInValue = {
DataSource = EPICSCAInput
Type = char8
NumberOfElements = 40
}
}
OutputSignals = {
AValue = {
DataSource = DDB1
Type = float32
}
LValue = {
DataSource = DDB1
Type = uint32
}
SValue = {
DataSource = DDB1
Type = char8
NumberOfElements = 40
}
}
}
+DDB12PV = {
Class = IOGAM
InputSignals = {
AValue = {
DataSource = DDB1
Type = float32
}
LValue = {
DataSource = DDB1
Type = uint32
}
SValue = {
DataSource = DDB1
Type = char8
NumberOfElements = 40
}
}
OutputSignals = {
AoValue = {
DataSource = EPICSCAOutput
Type = float32
}
LongOutValue = {
DataSource = EPICSCAOutput
Type = uint32
}
StringOutValue = {
DataSource = EPICSCAOutput
Type = char8
NumberOfElements = 40
}
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = {
Class = GAMDataSource
}
+Timer = {
Class = LinuxTimer
SleepNature = "Busy"
SleepPercentage = 0
ExecutionMode = RealTimeThread
CPUMask = 0x1
Signals = {
Counter = {
Type = uint32
}
Time = {
Type = uint32
}
}
}
+EPICSCAInput = {
//Class = "EPICSCA::EPICSCAInput"
Class = "JAEPICSCA::JAEPICSCAInput"
CPUMask = "1"
StackSize = "10000000"
Signals = {
AiValue = {
PVName = "ai"
Type = float32
}
LongInValue = {
PVName = "longin"
Type = uint32
}
StringInValue = {
PVName = "stringin"
Type = char8
NumberOfElements = 40
}
}
}
+EPICSCAOutput = {
//Class = "EPICSCA::EPICSCAOutput"
Class = "JAEPICSCA::JAEPICSCAOutput"
CPUMask = "1"
StackSize = "10000000"
NumberOfBuffers = 2
Signals = {
AoValue = {
PVName = "ao"
Type = float32
}
LongOutValue = {
PVName = "longout"
Type = uint32
}
StringOutValue = {
PVName = "stringout"
Type = char8
NumberOfElements = 40
}
}
}
+Display = {
Class = LoggerDataSource
}
+Timings = {
Class = TimingDataSource
}
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
Functions = {GAMTimer PV2DDB1 DDB12PV}
CPUMask = 0x1
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}

View File

@@ -0,0 +1,18 @@
record(longin, longin){
field(SCAN, "Passive")
}
record(longout, longout){
field(SCAN, "Passive")
}
record(ai, ai){
field(SCAN, "Passive")
}
record(ao, ao){
field(SCAN, "Passive")
}
record(stringin, stringin){
field(SCAN, "Passive")
}
record(stringout, stringout){
field(SCAN, "Passive")
}

View File

@@ -0,0 +1,257 @@
### The board on the Right Side Slots
# NI6259 P0 PVs
record(bo, "ni6259:d1:p0:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d1:p0:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
#NI6528 P3 PVs
record(bo, "ni6528:d1:p3:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p3:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
#NI6528 P4 PVs
record(bo, "ni6528:d1:p4:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d1:p4:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
### Left Side Slots
# NI6259 P0 PVs
record(bo, "ni6259:d0:p0:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6259:d0:p0:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
#NI6528 P3 PVs
record(bo, "ni6528:d0:p3:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p3:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
#NI6528 P4 PVs
record(bo, "ni6528:d0:p4:do0"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do4"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do5"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do6"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "ni6528:d0:p4:do7"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}

View File

@@ -0,0 +1,191 @@
+LoggerService = {
Class = LoggerService
CPUs = 0x1
StackSize = 32768
NumberOfLogPages = 128
+ConLogger = {
Class = ConsoleLogger
Format = "EtOoFmC"
PrintKeys = 1
}
}
+StateMachine = {
Class = StateMachine
+INITIAL = {
Class = ReferenceContainer
+START = {
Class = StateMachineEvent
NextState = "RUNNING"
NextStateError = "ERROR"
+PrepareNextStateOnOurRTApp = {
Class = Message
Destination = MyDemoApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = State1
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MyDemoApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+RUNNING = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = RUNNING
NextStateError = ERROR
}
}
+ERROR = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = ERROR
NextStateError = ERROR
}
}
}
+MyDemoApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = Timer
Type = uint32
}
Counter = {
DataSource = Timer
Type = uint32
Frequency = 1 //in Hz. Cycle for one state execution.
}
RTThreadPerf = {
DataSource = Timings
Alias = "State1.Thread1_CycleTime"
Type = uint32
}
}
OutputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
Counter = {
DataSource = DDB1
Type = uint32
}
RTThreadPerf = {
DataSource = DDB1
Type = uint32
}
}
}
+GAMEPICSCA = {
Class = IOGAM
InputSignals = {
doValue = {
DataSource = EPICSCAInput
Type = uint8
}
}
OutputSignals = {
Value = {
DataSource = DDB1
Type = uint8
}
}
}
+GAMDebug = {
Class = IOGAM
InputSignals = {
Value = {
DataSource = DDB1
Type = uint8
}
}
OutputSignals = {
Value = {
DataSource = NI6528
Type = uint8
}
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = {
Class = GAMDataSource
}
+Timer = {
Class = LinuxTimer
SleepNature = "Busy"
SleepPercentage = 0
ExecutionMode = RealTimeThread
CPUMask = 0x1
Signals = {
Counter = {
Type = uint32
}
Time = {
Type = uint32
}
}
}
+NI6528 = {
Class = NI6528
DeviceName = "/dev/pxi6528.0"
Port = 3
Value = {
Counter = {
Type = uint8
}
}
}
+EPICSCAInput = {
Class = "EPICSCA::EPICSCAInput"
CPUMask = "1"
StackSize = "10000000"
Signals = {
doValue = {
PVName = "test:doValue"
}
}
}
+Display = {
Class = LoggerDataSource
}
+Timings = {
Class = TimingDataSource
}
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
Functions = {GAMTimer GAMEPICSCA GAMDebug}
CPUMask = 0x1
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}

View File

@@ -0,0 +1,18 @@
record(bo, "test:do1"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "test:do2"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(bo, "test:do3"){
field(SCAN,"Passive")
field(ONAM, "ON")
field(ZNAM, "OFF")
}
record(longin, test:doValue){
field(SCAN, "Passive")
}

View File

@@ -0,0 +1,29 @@
ECPCSubscriber.cfg is a configuration for testing ECPC simulator (JAECPCSimulator.cfg).
Setup:
1) Run softIoc. In qst-gyrotron-fast-controller/Configurations execute command:
softIoc -d ECPC_IOC.db
2) Run ECPC simulator. In qst-gyrotron-fast-controller/Startup execute command:
./Main.sh -f ../Configurations/JAECPCSimulator.cfg -l RealTimeLoader -m StateMachine:Start
3) Run ECPC subscriber. In qst-gyrotron-fast-controller/Startup execute command:
./Main.sh -f ../Configurations/tests/ECPCSubscriber.cfg -l RealTimeLoader -m StateMachine:Start
The ECPC simulator should automatically start sending waveforms, which will be printed by the ECPC subscriber every 10 milliseconds.
The ECPC simulator will also be sending command, which is printed by the ECPC subscriber every millisecond.
To change command that is being sent, you have to caput 1 to one of following PVs:
MHVPS_ON (command 1)
GYA_BPS_SWON (command 2)
GYA_APS_SWON (command 3)
GYB_BPS_SWON (command 4)
GYB_APS_SWON (command 5)
GYA_BPS_SWOFF (command 6)
GYA_APS_SWOFF (command 7)
GYB_BPS_SWOFF (command 8)
GYB_APS_SWOFF (command 9)
RF_OFF (command 10)
To stop sending that command, caput 0 to that PV.

View File

@@ -0,0 +1,163 @@
+LoggerService = {
Class = LoggerService
CPUs = 0x1
StackSize = 32768
NumberOfLogPages = 128
+ConLogger = {
Class = ConsoleLogger
Format = "EtOoFmC"
PrintKeys = 1
}
}
+StateMachine = {
Class = StateMachine
+INITIAL = {
Class = ReferenceContainer
+START = {
Class = StateMachineEvent
NextState = "RUNNING"
NextStateError = "ERROR"
+PrepareNextStateOnOurRTApp = {
Class = Message
Destination = MyDemoApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = State1
}
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MyDemoApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+RUNNING = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = RUNNING
NextStateError = ERROR
}
}
+ERROR = {
Class = ReferenceContainer
+LOCKEDFOREVER = {
Class = StateMachineEvent
NextState = ERROR
NextStateError = ERROR
}
}
}
+MyDemoApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Time = { //Time attribute is updated with us resolution.
DataSource = Timer
Type = uint32
}
Counter = {
DataSource = Timer
Type = uint32
Frequency = 10 //in Hz. Cycle for one state execution.
}
RTThreadPerf = {
DataSource = Timings
Alias = "State1.Thread1_CycleTime"
Type = uint32
}
}
OutputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
Counter = {
DataSource = DDB1
Type = uint32
}
RTThreadPerf = {
DataSource = DDB1
Type = uint32
}
}
}
+TimerDisplayGAM = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
Counter = {
DataSource = DDB1
Type = uint32
}
}
OutputSignals = {
TimeDISP = {
DataSource = Display
Type = uint32
}
CounterDISP = {
DataSource = Display
Type = uint32
}
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = {
Class = GAMDataSource
}
+Timer = {
Class = LinuxTimer
SleepNature = "Busy"
SleepPercentage = 0
ExecutionMode = RealTimeThread
CPUMask = 0x1
Signals = {
Counter = {
Type = uint32
}
Time = {
Type = uint32
}
}
}
+Display = {
Class = LoggerDataSource
}
+Timings = {
Class = TimingDataSource
}
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
Functions = {GAMTimer TimerDisplayGAM}
CPUMask = 0x1
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}