|
|
|
|
using HslCommunication;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.Entity.DB91Entity
|
|
|
|
|
{
|
|
|
|
|
public class ForMotorVFD
|
|
|
|
|
{
|
|
|
|
|
public ForMotorVFD(ushort startSet, byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
//OperateResult<byte[]> read = PlcConnect.Instance.Read("DB91." + startSet + ".0", 14);
|
|
|
|
|
|
|
|
|
|
var content = bytes.Skip(startSet).Take(14).ToArray();
|
|
|
|
|
|
|
|
|
|
byte byt = content[0];
|
|
|
|
|
|
|
|
|
|
AutoMode = byt.GetBit(0);
|
|
|
|
|
ManualMode = byt.GetBit(1);
|
|
|
|
|
Start_A = byt.GetBit(2);
|
|
|
|
|
Stop_A = byt.GetBit(3);
|
|
|
|
|
|
|
|
|
|
Start_M = byt.GetBit(4);
|
|
|
|
|
Stop_M = byt.GetBit(5);
|
|
|
|
|
|
|
|
|
|
AlarmReset = byt.GetBit(6);
|
|
|
|
|
EXT_Estop = byt.GetBit(7);
|
|
|
|
|
|
|
|
|
|
byt = content[1];
|
|
|
|
|
Running= byt.GetBit(0);
|
|
|
|
|
|
|
|
|
|
Alarm = byt.GetBit(1);
|
|
|
|
|
Error = byt.GetBit(2);
|
|
|
|
|
|
|
|
|
|
Enable = byt.GetBit(3);
|
|
|
|
|
|
|
|
|
|
Polarity = byt.GetBit(4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetSpeed_A = PlcConnect.Instance.ByteTransform.TransSingle(content, 2);
|
|
|
|
|
SetSpeed_M = PlcConnect.Instance.ByteTransform.TransSingle(content, 6);
|
|
|
|
|
ACT_Speed = PlcConnect.Instance.ByteTransform.TransSingle(content, 10);
|
|
|
|
|
}
|
|
|
|
|
public bool AutoMode { get; private set; }
|
|
|
|
|
public bool ManualMode { get; private set; }
|
|
|
|
|
public bool Start_A { get; private set; }
|
|
|
|
|
public bool Stop_A { get; private set; }
|
|
|
|
|
public bool Start_M { get; private set; }
|
|
|
|
|
public bool Stop_M { get; private set; }
|
|
|
|
|
public bool AlarmReset { get; private set; }
|
|
|
|
|
public bool EXT_Estop { get; private set; }
|
|
|
|
|
|
|
|
|
|
public bool ManMode { get; private set; }
|
|
|
|
|
public bool VVVF_OK { get; private set; }
|
|
|
|
|
public bool Running { get; private set; }
|
|
|
|
|
public bool Alarm { get; private set; }
|
|
|
|
|
public bool Error { get; private set; }
|
|
|
|
|
public bool Enable { get; private set; }
|
|
|
|
|
public bool Polarity { get; private set; }
|
|
|
|
|
public float SetSpeed_A { get; private set; }
|
|
|
|
|
public float SetSpeed_M { get; private set; }
|
|
|
|
|
public float ACT_Speed { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|