using HslCommunication; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataBlockHelper.DBHelpers { public class DB92Help: DBHelper { public DB92Help() { OperateResult db = PlcConnect.Instance.Read("DB92.0.0", 34); bytes = db.Content; } public Pipe GetPipe => new Pipe(2, bytes); } public class Pipe { public Pipe() { } public Pipe(ushort startSet, byte[] bytes) { var trans = PlcConnect.Instance.ByteTransform; byte[] content = bytes.Skip(startSet).Take(32).ToArray(); MainPipieA=trans.TransSingle(content, 0); AuxPipieA = trans.TransSingle(content, 4); MainPipieB = trans.TransSingle(content,8); AuxPipieB=trans.TransSingle(content,12); MainPipieC = trans.TransSingle(content, 16); AuxPipieC = trans.TransSingle(content, 20); UpperPressure=trans.TransSingle(content, 24); LowerPressure = trans.TransSingle(content, 28); } public float MainPipieA { get; set; } public float AuxPipieA { get; set; } public float MainPipieB { get; set; } public float AuxPipieB { get; set; } public float MainPipieC { get; set; } public float AuxPipieC { get; set; } public float UpperPressure { get; set; } public float LowerPressure { get; set; } } }