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/ForceWaterEntity.cs

38 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.Entity.DB2105Entity
{
public class ForceWaterEntity
{
public ForceWaterEntity(byte[] bytes, int startSet)
{
//OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2104.2.0", 50);
var content = bytes.Skip(startSet).Take(8).ToArray();
var instanceByteTransform = PlcConnect.Instance.ByteTransform;
addValue = instanceByteTransform.TransInt16(content, 0);
remainValue = instanceByteTransform.TransInt16(content, 2);
forceBin = instanceByteTransform.TransInt16(content, 4);
var byt = content[6];
forceOn = byt.GetBit(0);
startIn = byt.GetBit(1);
startOut = byt.GetBit(2);
}
public short addValue { get; private set; }
public short remainValue { get; private set; }
public short forceBin { get; private set; }
public bool forceOn { get; private set; }
public bool startIn { get; private set; }
public bool startOut { get; private set; }
}
}