using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataBlockHelper.Entity.DB2105Entity { public class ForceWaterEntity { public ForceWaterEntity(byte[] bytes, int startSet) { //OperateResult read = PlcConnect.Instance.Read("DB2104.2.0", 50); var content = bytes.Skip(startSet).Take(8).ToArray(); var instanceByteTransform = PlcConnect.Instance.ByteTransform; addValue = instanceByteTransform.TransInt16(content, 0); remainValue = instanceByteTransform.TransInt16(content, 2); forceBin = instanceByteTransform.TransInt16(content, 4); var byt = content[6]; forceOn = byt.GetBit(0); startIn = byt.GetBit(1); startOut = byt.GetBit(2); } public short addValue { get; private set; } public short remainValue { get; private set; } public short forceBin { get; private set; } public bool forceOn { get; private set; } public bool startIn { get; private set; } public bool startOut { get; private set; } } }