这个block是在“Simulink Real Time Execution”(文件ID:#21908)中给出的block的金宝app一个版本,具有一些增强的特性。这些块可以用来降低Simulink模型的速度,以便实时观察它的运行情况。金宝app与之前的提交相比,这个版本考虑了计算步骤之间的执行时间。此外,高分辨率的性能计数器用于获得超过1微秒精度的时间。最后,剩余时间被计算并作为输出给出。
Ivo Houtzager(2021)。金宝appSimulink模块的实时执行(//www.tatmou.com/matlabcentral/fileexchange/30953-金宝appsimulink-block-for-real-time-execution), MATLAB中央文件交换。检索.
我还得到以下错误:
Sfun_rttime.c:(.text+0x1a0): undefined reference to ' hightimer'
将hightimer()函数定义为static解决了这个问题:
__inline static double hightimer()
当我第一次使用mex命令编译函数时工作:
墨西哥人- o sfun_rttime.c
这正是我想要的。谢谢你!
嗯,我在R2019a中得到这个错误:
Error in S-function 'rttime_example/Timer for Real-Time': S-function 'sfun_rttime' does not exist .日志含义
只能在simulink中工作金宝app。不能在目标硬件上编译。
巨大的贡献!很感激!
Sfun_rttime.obj:sfun_rttime.c:(.text+0x1c0): undefined reference to ' hightimer'
Sfun_rttime.obj:sfun_rttime.c:(.text+0x1f0): undefined reference to ' hightimer'
Sfun_rttime.obj:sfun_rttime.c:(.text+0x219): undefined reference to ' hightimer'
这也适用于嵌入式。
当试图编译时,我得到这个错误消息:
sfun_rttime。o:在函数hightimer中:
Sfun_rttime.c:(.text+0x2085):未定义对' clock_gettime'的引用
sfun_rttime。o:在函数' mdlOutputs'中:
Sfun_rttime.c:(.text+0x2116):未定义对' clock_gettime'的引用
Sfun_rttime.c:(.text+0x2191):未定义对' clock_gettime'的引用
Sfun_rttime.c:(.text+0x21d4):未定义对' clock_gettime'的引用
Collect2: ld返回1退出状态
` sfun_rttime `的链接。mexa64”失败了。
有人能给点建议吗?非常感谢
非常感谢。它工作!
必须首先使用mex命令编译该函数。
墨西哥人- o sfun_rttime.c
我一直得到这个错误:错误在S-function 'rttime_example/Timer for Real-Time': S-function 'sfun_rttime' does not exist。
有人能帮我一下吗?