Does it exist function for a Simulink model related to time (more or less like 'now') ?

1 回表示 (過去 30 日間)
Damiano Capocci
Damiano Capocci 2017 年 10 月 13 日
コメント済み: Walter Roberson 2017 年 10 月 16 日
I'm working on a FPGA project, i want to have a function which gives values related to time (current). Unfortunately "now" is not fully supported in a Simulink model. Could you tell me something?
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
It would be easier to have it as a signal entering the FPGA. Second easiest would possibly be a hybrid FPGA device where you can read the time off the other side. I don't know if a real time clock can be done in FPGA itself.
But I have to ask if is really the case that while everything is paused for debugging that the timer should keep going, and that you do not want to be able to simulate faster than real time for testing purposes?

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

回答 (1 件)

Prashant Arora
Prashant Arora 2017 年 10 月 16 日
Hi Damiano,
If you would like to use the "now" functionality in Simulink for simulation purposes, please refer to the following link:
The above method does not support code generation as functions like "now", "datetime" and "clock" do not support it. I believe the following post provides a reasonable workaround:
Please refer to the model provided in the link above.
Hope this helps!
Prashant

Community Treasure Hunt

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

Start Hunting!

Translated by