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/DB2107Helper.cs

94 lines
2.4 KiB
C#

using DataBlockHelper.Entity.DB2107Entity;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HslCommunication;
namespace DataBlockHelper.DBHelpers
{
public class DB2107Helper
{
private byte[] _bytes;
public DB2107Helper()
{
_bytes = PlcConnect.Instance.Read("DB2107.0.0", 2064).Content;
}
// public OperateResult<byte[]> GetAll=>PlcConnect.Instance.Read("DB2107.0.0", 2057);
public NormalStatusEntity NormalStatus => NormalS(_bytes);
private NormalStatusEntity NormalS(byte[] bytes)
{
return new NormalStatusEntity(bytes);
}
public ControlSignEntity ControlSign => ControlS(_bytes);
private ControlSignEntity ControlS(byte[] bytes)
{
return new ControlSignEntity(bytes);
}
public PressureEntity Pressure => Press(_bytes);
private PressureEntity Press(byte[] bytes)
{
return new PressureEntity(bytes);
}
public PIDEntity PID => Pid(_bytes);
private PIDEntity Pid(byte[] bytes)
{
return new PIDEntity(bytes);
}
public WeightEntity Weight => Weigh(_bytes);
private WeightEntity Weigh(byte[] bytes)
{
return new WeightEntity(bytes);
}
public WeightPraEntity WeightPra => WeightP(_bytes);
private WeightPraEntity WeightP(byte[] bytes)
{
return new WeightPraEntity(bytes);
}
public SpeedEntity Speed => Spee(_bytes);
private SpeedEntity Spee(byte[] bytes)
{
return new SpeedEntity(bytes);
}
public List<UntiStatusHMIArrayEntity> Dryer => new UntiStatusHMIArrayManager(4, 1408, 32, _bytes).GetList();
public List<UntiStatusHMIArrayEntity> Gelater => new UntiStatusHMIArrayManager(8, 1536, 32, _bytes).GetList();
public List<UntiStatusHMIArrayEntity> Weter => new UntiStatusHMIArrayManager(8, 1792, 32, _bytes).GetList();
public ValveEntity Valve => Val(_bytes);
private ValveEntity Val(byte[] bytes)
{
return new ValveEntity(bytes);
}
public LevelEntity Level => Lev(_bytes);
private LevelEntity Lev(byte[] bytes)
{
return new LevelEntity(bytes);
}
}
}