Logging data with TI F28379D C2000 development board in Simulink

8 visualizaciones (últimos 30 días)
Dirk Wanders
Dirk Wanders el 29 de Abr. de 2019
Editada: Dirk Wanders el 30 de Abr. de 2019
Hey All,
For a motor control project I want to save my scope data to the workspace or a file(the Simulink model is in the attachment). On other hardware this worked fine in the Simulation Data Inspector. However when I select the signal I want to save nothing shows up in the data inspector.
As a workaround I tried using the save to workspace block and the save option in the scope. However I was only manage to save the last 8 samples.
Is there someone that has used the F28379D for logging signals succefully? If so please let me know, then I now it is possible at least.
Also it will be greatly appreciated if someone has a working model and wants to share that with me.
Any other suggestions are also welcome.
Screenshot:
Screenshot data inspector.JPG
Thanks,
Dirk

Respuestas (2)

Venkatesh Chilapur
Venkatesh Chilapur el 30 de Abr. de 2019
Hi,
Please use the below script to stitch the files to one MAT file.
varName = 'ScopeData2';
list = dir(fullfile('C:/yyy/mat/', '*.mat')); %Path to MAT files..
name = {list.name};
str = sprintf('%s#', name{:});
num = sscanf(str, 'Data_%d.mat#'); %IMPORTANT: provide name of the mat files here
[dummy, index] = sort(num);
name = name(index)';
time = [];
data = [];
for i=1:length(name)
eval(['load C:/yyy/mat/' name{i}])
time = [time;eval([varName '.time'])]; %#ok<AGROW>
data = [data;eval([varName '.signals.values'])]; %#ok<AGROW>
end
finaldata = [time,double(data)]; % Sort with respect to time
sortedfinaldata = sortrows(finaldata,1);
HTH,
Regards,
Venkatesh C
  1 comentario
Dirk Wanders
Dirk Wanders el 30 de Abr. de 2019
Editada: Dirk Wanders el 30 de Abr. de 2019
Thanks, I will try this.
Edit: It works.
Do you know why the simulation data inspector doesn't work with this hardware?
Regards,
Dirk

Iniciar sesión para comentar.


Venkatesh Chilapur
Venkatesh Chilapur el 30 de Abr. de 2019
  1 comentario
Dirk Wanders
Dirk Wanders el 30 de Abr. de 2019
Thanks for your response, this works indeed.
But it results in thousands of files that I need to put together later. Is anyone aware of an option to write it to a single file or to the simulation data inspector?
Kind regards,
Dirk

Iniciar sesión para comentar.

Comunidades de usuarios

Más respuestas en  Power Electronics Control

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by