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.
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.
|
我在我的实时控制器上对共享变量进行写操作,运行于我的主机上的客户端对其进行读操作。当我通过输出至数组或者写入文件的方式查看数据,我注意到有许多重复的数据,如果我同时也读取共享变的时间戳,我看到重复的时间戳。我怎样才能避免读取重复的数据点,而仅仅读取一次?
通过对你的网络发布共享变量使能RT FIFO,并将其配置为多元素模式,可以避免读取重复的数据点,而仅仅读取一次。
当对一个没有使能RT FIFO,或者使能了RT FIFO并配置为单元素模式的网络发布共享变量进行写操作时,数据点将保留在缓冲中,直到被新的数据点覆盖。当客户端从该缓冲中进行读取操作,将重复读取同样的数据,直到新的数据可用。
当你使能RT FIFO,并配置为多元素模式,数据将仅保留在缓存中直到其被客户端读取。一旦数据被客户端读取,它将从缓冲中移除,并不能再次被读取。客户端将不会进行更新直到新数据可用。
|