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

realtime signal fed to simulink

parent 1efc146b
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,11 @@
% source MDSplus shotnumber
mdssrcshot=-1;
% destination MDSplus shotnumber (-1 stands for increment current by 1)
mdsdstshot=1;
mdsdstshot=2;
% verbosity level
verbosity=2;
% MDS writer period
mdsperiod=1;
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
......@@ -80,7 +82,7 @@ diary off
system('rm -rf mdswriter1.cfg');
diary mdswriter1.cfg
for i=1:numel(outsignals)
fprintf("%s = { NodeName =""template.outputs.%s"" Period = 1 AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 } \n", char(outsignals{i}{1}),char(outsignals{i}{5}));
fprintf("%s = { NodeName =""template.outputs.%s"" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 } \n", char(outsignals{i}{1}),char(outsignals{i}{5}));
end
diary off
......@@ -104,4 +106,5 @@ system(sprintf('sed -i "s/>WAVEGEN0_ELEMS</%d/g" algo_template.cfg',wg0dim));
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_template.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_template.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_template.cfg',verbosity));
system(sprintf('sed -i "s/MDSW0PERIOD/%d/g" algo_template.cfg',mdsperiod));
......@@ -29,21 +29,23 @@
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-9 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
TimeSignalMultiplier = 1e-6 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
}
*/
Thread1_Cycletime = { NodeName = "template.system.CH01" Period = 1 AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "template.system.CH02" Period = 1 AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "template.system.CH03" Period = 1 AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "template.system.CH04" Period = 1 AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
Thread1_Cycletime = { NodeName = "template.system.CH01" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "template.system.CH02" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "template.system.CH03" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "template.system.CH04" Period = MDSW0PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = 2000 SamplePhase = 0 }
>OUTPUTBUSMDSWRITER<
}
......@@ -82,7 +84,8 @@
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
GAMTimer
TimeConversion
Constants
Wavegen0TimeBroker
Wavegen0DataBroker
......
+StorageBroker = {
Class = IOGAM
InputSignals = {
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 }
......@@ -8,6 +10,8 @@
>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 }
......
......@@ -12,11 +12,21 @@ $TestApp = {
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 }
}
}
+Wavegen0TimeBroker = {
......
......@@ -10,7 +10,7 @@
NonVirtualBusMode = "Structured"
InputSignals = {
realtime = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Alias = zero }
realtime = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Alias = TimeSec }
>INPUTBUSSTRUCT<
}
OutputSignals = {
......
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