Xpc target data logging at different rate

1 回表示 (過去 30 日間)
Jan De Vries
Jan De Vries 2012 年 10 月 20 日
My xpc model rund at 100Hz. I want to log several data for a week non stop. However, the data doesn't need to be logged every 0.01s, only every 1s.
How can I log data at a different rate than my simulation steptime? And is it possible to log so many datapoints?
  1 件のコメント
Gordon Weast
Gordon Weast 2012 年 10 月 31 日
Jan,
I believe that using the 'Decimation' parameter in a file scope should allow you to save a subset. In your case, set Decimation to 100 to log every 100th time step.
Gordon Weast, xPC Target Development

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

回答 (1 件)

Ryan G
Ryan G 2012 年 10 月 23 日
Eventually I would suspect the system will run out of memory for one reason or another. However, you can use a file scope to log the data to a file on the host machine. See xpc data logging on the file exchange.
You can use a rate transition so that the data going to that scope is at 1hz instead of 100hz.
I would make sure as little as possible gets logged in memory since a week is a very long time for a sim in my opinion. Good Luck.
  2 件のコメント
Jan De Vries
Jan De Vries 2012 年 10 月 23 日
Thanks, Ryan. Doesn't a rate transition just hold values until next simulation step resulting in the same number of datapoints?
Ryan G
Ryan G 2012 年 10 月 23 日
It will repeat the values if you set it at a faster rate. If you set it for a slower rate, as you desire here, it will only pass through the value at the 1Hz rate. Go ahead and try it out in Simulink first to verify, but I know it will work as you desire.

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

カテゴリ

Help Center および File ExchangeTarget Computer Setup についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by