using HslCommunication; using System.Linq; namespace DataBlockHelper.Entity.DB91Entity { public class ForMotorEntity { public ForMotorEntity(ushort startSet, byte[] bytes) { //OperateResult read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 2); var content = bytes.Skip(startSet).Take(2).ToArray(); byte byt = content[0]; ManualMode = byt.GetBit(0); AutoMode = byt.GetBit(1); StartManual = byt.GetBit(2); StopManual = byt.GetBit(3); StartAuto = byt.GetBit(4); StopAuto = byt.GetBit(5); AlarmReset = byt.GetBit(6); Running = byt.GetBit(7); byt = content[1]; Run = byt.GetBit(0); Alarm = byt.GetBit(1); } public bool ManualMode { get; private set; } public bool AutoMode { get; private set; } public bool StartManual { get; private set; } public bool StopManual { get; private set; } public bool StartAuto { get; private set; } public bool StopAuto { get; private set; } public bool AlarmReset { get; private set; } public bool Running { get; private set; } public bool Run { get; private set; } public bool Alarm { get; private set; } } }