You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/DataBlockHelper/DBHelpers/DB2104Helper.cs

77 lines
1.9 KiB
C#

using DataBlockHelper.Entity.DB2107Entity;
using DataBlockHelper.Entity.DB2104Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB2104Helper : DBHelper
{
public DB2104Helper()
{
1 year ago
this.bytes = PlcConnect.Instance.Read("DB2104.0.0", 3618).Content;
}
public RecipeCommEntity RecipeComm => RecipeCom(bytes);
private RecipeCommEntity RecipeCom(byte[] bytes)
{
return new RecipeCommEntity(bytes);
}
public EnableStatusEntity EnableStatus => EnableS(bytes);
private EnableStatusEntity EnableS(byte[] bytes)
{
return new EnableStatusEntity(bytes);
}
1 year ago
/// <summary>
/// 热水秤A
/// </summary>
public WaterEntity GetAHotWater => GetWater(3738);
1 year ago
/// <summary>
/// 热水秤B
/// </summary>
public WaterEntity GetBHotWater => GetWater(3748);
1 year ago
/// <summary>
/// 冷水秤A
/// </summary>
public WaterEntity GetAColWater => GetWater(3758);
1 year ago
/// <summary>
/// 冷水秤B
/// </summary>
public WaterEntity GetBColWater => GetWater(3768);
1 year ago
private WaterEntity GetWater(int start)
{
var instanceByteTransform = PlcConnect.Instance.ByteTransform;
var ls = this.bytes = PlcConnect.Instance.Read($"DB2104.{start}.0", 10).Content;
1 year ago
WaterEntity entity = new WaterEntity
{
Bin = instanceByteTransform.TransInt16(ls, 0),
Set = instanceByteTransform.TransSingle(ls, 2),
1 year ago
Tolerance = instanceByteTransform.TransSingle(ls, 6)
1 year ago
};
return entity;
}
}
}