<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Development > Programming > Data communication > Process synchronization > Hypervisor |
在管理程序配置中,AR数据集消息路由器在配置的DMR任务类结束时执行,而Linux数据集消息路由器在执行结束时阻塞从AR数据集消息路由器发送的管理程序事件,从而同步执行。通过这种方式(取决于Linux系统配置),Linux数据集消息路由器会立即或在AR中配置的DMR任务类之后不久运行。
下面是一个 DMR 任务类的执行周期 (以发送值为例):
▪AR 应用程序通过 exos_dataset_publish()发送数据集
▪AR 数据集消息路由器
o接收来自应用程序的数据集消息
o通过共享内存将数据集转发给 Linux
o设置同步事件
▪Linux 数据集消息路由器
o在同步事件发生时开始执行
o通过共享内存接收数据集
o将数据集分配给 Linux 应用程序
o发送 NETTIME 同步信息
▪Linux 应用程序
o 根据 NETTIME 同步消息在exos_datamodel_process()中开始 执行
o从 数据集消息路由器接收数据 集
o调用 给定数据集上的EXOS_DATASET_EVENT_UPDATED 。
有关如何确保在 Linux 应用程序中同步接收数据的详细信息,请参阅 exos_datamodel_set_process_mode()。
在ExSyncInfo功能块中,可以使用ProcessSync结构监控当前周期时间和进程同步情况。
In a Hypervisor configuration, the AR Dataset Message Router executes at the end of the configured DMR task class, whereas the Linux Dataset Message Router synchronizes its execution by blocking on a Hypervisor event that is sent from the AR Dataset Message Router at the end of its execution. In this way (depending on the Linux system configuration), the Linux Dataset Message Router runs immediately, or shortly after the configured DMR Task class in AR.
This gives the following execution cycle in one DMR Task class (with the example of sending a value):
•AR application sends a dataset via exos_dataset_publish()
•AR Dataset Message Router
oreceives the dataset message from the application
oforwards the dataset to Linux via shared memory
osets the synchronization event
•Linux Dataset Message Router
ostarts its execution on the synchronization event
oreceives the dataset via shared memory
odistributes the dataset to the Linux application(s)
osends out a NETTIME synchronization message
•Linux application
ostarts its execution in exos_datamodel_process() on the NETTIME synchronization message
oreceives the dataset from the Dataset Message Router
ocalls the EXOS_DATASET_EVENT_UPDATED on the given dataset.
Please see exos_datamodel_set_process_mode() for more details on how to ensure data is received synchronously in the Linux application.
In the ExSyncInfo function block, the current cycle time and the process synchronization can be monitored using the ProcessSync structure.