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/DB2104Entity/RecipeCommEntity.cs

40 lines
1.2 KiB
C#

using HslCommunication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace DataBlockHelper.Entity.DB2104Entity
{
public class RecipeCommEntity
{
public RecipeCommEntity(byte[] bytes)
{
//OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2104.2.0", 50);
var content = bytes.Skip(2).Take(50).ToArray();
var instanceByteTransform = PlcConnect.Instance.ByteTransform;
RecpieCode = instanceByteTransform.TransUInt16(content, 0);
PlanCode = instanceByteTransform.TransUInt16(content, 2);
RecipeName =instanceByteTransform.TransString(content, 4, 21, Encoding.ASCII);
PlanName = instanceByteTransform.TransString(content, 26, 21, Encoding.ASCII);
Batch = instanceByteTransform.TransInt16(content, 48);
}
public ushort RecpieCode { get; private set; }
public ushort PlanCode { get; private set; }
public string RecipeName { get; private set; }
public string PlanName { get; private set; }
public short Batch { get; private set; }
}
}