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/DB2105Entity/FourBoolArrayEntity.cs

35 lines
793 B
C#


using System.Linq;
namespace DataBlockHelper.Entity.DB2105Entity
{
public class FourBoolArrayManager
{
private int StartSet;
private byte[] Bytes;
public FourBoolArrayManager(int startSet, byte[] bytes)
{
StartSet = startSet;
Bytes = bytes;
}
public bool[] GetList()
{
bool[] ListE = new bool[4];
//var getListE = PlcConnect.Instance.Read("DB2105." + StartSet + ".0", 1);
var content = Bytes.Skip(StartSet).Take(1).ToArray();
byte byt = content[0];
ListE[0] = byt.GetBit(0);
ListE[1] = byt.GetBit(1);
ListE[2] = byt.GetBit(2);
ListE[3] = byt.GetBit(3);
return ListE;;
}
}
}