using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPASmartClient.DosingSystem { /// <summary> /// PLC 到上位机数据 /// </summary> public class PlcToComputer { public PlcToComputer() { for (int i = 0; i < cylinderFlagBitStatus.Length; i++) { cylinderFlagBitStatus[i] = new CylinderFlagBitStatus(); } } /// <summary> /// 心跳 /// </summary> public bool Heartbeat { get; set; } /// <summary> /// 接收配方完成 /// </summary> public bool ResComplete { get; set; } /// <summary> /// 系统启动或停止状态 /// </summary> public bool SystemStartOrStop { get; set; } /// <summary> /// 手自动状态 /// </summary> public bool HandOrAuto { get; set; } /// <summary> /// 桶位置反馈 /// </summary> public short[] LocationFeedback { get; set; } = new short[32]; /// <summary> /// 桶是否允许配料 /// </summary> public bool[] IsAllowIngredients { get; set; } = new bool[32]; /// <summary> /// 报警信息 /// </summary> public bool[] ArrayInfo { get; set; } = new bool[32]; /// <summary> /// 本地急停 /// </summary> public bool LocalEStop { get; set; } /// <summary> /// 远程急停 /// </summary> public bool RemoteEStop { get; set; } /// <summary> /// 上桶工位检测 /// </summary> public bool OnDetection { get; set; } /// <summary> /// 下桶工位检测 /// </summary> public bool UnderDetection { get; set; } /// <summary> /// 上桶工位气缸检测 /// </summary> public CylinderFlagBitStatus OnCylinderDetection { get; set; } = new CylinderFlagBitStatus(); /// <summary> /// 下桶工位气缸检测 /// </summary> public CylinderFlagBitStatus UnderCylinderDetection { get; set; } = new CylinderFlagBitStatus(); /// <summary> /// 工位光电检测 /// </summary> public bool[] StationDetection { get; set; } = new bool[32]; /// <summary> /// 气缸状态信号 /// </summary> public CylinderFlagBitStatus[] cylinderFlagBitStatus { get; set; } = new CylinderFlagBitStatus[32]; } /// <summary> /// 气缸到位检测类 /// </summary> public class CylinderFlagBitStatus { /// <summary> /// 气缸原点信号 /// </summary> public bool HomeSignal { get; set; } /// <summary> /// 气缸到位信号 /// </summary> public bool InPlaceSignal { get; set; } } }