using HslCommunication; namespace DataBlockHelper.Entity.DB2107Entity { public class PIDEntity { public PID_HMI Convey_V1 => new PID_HMI(614); public PID_HMI Purge_V1 => new PID_HMI(622); public PID_HMI Convey_V2 => new PID_HMI(630); public PID_HMI Purge_V2 => new PID_HMI(638); public PID_HMI Convey_V3 => new PID_HMI(646); public PID_HMI Purge_V3 => new PID_HMI(654); public PID_HMI Convey_V4 => new PID_HMI(662); public PID_HMI Purge_V4 => new PID_HMI(670); public PID_HMI Convey_V5 => new PID_HMI(678); public PID_HMI Purge_V5 => new PID_HMI(686); } public class PID_HMI { public PID_HMI(ushort startSet) { OperateResult read = PlcConnect.Instance.Read("DB2107." + startSet + ".0", 8); var content = read.Content; PV = PlcConnect.Instance.ByteTransform.TransSingle(content, 0); SV = PlcConnect.Instance.ByteTransform.TransSingle(content, 4); } public float PV { get; private set; } public float SV { get; private set; } } }