add - DB2111 部分读取

dep
wangsr 12 months ago
parent 0b6e85a04c
commit b469953750

@ -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);
}
}

@ -56,6 +56,7 @@
<Compile Include="DBHelpers\DB2105Helper.cs" />
<Compile Include="DBHelpers\DB2105WriteHelper.cs" />
<Compile Include="DBHelpers\DB2106Helper.cs" />
<Compile Include="DBHelpers\DB2111Helper.cs" />
<Compile Include="DBHelpers\DB2119Helper.cs" />
<Compile Include="DBHelpers\DB2119WriteHelper.cs" />
<Compile Include="DBHelpers\Db3000Helper.cs" />
@ -84,6 +85,7 @@
<Compile Include="Entity\DB2106Entity\GelReportEntity.cs" />
<Compile Include="Entity\DB2106Entity\WetReportEntity.cs" />
<Compile Include="Entity\DB2108Helper.cs" />
<Compile Include="Entity\DB2111Entity\ReportDosEntity.cs" />
<Compile Include="Entity\DB2119Entity\ForceWaterEntity.cs" />
<Compile Include="Entity\DB2119Entity\SprialTempEntity.cs" />
<Compile Include="Entity\DB2119Entity\WaterTempEntity.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<byte[]> 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; }
}
}
Loading…
Cancel
Save