diff --git a/DataBlockHelper/DBHelpers/DB2111Helper.cs b/DataBlockHelper/DBHelpers/DB2111Helper.cs new file mode 100644 index 0000000..ca8352a --- /dev/null +++ b/DataBlockHelper/DBHelpers/DB2111Helper.cs @@ -0,0 +1,27 @@ +using DataBlockHelper.Entity.DB2103Entity; +using DataBlockHelper.Entity.DB2111Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataBlockHelper.DBHelpers +{ + public class DB2111Helper : DBHelper + { + public DB2111Helper() + { + bytes = PlcConnect.Instance.Read("DB2111.0.0", 1682).Content; + } + + public ReportDosEntity hwReport_A => new ReportDosEntity(bytes, 1506); + public ReportDosEntity hwReport_B => new ReportDosEntity(bytes, 1528); + public ReportDosEntity cwReport_A => new ReportDosEntity(bytes, 1550); + public ReportDosEntity cwReport_B => new ReportDosEntity(bytes, 1572); + public ReportDosEntity DryDosing_A => new ReportDosEntity(bytes, 1594); + public ReportDosEntity DryDosing_B => new ReportDosEntity(bytes, 1616); + public ReportDosEntity DryDosing_C => new ReportDosEntity(bytes, 1638); + public ReportDosEntity DryDosing_D => new ReportDosEntity(bytes, 1660); + } +} diff --git a/DataBlockHelper/DataBlockHelper.csproj b/DataBlockHelper/DataBlockHelper.csproj index f23baee..4bf9b1b 100644 --- a/DataBlockHelper/DataBlockHelper.csproj +++ b/DataBlockHelper/DataBlockHelper.csproj @@ -56,6 +56,7 @@ + @@ -84,6 +85,7 @@ + diff --git a/DataBlockHelper/Entity/DB2111Entity/ReportDosEntity.cs b/DataBlockHelper/Entity/DB2111Entity/ReportDosEntity.cs new file mode 100644 index 0000000..f53e3f6 --- /dev/null +++ b/DataBlockHelper/Entity/DB2111Entity/ReportDosEntity.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI; + +namespace DataBlockHelper.Entity.DB2111Entity +{ + public class ReportDosEntity + { + public ReportDosEntity(byte[] bytes, int StartSet) + { + //OperateResult read = PlcConnect.Instance.Read("DB2107.10.0", 2); + + var content = bytes.Skip(StartSet).Take(22).ToArray(); + + eqNo = PlcConnect.Instance.ByteTransform.TransInt16(content, 0); + batch = PlcConnect.Instance.ByteTransform.TransInt16(content, 2); + matCode = PlcConnect.Instance.ByteTransform.TransInt16(content, 4); + setValue = PlcConnect.Instance.ByteTransform.TransSingle(content, 6); + setToler = PlcConnect.Instance.ByteTransform.TransSingle(content, 10); + actValue = PlcConnect.Instance.ByteTransform.TransSingle(content, 14); + actToler = PlcConnect.Instance.ByteTransform.TransSingle(content, 18); + + + } + public short eqNo { get; private set; } + public short batch { get; private set; } + public short matCode { get; private set; } + public float setValue { get; private set; } + public float setToler { get; private set; } + public float actValue { get; private set; } + public float actToler { get; private set; } + } +}