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.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DataBlockHelper.Entity.DB2119Entity
|
|
|
|
|
{
|
|
|
|
|
public class ForceWaterEntity
|
|
|
|
|
{
|
|
|
|
|
public ForceWaterEntity(ushort startSet, byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
// OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2102." + startSet + ".0", 2);
|
|
|
|
|
|
|
|
|
|
byte[] content = bytes.Skip(startSet).Take(8).ToArray();
|
|
|
|
|
|
|
|
|
|
addValue = PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
|
|
|
|
|
remainValue = PlcConnect.Instance.ByteTransform.TransInt16(content, 2);
|
|
|
|
|
forceBin = PlcConnect.Instance.ByteTransform.TransInt16(content, 4);
|
|
|
|
|
|
|
|
|
|
byte byt = content[6];
|
|
|
|
|
|
|
|
|
|
forceOn = byt.GetBit(0);
|
|
|
|
|
startIn = byt.GetBit(1);
|
|
|
|
|
startOut = byt.GetBit(2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public short addValue { get; set; }
|
|
|
|
|
public short remainValue { get; set; }
|
|
|
|
|
public short forceBin { get; set; }
|
|
|
|
|
public bool forceOn { get; set; }
|
|
|
|
|
public bool startIn { get; set; }
|
|
|
|
|
public bool startOut { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|