Simulink: To Workspace block, collects only one or two data points (Running in External mode)

38 ビュー (過去 30 日間)
I am running a simulink model in external mode, and I get only one data point after the run from "To workspace block". I have tinkered with the settings a lot to get this to work, but I am not able to get more than two data points.
I am using Matlab R2015b, model is running on Arduino Mega 2560. The following are the screenshots of the settings I am using: Model:
To Worksoace block setting:
Solver settings:
Data Import/Export:

採用された回答

Boris
Boris 2015 年 12 月 12 日
Unfortunately I have the same problem. It worked fine with R2014b and doesn't work with R2015a and R2015b.
If you (or someone else) finds a solution, I'm very interested.
  2 件のコメント
Boris
Boris 2016 年 3 月 9 日
How can my answer be the accepted one? I just said I have the same problem and still have the problem.
zaman  sowmik
zaman sowmik 2020 年 2 月 21 日
because you are only one who has given an effort

サインインしてコメントする。

その他の回答 (5 件)

Min Seg
Min Seg 2016 年 3 月 1 日
I have tried 2014b and that seems to work fine.
  1 件のコメント
N Kando
N Kando 2017 年 1 月 26 日
編集済み: N Kando 2017 年 1 月 26 日
Windows OS in both cases (versus Mac/Linux)?

サインインしてコメントする。


Vidya Viswanathan
Vidya Viswanathan 2016 年 4 月 1 日
Hi,
I notice that in your model, the sample rate used is 6ms. Typically, the gap in output data is observed when the sample rate is less than 10ms because the target tries to upload the data to the host every few seconds.
To resolve the issue,
1) Please increase the duration further in your model and see if it satisfies your requirements. Ideally, it is not recommended to run external mode on Arduino targets at very high rates (such as 1 ms).
2) If your requirement is to have data archiving at very high speeds, it is recommended to use a serial block for data upload. You would then use an ICT receive block on the Host to log data into MATLAB.
I hope this addresses your query.
Regards,
Vidya Viswanathan
  1 件のコメント
N Kando
N Kando 2017 年 1 月 26 日
編集済み: N Kando 2017 年 1 月 26 日
I am encountering the same issues with the MinSeg.
The dynamic data goes to scope without issue, but only the final value goes to the workspace.
I have tried an (inherited) simulation step of 0.1 [s], and also set the decimation to 10. This did not have any effect; only the final value appears.
[r2015b]

サインインしてコメントする。


Auralius Manurung
Auralius Manurung 2016 年 2 月 26 日
I am having the same problem in R2015b. Any update on this issue will be very much appreciated.

Giorgio Concu
Giorgio Concu 2017 年 12 月 6 日
I had the same problem and I fix it just upgrading to R2016b.

Number seven
Number seven 2022 年 3 月 10 日
I was having a similar issue where no data was being output to the workspace. I fixed it by going to tab Code > External mode control panel > Data Archiving. Then here I enabled Data Archiving, selected a directory and typed my desired file name. Now I have my variable in the To Workspace block being written to workspace, although I also get a file in the same directory with the name I set in Data Archiving.

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by