Skip to content
Snippets Groups Projects
Commit aa8aef92 authored by Federico Felici's avatar Federico Felici
Browse files

Remove obsolete files.

parent 48d0d73f
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1178 deletions
function [busNames,Buses] = algo_cfs1_proc_out_bus()
% [busNames,Buses] = SCDalgo_cfs1_signal_buses()
% Define some buses needed for the cfs1
busNames={};
Buses={};
% proc_out_bus
elems(1)=Simulink.BusElement;
elems(1).Name='signal1';
elems(1).DataType='single';
procoutBus = Simulink.Bus;
procoutBus.HeaderFile = '';
procoutBus.Description = '';
procoutBus.DataScope = 'Auto';
procoutBus.Alignment = -1;
procoutBus.Elements = elems;
clear elems;
% append to list
busNames{end+1} = 'algo_cfs1_procout';
Buses{end+1} = procoutBus;
end
function algo_cfs1and2_harness_setup(obj)
% run harness and check the result
%% define combined harness test data dictionary
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
system('rm -rf algo_cfs1and2_harness_run.sldd');
Simulink.data.dictionary.create('algo_cfs1and2_harness_run.sldd');
dd=Simulink.data.dictionary.open('algo_cfs1and2_harness_run.sldd');
dd.addDataSource('algo_cfs1.sldd');
dd.addDataSource('algo_cfs2.sldd');
ddd=dd.getSection('Design Data');
% proc_in_bus
elems(1)=Simulink.BusElement;
elems(1).Name='cfs1_proc_out';
elems(1).DataType='Bus: algo_cfs1_procout';
elems(2)=Simulink.BusElement;
elems(2).Name='cfs2_proc_out';
elems(2).DataType='Bus: algo_cfs2_procout';
procinBus = Simulink.Bus;
procinBus.HeaderFile = '';
procinBus.Description = '';
procinBus.DataScope = 'Auto';
procinBus.Alignment = -1;
procinBus.Elements = elems;
clear elems;
% assign proc_in bus in combined data dictionary
ddd.addEntry('algo_cfs12_procin',procinBus);
%assignin('base','algo_cfs12_procin',procinBus);
%% add combined harness dd to single algorithms
if exist('algo_cfs1.sldd','file')
dd=Simulink.data.dictionary.open('algo_cfs1.sldd');
dd.addDataSource('algo_cfs1and2_harness_run.sldd');
end
if exist('algo_cfs2.sldd','file')
dd=Simulink.data.dictionary.open('algo_cfs2.sldd');
dd.addDataSource('algo_cfs1and2_harness_run.sldd');
end
% % load tunable control parameters from mds
% shot = 1; % shot reference
% obj.actualize(shot);
%
% % SimIn object to customize configuration of Simulation run for test
% SimIn = Simulink.SimulationInput([obj.getname '_harness']);
%
% % Custom parameters for this run to save outport data
% SimIn = SimIn.setModelParameter('SaveOutput','on'); % set to save outport signals
% SimIn = SimIn.setModelParameter('SignalLogging','on'); % set to save log signals
% SimIn = SimIn.setModelParameter('OutputSaveName','SimOut');
% SimIn = SimIn.setModelParameter('SaveFormat','Dataset');
% SimIn = SimIn.setModelParameter('StartTime',num2str(obj.gettiming().t_start));
% SimIn = SimIn.setModelParameter('StopTime',num2str(obj.gettiming().t_stop));
% SimIn = SimIn.setModelParameter('FixedStep',Simulink.data.dictionary.createnum2str(obj.gettiming().dt));
%
% % simulate - simulate only single types to save time
% result = sim(SimIn);
%
% % check output port data
% tp = Simulink.data.evalinGlobal(obj.getname,'algo_cfs1_tp.Value');
% fp = Simulink.data.evalinGlobal(obj.getname,'algo_cfs1_fp');
%
% input = evalin('base','algo_cfs1_inbus1');
% input1 = input.signal1.Data;
% input2 = input.signal2.Data;
%
% output1 = result.simout.signal1.Data;
% output2 = result.simout.signal2.Data;
%
% size(input1)
% size(output1)
%
% maxerror1 = 0.1;
% maxerror2 = 0.1;
% assert(max(abs(output1 - input1.*tp.gain))<maxerror1,'Wrong output 1!');
% assert(max(abs(output2 - (input2.*tp.refmodel.gain+fp.refmodel.offset)))<maxerror2,'Wrong output 2!');
eval(sprintf('cd %s',startpath));
end
function [busNames,Buses] = algo_cfs2_proc_out_bus()
% [busNames,Buses] = SCDalgo_cfs2_signal_buses()
% Define some buses needed for the cfs2
busNames={};
Buses={};
% proc_out_bus
elems(1)=Simulink.BusElement;
elems(1).Name='signal1';
elems(1).DataType='single';
procout = Simulink.Bus;
procout.HeaderFile = '';
procout.Description = '';
procout.DataScope = 'Auto';
procout.Alignment = -1;
procout.Elements = elems;
clear elems;
% append to list
busNames{end+1} = 'algo_cfs2_procout';
Buses{end+1} = procout;
end
**/*.sldd
**/*.cfg
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
%% Holy grail test script:
% defines, inits and sets up cfs1 and cfs2 algo obj
% actulizes them on -1
% configures an interlaced cfs1 / cfs2 simulation model
% simulates it, storing outputs in th ebase workspace
% builds cfs1 and cfs2 .so libs
% builds MARTe2 dual thread cfs1 and cfs2 cfg file
% transfers these to realtime machine
% runs 1 MARTe2 run of cfs1 and cfs2
% retrieves the outputs from MDSplus
% plots the sim vs realtime signals (some of them)
%% cfs1 and cfs2 algo objects configuration
obj1=algoobj_cfs1; obj1.init; obj1.setup;
obj2=algoobj_cfs2; obj2.init; obj2.setup;
%% test shot actualization (model, to cope with MARTe2 settings)
shot=-1;
obj1.actualize(shot);
obj2.actualize(shot);
%% Workaround to define proc buses in one place only
% NOTE: this is not to be replicated,
% an higher hyerarchical SCDDS level must be put in place
% to do it properly
dd1=Simulink.data.dictionary.open('algo_cfs1.sldd');
ddd1=dd1.getSection('Design Data');
ddd1.deleteEntry('algo_cfs2_procout');
%
dd2=Simulink.data.dictionary.open('algo_cfs2.sldd');
ddd2=dd2.getSection('Design Data');
ddd2.deleteEntry('algo_cfs1_procout');
%
dd1.addDataSource('algo_cfs2.sldd');
dd2.addDataSource('algo_cfs1.sldd');
%% Simulink simulation
sim('cfs12combined_test');
%% cfs1 and cfs2 build
SCDconf_setConf('configurationSettingsCODEgcc');
load_system('algo_cfs1');
rtwbuild('algo_cfs1');
load_system('algo_cfs2');
rtwbuild('algo_cfs2');
%% MARTe2 cfg file autogeneration
cd marte2cfg/2threads/
algo_cfs1and2_create_marte2_cfg;
cd ../..
%% Transfer gencode and cfg to the realtime machine
system('scp marte2cfg/2threads/algo_cfs1and2_2threads.cfg root@node06:/root/MARTe2-examples/Configurations');
system('scp ../../../gencodes/CodeGenFolder/algo_cfs1.so root@node06:/root/MARTe2-examples/Simulinkso');
system('scp ../../../gencodes/CodeGenFolder/algo_cfs2.so root@node06:/root/MARTe2-examples/Simulinkso');
%% MARTe2 run of the same thing, on the realtime machine
system('ssh root@node06 ''source /etc/profile; cd MARTe2-examples; ./runcfs.sh''');
%% Gets MARTe2 outputs
mdsconnect('scd');
marteshot=mdsopen('scdds',0)
cfs1signal1marte2=tdi('cfs1.outputs.signal1');
cfs1signal2marte2=tdi('cfs1.outputs.signal2');
cfs1signal3marte2=tdi('cfs1.outputs.signal3');
cfs2signal1marte2=tdi('cfs2.outputs.signal1');
cfs2signal2marte2=tdi('cfs2.outputs.signal2');
cfs2signal3marte2=tdi('cfs2.outputs.signal3');
%% Plot combined simulation / realtime ouput signals
figure(1);
clf
hold on
plot(cfs1simout.signal1,'k--');%'LineWidth',4);
plot(cfs1simout.signal2,'k--');%'LineWidth',4);
plot(cfs1simout.signal3,'k--');%'LineWidth',4);
plot(cfs2simout.signal1,'k--');%'LineWidth',4);
plot(cfs2simout.signal2,'k--');%'LineWidth',4);
plot(cfs2simout.signal3,'k--');%'LineWidth',4);
plot(cfs1signal1marte2,'r');
plot(cfs1signal2marte2,'r');
plot(cfs1signal3marte2,'r');
plot(cfs2signal1marte2,'r');
plot(cfs2signal2marte2,'r');
plot(cfs2signal3marte2,'r');
xlim([0 3]);
grid on
>MDSPARAMS1<
>MDSPARAMS2<
>RTAPPPRESL<
>RTAPPSL<
>RTAPPPOSTSL<
>DATA<
>STATES<
% This script creates a testable
% MARTe2 cfg file for the cfs1 + cfs2 algorithms
% with these specifications:
%
% single realtime thread, LinuxTimer synched at 1kHz, 2 SimulinkWrapGAM in
% sequence
% tunable parameters MDSplus link via MDSObjLoader instantiations
% tunable waveforms MDSplus link via MDSObjWavegen instantiations
% inter algorithm communication via dedicated proc buses routing
% algorithms output MDSplus link via standard MDSWriter
%% 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;
%% Paths handling
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
%% MDSParameters stubs generation
fid=fopen('MDSPARAMS1.cfg','w');
obj1.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj1.printMARTe2parconfig(-1);//g'' MDSPARAMS1.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader1/g'' MDSPARAMS1.cfg');
fid=fopen('MDSPARAMS2.cfg','w');
obj2.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj2.printMARTe2parconfig(-1);//g'' MDSPARAMS2.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader2/g'' MDSPARAMS2.cfg');
%% MDSWavegen datasource part generation
fid=fopen('MDSWAVEGEN1.cfg','w');
wg1dim=obj1.printMARTe2wgbusconfig(-1,'algo_cfs1_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj1.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');
fid=fopen('MDSWAVEGEN2.cfg','w');
wg2dim=obj2.printMARTe2wgbusconfig(-1,'algo_cfs2_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj2.printMARTe2wgbusconfig(-1,''algo_cfs2_inBus'',1000);//g'' MDSWAVEGEN2.cfg');
system('sed -i ''s/MDSWavegen_algo_cfs2_inBus_1/MDSWavegen_2/g'' MDSWAVEGEN2.cfg');
system('sed -i ''s/wavegen_algo_cfs2_inBus_1/wavegen_2/g'' MDSWAVEGEN2.cfg');
%% structured bus stubs
algo_cfs1_inBus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_inBus');
cfs1inputbusflat=genbusstructstub('INPUTBUSSTRUCT1.cfg',algo_cfs1_inBus,'input','DDB1');
algo_cfs1_outBus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_outBus');
cfs1outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT1.cfg',algo_cfs1_outBus,'output','DDB1');
algo_cfs2_inBus=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_inBus');
cfs2inputbusflat=genbusstructstub('INPUTBUSSTRUCT2.cfg',algo_cfs2_inBus,'input','DDB2');
algo_cfs2_outBus=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_outBus');
cfs2outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT2.cfg',algo_cfs2_outBus,'output','DDB2');
%% Data types stubs
algo_cfs1_procout=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_procout');
algo_cfs2_procout=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_procout');
%algo_cfs12_procin=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs12_procin');
fid=fopen('TYPEDEF.cfg','w');
bus2marte2type(algo_cfs1_procout, 'algo_cfs1_procout', fid);
bus2marte2type(algo_cfs2_procout, 'algo_cfs2_procout', fid);
%bus2marte2type(algo_cfs12_procin, 'algo_cfs12_procin', fid);
fclose(fid);
%% Clean
clear algo_cfs1_outBus algo_cfs1_outBus algo_cfs1_procout
clear algo_cfs2_outBus algo_cfs2_outBus algo_cfs2_procout
clear algo_cfs12_procin
%% flat bus stubs
genbusflatstub1('INPUTBUS1DDB1FLAT.cfg',cfs1inputbusflat,'DDB1');
genbusflatstub1('INPUTBUS2DDB2FLAT.cfg',cfs2inputbusflat,'DDB2');
genbusflatstub1('OUTPUTBUSFLAT1.cfg',cfs1outputbusflat,'DDB1');
genbusflatstub1('OUTPUTBUSFLAT2.cfg',cfs2outputbusflat,'DDB2');
genbusflatstub1('OUTPUTBUSFLATMDS1.cfg',cfs1outputbusflat,'MDSWriter_1');
genbusflatstub1('OUTPUTBUSFLATMDS2.cfg',cfs2outputbusflat,'MDSWriter_2');
genbusflatstub2('OUTPUTBUSMDSWRITER1.cfg',cfs1outputbusflat,'cfs1.outputs','MDSW0PERIOD','2000');
genbusflatstub2('OUTPUTBUSMDSWRITER2.cfg',cfs1outputbusflat,'cfs2.outputs','MDSW0PERIOD','2000');
%% cfg build
system('cp algo_cfs1and2_1thread.cfgsrc algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>MDSPARAMS1</r MDSPARAMS1.cfg" -e "/>MDSPARAMS1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>MDSPARAMS2</r MDSPARAMS2.cfg" -e "/>MDSPARAMS2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>RTAPPPRESL</r rtapp-presl.cfgsrc" -e "/>RTAPPPRESL</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>RTAPPSL</r rtapp-simulinkwrapper.cfgsrc" -e "/>RTAPPSL</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>RTAPPPOSTSL</r rtapp-postsl.cfgsrc" -e "/>RTAPPPOSTSL</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>DATA</r data.cfgsrc" -e "/>DATA</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>STATES</r states.cfgsrc" -e "/>STATES</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>INPUTBUS1DDB1FLAT</r INPUTBUS1DDB1FLAT.cfg" -e "/>INPUTBUS1DDB1FLAT</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>INPUTBUS2DDB2FLAT</r INPUTBUS2DDB2FLAT.cfg" -e "/>INPUTBUS2DDB2FLAT</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT1</r INPUTBUSSTRUCT1.cfg" -e "/>INPUTBUSSTRUCT1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT2</r INPUTBUSSTRUCT2.cfg" -e "/>INPUTBUSSTRUCT2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT1</r OUTPUTBUSSTRUCT1.cfg" -e "/>OUTPUTBUSSTRUCT1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT2</r OUTPUTBUSSTRUCT2.cfg" -e "/>OUTPUTBUSSTRUCT2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT</r storagebroker1.cfg" -e "/>OUTPUTBUSFLAT</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS</r storagebroker2.cfg" -e "/>OUTPUTBUSFLATMDS</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>MDSWAVEGEN1</r MDSWAVEGEN1.cfg" -e "/>MDSWAVEGEN1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>MDSWAVEGEN2</r MDSWAVEGEN2.cfg" -e "/>MDSWAVEGEN2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1</r OUTPUTBUSFLAT1.cfg" -e "/>OUTPUTBUSFLAT1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT2</r OUTPUTBUSFLAT2.cfg" -e "/>OUTPUTBUSFLAT2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS1</r OUTPUTBUSFLATMDS1.cfg" -e "/>OUTPUTBUSFLATMDS1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS2</r OUTPUTBUSFLATMDS2.cfg" -e "/>OUTPUTBUSFLATMDS2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER1</r OUTPUTBUSMDSWRITER1.cfg" -e "/>OUTPUTBUSMDSWRITER1</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER2</r OUTPUTBUSMDSWRITER2.cfg" -e "/>OUTPUTBUSMDSWRITER2</d" algo_cfs1and2_1thread.cfg');
system('sed -i -e "/>TYPEDEF</r TYPEDEF.cfg" -e "/>TYPEDEF</d" algo_cfs1and2_1thread.cfg');
system(sprintf('sed -i "s/>WAVEGEN1_ELEMS</%d/g" algo_cfs1and2_1thread.cfg',wg1dim));
system(sprintf('sed -i "s/>WAVEGEN2_ELEMS</%d/g" algo_cfs1and2_1thread.cfg',wg2dim));
%% cfg adapt
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_cfs1and2_1thread.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_cfs1and2_1thread.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_cfs1and2_1thread.cfg',verbosity));
system(sprintf('sed -i "s/MDSW0PERIOD/%d/g" algo_cfs1and2_1thread.cfg',mdsperiod));
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+DDB2 = { 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<
>MDSWAVEGEN2<
+MDSWriter_1 = {
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 = "cfs1.system.CH01" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs1.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs1.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs1.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 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
}
}
*/
}
+MDSWriter_2 = {
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 = 0 //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 }
GAMSimulink2_ReadTime = { NodeName = "cfs2.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink2_ExecTime = { NodeName = "cfs2.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink2_WriteTime = { NodeName = "cfs2.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
>OUTPUTBUSMDSWRITER2<
}
}
}
+StorageBroker1 = {
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 }
>OUTPUTBUSFLAT1<
}
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 }
>OUTPUTBUSFLATMDS1<
}
}
+StorageBroker2 = {
Class = IOGAM
InputSignals = {
Trigger = { DataSource = DDB1 Type = uint8 }
Time = { DataSource = DDB1 Type = uint32 }
Thread1_CycleTime = { DataSource = Timings Type = uint32 Alias = State1.Thread1_CycleTime }
GAMSimulink2_ReadTime = { DataSource = Timings Type = uint32 }
GAMSimulink2_ExecTime = { DataSource = Timings Type = uint32 }
GAMSimulink2_WriteTime = { DataSource = Timings Type = uint32 }
>OUTPUTBUSFLAT2<
}
OutputSignals = {
Trigger = { DataSource = MDSWriter_2 Type = uint8 }
Time = { DataSource = MDSWriter_2 Type = uint32 }
Thread1_Cycletime = { DataSource = MDSWriter_2 Type = uint32 }
GAMSimulink2_ReadTime = { DataSource = MDSWriter_2 Type = uint32 }
GAMSimulink2_ExecTime = { DataSource = MDSWriter_2 Type = uint32 }
GAMSimulink2_WriteTime = { DataSource = MDSWriter_2 Type = uint32 }
>OUTPUTBUSFLATMDS2<
}
}
}
+Types = {
Class = ReferenceContainer
>TYPEDEF<
}
$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 = {
>INPUTBUS1DDB1FLAT<
}
}
+Wavegen2TimeBroker = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
time = { DataSource = MDSWavegen_2 Type = int32 }
}
}
+Wavegen2DataBroker = {
Class = IOGAM
InputSignals = {
wavegen_2 = { DataSource = MDSWavegen_2 Type = float32 NumberOfElements = >WAVEGEN2_ELEMS< }
}
OutputSignals = {
>INPUTBUS2DDB2FLAT<
}
}
\ No newline at end of file
+ProcRouter = {
Class = IOGAM
InputSignals = {
proc_out_1 = { DataSource = DDB1 Type = algo_cfs1_procout }
proc_out_2 = { DataSource = DDB1 Type = algo_cfs2_procout }
}
OutputSignals = {
proc_in_2 = { DataSource = DDB1 Type = algo_cfs1_procout }
proc_in_1 = { DataSource = DDB1 Type = algo_cfs2_procout }
}
}
+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<
proc_in = { DataSource = DDB1 Type = algo_cfs2_procout Alias = proc_in_1 }
}
OutputSignals = {
>OUTPUTBUSSTRUCT1<
proc_out = { DataSource = DDB1 Type = algo_cfs1_procout Alias = proc_out_1 }
}
/*
Parameters = {
k1 = (float32) 2.5
}
*/
}
+GAMSimulink2 = {
Class = SimulinkWrapperGAM
Library = "/root/MARTe2-examples/Simulinkso/algo_cfs2.so"
SymbolPrefix = "algo_cfs2"
Verbosity = VERBOSITY
SkipInvalidTunableParams = 0
TunableParamExternalSource= "MDSParamLoader2"
//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 }
>INPUTBUSSTRUCT2<
proc_in = { DataSource = DDB1 Type = algo_cfs1_procout Alias = proc_in_2 }
}
OutputSignals = {
>OUTPUTBUSSTRUCT2<
proc_out = { DataSource = DDB1 Type = algo_cfs2_procout Alias = proc_out_2 }
}
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
TimeConversion
Constants
Wavegen1TimeBroker
Wavegen1DataBroker
Wavegen2TimeBroker
Wavegen2DataBroker
ProcRouter
GAMSimulink1
GAMSimulink2
StorageBroker1
StorageBroker2
//LoggerBroker
}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
>MDSPARAMS1<
>MDSPARAMS2<
>RTAPPTHREAD1<
>RTAPPTHREAD2<
>DATA<
>STATES<
% This script creates a testable
% MARTe2 cfg file for the cfs1 + cfs2 algorithms
% with these specifications:
%
% 2 rt threads, 1 SimulinkWrapperGAMs per thread
% tunable parameters MDSplus link via MDSObjLoader instantiations
% tunable waveforms MDSplus link via MDSObjWavegen instantiations
% inter algorithm communication via dedicated proc buses routing
% algorithms output MDSplus link via standard MDSWriter
%% 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;
%% Paths handling
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
%% MDSParameters stubs generation
fid=fopen('MDSPARAMS1.cfg','w');
obj1.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj1.printMARTe2parconfig(-1);//g'' MDSPARAMS1.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader1/g'' MDSPARAMS1.cfg');
fid=fopen('MDSPARAMS2.cfg','w');
obj2.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj2.printMARTe2parconfig(-1);//g'' MDSPARAMS2.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader2/g'' MDSPARAMS2.cfg');
%% MDSWavegen datasource part generation
fid=fopen('MDSWAVEGEN1.cfg','w');
wg1dim=obj1.printMARTe2wgbusconfig(-1,'algo_cfs1_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj1.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');
fid=fopen('MDSWAVEGEN2.cfg','w');
wg2dim=obj2.printMARTe2wgbusconfig(-1,'algo_cfs2_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj2.printMARTe2wgbusconfig(-1,''algo_cfs2_inBus'',1000);//g'' MDSWAVEGEN2.cfg');
system('sed -i ''s/MDSWavegen_algo_cfs2_inBus_1/MDSWavegen_2/g'' MDSWAVEGEN2.cfg');
system('sed -i ''s/wavegen_algo_cfs2_inBus_1/wavegen_2/g'' MDSWAVEGEN2.cfg');
%% structured bus stubs
algo_cfs1_inBus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_inBus');
cfs1inputbusflat=genbusstructstub('INPUTBUSSTRUCT1.cfg',algo_cfs1_inBus,'input','DDB1');
algo_cfs1_outBus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_outBus');
cfs1outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT1.cfg',algo_cfs1_outBus,'output','DDB1');
algo_cfs2_inBus=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_inBus');
cfs2inputbusflat=genbusstructstub('INPUTBUSSTRUCT2.cfg',algo_cfs2_inBus,'input','DDB2');
algo_cfs2_outBus=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_outBus');
cfs2outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT2.cfg',algo_cfs2_outBus,'output','DDB2');
%% Data types stubs
algo_cfs1_procout=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_procout');
algo_cfs2_procout=Simulink.data.evalinGlobal('algo_cfs2','algo_cfs2_procout');
%algo_cfs12_procin=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs12_procin');
fid=fopen('TYPEDEF.cfg','w');
bus2marte2type(algo_cfs1_procout, 'algo_cfs1_procout', fid);
bus2marte2type(algo_cfs2_procout, 'algo_cfs2_procout', fid);
%bus2marte2type(algo_cfs12_procin, 'algo_cfs12_procin', fid);
fclose(fid);
%% Clean
clear algo_cfs1_outBus algo_cfs1_outBus algo_cfs1_procout
clear algo_cfs2_outBus algo_cfs2_outBus algo_cfs2_procout
clear algo_cfs12_procin
%% flat bus stubs
genbusflatstub1('INPUTBUS1DDB1FLAT.cfg',cfs1inputbusflat,'DDB1');
genbusflatstub1('INPUTBUS2DDB2FLAT.cfg',cfs2inputbusflat,'DDB2');
genbusflatstub1('OUTPUTBUSFLAT1.cfg',cfs1outputbusflat,'DDB1');
genbusflatstub1('OUTPUTBUSFLAT2.cfg',cfs2outputbusflat,'DDB2');
genbusflatstub1('OUTPUTBUSFLATMDS1.cfg',cfs1outputbusflat,'MDSWriter_1');
genbusflatstub1('OUTPUTBUSFLATMDS2.cfg',cfs2outputbusflat,'MDSWriter_2');
genbusflatstub2('OUTPUTBUSMDSWRITER1.cfg',cfs1outputbusflat,'cfs1.outputs','MDSW0PERIOD','2000');
genbusflatstub2('OUTPUTBUSMDSWRITER2.cfg',cfs1outputbusflat,'cfs2.outputs','MDSW0PERIOD','2000');
%% cfg build
system('cp algo_cfs1and2_2threads.cfgsrc algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>MDSPARAMS1</r MDSPARAMS1.cfg" -e "/>MDSPARAMS1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>MDSPARAMS2</r MDSPARAMS2.cfg" -e "/>MDSPARAMS2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>RTAPPTHREAD1</r rtapp-thread1.cfgsrc" -e "/>RTAPPTHREAD1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>RTAPPTHREAD2</r rtapp-thread2.cfgsrc" -e "/>RTAPPTHREAD2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>DATA</r data.cfgsrc" -e "/>DATA</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>STATES</r states.cfgsrc" -e "/>STATES</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>INPUTBUS1DDB1FLAT</r INPUTBUS1DDB1FLAT.cfg" -e "/>INPUTBUS1DDB1FLAT</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>INPUTBUS2DDB2FLAT</r INPUTBUS2DDB2FLAT.cfg" -e "/>INPUTBUS2DDB2FLAT</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT1</r INPUTBUSSTRUCT1.cfg" -e "/>INPUTBUSSTRUCT1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT2</r INPUTBUSSTRUCT2.cfg" -e "/>INPUTBUSSTRUCT2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT1</r OUTPUTBUSSTRUCT1.cfg" -e "/>OUTPUTBUSSTRUCT1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT2</r OUTPUTBUSSTRUCT2.cfg" -e "/>OUTPUTBUSSTRUCT2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT</r storagebroker1.cfg" -e "/>OUTPUTBUSFLAT</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS</r storagebroker2.cfg" -e "/>OUTPUTBUSFLATMDS</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>MDSWAVEGEN1</r MDSWAVEGEN1.cfg" -e "/>MDSWAVEGEN1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>MDSWAVEGEN2</r MDSWAVEGEN2.cfg" -e "/>MDSWAVEGEN2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1</r OUTPUTBUSFLAT1.cfg" -e "/>OUTPUTBUSFLAT1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT2</r OUTPUTBUSFLAT2.cfg" -e "/>OUTPUTBUSFLAT2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS1</r OUTPUTBUSFLATMDS1.cfg" -e "/>OUTPUTBUSFLATMDS1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSFLATMDS2</r OUTPUTBUSFLATMDS2.cfg" -e "/>OUTPUTBUSFLATMDS2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER1</r OUTPUTBUSMDSWRITER1.cfg" -e "/>OUTPUTBUSMDSWRITER1</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER2</r OUTPUTBUSMDSWRITER2.cfg" -e "/>OUTPUTBUSMDSWRITER2</d" algo_cfs1and2_2threads.cfg');
system('sed -i -e "/>TYPEDEF</r TYPEDEF.cfg" -e "/>TYPEDEF</d" algo_cfs1and2_2threads.cfg');
system(sprintf('sed -i "s/>WAVEGEN1_ELEMS</%d/g" algo_cfs1and2_2threads.cfg',wg1dim));
system(sprintf('sed -i "s/>WAVEGEN2_ELEMS</%d/g" algo_cfs1and2_2threads.cfg',wg2dim));
%% cfg adapt
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_cfs1and2_2threads.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_cfs1and2_2threads.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_cfs1and2_2threads.cfg',verbosity));
system(sprintf('sed -i "s/MDSW0PERIOD/%d/g" algo_cfs1and2_2threads.cfg',mdsperiod));
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+DDB2 = { 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<
>MDSWAVEGEN2<
+RTThreadSynch1 = {
Class = RealTimeThreadSynchronisation
Timeout = 1000 //Timeout in ms to wait for the thread to cycle.
//Timeout = 0
}
+RTThreadReadBack2 = {
Class = RealTimeThreadAsyncBridge
NumberOfBuffers = 3 //Optional but < 64. Default = 1. Each buffer contains a copy of each signal.
//HeapName = "Default" //Optional. Default = GlobalObjectsDatabase::Instance()->GetStandardHeap();
//Optional. Default = TTInfiniteWait. The TerminateOutputCopy function can block when the counter used to newest written buffer overflows and needs to be reset.
// If the reader should wait for this counter to be properly reset then the ResetMSecTimeout should
// be increased to a large number. If instead the reader does not mind to get oldest buffer (instead of the newest) while this reset operation
// is being performed, the ResetMSecTimeout should be set to 0.
// This overflow will occur every 2**32-1 writes, which at e.g. 1 kHz frequency, will occur every ~49 days).
//ResetMSecTimeout = 0
Signals = {
proc_out_2 = { Type = algo_cfs2_procout }
}
}
+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 = 0x10 //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 = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs1.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs1.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs1.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 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
}
}
*/
}
+MDSWriter_2 = {
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 = 0x10 //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 = 0 //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,
}
Thread2_Cycletime = { NodeName = "cfs2.system.CH01" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink2_ReadTime = { NodeName = "cfs2.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink2_ExecTime = { NodeName = "cfs2.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink2_WriteTime = { NodeName = "cfs2.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
>OUTPUTBUSMDSWRITER2<
}
}
}
+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 }
>OUTPUTBUSFLAT<
}
OutputSignals = {
Trigger = { DataSource = MDSWriter_0 Type = uint8 }
Time = { DataSource = MDSWriter_0 Type = uint32 }
Thread1_Cycletime = { DataSource = MDSWriter_0 Type = uint32 }
GAMSimulink1_ReadTime = { DataSource = MDSWriter_0 Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = MDSWriter_0 Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = MDSWriter_0 Type = uint32 }
>OUTPUTBUSFLATMDS<
}
}
}
+Types = {
Class = ReferenceContainer
>TYPEDEF<
}
$TestApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
/*** Thread1 ***/
+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 }
}
}
+T1TSynch = {
Class = IOGAM
InputSignals = {
TimeSec = { DataSource = DDB1 Type = float32 }
>PROCOUT1BUSDDB1FLAT<
}
OutputSignals = {
TimeSec = { DataSource = RTThreadSynch1 Type = float32 }
>PROCOUT1BUSRTT1FLAT<
}
}
+T2Readback = {
Class = IOGAM
InputSignals = {
>PROCOUT2BUSRDBK2FLAT<
}
OutputSignals = {
>PROCOUT2BUSDDB1FLAT<
}
}
+Procinbuilder1 = {
Class = IOGAM
InputSignals = {
>PROCOUT1BUSDDB1FLAT<
>PROCOUT2BUSDDB1FLAT<
}
OutputSignals = {
>PROCINBUSDDB1FLAT<
}
}
+Constants1 = {
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 = {
>INPUTBUS1DDB1FLAT<
}
}
/*** Thread2 ***/
+T1T2Com = {
Class = IOGAM
InputSignals = {
TimeSec = { DataSource = RTThreadSynch1 Type = float32 }
>PROCOUT1BUSRTT1FLAT<
}
OutputSignals = {
TimeSec = { DataSource = DDB2 Type = float32 }
>PROCOUT1BUSDDB2FLAT<
}
}
+Constants2 = {
Class = ConstantGAM
OutputSignals = {
zero = { DataSource = DDB2 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Default=0 }
Trigger = { DataSource = DDB2 Type = uint8 NumberOfElements = 1 NumberOfDimensions=0 Default=1 }
}
}
+Wavegen2TimeBroker = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB2 Type = uint32 }
}
OutputSignals = {
time = { DataSource = MDSWavegen_2 Type = int32 }
}
}
+Wavegen2DataBroker = {
Class = IOGAM
InputSignals = {
wavegen_2 = { DataSource = MDSWavegen_2 Type = float32 NumberOfElements = >WAVEGEN2_ELEMS< }
}
OutputSignals = {
>INPUTBUSFLAT2<
}
}
+T2TCom = {
Class = IOGAM
InputSignals = {
>PROCOUT2BUSDDB2<
}
OutputSignals = {
>PROCOUT2BUSRTT2<
}
}
\ 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 }
>INPUTBUSSTRUCT<
}
OutputSignals = {
>OUTPUTBUSSTRUCT<
}
/*
Parameters = {
k1 = (float32) 2.5
}
*/
}
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