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/DB2103Entity/FOR_MOTOREntity.cs

45 lines
1.3 KiB
C#

using HslCommunication;
namespace DataBlockHelper.Entity.DB2103Entity
{
public class FOR_MOTOREntity
{
public FOR_MOTOREntity(ushort startSet)
{
OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2103." + startSet + ".0", 2);
var content = read.Content;
byte byt = content[0];
ManualMode = byt.GetBit(0);
AutoMode = byt.GetBit(1);
AlarmReset = byt.GetBit(2);
StartManual = byt.GetBit(3);
StopManual = byt.GetBit(4);
StartAuto = byt.GetBit(5);
StopAuto = 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 AlarmReset { 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 Running { get; private set; }
public bool Run { get; private set; }
public bool Alarm { get; private set; }
}
}