Skip to content
Snippets Groups Projects
Commit 94163ce2 authored by Cristian Galperti's avatar Cristian Galperti
Browse files

cfs1 and 2 standalone cfg generator regenerated

parent 7f17ec57
No related branches found
No related tags found
No related merge requests found
Showing
with 693 additions and 0 deletions
>MDSPARAMS1<
>RTAPPPRESL<
>RTAPPSL<
>RTAPPPOSTSL<
>DATA<
>STATES<
% This script creates a testable
% MARTe2 cfg file for the cfs1 algorithm
% with these specifications:
%
% tunable parameters MDSplus link via MDSObjLoader instatiation
% tunable waveforms MDSplus link via MDSObjWavegen instantiation
% single realtime thread, LinuxTimer synched at 1kHz
% algorithms output MDSplus link via standard MDSWriter
%
% it is assumend that a cfs1 algorithm decritpion object
% has already been siccessfully defined, inited and setup, via:
% obj=algo_cfs1; obj.init; obj.setup;
%% Parameters
% source MDSplus shotnumber
mdssrcshot=-1;
% destination MDSplus shotnumber (-1 stands for increment current by 1)
mdsdstshot=-1;
% verbosity level
verbosity=2;
% MDS writer period
mdsperiod=0.001;
% MDSWriter segment length
mdsseglen=2000;
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
%% MDSParameters stub
fid=fopen('MDSPARAMS1.cfg','w');
obj.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj1.printMARTe2parconfig(-1);//g'' MDSPARAMS1.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader1/g'' MDSPARAMS1.cfg');
%% MDSWavegen stub
fid=fopen('MDSWAVEGEN1.cfg','w');
wg1dim=obj.printMARTe2wgbusconfig(-1,'algo_cfs1_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj.printMARTe2wgbusconfig(-1,''algo_cfs1_inBus'',1000);//g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/MDSWavegen_algo_cfs1_inBus_1/MDSWavegen_1/g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/wavegen_algo_cfs1_inBus_1/wavegen_1/g'' MDSWAVEGEN1.cfg');
%% Structured bus stubs
algo_cfs1_inbus =Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_inBus');
inputbusflat =genbusstructstub('INPUTBUSSTRUCT1.cfg',algo_cfs1_inbus,'input','DDB1');
algo_cfs1_outbus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_outBus');
outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT1.cfg',algo_cfs1_outbus,'output','DDB1');
%% Wavegen input stubs
genbusflatstub1('INPUTBUSFLAT1.cfg',inputbusflat,'DDB1')
%% StorageBroker output stubs
genbusflatstub1('OUTPUTBUSFLAT1DDB1.cfg',outputbusflat,'DDB1')
genbusflatstub1('OUTPUTBUSFLAT1MDS1.cfg',outputbusflat,'MDSWriter_1')
%% MDSWriter stubs
genbusflatstub2('OUTPUTBUSMDSWRITER1.cfg',outputbusflat,'cfs1.outputs','MDSW1PERIOD','MDSW1SEGLEN');
%% cfg build
system('cp algo_cfs1.cfgsrc algo_cfs1.cfg');
system('sed -i -e "/>MDSPARAMS1</r MDSPARAMS1.cfg" -e "/>MDSPARAMS1</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPPRESL</r rtapp-presl.cfgsrc" -e "/>RTAPPPRESL</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPSL</r rtapp-simulinkwrapper.cfgsrc" -e "/>RTAPPSL</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPPOSTSL</r rtapp-postsl.cfgsrc" -e "/>RTAPPPOSTSL</d" algo_cfs1.cfg');
system('sed -i -e "/>DATA</r data.cfgsrc" -e "/>DATA</d" algo_cfs1.cfg');
system('sed -i -e "/>STATES</r states.cfgsrc" -e "/>STATES</d" algo_cfs1.cfg');
system('sed -i -e "/>INPUTBUSFLAT1</r INPUTBUSFLAT1.cfg" -e "/>INPUTBUSFLAT1</d" algo_cfs1.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT1</r INPUTBUSSTRUCT1.cfg" -e "/>INPUTBUSSTRUCT1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT1</r OUTPUTBUSSTRUCT1.cfg" -e "/>OUTPUTBUSSTRUCT1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1DDB1</r OUTPUTBUSFLAT1DDB1.cfg" -e "/>OUTPUTBUSFLAT1DDB1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1MDS1</r OUTPUTBUSFLAT1MDS1.cfg" -e "/>OUTPUTBUSFLAT1MDS1</d" algo_cfs1.cfg');
system('sed -i -e "/>MDSWAVEGEN1</r MDSWAVEGEN1.cfg" -e "/>MDSWAVEGEN1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER1</r OUTPUTBUSMDSWRITER1.cfg" -e "/>OUTPUTBUSMDSWRITER1</d" algo_cfs1.cfg');
system(sprintf('sed -i "s/>WAVEGEN1_ELEMS</%d/g" algo_cfs1.cfg',wg1dim));
%% cfg adapt
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_cfs1.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_cfs1.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_cfs1.cfg',verbosity));
system(sprintf('sed -i "s/MDSW1PERIOD/%d/g" algo_cfs1.cfg',mdsperiod));
system(sprintf('sed -i "s/MDSW1SEGLEN/%d/g" algo_cfs1.cfg',mdsseglen));
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+LoggerDataSource = { Class = LoggerDataSource }
+Timings = { Class = TimingDataSource }
+Timer = {
Class = LinuxTimer
SleepNature = "Busy" // Default | Busy
ExecutionMode = RealTimeThread // IndependentThread | RealTimeThread
CPUMask = 0x8 // IndependentThread CPU mask
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
>MDSWAVEGEN1<
+MDSWriter_1 = {
Class = MDSWriter
NumberOfBuffers = 10000 //Compulsory. Number of buffers in the circular buffer defined above. Each buffer is capable of holding a copy of all the DataSourceI signals.
CPUMask = 0x8 //Compulsory. Affinity assigned to the threads responsible for asynchronously flush data into the MDSplus database.
StackSize = 10000000 //Compulsory. Stack size of the thread above.
TreeName = "scdds" //Compulsory. Name of the MDSplus tree.
PulseNumber = MDSDSTSHOT //Optional. If -1 a new pulse will be created and the MDSplus pulse number incremented.
StoreOnTrigger = 1 //Compulsory. If 0 all the data in the circular buffer is continuously stored. If 1 data is stored when the Trigger signal is 1 (see below).
EventName = "updatejScope" //Compulsory. Event sent to jScope when TimeRefresh seconds have elapsed.
TimeRefresh = 5 //Compulsory. An event with the name set in the property EventName is sent to jScope when TimeRefresh seconds have elapsed.
NumberOfPreTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store before the trigger.
NumberOfPostTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store after the trigger.
Signals = {
Trigger = { //Compulsory when StoreOnTrigger = 1. Must be set in index 0 of the Signals node. When the value of this signal is 1 data will be stored.
Type = uint8 //Type must be uint8
}
Time = { //Compulsory when StoreOnTrigger = 1. Can be store in any index, but TimeSignal must be set = 1
Type = uint32 //Type must be uint32 or int32
TimeSignal = 1 //When set, this signal will be considered as the time source against which all signals will be stored.
TimeSignalMultiplier = 1e-6 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
}
Thread1_Cycletime = { NodeName = "cfs1.system.CH01" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs1.system.CH02" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs1.system.CH03" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs1.system.CH04" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
>OUTPUTBUSMDSWRITER1<
}
/*
+Messages = { //Optional. If set a message will be fired every time one of the events below occur
Class = ReferenceContainer
+TreeOpenedOK = { //Optional, but if set, the name of the Object shall be TreeOpenedOK. If set a message containing a ConfigurationDatabase with param1=PULSE_NUMBER will be sent to the Destination, every time the Tree is successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeOpenedFail = { //Optional, but if set, the name of the Object shall be TreeOpenedFail. If set a message will be sent to the Destination, every time the Tree cannot be successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeFlushed = { //Optional, but if set, the name of the Object shall be TreeFlushed. If set a message will be sent to the Destination, every time the Tree is flushed.
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
}
*/
}
}
+StorageBroker = {
Class = IOGAM
InputSignals = {
Trigger = { DataSource = DDB1 Type = uint8 }
Time = { DataSource = DDB1 Type = uint32 }
Thread1_CycleTime = { DataSource = Timings Type = uint32 Alias = State1.Thread1_CycleTime }
GAMSimulink1_ReadTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = Timings Type = uint32 }
>OUTPUTBUSFLAT1DDB1<
}
OutputSignals = {
Trigger = { DataSource = MDSWriter_1 Type = uint8 }
Time = { DataSource = MDSWriter_1 Type = uint32 }
Thread1_Cycletime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ReadTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = MDSWriter_1 Type = uint32 }
>OUTPUTBUSFLAT1MDS1<
}
}
}
$TestApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Counter = { DataSource = Timer Type = uint32 }
Time = { Frequency = 1000 DataSource = Timer Type = uint32 }
}
OutputSignals = {
Counter = { DataSource = DDB1 Type = uint32 }
Time = { DataSource = DDB1 Type = uint32 }
}
}
+TimeConversion = {
Class = ConversionGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
TimeSec = { DataSource = DDB1 Type = float32 Gain = 0.000001 }
}
}
+Constants = {
Class = ConstantGAM
OutputSignals = {
zero = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Default=0 }
Trigger = { DataSource = DDB1 Type = uint8 NumberOfElements = 1 NumberOfDimensions=0 Default=1 }
}
}
+Wavegen1TimeBroker = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
time = { DataSource = MDSWavegen_1 Type = int32 }
}
}
+Wavegen1DataBroker = {
Class = IOGAM
InputSignals = {
wavegen_1 = { DataSource = MDSWavegen_1 Type = float32 NumberOfElements = >WAVEGEN1_ELEMS< }
}
OutputSignals = {
>INPUTBUSFLAT1<
}
}
\ No newline at end of file
+GAMSimulink1 = {
Class = SimulinkWrapperGAM
Library = "/root/MARTe2-examples/Simulinkso/algo_cfs1.so"
SymbolPrefix = "algo_cfs1"
Verbosity = VERBOSITY
SkipInvalidTunableParams = 0
TunableParamExternalSource= "MDSParamLoader1"
//NonVirtualBusMode = "ByteArray" // NOTE: homogeneus buses are not handled correctly, wrong
// handling of NumberOfElements = 1
NonVirtualBusMode = "Structured"
InputSignals = {
realtime = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Alias = TimeSec }
>INPUTBUSSTRUCT1<
}
OutputSignals = {
>OUTPUTBUSSTRUCT1<
}
/*
Parameters = {
k1 = (float32) 2.5
}
*/
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
TimeConversion
Constants
Wavegen1TimeBroker
Wavegen1DataBroker
GAMSimulink1
StorageBroker
//LoggerBroker
}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
>MDSPARAMS1<
>RTAPPPRESL<
>RTAPPSL<
>RTAPPPOSTSL<
>DATA<
>STATES<
% This script creates a testable
% MARTe2 cfg file for the cfs2 algorithm
% with these specifications:
%
% tunable parameters MDSplus link via MDSObjLoader instatiation
% tunable waveforms MDSplus link via MDSObjWavegen instantiation
% single realtime thread, LinuxTimer synched at 1kHz
% algorithms output MDSplus link via standard MDSWriter
%
% it is assumend that a cfs2 algorithm decritpion object
% has already been siccessfully defined, inited and setup, via:
% obj=algo_cfs2; obj.init; obj.setup;
%% Parameters
% source MDSplus shotnumber
mdssrcshot=-1;
% destination MDSplus shotnumber (-1 stands for increment current by 1)
mdsdstshot=-1;
% verbosity level
verbosity=2;
% MDS writer period
mdsperiod=0.001;
% MDSWriter segment length
mdsseglen=2000;
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
%% MDSParameters stub
fid=fopen('MDSPARAMS1.cfg','w');
obj.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj1.printMARTe2parconfig(-1);//g'' MDSPARAMS1.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader1/g'' MDSPARAMS1.cfg');
%% MDSWavegen stub
fid=fopen('MDSWAVEGEN1.cfg','w');
wg1dim=obj.printMARTe2wgbusconfig(-1,'algo_cfs2_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj.printMARTe2wgbusconfig(-1,''algo_cfs2_inBus'',1000);//g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/MDSWavegen_algo_cfs2_inBus_1/MDSWavegen_1/g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/wavegen_algo_cfs2_inBus_1/wavegen_1/g'' MDSWAVEGEN1.cfg');
%% Structured bus stubs
algo_cfs2_inbus =Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_inBus');
inputbusflat =genbusstructstub('INPUTBUSSTRUCT1.cfg',algo_cfs2_inbus,'input','DDB1');
algo_cfs2_outbus=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_outBus');
outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT1.cfg',algo_cfs2_outbus,'output','DDB1');
%% Wavegen input stubs
genbusflatstub1('INPUTBUSFLAT1.cfg',inputbusflat,'DDB1')
%% StorageBroker output stubs
genbusflatstub1('OUTPUTBUSFLAT1DDB1.cfg',outputbusflat,'DDB1')
genbusflatstub1('OUTPUTBUSFLAT1MDS1.cfg',outputbusflat,'MDSWriter_1')
%% MDSWriter stubs
genbusflatstub2('OUTPUTBUSMDSWRITER1.cfg',outputbusflat,'cfs2.outputs','MDSW1PERIOD','MDSW1SEGLEN');
%% cfg build
system('cp algo_cfs2.cfgsrc algo_cfs2.cfg');
system('sed -i -e "/>MDSPARAMS1</r MDSPARAMS1.cfg" -e "/>MDSPARAMS1</d" algo_cfs2.cfg');
system('sed -i -e "/>RTAPPPRESL</r rtapp-presl.cfgsrc" -e "/>RTAPPPRESL</d" algo_cfs2.cfg');
system('sed -i -e "/>RTAPPSL</r rtapp-simulinkwrapper.cfgsrc" -e "/>RTAPPSL</d" algo_cfs2.cfg');
system('sed -i -e "/>RTAPPPOSTSL</r rtapp-postsl.cfgsrc" -e "/>RTAPPPOSTSL</d" algo_cfs2.cfg');
system('sed -i -e "/>DATA</r data.cfgsrc" -e "/>DATA</d" algo_cfs2.cfg');
system('sed -i -e "/>STATES</r states.cfgsrc" -e "/>STATES</d" algo_cfs2.cfg');
system('sed -i -e "/>INPUTBUSFLAT1</r INPUTBUSFLAT1.cfg" -e "/>INPUTBUSFLAT1</d" algo_cfs2.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT1</r INPUTBUSSTRUCT1.cfg" -e "/>INPUTBUSSTRUCT1</d" algo_cfs2.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT1</r OUTPUTBUSSTRUCT1.cfg" -e "/>OUTPUTBUSSTRUCT1</d" algo_cfs2.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1DDB1</r OUTPUTBUSFLAT1DDB1.cfg" -e "/>OUTPUTBUSFLAT1DDB1</d" algo_cfs2.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1MDS1</r OUTPUTBUSFLAT1MDS1.cfg" -e "/>OUTPUTBUSFLAT1MDS1</d" algo_cfs2.cfg');
system('sed -i -e "/>MDSWAVEGEN1</r MDSWAVEGEN1.cfg" -e "/>MDSWAVEGEN1</d" algo_cfs2.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER1</r OUTPUTBUSMDSWRITER1.cfg" -e "/>OUTPUTBUSMDSWRITER1</d" algo_cfs2.cfg');
system(sprintf('sed -i "s/>WAVEGEN1_ELEMS</%d/g" algo_cfs2.cfg',wg1dim));
%% cfg adapt
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_cfs2.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_cfs2.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_cfs2.cfg',verbosity));
system(sprintf('sed -i "s/MDSW1PERIOD/%d/g" algo_cfs2.cfg',mdsperiod));
system(sprintf('sed -i "s/MDSW1SEGLEN/%d/g" algo_cfs2.cfg',mdsseglen));
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+LoggerDataSource = { Class = LoggerDataSource }
+Timings = { Class = TimingDataSource }
+Timer = {
Class = LinuxTimer
SleepNature = "Busy" // Default | Busy
ExecutionMode = RealTimeThread // IndependentThread | RealTimeThread
CPUMask = 0x8 // IndependentThread CPU mask
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
>MDSWAVEGEN1<
+MDSWriter_1 = {
Class = MDSWriter
NumberOfBuffers = 10000 //Compulsory. Number of buffers in the circular buffer defined above. Each buffer is capable of holding a copy of all the DataSourceI signals.
CPUMask = 0x8 //Compulsory. Affinity assigned to the threads responsible for asynchronously flush data into the MDSplus database.
StackSize = 10000000 //Compulsory. Stack size of the thread above.
TreeName = "scdds" //Compulsory. Name of the MDSplus tree.
PulseNumber = MDSDSTSHOT //Optional. If -1 a new pulse will be created and the MDSplus pulse number incremented.
StoreOnTrigger = 1 //Compulsory. If 0 all the data in the circular buffer is continuously stored. If 1 data is stored when the Trigger signal is 1 (see below).
EventName = "updatejScope" //Compulsory. Event sent to jScope when TimeRefresh seconds have elapsed.
TimeRefresh = 5 //Compulsory. An event with the name set in the property EventName is sent to jScope when TimeRefresh seconds have elapsed.
NumberOfPreTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store before the trigger.
NumberOfPostTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store after the trigger.
Signals = {
Trigger = { //Compulsory when StoreOnTrigger = 1. Must be set in index 0 of the Signals node. When the value of this signal is 1 data will be stored.
Type = uint8 //Type must be uint8
}
Time = { //Compulsory when StoreOnTrigger = 1. Can be store in any index, but TimeSignal must be set = 1
Type = uint32 //Type must be uint32 or int32
TimeSignal = 1 //When set, this signal will be considered as the time source against which all signals will be stored.
TimeSignalMultiplier = 1e-6 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
}
Thread1_Cycletime = { NodeName = "cfs2.system.CH01" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs2.system.CH02" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs2.system.CH03" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs2.system.CH04" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
>OUTPUTBUSMDSWRITER1<
}
/*
+Messages = { //Optional. If set a message will be fired every time one of the events below occur
Class = ReferenceContainer
+TreeOpenedOK = { //Optional, but if set, the name of the Object shall be TreeOpenedOK. If set a message containing a ConfigurationDatabase with param1=PULSE_NUMBER will be sent to the Destination, every time the Tree is successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeOpenedFail = { //Optional, but if set, the name of the Object shall be TreeOpenedFail. If set a message will be sent to the Destination, every time the Tree cannot be successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeFlushed = { //Optional, but if set, the name of the Object shall be TreeFlushed. If set a message will be sent to the Destination, every time the Tree is flushed.
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
}
*/
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+LoggerDataSource = { Class = LoggerDataSource }
+Timings = { Class = TimingDataSource }
+Timer = {
Class = LinuxTimer
SleepNature = "Busy" // Default | Busy
ExecutionMode = RealTimeThread // IndependentThread | RealTimeThread
CPUMask = 0x8 // IndependentThread CPU mask
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
>MDSWAVEGEN0<
+MDSWriter_0 = {
Class = MDSWriter
NumberOfBuffers = 2000 //Compulsory. Number of buffers in the circular buffer defined above. Each buffer is capable of holding a copy of all the DataSourceI signals.
CPUMask = 0x8 //Compulsory. Affinity assigned to the threads responsible for asynchronously flush data into the MDSplus database.
StackSize = 10000000 //Compulsory. Stack size of the thread above.
TreeName = "scdds" //Compulsory. Name of the MDSplus tree.
PulseNumber = MDSDSTSHOT //Optional. If -1 a new pulse will be created and the MDSplus pulse number incremented.
StoreOnTrigger = 1 //Compulsory. If 0 all the data in the circular buffer is continuously stored. If 1 data is stored when the Trigger signal is 1 (see below).
EventName = "updatejScope" //Compulsory. Event sent to jScope when TimeRefresh seconds have elapsed.
TimeRefresh = 5 //Compulsory. An event with the name set in the property EventName is sent to jScope when TimeRefresh seconds have elapsed.
NumberOfPreTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store before the trigger.
NumberOfPostTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store after the trigger.
Signals = {
Trigger = { //Compulsory when StoreOnTrigger = 1. Must be set in index 0 of the Signals node. When the value of this signal is 1 data will be stored.
Type = uint8 //Type must be uint8
}
Time = { //Compulsory when StoreOnTrigger = 1. Can be store in any index, but TimeSignal must be set = 1
Type = uint32 //Type must be uint32 or int32
TimeSignal = 1 //When set, this signal will be considered as the time source against which all signals will be stored.
TimeSignalMultiplier = 1e-6 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
}
Thread1_Cycletime = { NodeName = "cfs2.system.CH01" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs2.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs2.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs2.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
>OUTPUTBUSMDSWRITER<
}
/*
+Messages = { //Optional. If set a message will be fired every time one of the events below occur
Class = ReferenceContainer
+TreeOpenedOK = { //Optional, but if set, the name of the Object shall be TreeOpenedOK. If set a message containing a ConfigurationDatabase with param1=PULSE_NUMBER will be sent to the Destination, every time the Tree is successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeOpenedFail = { //Optional, but if set, the name of the Object shall be TreeOpenedFail. If set a message will be sent to the Destination, every time the Tree cannot be successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeFlushed = { //Optional, but if set, the name of the Object shall be TreeFlushed. If set a message will be sent to the Destination, every time the Tree is flushed.
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
}
*/
}
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
TimeConversion
Constants
Wavegen0TimeBroker
Wavegen0DataBroker
GAMSimulink1
StorageBroker
//LoggerBroker
}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
+StorageBroker = {
Class = IOGAM
InputSignals = {
Trigger = { DataSource = DDB1 Type = uint8 }
Time = { DataSource = DDB1 Type = uint32 }
Thread1_CycleTime = { DataSource = Timings Type = uint32 Alias = State1.Thread1_CycleTime }
GAMSimulink1_ReadTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = Timings Type = uint32 }
>OUTPUTBUSFLAT1DDB1<
}
OutputSignals = {
Trigger = { DataSource = MDSWriter_1 Type = uint8 }
Time = { DataSource = MDSWriter_1 Type = uint32 }
Thread1_Cycletime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ReadTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = MDSWriter_1 Type = uint32 }
>OUTPUTBUSFLAT1MDS1<
}
}
}
$TestApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Counter = { DataSource = Timer Type = uint32 }
Time = { Frequency = 1000 DataSource = Timer Type = uint32 }
}
OutputSignals = {
Counter = { DataSource = DDB1 Type = uint32 }
Time = { DataSource = DDB1 Type = uint32 }
}
}
+TimeConversion = {
Class = ConversionGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
TimeSec = { DataSource = DDB1 Type = float32 Gain = 0.000001 }
}
}
+Constants = {
Class = ConstantGAM
OutputSignals = {
zero = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Default=0 }
Trigger = { DataSource = DDB1 Type = uint8 NumberOfElements = 1 NumberOfDimensions=0 Default=1 }
}
}
+Wavegen1TimeBroker = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
time = { DataSource = MDSWavegen_1 Type = int32 }
}
}
+Wavegen1DataBroker = {
Class = IOGAM
InputSignals = {
wavegen_1 = { DataSource = MDSWavegen_1 Type = float32 NumberOfElements = >WAVEGEN1_ELEMS< }
}
OutputSignals = {
>INPUTBUSFLAT1<
}
}
\ No newline at end of file
+GAMSimulink1 = {
Class = SimulinkWrapperGAM
Library = "/root/MARTe2-examples/Simulinkso/algo_cfs2.so"
SymbolPrefix = "algo_cfs2"
Verbosity = VERBOSITY
SkipInvalidTunableParams = 0
TunableParamExternalSource= "MDSParamLoader1"
//NonVirtualBusMode = "ByteArray" // NOTE: homogeneus buses are not handled correctly, wrong
// handling of NumberOfElements = 1
NonVirtualBusMode = "Structured"
InputSignals = {
realtime = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Alias = TimeSec }
>INPUTBUSSTRUCT1<
}
OutputSignals = {
>OUTPUTBUSSTRUCT1<
}
/*
Parameters = {
k1 = (float32) 2.5
}
*/
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
TimeConversion
Constants
Wavegen1TimeBroker
Wavegen1DataBroker
GAMSimulink1
StorageBroker
//LoggerBroker
}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment