<< 点击显示目录 >> 主页 exOS使用助手 > exOS Automation Help > Getting started > Sending and receiving values |
当设置 WaterTankCyclic_0.Connected时,意味着 AR 和 Linux 之间的通信已经建立。该连接通过心跳进行监控,因此任何中断都会被自动检测到,这意味着一旦出现干扰, WaterTankCyclic_0.Disconnected 将被设置。
要测试发送信号,可将 WaterTank_0.FillValve 设为 1 (VALVE_OPEN)。Linux WaterTank 应用程序被编程为在发生任何变化时返回 FillValve 信号的数据延迟。通过 WaterTank_0.Status.FillValveDelay,可以监控该延迟(以 us 为单位)。
此外,还可以通过以下方式对加热器模拟进行测试
1.更改其中一个配置设置。 HeaterConfig 结构将被发送到 Linux 应用程序,后者会将数值限制在可用范围内,并将 WaterTank_0.HeaterConfig 作为回复 发送回来。
1.通过 WaterTankCyclic_0.Start将水箱设置为运行状态
1.通过设置 WaterTank_0.EnableHeater,启动加热器 。 WaterTank_0.Status.Heater.WaterTemperature 输出应升至 WaterTank_0.Config.MaxTemperature 的 值。温度信号的数据延迟可通过 WaterTank_0.StatusDelay 监控 ,温度变化的次数可通过 WaterTank_0.StatusChanges 查看 。应用程序将持续发送新值,直到 WaterTank_0.EnableHeater 设置为 FALSE。然后,温度会下降到一个稳定的低点。
When WaterTankCyclic_0.Connected is set, it means that the communication between AR and Linux has been established. This connection is monitored via heartbeats, so any interruption is automatically detected, meaning in case of a disturbance, WaterTankCyclic_0.Disconnected is set.
To test sending a signal, the WaterTank_0.FillValve can be set to 1 (VALVE_OPEN). The Linux WaterTank application is programmed to return the data latency of the FillValve signal at any change. This latency (in us) can be monitored via WaterTank_0.Status.FillValveDelay.
Furthermore, the heater simulation can be tested via
1.Change one of the configuration settings. The HeaterConfig structure will be sent to the Linux application which limits the values to a usable range and sends back WaterTank_0.HeaterConfig as a reply.
2.Set the WateTank into Operational state via WaterTankCyclic_0.Start
3.Start the heater by setting WaterTank_0.EnableHeater. The WaterTank_0.Status.Heater.WaterTemperature output should increase up to the WaterTank_0.Config.MaxTemperature. The data latency of the temperature signal can be monitored via WaterTank_0.StatusDelay, and the number of temperature changes is visible via WaterTank_0.StatusChanges. The application is made in a way that it will continue sending new values until the WaterTank_0.EnableHeater is set to FALSE. Then, the temperature decreases to a steady low point.