Logging Data in External Mode

6 次查看(过去 30 天)
Is there a way to collect more then one frame of data in External Mode?
I'm trying to read in the signal from the STM32F4 Discovery Mic In Block (Sample Rate 8000, Frame Size 1600) by connnecting the block to the Scope Block (Log Data to Workspace without any limitations). By doing this I only get one frame consisting of 1600 samples even though the simulation is running for 10 seconds.

回答(1 个)

Siddharth Mohan
Siddharth Mohan 2016-9-13
Hi Alexander,
You can save the complete simulation data in External Mode using the 'External Mode Control Panel'. You can do this in two different ways.
1) Increase the External mode trigger duration.
You can change the External mode trigger duration to log more data. From your model, go to Code->External Mode Control Panel-> Signal & triggering -> Duration. Set this to a number that might be enough for you to capture the complete simulation data. Please note that some targets might limit you to have a specific trigger duration.
2) Saving simulation data to MAT files
You can also save simulation data to MAT file(s). The number of MAT files generated will depend on the 'External mode trigger duration'. For example: If the trigger duration is set to 100 and the complete simulation generates 200 data points, you will get two MAT files. The first will have data stored in a variable from T1 -> T100 and the second will have data from T101 -> T200. You can follow the steps below to try this out.
a) Code -> External Mode Control Panel -> Data Archiving
b) Check the 'Enable archiving' box.
c) In the 'Directory' edit box, specify a directory where you'd like to save the MAT file(s)
d) In the 'File' edit box, enter a name for your MAT file.
Let me know if you have other questions!
Thanks,
Siddharth
  2 个评论
Alexander Kramlich
Alexander Kramlich 2016-9-14
编辑:Alexander Kramlich 2016-9-14
Hi Siddharth,
I've already seen this answer in another thread, but both ways didn't quite solved my problem.
1) I managed to get more than 1 frame, but If I change the Duration to a value greater than 10, the variable is created in the workspace, but no values are stored in it. In case of Duration equal to 10 (or below), I get 10 (or less) frames with 1600 values each, but since my simulation time is 5 seconds I wonder where are the other 15 frames? Since my sample rate is set to 8000 Hz and the frame size is set to 1600, there has to be 25 frames total. What happens to the other 15 frames? Do I get the first 10 frames or do I get random frames over the period of 5 seconds?
Therefore I don't quite understand the concept of Duration in this context. Why I just can't save the data I see in the scope?
2) Similar problem as in 1). If Duration is equal to 10, the file is generated and I get 10 frames (but not all frames). If Duration is greater than 10, no file is generated at all.
Thanks for your help anyway, Alex
Siddharth Mohan
Siddharth Mohan 2016-9-16
Hi Alex,
I can't say for sure what might be going on here. This will need some more investigation. Could you please contact Mathworks technical support? We'll take it forward from there. Here is the link to contact support:
Thanks, Siddharth

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by