Simulink timer subsystem example

版本 1.0.0.0 (34.7 KB) 作者: Marc Compere
A single-pulse input initiates elapsed time comparison to a desired timer duration.
536.0 次下载
更新时间 2018/6/13

查看许可证

This is the Readme.txt file for the Simulink timer subsystem example.
The timer is a Simulink implementation of a (simulation) timer that can be armed
by sending it a 1-pulse ping signal to 'ping input'.

A single-pulse input initiates an elapsed time calculation that is subsequently
compared to a desired timer duration. The boolean result of this comparison
provides the timer state output.

A 1-pulse ping can be generated with the change detect block that looks for
any difference in it's input signal.

The timer is armed when a 1-pulse ping is detected which begins an elapsed
time calculation. Elapsed time is compared to the desired timer duration
and the timer state is held high while t_elapsed <= t_timer_duration.

Inside the timer subsystem is a 'triggered capture-and-hold' block that captures
the current simulation time when a high is detected on the ping input signal.

This timer subsystem has been tested on Matlab R2016b and R2018a and a close
variant of this subsystem has been used as far back as 2004.

The soft real time subsystem shown in the screenshot is not included in this
single-file release but is freely avaialable under the MathWorks File Exchange
entry titled "Soft Real Time Block for Pacing Simulink Simulations" at:
https://www.mathworks.com/matlabcentral/fileexchange/67520-soft-real-time-block-for-pacing-simulink-simulations

There is no requirement for the soft real time subsystem for this timer to work
but running in soft real time helps illustrate how the timer subsystem works with
the manual switch blocks.
Alternatively the native Simulink 'Pace' block also helps run the system at a
manageable pace for clear demonstration using the manual switch block.

----------------------------------------------------------------------------------

Marc Compere, comperem@gmail.com
created : 12 Jun 2018
modified: 12 Jun 2018

引用格式

Marc Compere (2024). Simulink timer subsystem example (https://www.mathworks.com/matlabcentral/fileexchange/67712-simulink-timer-subsystem-example), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0