From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



实时系统中关键代码的错误时间戳问题



主要软件:
主要软件版本: 7.1
主要软件修正版本: N/A
次要软件: N/A

问题: 实时操作系统通过大概每微秒产生中断来更新系统时间。为了减小时间抖动,在实时操作系统在运行关键代码的时候不会产生这个中断。这就会导致实时操作系统的系统事件滞后或者停止。这会影响场点读写,获得时间字符串或是读取DAQmx等函数的返回时间。

解答:

休眠时间

如果你的紧要时间代码在一个推荐使用等待(ms)或是等待下一个整数倍毫秒VI(或是实时的定时计数部件)中运行,使紧要时间线程休眠。休眠会允许处理器时间更新系统时间,

硬件计数

使用DAQ办卡时钟等外部时钟源,使用的时间可以根据时钟频率和滴答计数用数学计算的方法计算出来。

提示:

时钟嘀嗒计数

虽然实时操作系统的系统时间会在运行紧要时间代码时变得不是那么紧凑,但是时钟滴答计数VI不会受到影响。

注意:

  • 时钟滴答计数过大约49天会翻转一次。
  • 1 时钟滴答 = 1.000686 微秒。
  • 如果控制器晶振的协调过,系统时间每天可能会产生530秒的时钟偏斜




相关链接: KnowledgeBase 3C3FT6VM: How Do the Timing VIs Function On My Real-Time FieldPoint Controller?
KnowledgeBase 25OBHC4U:  LabVIEW RT's "Get Date/Time in Seconds" Function Does Not Keep Real-Time -- It Falls Behind.
KnowledgeBase 2368MD4U:  How Can I Accurately Measure the Determinism of a Time-Critical Application Using LabVIEW RT?



附件:





报告日期: 03/15/2002
最近更新: 05/27/2011
文档编号: 2JEEFNKN