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.
SynReport/Plc/NormalStatusEntity.cs

112 lines
3.8 KiB
C#

using NewLife;
namespace WorkerSynReport.Plc;
public class NormalStatusEntity
{
public NormalStatusEntity(byte[] bytes)
{
//OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2107.2.0", 7);
var content = bytes.Skip(2).Take(7).ToArray();
WatchDog = PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
byte byt = content[2];
RecipeRun = byt.GetBit(0);
RecipePause = byt.GetBit(1);
Ready = byt.GetBit(2);
Alarm = byt.GetBit(3);
EMStop = byt.GetBit(4);
RdyRpt_V1 = byt.GetBit(5);
RdyRpt_V2 = byt.GetBit(6);
RdyRpt_V3 = byt.GetBit(7);
byt = content[3];
RdyRpt_V4 = byt.GetBit(0);
RdyRpt_V5 = byt.GetBit(1);
RdyRpt_W1 = byt.GetBit(2);
RdyRpt_W2 = byt.GetBit(3);
RdyRpt_W3 = byt.GetBit(4);
RdyRpt_W4 = byt.GetBit(5);
RdyRpt_D1 = byt.GetBit(6);
RdyRpt_D2 = byt.GetBit(7);
byt = content[4];
RdyRpt_D3 = byt.GetBit(0);
RdyRpt_D4 = byt.GetBit(1);
RdyRpt_G1 = byt.GetBit(2);
RdyRpt_G2 = byt.GetBit(3);
RdyRpt_G3 = byt.GetBit(4);
RdyRpt_G4 = byt.GetBit(5);
RdyRpt_G5 = byt.GetBit(6);
RdyRpt_G6 = byt.GetBit(7);
byt = content[5];
RdyRpt_G7 = byt.GetBit(0);
RdyRpt_G8 = byt.GetBit(1);
RdyRpt_M1 = byt.GetBit(2);
RdyRpt_M2 = byt.GetBit(3);
RdyRpt_M3 = byt.GetBit(4);
RdyRpt_M4 = byt.GetBit(5);
RdyRpt_M5 = byt.GetBit(6);
RdyRpt_M6 = byt.GetBit(7);
byt = content[6];
RdyRpt_M7 = byt.GetBit(0);
RdyRpt_M8 = byt.GetBit(1);
spare1= byt.GetBit(2);
spare2 = byt.GetBit(3);
spare3 = byt.GetBit(4);
spare4 = byt.GetBit(5);
}
public int WatchDog { get; private set; }
public bool RecipeRun { get; private set; }
public bool RecipePause { get; private set; }
public bool Ready { get; private set; }
public bool Alarm { get; private set; }
public bool EMStop { get; private set; }
public bool RdyRpt_V1 { get; private set; }
public bool RdyRpt_V2 { get; private set; }
public bool RdyRpt_V3 { get; private set; }
public bool RdyRpt_V4 { get; private set; }
public bool RdyRpt_V5 { get; private set; }
public bool RdyRpt_W1 { get; private set; }
public bool RdyRpt_W2 { get; private set; }
public bool RdyRpt_W3 { get; private set; }
public bool RdyRpt_W4 { get; private set; }
public bool RdyRpt_D1 { get; private set; }
public bool RdyRpt_D2 { get; private set; }
public bool RdyRpt_D3 { get; private set; }
public bool RdyRpt_D4 { get; private set; }
public bool RdyRpt_G1 { get; private set; }
public bool RdyRpt_G2 { get; private set; }
public bool RdyRpt_G3 { get; private set; }
public bool RdyRpt_G4 { get; private set; }
public bool RdyRpt_G5 { get; private set; }
public bool RdyRpt_G6 { get; private set; }
public bool RdyRpt_G7 { get; private set; }
public bool RdyRpt_G8 { get; private set; }
public bool RdyRpt_M1 { get; private set; }
public bool RdyRpt_M2 { get; private set; }
public bool RdyRpt_M3 { get; private set; }
public bool RdyRpt_M4 { get; private set; }
public bool RdyRpt_M5 { get; private set; }
public bool RdyRpt_M6 { get; private set; }
public bool RdyRpt_M7 { get; private set; }
public bool RdyRpt_M8 { get; private set; }
public bool spare1 { get; private set; }
public bool spare2 { get; private set; }
public bool spare3 { get; private set; }
public bool spare4 { get; private set; }
}