You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/DataBlockHelper/Entity/DB2102Entity/FOR_VALVE_DoubleEntity.cs

56 lines
1.9 KiB
C#

using System.Linq;
using HslCommunication;
namespace DataBlockHelper.Entity.DB2102Entity
{
public class FOR_VALVE_DoubleEntity
{
public FOR_VALVE_DoubleEntity(ushort startSet,byte [] bytes)
{
// OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2102." + startSet + ".0", 2);
byte[] content = bytes.Skip(startSet).Take(2).ToArray();
byte byt = content[0];
ManualMode = byt.GetBit(0);
AutoMode = byt.GetBit(1);
SetLeftManual = byt.GetBit(2);
SetRightManual = byt.GetBit(3);
SetLeftAuto = byt.GetBit(4);
SetRightAuto = byt.GetBit(5);
AlarmReset = byt.GetBit(6);
LeftPosition = byt.GetBit(7);
byt = content[1];
RightPosition = byt.GetBit(0);
SetLeft = byt.GetBit(1);
SetRight = byt.GetBit(2);
AlarmLeftPosition = byt.GetBit(3);
AlarmRightPosition = byt.GetBit(4);
AlarmPosition = byt.GetBit(5);
Alarm = byt.GetBit(6);
}
public bool ManualMode { get; private set; }
public bool AutoMode { get; private set; }
public bool SetLeftManual { get; private set; }
public bool SetRightManual { get; private set; }
public bool SetLeftAuto { get; private set; }
public bool SetRightAuto { get; private set; }
public bool AlarmReset { get; private set; }
public bool LeftPosition { get; private set; }
public bool RightPosition { get; private set; }
public bool SetLeft { get; private set; }
public bool SetRight { get; private set; }
public bool AlarmLeftPosition { get; private set; }
public bool AlarmRightPosition { get; private set; }
public bool AlarmPosition { get; private set; }
public bool Alarm { get; private set; }
}
}