From e9367782f0aba66b787adecd7584b1b23e5fd5bc Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期五, 30 八月 2024 16:57:14 +0800
Subject: [PATCH] 设备监控优化

---
 Admin.NET/WCS.Application/PLC/PLCUtil.cs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Admin.NET/WCS.Application/PLC/PLCUtil.cs b/Admin.NET/WCS.Application/PLC/PLCUtil.cs
index 69442c6..c0b0612 100644
--- a/Admin.NET/WCS.Application/PLC/PLCUtil.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCUtil.cs
@@ -21,9 +21,9 @@
         _client = new SiemensClient((SiemensVersion)modPlc.PLCType, modPlc.IP, modPlc.Port);
         _client.Open();
     }
-    public bool Connected()
+    public bool Connected
     {
-        return _client.Connected;
+        get { return _client.Connected; }
     }
     public IoTClient.Result Open()
     {
@@ -80,6 +80,9 @@
             case PLCDataTypeEnum.Double:
                 result = _client.ReadDouble(address);
                 break;
+            case PLCDataTypeEnum.String:
+                result = _client.ReadString(address);
+                break;
             default:
                 result = new IoTClient.Result<object>();
                 break;

--
Gitblit v1.8.0