Moved to Signal Arrays

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
2024-12-14 00:27:37 +00:00
parent a2714221fa
commit 361ab6880c
3 changed files with 290 additions and 562 deletions

View File

@@ -15,7 +15,7 @@
Event = { Event = {
Destination = "StateMachine" Destination = "StateMachine"
PVValue = "Function" PVValue = "Function"
FunctionMap = {{"1" "GOTORUN"}{"0" "GOTOIDLE"}} FunctionMap = {{"2", "GOTOPULSING"}, {"1", "GOTOWAITING_FOR_PRE"}, {"0", "GOTOIDLE"}}
} }
} }
+PV_ERROR_RST = { +PV_ERROR_RST = {
@@ -48,6 +48,18 @@
Function = "GOTOIDLE" Function = "GOTOIDLE"
Mode = "ExpectsReply" Mode = "ExpectsReply"
} }
+GOTOWAITING_FOR_PRE = {
Class = Message
Destination = StateMachine
Function = GOTOWAITING_FOR_PRE
Mode = ExpectsReply
}
+GOTOPULSING = {
Class = Message
Destination = StateMachine
Function = GOTOPULSING
Mode = ExpectsReply
}
+GOTORUN = { +GOTORUN = {
Class = "Message" Class = "Message"
Destination = "StateMachine" Destination = "StateMachine"
@@ -113,11 +125,23 @@
} }
+IDLE = { +IDLE = {
Class = "ReferenceContainer" Class = "ReferenceContainer"
+GOTORUN = { +GOTOWAITING_FOR_PRE = {
//+GOTORUN = {
Class = "StateMachineEvent" Class = "StateMachineEvent"
NextState = "RUN" NextState = "WAITING_FOR_PRE"
//NextState = "RUN"
NextStateError = "ERROR" NextStateError = "ERROR"
Timeout = "0" Timeout = "0"
+ChangeToWaitPreMsg = {
Class = Message
Destination = "IsttokApp"
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = "Online"
}
}
+OpenTreeMsg = { +OpenTreeMsg = {
Class = "Message" Class = "Message"
Destination = "IsttokApp.Data.SignalsWriter" Destination = "IsttokApp.Data.SignalsWriter"
@@ -135,6 +159,7 @@
Function = "WriteEoWo" Function = "WriteEoWo"
Mode = "ExpectsReply" Mode = "ExpectsReply"
} }
/*
+ChangeToRunMsg = { +ChangeToRunMsg = {
Class = "Message" Class = "Message"
Destination = "IsttokApp" Destination = "IsttokApp"
@@ -145,6 +170,7 @@
param1 = "Run" param1 = "Run"
} }
} }
*/
+StopCurrentStateExecutionMsg = { +StopCurrentStateExecutionMsg = {
Class = "Message" Class = "Message"
Destination = "IsttokApp" Destination = "IsttokApp"
@@ -159,7 +185,60 @@
} }
} }
} }
+RUN = { +WAITING_FOR_PRE = {
Class = ReferenceContainer
+ENTER = {
Class = ReferenceContainer
+SetStatusPV = {
Class = Message
Destination = "EPICSCAInterface.PV_STATUS"
Function = CAPut
Mode = ExpectsReply
+Parameters = {
Class = ConfigurationDatabase
param1 = 1
}
}
}
+GOTOPULSING = {
Class = StateMachineEvent
NextState = "PULSING"
NextStateError = "ERROR"
//NextStateError = "IDLE"
Timeout = 0
+ChangeToRunMsg = {
Class = Message
Destination = MdsLoopApp
Mode = ExpectsReply
Function = PrepareNextState
+Parameters = {
Class = ConfigurationDatabase
param1 = Online
}
}
/*
+CalcOffSetsMsg = {
Class = "Message"
Destination = "MdsLoopApp.Functions.GAMElectricProbes"
Function = "CalcOffSets"
Mode = "ExpectsReply"
}
*/
+StopCurrentStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StopCurrentStateExecution
Mode = ExpectsReply
}
+StartNextStateExecutionMsg = {
Class = Message
Destination = MdsLoopApp
Function = StartNextStateExecution
Mode = ExpectsReply
}
}
}
+PULSING = {
Class = "ReferenceContainer" Class = "ReferenceContainer"
+ENTER = { +ENTER = {
Class = "ReferenceContainer" Class = "ReferenceContainer"
@@ -314,133 +393,15 @@ $IsttokApp = {
DataSource = "AtcaIopAdc_DS" DataSource = "AtcaIopAdc_DS"
Type = "uint32" Type = "uint32"
} }
ADC0Decim = { ADCDecim = {
DataSource = "AtcaIopAdc_DS" DataSource = "AtcaIopAdc_DS"
Type = "int32" Type = "int32"
NumberOfElements = 16
} }
ADC1Decim = { ADCInt = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC2Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC3Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC4Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC5Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC6Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC7Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC8Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC9Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC10Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC11Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC12Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC13Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC14Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC15Decim = {
DataSource = "AtcaIopAdc_DS"
Type = "int32"
}
ADC0Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC1Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC2Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC3Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC4Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC5Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC6Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC7Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC8Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC9Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC10Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC11Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC12Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC13Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC14Int = {
DataSource = "AtcaIopAdc_DS"
Type = "int64"
}
ADC15Int = {
DataSource = "AtcaIopAdc_DS" DataSource = "AtcaIopAdc_DS"
Type = "int64" Type = "int64"
NumberOfElements = 16
} }
Idle_Thread1_CycleTime = { Idle_Thread1_CycleTime = {
DataSource = "Timings" DataSource = "Timings"
@@ -449,7 +410,7 @@ $IsttokApp = {
} }
Run_Thread1_CycleTime = { Run_Thread1_CycleTime = {
DataSource = "Timings" DataSource = "Timings"
Alias = "Run.Thread1_CycleTime" Alias = "Online.Thread1_CycleTime"
Type = "uint32" Type = "uint32"
} }
} }
@@ -470,133 +431,16 @@ $IsttokApp = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "uint32" Type = "uint32"
} }
ADC0DRaw = { ADCDRaw = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "int32" Type = "int32"
NumberOfElements = 16
NumberOfDimensions = 1
} }
ADC1DRaw = { ADCIntegral = {
DataSource = "DDB1"
Type = "int32"
}
ADC2DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC3DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC4DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC5DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC6DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC7DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC8DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC9DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC10DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC11DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC12DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC13DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC14DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC15DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC0Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC1Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC2Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC3Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC4Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC5Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC6Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC7Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC8Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC9Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC10Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC11Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC12Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC13Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC14Integral = {
DataSource = "DDB1"
Type = "int64"
}
ADC15Integral = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "int64" Type = "int64"
NumberOfElements = 16
} }
Idle_Thread1_CycleTime = { Idle_Thread1_CycleTime = {
DataSource = "DDB1" DataSource = "DDB1"
@@ -609,6 +453,7 @@ $IsttokApp = {
} }
} }
} }
/*
+DacConstants = { +DacConstants = {
Class = ConstantGAM Class = ConstantGAM
OutputSignals = { OutputSignals = {
@@ -624,18 +469,45 @@ $IsttokApp = {
} }
} }
} }
+AtcaGAMOutput = { */
+GAMDacSignals = {
Class = "IOGAM" Class = "IOGAM"
InputSignals = { InputSignals = {
//DacSignal0 = { ADCDecimF = {
ADC1DecimV = { DataSource = "DDB1"
Type = "float32"
NumberOfElements = "16"
}
}
OutputSignals = {
DacSignal0 = {
DataSource = "DDB1" DataSource = "DDB1"
Type = float32 Type = float32
} }
ADC2DecimV = { DacSignal1 = {
DataSource = "DDB1" DataSource = "DDB1"
Type = float32 Type = float32
} }
ADCDacOthers = {
DataSource = "DDB1"
Type = "float32"
NumberOfElements = "14"
}
}
}
+GAMDacOutput = {
Class = "IOGAM"
InputSignals = {
DacSignal0 = {
DataSource = "DDB1"
Type = float32
Default = -1.0
}
DacSignal1 = {
DataSource = "DDB1"
Type = float32
Default = 2.0
}
} }
OutputSignals = { OutputSignals = {
DAC0 = { DAC0 = {
@@ -679,50 +551,55 @@ $IsttokApp = {
} }
} }
} }
/*
+GAMConvert2Volt = { +GAMConvert2Volt = {
Class = "ConversionGAM" Class = "ConversionGAM"
InputSignals = { InputSignals = {
ADC0DRaw = { ADCDRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC1DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC2DRaw = {
DataSource = "DDB1"
Type = "int32"
}
ADC3DRaw = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "int32" Type = "int32"
//Elements = 12
} }
} }
OutputSignals = { OutputSignals = {
ADC0DecimV= { ADCDecimV= {
DataSource = "DDB1" DataSource = "DDB1"
Type = "float32" Type = "float32"
Gain = 0.00007629 Gain = 0.00007629
//Elements = 12
//Gain = 0.0000762939453125 10.0 / 2 **17 //Gain = 0.0000762939453125 10.0 / 2 **17
} }
ADC1DecimV = {
DataSource = "DDB1"
Type = "float32"
Gain = 0.00007629
}
ADC2DecimV = {
DataSource = "DDB1"
Type = "float32"
Gain = 0.00007629
}
ADC3DecimV = {
DataSource = "DDB1"
Type = "float32"
Gain = 0.00007629
}
} }
} }
*/
+GAMConvert2Float = {
Class = "ConversionGAM"
InputSignals = {
ADCDRaw = {
DataSource = "DDB1"
Type = "int32"
//NumberOfElements = "16"
}
ADCIntegral = {
DataSource = "DDB1"
Type = "int64"
//NumberOfElements = "16"
}
}
OutputSignals = {
ADCDecimF = {
DataSource = "DDB1"
Type = "float32"
NumberOfElements = "16"
}
ADCIntegF = {
DataSource = "DDB1"
Type = "float32"
NumberOfElements = "16"
}
}
}
/*
+GAMConvert2Float = { +GAMConvert2Float = {
Class = "ConversionGAM" Class = "ConversionGAM"
InputSignals = { InputSignals = {
@@ -954,6 +831,7 @@ $IsttokApp = {
} }
} }
} }
*/
+GAMHistogramCycleTimes = { +GAMHistogramCycleTimes = {
Class = "HistogramGAM" Class = "HistogramGAM"
BeginCycleNumber = "10" BeginCycleNumber = "10"
@@ -1037,6 +915,7 @@ $IsttokApp = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "uint32" Type = "uint32"
} }
/*
ADC0DecimV = { ADC0DecimV = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "float32" Type = "float32"
@@ -1045,6 +924,7 @@ $IsttokApp = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "float32" Type = "float32"
} }
*/
} }
OutputSignals = { OutputSignals = {
CounterLi = { CounterLi = {
@@ -1063,6 +943,7 @@ $IsttokApp = {
DataSource = "EPICSCAOutput" DataSource = "EPICSCAOutput"
Type = "uint32" Type = "uint32"
} }
/*
ADC0DecimAi = { ADC0DecimAi = {
DataSource = "EPICSCAOutput" DataSource = "EPICSCAOutput"
Type = "float32" Type = "float32"
@@ -1071,6 +952,7 @@ $IsttokApp = {
DataSource = "EPICSCAOutput" DataSource = "EPICSCAOutput"
Type = "float32" Type = "float32"
} }
*/
} }
} }
+GAMSignalsWriter = { +GAMSignalsWriter = {
@@ -1080,115 +962,12 @@ $IsttokApp = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "uint32" Type = "uint32"
} }
ADC0DecimS = { ADCDecimF = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "float32" Type = "float32"
//NumberOfElements = 12
} }
ADC1DecimS = { ADCIntegF = {
DataSource = "DDB1"
Type = "float32"
}
ADC2DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC3DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC4DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC5DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC6DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC7DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC8DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC9DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC10DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC11DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC12DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC13DecimS = {
DataSource = "DDB1"
Type = "float32"
}
ADC0IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC1IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC2IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC3IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC4IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC5IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC6IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC7IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC8IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC9IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC10IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC11IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC12IntegS = {
DataSource = "DDB1"
Type = "float32"
}
ADC13IntegS = {
DataSource = "DDB1" DataSource = "DDB1"
Type = "float32" Type = "float32"
} }
@@ -1246,13 +1025,10 @@ $IsttokApp = {
DataSource = "SignalsWriter" DataSource = "SignalsWriter"
Type = "float32" Type = "float32"
} }
AdcRawDecim12 = { AdcRawDecimOther = {
DataSource = "SignalsWriter" DataSource = "DDB1"
Type = "float32"
}
AdcRawDecim13 = {
DataSource = "SignalsWriter"
Type = "float32" Type = "float32"
NumberOfElements = 4
} }
AdcInteg0 = { AdcInteg0 = {
DataSource = "SignalsWriter" DataSource = "SignalsWriter"
@@ -1302,13 +1078,10 @@ $IsttokApp = {
DataSource = "SignalsWriter" DataSource = "SignalsWriter"
Type = "float32" Type = "float32"
} }
AdcInteg12 = { AdcIntegOther = {
DataSource = "SignalsWriter" DataSource = "DDB1"
Type = "float32"
}
AdcInteg13 = {
DataSource = "SignalsWriter"
Type = "float32" Type = "float32"
NumberOfElements = 4
} }
} }
} }
@@ -1346,14 +1119,14 @@ $IsttokApp = {
BoardId = 9 BoardId = 9
//NumberOfChannels = 2 //NumberOfChannels = 2
Signals = { Signals = {
DAC0 = { DAC0 = {
Type = float32 Type = float32
OutputRange = 15.0 OutputRange = 15.0
// OutputPolarity = Bipolar // OutputPolarity = Bipolar
} }
DAC1 = { DAC1 = {
Type = float32 Type = float32
OutputRange = 15.0 OutputRange = 15.0
} }
} }
} }
@@ -1364,7 +1137,7 @@ $IsttokApp = {
DeviceName = "/dev/atca_v6" DeviceName = "/dev/atca_v6"
BoardId = 9 BoardId = 9
DeviceDmaName = "/dev/atca_v6_dmart_2" DeviceDmaName = "/dev/atca_v6_dmart_2"
NumberOfChannels = "12" NumberOfChannels = "16"
IsMaster = "1" IsMaster = "1"
SleepNature = "Busy" SleepNature = "Busy"
SleepPercentage = "15" SleepPercentage = "15"
@@ -1388,100 +1161,10 @@ $IsttokApp = {
TimeoutMax = { TimeoutMax = {
Type = "uint32" Type = "uint32"
} }
ADC0Decim = { ADCDecim = {
Type = "int32" Type = "int32"
} }
ADC1Decim = { ADCInt = {
Type = "int32"
}
ADC2Decim = {
Type = "int32"
}
ADC3Decim = {
Type = "int32"
}
ADC4Decim = {
Type = "int32"
}
ADC5Decim = {
Type = "int32"
}
ADC6Decim = {
Type = "int32"
}
ADC7Decim = {
Type = "int32"
}
ADC8Decim = {
Type = "int32"
}
ADC9Decim = {
Type = "int32"
}
ADC10Decim = {
Type = "int32"
}
ADC11Decim = {
Type = "int32"
}
ADC12Decim = {
Type = "int32"
}
ADC13Decim = {
Type = "int32"
}
ADC14Decim = {
Type = "int32"
}
ADC15Decim = {
Type = "int32"
}
ADC0Int = {
Type = "int64"
}
ADC1Int = {
Type = "int64"
}
ADC2Int = {
Type = "int64"
}
ADC3Int = {
Type = "int64"
}
ADC4Int = {
Type = "int64"
}
ADC5Int = {
Type = "int64"
}
ADC6Int = {
Type = "int64"
}
ADC7Int = {
Type = "int64"
}
ADC8Int = {
Type = "int64"
}
ADC9Int = {
Type = "int64"
}
ADC10Int = {
Type = "int64"
}
ADC11Int = {
Type = "int64"
}
ADC12Int = {
Type = "int64"
}
ADC13Int = {
Type = "int64"
}
ADC14Int = {
Type = "int64"
}
ADC15Int = {
Type = "int64" Type = "int64"
} }
} }
@@ -1610,6 +1293,7 @@ $IsttokApp = {
SamplePhase = "0" SamplePhase = "0"
AutomaticSegmentation = "0" AutomaticSegmentation = "0"
} }
/*
AdcRawDecim12 = { AdcRawDecim12 = {
NodeName = "ATCAIOP1.ADC12RAW" NodeName = "ATCAIOP1.ADC12RAW"
Period = "100e-6" Period = "100e-6"
@@ -1628,6 +1312,7 @@ $IsttokApp = {
SamplePhase = "0" SamplePhase = "0"
AutomaticSegmentation = "0" AutomaticSegmentation = "0"
} }
*/
AdcInteg0 = { AdcInteg0 = {
NodeName = "ATCAIOP1.ADC0INT" NodeName = "ATCAIOP1.ADC0INT"
Period = "100e-6" Period = "100e-6"
@@ -1736,6 +1421,7 @@ $IsttokApp = {
SamplePhase = "0" SamplePhase = "0"
AutomaticSegmentation = "0" AutomaticSegmentation = "0"
} }
/*
AdcInteg12 = { AdcInteg12 = {
NodeName = "ATCAIOP1.ADC12INT" NodeName = "ATCAIOP1.ADC12INT"
Period = "100e-6" Period = "100e-6"
@@ -1754,6 +1440,7 @@ $IsttokApp = {
SamplePhase = "0" SamplePhase = "0"
AutomaticSegmentation = "0" AutomaticSegmentation = "0"
} }
*/
} }
} }
+EPICSCAOutput = { +EPICSCAOutput = {
@@ -1779,6 +1466,7 @@ $IsttokApp = {
PVName = "ISTTOK:marte2:AtcaIop-Timeout-Max" PVName = "ISTTOK:marte2:AtcaIop-Timeout-Max"
Type = "uint32" Type = "uint32"
} }
/*
ADC0DecimAi = { ADC0DecimAi = {
PVName = "ISTTOK:marte2:Adc0-Decim" PVName = "ISTTOK:marte2:Adc0-Decim"
Type = "float32" Type = "float32"
@@ -1787,6 +1475,7 @@ $IsttokApp = {
PVName = "ISTTOK:marte2:Adc1-Decim" PVName = "ISTTOK:marte2:Adc1-Decim"
Type = "float32" Type = "float32"
} }
*/
} }
} }
+EPICSCAInput = { +EPICSCAInput = {
@@ -1833,19 +1522,19 @@ $IsttokApp = {
Class = "RealTimeThread" Class = "RealTimeThread"
CPUs = "0x100" CPUs = "0x100"
//Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput"} //Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput"}
Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "AtcaGAMEoWoOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput" "GAMCAInput"} Functions = {"AtcaGAMInput" "AtcaGAMEoWoOutput" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMDacSignals" "GAMCAOutput" "GAMDacOutput" "GAMCAInput"}
} }
} }
} }
+Run = { +Online = {
Class = "RealTimeState" Class = "RealTimeState"
+Threads = { +Threads = {
Class = "ReferenceContainer" Class = "ReferenceContainer"
+Thread1 = { +Thread1 = {
Class = "RealTimeThread" Class = "RealTimeThread"
CPUs = "0x100" CPUs = "0x100"
Functions = {"AtcaGAMInput" "DacConstants" "AtcaGAMOutput" "AtcaGAMEoWoOutput" "GAMConvert2Volt" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMCAOutput" "GAMCAInput" "GAMSignalsWriter"} Functions = {"AtcaGAMInput" "AtcaGAMEoWoOutput" "GAMConvert2Float" "GAMHistogramCycleTimes" "GAMDacSignals" "GAMDacOutput" "GAMCAOutput" "GAMCAInput" "GAMSignalsWriter"}
} }
} }
} }

View File

@@ -80,11 +80,11 @@ namespace MARTe {
} DMA_CH1_PCKT; } DMA_CH1_PCKT;
struct atca_eo_config { struct atca_eo_config {
int32_t offset[ATCA_IOP_MAX_CHANNELS]; int32_t offset[ATCA_IOP_N_ADCs];
}; };
struct atca_wo_config { struct atca_wo_config {
int32_t offset[ATCA_IOP_MAX_CHANNELS]; int32_t offset[ATCA_IOP_N_ADCs];
}; };
//} //}
@@ -116,8 +116,8 @@ AtcaIopADC::AtcaIopADC() :
//pollTimout = 0u; //pollTimout = 0u;
adcPeriod = 0.; adcPeriod = 0.;
uint32 k; uint32 k;
adcValues = NULL_PTR(int32 *);
for (k=0u; k < ATCA_IOP_N_ADCs; k++) { for (k=0u; k < ATCA_IOP_N_ADCs; k++) {
adcValues[k] = 0u;
electricalOffsets[k] = 0u; electricalOffsets[k] = 0u;
wiringOffsets[k] = 0.0; wiringOffsets[k] = 0.0;
} }
@@ -159,7 +159,8 @@ AtcaIopADC::~AtcaIopADC() {
close(boardDmaDescriptor); close(boardDmaDescriptor);
REPORT_ERROR(ErrorManagement::Information, "Close device %d OK", boardDmaDescriptor); REPORT_ERROR(ErrorManagement::Information, "Close device %d OK", boardDmaDescriptor);
} }
uint32 k; adcValues = NULL_PTR(int32 *);
//uint32 k;
} }
bool AtcaIopADC::AllocateMemory() { bool AtcaIopADC::AllocateMemory() {
@@ -180,21 +181,14 @@ bool AtcaIopADC::Initialise(StructuredDataI& data) {
REPORT_ERROR(ErrorManagement::ParametersError, "The BoardId shall be specified"); REPORT_ERROR(ErrorManagement::ParametersError, "The BoardId shall be specified");
} }
} }
/* numberOfChannels = 0u;
if (ok) {
ok = data.Read("DeviceDmaName", deviceDmaName);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The DeviceDmaName shall be specified");
}
}
*/
if (ok) { if (ok) {
ok = data.Read("NumberOfChannels", numberOfChannels); ok = data.Read("NumberOfChannels", numberOfChannels);
if (!ok) { if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The NumberOfChannels shall be specified"); REPORT_ERROR(ErrorManagement::ParametersError, "The NumberOfChannels shall be specified");
} }
if (numberOfChannels > ATCA_IOP_MAX_CHANNELS ) { if (numberOfChannels > ATCA_IOP_N_ADCs ) {
numberOfChannels = ATCA_IOP_MAX_CHANNELS; numberOfChannels = ATCA_IOP_N_ADCs;
} }
} }
if (ok) { if (ok) {
@@ -237,9 +231,9 @@ bool AtcaIopADC::Initialise(StructuredDataI& data) {
} }
if (ok) { if (ok) {
numberOfElements = arrayDescription.GetNumberOfElements(0u); numberOfElements = arrayDescription.GetNumberOfElements(0u);
ok = (numberOfElements == ATCA_IOP_N_ADCs); ok = (numberOfElements == numberOfChannels);
if (!ok) { if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "Exactly %d elements shall be defined in the array ElectricalOffsets", ATCA_IOP_N_ADCs); REPORT_ERROR(ErrorManagement::ParametersError, "Exactly %d elements shall be defined in the array ElectricalOffsets", numberOfChannels);
} }
} }
if (ok) { if (ok) {
@@ -254,9 +248,9 @@ bool AtcaIopADC::Initialise(StructuredDataI& data) {
} }
if (ok) { if (ok) {
numberOfElements = arrayDescription.GetNumberOfElements(0u); numberOfElements = arrayDescription.GetNumberOfElements(0u);
ok = (numberOfElements == ATCA_IOP_N_ADCs); ok = (numberOfElements == numberOfChannels);
if (!ok) { if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "Exactly %d elements shall be defined in the array WiringOffsets", ATCA_IOP_N_ADCs); REPORT_ERROR(ErrorManagement::ParametersError, "Exactly %d elements shall be defined in the array WiringOffsets", numberOfChannels);
} }
} }
if (ok) { if (ok) {
@@ -312,7 +306,6 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
struct atca_eo_config eo_conf; struct atca_eo_config eo_conf;
struct atca_wo_config wo_conf; struct atca_wo_config wo_conf;
//The DataSource shall have N signals. //The DataSource shall have N signals.
//The first two are uint32 (counter and time) a
// //
if (ok) { if (ok) {
ok = (GetNumberOfSignals() == ATCA_IOP_N_SIGNALS); ok = (GetNumberOfSignals() == ATCA_IOP_N_SIGNALS);
@@ -333,47 +326,45 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 32 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits)); REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 32 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits));
} }
} }
ok = (GetSignalType(4u).type == SignedInteger);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal 4 shall be of type SignedInteger");
}
ok = (GetSignalType(4u).numberOfBits == 32u);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 32 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits));
}
uint8 nDimensions = 0u;
uint32 nElements = 0u;
ok = GetSignalNumberOfDimensions(4u, nDimensions);
if (ok) {
ok = GetSignalNumberOfElements(4u, nElements);
REPORT_ERROR(ErrorManagement::Information, "The signal 4 shall has %d Elements", nElements);
}
startPos = endPos; startPos = endPos;
endPos = startPos + ATCA_IOP_N_ADCs; endPos = startPos + ATCA_IOP_N_ADCs;
for (i=startPos; (i < endPos) && (ok); i++) { if (ok) {
ok = (GetSignalType(i).type == SignedInteger); ok = (GetSignalType(5u).type == SignedInteger);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal %d shall be of type SignedInteger", i);
}
ok = (GetSignalType(i).numberOfBits == 32u);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 32 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits));
}
} }
startPos = endPos; if (!ok) {
endPos = startPos + ATCA_IOP_N_INTEGRALS; REPORT_ERROR(ErrorManagement::ParametersError, "The signal 4 shall be of type SignedInteger");
for (i=startPos; (i < endPos) && (ok); i++) {
ok = (GetSignalType(i).type == SignedInteger);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal %d shall be of type SignedInteger", i);
}
ok = (GetSignalType(i).numberOfBits == 64u);
if (!ok) {
REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 64 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits));
}
} }
startPos = endPos; ok = (GetSignalType(5u).numberOfBits == 64u);
endPos = ATCA_IOP_N_SIGNALS; if (!ok) {
for (i=startPos; (i < endPos) && (ok); i++) { REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position 5 shall have 64 bits and %d were specified", uint16(GetSignalType(i).numberOfBits));
ok = (GetSignalType(i).type == SignedInteger); }
if (!ok) { nDimensions = 0u;
REPORT_ERROR(ErrorManagement::ParametersError, "The signal %d shall be of type SignedInteger", i); nElements = 0u;
} if (!ok) {
ok = (GetSignalType(i).numberOfBits == 32u); ok = GetSignalNumberOfDimensions(5u, nDimensions);
if (!ok) { }
REPORT_ERROR(ErrorManagement::ParametersError, "The signal in position %d shall have 32 bits and %d were specified", i, uint16(GetSignalType(i).numberOfBits)); if (ok) {
} ok = GetSignalNumberOfElements(5u, nElements);
} }
StreamString fullDeviceName; StreamString fullDeviceName;
//Configure the board //Configure the board
if (ok) { if (ok) {
ok = fullDeviceName.Printf("%s_%d", deviceName.Buffer(), boardId); ok = fullDeviceName.Printf("%s_%d", deviceName.Buffer(), boardId);
//ok = fullDeviceName.Printf("%s", deviceName.Buffer());
} }
if (ok) { if (ok) {
ok = fullDeviceName.Seek(0LLU); ok = fullDeviceName.Seek(0LLU);
@@ -390,7 +381,6 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
ok = fullDeviceName.Seek(0LLU); ok = fullDeviceName.Seek(0LLU);
if (ok) { if (ok) {
ok = fullDeviceName.Printf("%s_dmart_%d", deviceName.Buffer(), boardId); ok = fullDeviceName.Printf("%s_dmart_%d", deviceName.Buffer(), boardId);
//ok = fullDeviceName.Printf("%s", deviceName.Buffer());
} }
if (ok) { if (ok) {
ok = fullDeviceName.Seek(0LLU); ok = fullDeviceName.Seek(0LLU);
@@ -434,7 +424,7 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
else else
rc = ioctl(boardFileDescriptor, ATCA_PCIE_IOPT_CHOP_OFF); rc = ioctl(boardFileDescriptor, ATCA_PCIE_IOPT_CHOP_OFF);
for (i=0u; i < ATCA_IOP_MAX_CHANNELS ; i++) { for (i=0u; i < ATCA_IOP_N_ADCs ; i++) {
eo_conf.offset[i] = 0u; eo_conf.offset[i] = 0u;
wo_conf.offset[i] = 0.0; wo_conf.offset[i] = 0.0;
} }
@@ -569,6 +559,9 @@ bool AtcaIopADC::SetConfiguredDatabase(StructuredDataI& data) {
totalNumberOfSamplesPerSecond, adcFrequency); totalNumberOfSamplesPerSecond, adcFrequency);
} }
} }
if (ok) {
adcValues = new int32[numberOfChannels];
}
return ok; return ok;
} }
@@ -591,6 +584,13 @@ bool AtcaIopADC::GetSignalMemoryBuffer(const uint32 signalIdx, const uint32 buff
else if (signalIdx == 3u) { else if (signalIdx == 3u) {
signalAddress = &timeoutMax; signalAddress = &timeoutMax;
} }
else if (signalIdx == 4u) {
signalAddress = &adcValues[0]; //signalIdx - ATCA_IOP_N_TIMCNT]cwtimeoutMax;
}
else if (signalIdx == 5u) {
signalAddress = &adcIntegralValues[0]; //signalIdx - ATCA_IOP_N_TIMCNT]cwtimeoutMax;
}
/*
else if (signalIdx < ATCA_IOP_N_TIMCNT + ATCA_IOP_N_ADCs ) { else if (signalIdx < ATCA_IOP_N_TIMCNT + ATCA_IOP_N_ADCs ) {
signalAddress = &adcValues[signalIdx - ATCA_IOP_N_TIMCNT]; signalAddress = &adcValues[signalIdx - ATCA_IOP_N_TIMCNT];
} }
@@ -598,6 +598,7 @@ bool AtcaIopADC::GetSignalMemoryBuffer(const uint32 signalIdx, const uint32 buff
signalAddress = &adcIntegralValues[signalIdx - signalAddress = &adcIntegralValues[signalIdx -
(ATCA_IOP_N_TIMCNT + ATCA_IOP_N_ADCs)]; (ATCA_IOP_N_TIMCNT + ATCA_IOP_N_ADCs)];
} }
*/
else { else {
ok = false; ok = false;
} }

View File

@@ -50,13 +50,13 @@ namespace MARTe {
/** /**
* The number of signals (2 time signals + ). * The number of signals (2 time signals + ).
*/ */
const uint32 ATCA_IOP_MAX_CHANNELS = 32u; // const uint32 ATCA_IOP_MAX_CHANNELS = 32u;
const uint32 ATCA_IOP_N_TIMCNT = 4u; const uint32 ATCA_IOP_N_TIMCNT = 4u;
const uint32 ATCA_IOP_N_ADCs = 16u; const uint32 ATCA_IOP_N_ADCs = 16u;
const uint32 ATCA_IOP_N_INTEGRALS = ATCA_IOP_N_ADCs; const uint32 ATCA_IOP_N_INTEGRALS = ATCA_IOP_N_ADCs;
const uint32 ATCA_IOP_N_SIGNALS = (ATCA_IOP_N_TIMCNT + ATCA_IOP_N_ADCs + const uint32 ATCA_IOP_N_SIGNALS = (ATCA_IOP_N_TIMCNT + 2); //ATCA_IOP_N_ADCs +
ATCA_IOP_N_INTEGRALS); //ATCA_IOP_N_INTEGRALS);
/** /**
* The number of buffers to synchronise with the DMA * The number of buffers to synchronise with the DMA
*/ */
@@ -66,7 +66,44 @@ namespace MARTe {
* @brief A DataSource that simulates an ADC board * @brief A DataSource that simulates an ADC board
* TODO * TODO
* <pre> * <pre>
* +ADCSim = { * +AtcaIopADC = {
* Class = "AtcaIop::AtcaIopADC"
CPUMask = "0x040"
StackSize = "1048576"
DeviceName = "/dev/atca_v6"
BoardId = 9
DeviceDmaName = "/dev/atca_v6_dmart_2"
NumberOfChannels = "12"
IsMaster = "1"
SleepNature = "Busy"
SleepPercentage = "15"
ADCFrequency = "2000000"
RTDecimation = "200"
ChopperPeriod = "2000"
ElectricalOffsets = {"-151" "110" "-417" "-35" "-204" "0" "134" "-59" "-227" "-308" "-120" "-175" "0" "0" "0" "0"}
WiringOffsets = {"0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0" "0.0"}
//WiringOffsets = {0.354 0.288 -0.010 -0.083 0.347 0.228 0.088 0.186 -0.297 -0.101 0.025 -0.012 0.0 0.0 0.0 0.0}
//WiringOffsets = {"0.271" "0.211" "0.098" "0.141" "0.312" "0.203" "0.212" "0.361" "-0.546" "-0.433" "-0.598" "1.362"}
Signals = {
Counter = {
Type = "uint32"
}
Time = {
Type = "uint32"
}
TimeoutCount = {
Type = "uint32"
}
TimeoutMax = {
Type = "uint32"
}
ADC0Decim = {
Type = "int32"
}
ADC1Decim = {
Type = "int32"
}
* Class = ADCSimulator * Class = ADCSimulator
* DeviceName = "/dev/atca_v6" //Mandatory * DeviceName = "/dev/atca_v6" //Mandatory
* BoardId = 0 // Mandatory * BoardId = 0 // Mandatory
@@ -323,12 +360,13 @@ namespace MARTe {
/** /**
* ADC values * ADC values
*/ */
int32 adcValues[ATCA_IOP_MAX_CHANNELS]; //int32 adcValues[ATCA_IOP_N_ADCs];
int32 *adcValues;
/** /**
* ADC Integral values * ADC Integral values
*/ */
int64 adcIntegralValues[ATCA_IOP_MAX_CHANNELS]; int64 adcIntegralValues[ATCA_IOP_N_ADCs];
/** /**
* Number of samples to read on each cycle * Number of samples to read on each cycle
@@ -387,12 +425,12 @@ namespace MARTe {
/** /**
* The Electrical Offset Parameters. * The Electrical Offset Parameters.
*/ */
int32 electricalOffsets[ATCA_IOP_MAX_CHANNELS]; int32 electricalOffsets[ATCA_IOP_N_ADCs];
/** /**
* The Wiring Offset Parameters. * The Wiring Offset Parameters.
*/ */
float32 wiringOffsets[ATCA_IOP_MAX_CHANNELS]; float32 wiringOffsets[ATCA_IOP_N_ADCs];
/** /**
* The ADC chopping period in samples * The ADC chopping period in samples