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.
60 lines
2.4 KiB
C#
60 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DataBlockHelper.Entity.DB2119Entity
|
|
{
|
|
public class SprialTempEntity
|
|
{
|
|
public SprialTempEntity(ushort startSet, byte[] bytes)
|
|
{
|
|
// OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2102." + startSet + ".0", 2);
|
|
|
|
if(null== bytes)
|
|
{
|
|
return;
|
|
}
|
|
|
|
byte[] content = bytes.Skip(startSet).Take(22).ToArray();
|
|
|
|
Value_Set = PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
|
|
Value_Ack = PlcConnect.Instance.ByteTransform.TransInt16(content, 2);
|
|
Value_Fast = PlcConnect.Instance.ByteTransform.TransInt16(content, 4);
|
|
Value_Point = PlcConnect.Instance.ByteTransform.TransInt16(content, 6);
|
|
Motor_Speed = PlcConnect.Instance.ByteTransform.TransInt16(content, 8);
|
|
Speed_Fast = PlcConnect.Instance.ByteTransform.TransInt16(content, 10);
|
|
Speed_Low = PlcConnect.Instance.ByteTransform.TransInt16(content, 12);
|
|
Speed_Point = PlcConnect.Instance.ByteTransform.TransInt16(content, 14);
|
|
Value_Weight = PlcConnect.Instance.ByteTransform.TransInt16(content, 16);
|
|
Weter_Bin = PlcConnect.Instance.ByteTransform.TransInt16(content, 18);
|
|
|
|
byte byt = content[20];
|
|
|
|
Dos_Start = byt.GetBit(0);
|
|
Dos_Stop = byt.GetBit(1);
|
|
Dos_Status = byt.GetBit(2);
|
|
Dos_End = byt.GetBit(3);
|
|
Polarty = byt.GetBit(4);
|
|
|
|
}
|
|
|
|
public short Value_Set { get; private set; }
|
|
public short Value_Ack { get; private set; }
|
|
public short Value_Fast { get; private set; }
|
|
public short Value_Point { get; private set; }
|
|
public short Motor_Speed { get; private set; }
|
|
public short Speed_Fast { get; private set; }
|
|
public short Speed_Low { get; private set; }
|
|
public short Speed_Point { get; private set; }
|
|
public short Value_Weight { get; private set; }
|
|
public short Weter_Bin { get; private set; }
|
|
public bool Dos_Start { get; private set; }
|
|
public bool Dos_Stop { get; private set; }
|
|
public bool Dos_Status { get; private set; }
|
|
public bool Dos_End { get; private set; }
|
|
public bool Polarty { get; private set; }
|
|
}
|
|
}
|