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/DBHelpers/DB137Helper.cs

61 lines
1.6 KiB
C#

12 months ago
using HslCommunication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBlockHelper.DBHelpers
{
public class DB137Helper : DBHelper
{
public DB137Helper() {
OperateResult<byte[]> db = PlcConnect.Instance.Read("DB137.0.0", 14);
bytes = db.Content;
var trans = PlcConnect.Instance.ByteTransform;
var tyb = bytes.Skip(0).Take(1).First();
HighLevel01 = tyb.GetBit(0);
HighLevel02 = tyb.GetBit(1);
HighLevel03 = tyb.GetBit(2);
Excitation01 = tyb.GetBit(3);
Excitation02 = tyb.GetBit(4);
Excitation03= tyb.GetBit(5);
SideBlowing01=tyb.GetBit(6);
SideBlowing02=tyb.GetBit(7);
tyb = bytes.Skip(1).Take(1).First();
SideBlowing03 = tyb.GetBit(0);
12 months ago
SpeedA = trans.TransSingle(bytes, 2);
SpeedB = trans.TransSingle(bytes, 6);
SpeedC = trans.TransSingle(bytes, 10);
12 months ago
}
public bool HighLevel01 { get; set; }
public bool HighLevel02 { get; set; }
public bool HighLevel03 { get; set; }
public bool Excitation01 { get; set; }
public bool Excitation02 { get; set; }
public bool Excitation03 { get; set; }
public bool SideBlowing01 { get; set; }
public bool SideBlowing02 { get; set; }
public bool SideBlowing03 { get; set; }
12 months ago
public float SpeedA { get; set; }
public float SpeedB { get; set; }
public float SpeedC { get; set; }
12 months ago
}
}