DB120Help

dep_deliver
我叫锄头 12 months ago
parent 2228d3be9a
commit f2d3e2f0d2

@ -80,12 +80,10 @@ namespace Mesnac.Action.ChemicalWeighing.Test
private void MCButton_Click(object sender, EventArgs e)
{
DB137WriterHelper.AddSpeed(new List<float>()
{
1,2,3
});
var s= new DB120Help().SiloO;
new DB137Helper();
s = new DB120Help().SiloJ;
DB120WriteHelp.AddABCDEF(new Uhd()
{

@ -13,7 +13,7 @@ namespace DataBlockHelper.DBHelpers
public DB120Help() {
OperateResult<byte[]> db120 = PlcConnect.Instance.Read("DB120.0.0", 66);
OperateResult<byte[]> db120 = PlcConnect.Instance.Read("DB120.0.0", 154);
bytes = db120.Content;
}
@ -21,6 +21,152 @@ namespace DataBlockHelper.DBHelpers
public Uhd GetUhd => new Uhd(bytes);
public DustfanEntity Dustfan => new DustfanEntity(78, bytes);
public DustfanEntity DustfanLineA => new DustfanEntity(80, bytes);
public DustfanEntity DustfanLineB => new DustfanEntity(82, bytes);
public DustfanEntity DustfanLineC => new DustfanEntity(84, bytes);
public float SiloA
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 94);
}
}
public float SiloB
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 98);
}
}
public float SiloC
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 102);
}
}
public float SiloD
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 106);
}
}
public float SiloE
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 110);
}
}
public float SiloF
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 114);
}
}
public float SiloG
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 118);
}
}
public float SiloH
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 122);
}
}
public float SiloI
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 126);
}
}
public float SiloJ
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 130);
}
}
public float SiloK
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 134);
}
}
public float SiloL
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 138);
}
}
public float SiloM
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 142);
}
}
public float SiloN
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 146);
}
}
public float SiloO
{
get
{
var trans = PlcConnect.Instance.ByteTransform;
return trans.TransSingle(bytes, 150);
}
}
}
public class Uhd
@ -84,4 +230,28 @@ namespace DataBlockHelper.DBHelpers
public ushort Delay3 { get; set; }
}
public class DustfanEntity
{
public DustfanEntity(ushort startSet, byte[] bytes) {
byte[] content = bytes.Skip(startSet).Take(2).ToArray();
byte byt = content[0];
SilogroupA = byt.GetBit(0);
SilogroupB = byt.GetBit(1);
SilogroupC = byt.GetBit(2);
SilogroupD = byt.GetBit(3);
SilogroupE = byt.GetBit(4);
}
public bool SilogroupA { get; set; }
public bool SilogroupB { get; set; }
public bool SilogroupC { get; set; }
public bool SilogroupD { get; set; }
public bool SilogroupE { get; set; }
}
}

Loading…
Cancel
Save