From 87cc1c0d71fe6c6000ac6523bbb367d5ac29b5d2 Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期六, 11 一月 2025 16:40:51 +0800 Subject: [PATCH] 更新设备通讯超时设置及优化代码结构 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs index 5470af5..31378ac 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs @@ -604,8 +604,12 @@ // 灏嗕慨鏀瑰悗鐨勬暟缁剎閲嶆柊鎷兼帴鎴愬瓧绗︿覆锛屼綔涓烘柊鐨凞eviceProAddress string DeviceProAddress = string.Join(".", x); - // 浣跨敤conveyorLine鐨凜ommunicator瀵硅薄鐨刉rite鏂规硶锛屽皢value鍐欏叆鏂扮殑DeviceProAddress鍦板潃 - conveyorLine.Communicator.Write(DeviceProAddress, value); + var writeBool = conveyorLine.Communicator.Read<bool>(DeviceProAddress); + if (writeBool != value) + { + // 浣跨敤conveyorLine鐨凜ommunicator瀵硅薄鐨刉rite鏂规硶锛屽皢value鍐欏叆鏂扮殑DeviceProAddress鍦板潃 + conveyorLine.Communicator.Write(DeviceProAddress, value); + } } #region 妫�娴嬬┖鐩樺疄鐩樹换鍔� -- Gitblit v1.9.3