using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataBlockHelper.Entity.DB191Entity { public class ForConveyorStep { public ForConveyorStep(ushort startSet, byte[] bytes) { //OperateResult read = PlcConnect.Instance.Read("DB1." + startSet + ".0", 8); var content = bytes.Skip(startSet).Take(4).ToArray(); byte byt = content[0]; Unpack1 = byt.GetBit(0); Step1t1 = byt.GetBit(1); Step2t1 = byt.GetBit(2); Step3t1 = byt.GetBit(3); Send1 = byt.GetBit(4); Step4t1 = byt.GetBit(5); Step5t1 = byt.GetBit(6); Step6t1 = byt.GetBit(7); byt = content[1]; Step7t1 = byt.GetBit(0); Unpack2 = byt.GetBit(1); Step1t2 = byt.GetBit(2); Step2t2 = byt.GetBit(3); Step3t2 = byt.GetBit(4); Send2 = byt.GetBit(5); Step4t2 = byt.GetBit(6); Step5t2 = byt.GetBit(7); byt = content[2]; Step6t2 = byt.GetBit(0); Step7t2 = byt.GetBit(1); } public bool Unpack1 { get; private set; } public bool Step1t1 { get; private set; } public bool Step2t1 { get; private set; } public bool Step3t1 { get; private set; } public bool Send1 { get; private set; } public bool Step4t1 { get; private set; } public bool Step5t1 { get; private set; } public bool Step6t1 { get; private set; } public bool Step7t1 { get; private set; } public bool Unpack2 { get; private set; } public bool Step1t2 { get; private set; } public bool Step2t2 { get; private set; } public bool Step3t2 { get; private set; } public bool Send2 { get; private set; } public bool Step4t2 { get; private set; } public bool Step5t2 { get; private set; } public bool Step6t2 { get; private set; } public bool Step7t2 { get; private set; } } }