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.
68 lines
1.5 KiB
C#
68 lines
1.5 KiB
C#
using HslCommunication;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DataBlockHelper.DBHelpers
|
|
{
|
|
public class DB92Help: DBHelper
|
|
{
|
|
public DB92Help()
|
|
{
|
|
OperateResult<byte[]> db = PlcConnect.Instance.Read("DB92.0.0", 34);
|
|
bytes = db.Content;
|
|
}
|
|
|
|
|
|
public Pipe GetPipe => new Pipe(2, bytes);
|
|
}
|
|
|
|
|
|
public class Pipe
|
|
{
|
|
public Pipe()
|
|
{
|
|
|
|
}
|
|
|
|
public Pipe(ushort startSet, byte[] bytes)
|
|
{
|
|
var trans = PlcConnect.Instance.ByteTransform;
|
|
byte[] content = bytes.Skip(startSet).Take(32).ToArray();
|
|
|
|
MainPipieA=trans.TransSingle(content, 0);
|
|
AuxPipieA = trans.TransSingle(content, 4);
|
|
|
|
|
|
MainPipieB = trans.TransSingle(content,8);
|
|
AuxPipieB=trans.TransSingle(content,12);
|
|
|
|
MainPipieC = trans.TransSingle(content, 16);
|
|
AuxPipieC = trans.TransSingle(content, 20);
|
|
|
|
UpperPressure=trans.TransSingle(content, 24);
|
|
LowerPressure = trans.TransSingle(content, 28);
|
|
}
|
|
|
|
public float MainPipieA { get; set; }
|
|
public float AuxPipieA { get; set; }
|
|
|
|
|
|
public float MainPipieB { get; set; }
|
|
public float AuxPipieB { get; set; }
|
|
|
|
|
|
public float MainPipieC { get; set; }
|
|
public float AuxPipieC { get; set; }
|
|
|
|
|
|
|
|
public float UpperPressure { get; set; }
|
|
|
|
public float LowerPressure { get; set; }
|
|
}
|
|
}
|