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/DB91Entity/ForMotorEntity.cs

44 lines
1.3 KiB
C#

using HslCommunication;
namespace DataBlockHelper.Entity.DB91Entity
{
public class ForMotorEntity
{
public ForMotorEntity(ushort startSet)
{
OperateResult<byte[]> read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 2);
var content = read.Content;
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; }
}
}