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

49 lines
1.4 KiB
C#

using HslCommunication;
using System.Linq;
using System.Security.Cryptography;
namespace DataBlockHelper.Entity.DB2103Entity
{
public class FOR_MOTOREntity
{
public FOR_MOTOREntity(ushort startSet, byte[] bytes)
{
1 year ago
// OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2103." + startSet + ".0", 2);
1 year ago
byte[] content = bytes.Skip(startSet).Take(2).ToArray();
1 year ago
//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; }
}
}