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/DB2107Entity/PIDEntity.cs

36 lines
1.1 KiB
C#

using HslCommunication;
namespace DataBlockHelper.Entity.DB2107Entity
{
public class PIDEntity
{
public PID_HMI Convey_V1 => new PID_HMI(614);
public PID_HMI Purge_V1 => new PID_HMI(622);
public PID_HMI Convey_V2 => new PID_HMI(630);
public PID_HMI Purge_V2 => new PID_HMI(638);
public PID_HMI Convey_V3 => new PID_HMI(646);
public PID_HMI Purge_V3 => new PID_HMI(654);
public PID_HMI Convey_V4 => new PID_HMI(662);
public PID_HMI Purge_V4 => new PID_HMI(670);
public PID_HMI Convey_V5 => new PID_HMI(678);
public PID_HMI Purge_V5 => new PID_HMI(686);
}
public class PID_HMI
{
public PID_HMI(ushort startSet)
{
OperateResult<byte[]> read = PlcConnect.Instance.Read("DB2107." + startSet + ".0", 8);
var content = read.Content;
PV = PlcConnect.Instance.ByteTransform.TransSingle(content, 0);
SV = PlcConnect.Instance.ByteTransform.TransSingle(content, 4);
}
public float PV { get; private set; }
public float SV { get; private set; }
}
}