From 7285fd041c9ed732ae2039c4cc54f3eb382d9112 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周日, 08 12月 2024 14:48:50 +0800 Subject: [PATCH] 33 --- SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs index 813d817..5f7e820 100644 --- a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs +++ b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs @@ -179,7 +179,35 @@ } } + /// <summary> + /// 鍐橮LC bool + /// </summary> + /// <param name="dbAddress"></param> + /// <param name="value"></param> + /// <param name="msg"></param> + /// <returns></returns> + public bool WriteBoolPlcData(string dbAddress, bool value, out string msg) + { + try + { + msg = ""; + MessageModel b2 = null; + b2 = this.plcService.WriteValuePoint(dbAddress, value, value); + if (!b2.result) + { + msg = string.Format($"鍐欏叆PLC鍦板潃{dbAddress}锛屽�納value}澶辫触"); + return false; + } + return true; + } + catch (Exception ex) + { + msg = ex.Message; + Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, $"鍦板潃{dbAddress}澶辫触:" + ex.Message, ex); + return false; + } + } /// <summary> /// 鍐欏叆榻愬缁撴灉銆佽В鏋愮粨鏋� -- Gitblit v1.9.3