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.
101 lines
3.8 KiB
C#
101 lines
3.8 KiB
C#
using HslCommunication;
|
|
using System.Linq;
|
|
|
|
namespace DataBlockHelper.Entity.DB2104Entity
|
|
{
|
|
public class EnableStatusEntity
|
|
{
|
|
public EnableStatusEntity(byte[] bytes)
|
|
{
|
|
//OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2104.52.0", 5);
|
|
|
|
var content = bytes.Skip(52).Take(5).ToArray(); ;
|
|
|
|
byte byt = content[0];
|
|
|
|
EnableDB_B1 = byt.GetBit(0);
|
|
EnableDB_B2 = byt.GetBit(1);
|
|
EnableDB_B3 = byt.GetBit(2);
|
|
EnableDB_B4 = byt.GetBit(3);
|
|
EnableDB_B5 = byt.GetBit(4);
|
|
EnableDB_B6 = byt.GetBit(5);
|
|
EnableDB_B7 = byt.GetBit(6);
|
|
EnableDB_B8 = byt.GetBit(7);
|
|
|
|
byt = content[1];
|
|
|
|
EnableDB_B9 = byt.GetBit(0);
|
|
EnableDB_B10 = byt.GetBit(1);
|
|
EnableDB_B11 = byt.GetBit(2);
|
|
EnableDB_B12 = byt.GetBit(3);
|
|
EnableWater_S1 = byt.GetBit(4);
|
|
EnableWater_S2 = byt.GetBit(5);
|
|
EnableDryer_D1 = byt.GetBit(6);
|
|
EnableDryer_D2 = byt.GetBit(7);
|
|
|
|
byt = content[2];
|
|
|
|
EnableDryer_D3 = byt.GetBit(0);
|
|
EnableDryer_D4 = byt.GetBit(1);
|
|
EnableGelat_G1 = byt.GetBit(2);
|
|
EnableGelat_G2 = byt.GetBit(3);
|
|
EnableGelat_G3 = byt.GetBit(4);
|
|
EnableGelat_G4 = byt.GetBit(5);
|
|
EnableGelat_G5 = byt.GetBit(6);
|
|
EnableGelat_G6 = byt.GetBit(7);
|
|
|
|
byt = content[3];
|
|
|
|
EnableGelat_G7 = byt.GetBit(0);
|
|
EnableGelat_G8 = byt.GetBit(1);
|
|
EnableWeter_M1 = byt.GetBit(2);
|
|
EnableWeter_M2 = byt.GetBit(3);
|
|
EnableWeter_M3 = byt.GetBit(4);
|
|
EnableWeter_M4 = byt.GetBit(5);
|
|
EnableWeter_M5 = byt.GetBit(6);
|
|
EnableWeter_M6 = byt.GetBit(7);
|
|
|
|
byt = content[4];
|
|
|
|
EnableWeter_M7 = byt.GetBit(0);
|
|
EnableWeter_M8 = byt.GetBit(1);
|
|
}
|
|
|
|
public bool EnableDB_B1 { get; private set; }
|
|
public bool EnableDB_B2 { get; private set; }
|
|
public bool EnableDB_B3 { get; private set; }
|
|
public bool EnableDB_B4 { get; private set; }
|
|
public bool EnableDB_B5 { get; private set; }
|
|
public bool EnableDB_B6 { get; private set; }
|
|
public bool EnableDB_B7 { get; private set; }
|
|
public bool EnableDB_B8 { get; private set; }
|
|
public bool EnableDB_B9 { get; private set; }
|
|
public bool EnableDB_B10 { get; private set; }
|
|
public bool EnableDB_B11 { get; private set; }
|
|
public bool EnableDB_B12 { get; private set; }
|
|
public bool EnableWater_S1 { get; private set; }
|
|
public bool EnableWater_S2 { get; private set; }
|
|
public bool EnableDryer_D1 { get; private set; }
|
|
public bool EnableDryer_D2 { get; private set; }
|
|
public bool EnableDryer_D3 { get; private set; }
|
|
public bool EnableDryer_D4 { get; private set; }
|
|
public bool EnableGelat_G1 { get; private set; }
|
|
public bool EnableGelat_G2 { get; private set; }
|
|
public bool EnableGelat_G3 { get; private set; }
|
|
public bool EnableGelat_G4 { get; private set; }
|
|
public bool EnableGelat_G5 { get; private set; }
|
|
public bool EnableGelat_G6 { get; private set; }
|
|
public bool EnableGelat_G7 { get; private set; }
|
|
public bool EnableGelat_G8 { get; private set; }
|
|
public bool EnableWeter_M1 { get; private set; }
|
|
public bool EnableWeter_M2 { get; private set; }
|
|
public bool EnableWeter_M3 { get; private set; }
|
|
public bool EnableWeter_M4 { get; private set; }
|
|
public bool EnableWeter_M5 { get; private set; }
|
|
public bool EnableWeter_M6 { get; private set; }
|
|
public bool EnableWeter_M7 { get; private set; }
|
|
public bool EnableWeter_M8 { get; private set; }
|
|
|
|
}
|
|
}
|