From a4cd1b8cf568057a5778cd36e8f5db121be50a24 Mon Sep 17 00:00:00 2001 From: nodyang Date: Thu, 19 Oct 2023 17:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96Db3000Help?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBlockHelper/DBHelpers/Db3000Helper.cs | 32 +++++++++++++++++++++++ DataBlockHelper/DataBlockHelper.csproj | 1 + 2 files changed, 33 insertions(+) create mode 100644 DataBlockHelper/DBHelpers/Db3000Helper.cs diff --git a/DataBlockHelper/DBHelpers/Db3000Helper.cs b/DataBlockHelper/DBHelpers/Db3000Helper.cs new file mode 100644 index 0000000..b2cb803 --- /dev/null +++ b/DataBlockHelper/DBHelpers/Db3000Helper.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using HslCommunication; + +namespace DataBlockHelper.DBHelpers +{ + public class Db3000Helper + { + public static List ReadDb() + { + List ls = new List(); + var operateResult = PlcConnect.Instance.Read("DB3000.0.0",1); + if (operateResult.IsSuccess) + { + var context = operateResult.Content; + + for (var i = 0; i < 6; i++) + { + var bo= context.GetBoolByIndex(i); + ls.Add(bo); + + + } + + + } + + + + return ls; + } + } +} \ No newline at end of file diff --git a/DataBlockHelper/DataBlockHelper.csproj b/DataBlockHelper/DataBlockHelper.csproj index 5661917..3fbc87c 100644 --- a/DataBlockHelper/DataBlockHelper.csproj +++ b/DataBlockHelper/DataBlockHelper.csproj @@ -55,6 +55,7 @@ +