using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FryPot_DosingSystem.Control { /// /// plc变量 /// internal class GlobalVariable { /// /// 滚筒线1 /// public RollerLineOne rollerLineOne = new RollerLineOne(); /// /// 滚筒线2 /// public RollerLineTwo rollerLineTwo = new RollerLineTwo(); /// /// 滚筒线3 /// public RollerLineThree rollerLineThree = new RollerLineThree(); /// /// 炒锅1 /// public FryPotOne fryPotOne= new FryPotOne(); /// /// 炒锅2 /// public FryPotTwo fryPotTwo= new FryPotTwo(); /// /// 炒锅3 /// public FryPotThree fryPotThree= new FryPotThree(); /// /// 炒锅4 /// public FryPotFour fryPotFour= new FryPotFour(); /// /// 炒锅5 /// public FryPotFive fryPotFive= new FryPotFive(); /// /// 洗桶进桶滚筒运行信号 /// public ushort CleadBarrelEnterSingle { get; set; } /// /// 洗桶出桶滚筒运行信号 /// public ushort CleadBarrelExitSingle { get; set; } /// /// PLC初始化状态 /// public ushort PlcInite { get; set; } /// /// 清洗台清洗完成信号 /// public ushort CleanComplete { get; set; } #region 上位机内部逻辑条件 /// /// 退出线体1任务 /// public bool ExitLineOneTask { get; set; } /// /// 退出线体2任务 /// public bool ExitLineTwoTask { get; set; } /// /// 退出线体3任务 /// public bool ExitLineThreeTask { get; set; } /// /// 允许AGV去线体1装桶条件 /// public bool AllowAgvToLineLoadRoller { get; set; } = true; /// /// 允许AGV去线体2装桶条件 /// public bool AllowAgvToLineTwoLoadRoller { get; set; } = true; /// /// 允许AGV去线体3装桶条件 /// public bool AllowAgvToLineThreeLoadRoller { get; set; } = true; ///// ///// 配方唯一ID ///// //public string RecipeId { get; set; } /// /// 线体1对应的进桶出桶互锁 /// public bool InOrOutputLock { get; set; } /// /// 线体2对应的进桶出桶互锁 /// public bool LTwoInOrOutputLock { get; set; } /// /// 线体3对应的进桶出桶互锁 /// public bool LThreeInOrOutputLock { get; set; } ///// ///// 线体1任务执行锁 ///// //public bool LOneTaskLock { get; set; } ///// ///// 线体2任务执行锁 ///// //public bool LTwoTaskLock { get; set; } ///// ///// 线体3任务执行锁 ///// //public bool LThreeTaskLock { get; set; } /// /// 线体1当前正在制作的配方名称 /// public string LOneCurrentRecipeName { get; set; } = string.Empty; /// /// 线体2当前正在制作的配方名称 /// public string LTwoCurrentRecipeName { get; set; } = string.Empty; /// /// 线体3当前正在制作的配方名称 /// public string LThreeCurrentRecipeName { get; set; } = string.Empty; #endregion #region 线体1流程互锁变量 public bool LoadRoller { get; set; } public bool AgvToFryPot { get; set; } public bool PotOneInputMaterialArrive { get; set; } public bool PotOneOutputRollerArrive { get; set; } public bool AgvArrivePot { get; set; } #endregion #region 线体2流程互锁变量 public bool LTwoLoadRoller { get; set; } public bool LTwoAgvToFryPot { get; set; } public bool LTwoPotInputMaterialArrive { get; set; } public bool LTwoPotOutputRollerArrive { get; set; } public bool LTwoAgvArrivePot { get; set; } #endregion #region 线体3流程互锁变量 public bool LThreeLoadRoller { get; set; } public bool LThreeAgvToFryPot { get; set; } public bool LThreePotInputMaterialArrive { get; set; } public bool LThreePotOutputRollerArrive { get; set; } public bool LThreeAgvArrivePot { get; set; } #endregion #region AGV视图显示变量 public int LOneMaterialNum { get; set; } = 0; public int LOneFryPotSerial { get; set; } = 1; public int LOneCurrentCookingStep { get; set; } = 0; public bool agvArriveUpLoad { get; set; } public bool agvArriveUnLoad { get; set; } public bool agvFryPotEmptyRollerArrive { get; set; } public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成 public bool agvLineOneLoadCom { get; set; }//线体1上料完成 public int LTwoMaterialNum { get; set; } = 0; public int LTwoFryPotSerial { get; set; } = 2; public int LTwoCurrentCookingStep { get; set; } = 0; public bool agvArriveLTwoUpLoad { get; set; } public bool LTwoagvArriveUnLoad { get; set; } public bool LTwoagvFryPotEmptyRollerArrive { get; set; } public bool agvLineTwoLoadCom { get; set; }//线体2上料完成 public int LThreeMaterialNum { get; set; } = 0; public int LThreeFryPotSerial { get; set; } = 3; public int LThreeCurrentCookingStep { get; set; } = 0; public bool agvArriveLThreeUpLoad { get; set; } public bool LThreeagvArriveUnLoad { get; set; } public bool LThreeagvFryPotEmptyRollerArrive { get; set; } public bool agvLineThreeLoadCom { get; set; }//线体1上料完成 public int LFourRollerNum { get; set; } = 0;//4号线体空桶数量 //新增空桶清洗系列变量 public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清洗台或炒锅 public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置 public bool agvArriveCleanLoad { get; set; }//agv到达清洗台上料位置 public bool agvArriveLineOneLoadEmptyRoller { get; set; }//agv到达线体1空桶上料位置 public bool agvArriveLineTwoLoadEmptyRoller { get; set; }//agv到达线体2空桶上料位置 public bool agvArriveLineThreeLoadEmptyRoller { get; set; }//agv到达线体3空桶上料位置 public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成 public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成 public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成 //空桶清洗流程锁 #endregion } /// /// 滚筒线1相关变量 /// public class RollerLineOne { /// /// 工位号1 /// public ushort StationOne { get; set; } /// /// 工位号2 /// public ushort StationTwo { get; set; } /// /// 工位号3 /// public ushort StationThree { get; set; } /// /// 工位号4 /// public ushort StationFour { get; set; } /// /// 工位号5 /// public ushort StationFive { get; set; } /// /// 工位号6 /// public ushort StationSix { get; set; } /// /// 工位号7 /// public ushort StationSeven { get; set; } /// /// 工位号8 /// public ushort StationEight { get; set; } /// /// 输送出料滚筒运行信号 /// public ushort OutMaterialingSingle { get; set; } /// /// 输送出料滚筒运行故障信号 /// public ushort OutMaterialingTroubleSingle { get; set; } /// /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } /// /// 线体1上空桶确认信号 /// public ushort EmptyRollerConfirmSingle { get; set; } /// /// 线体1上单个空桶编号 /// public ushort EmptyRollerNum { get; set; } /// /// 上一个桶是否是空桶 /// public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶 public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 /// /// 线体1上所有空桶的编号集合 /// public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线2相关变量 /// public class RollerLineTwo { /// /// 工位号1 /// public ushort StationOne { get; set; } /// /// 工位号2 /// public ushort StationTwo { get; set; } /// /// 工位号3 /// public ushort StationThree { get; set; } /// /// 工位号4 /// public ushort StationFour { get; set; } /// /// 工位号5 /// public ushort StationFive { get; set; } /// /// 工位号6 /// public ushort StationSix { get; set; } /// /// 工位号7 /// public ushort StationSeven { get; set; } /// /// 工位号8 /// public ushort StationEight { get; set; } /// /// 输送出料滚筒运行信号 /// public ushort OutMaterialingSingle { get; set; } /// /// 输送出料滚筒运行故障信号 /// public ushort OutMaterialingTroubleSingle { get; set; } /// /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } /// /// 线体1上空桶确认信号 /// public ushort EmptyRollerConfirmSingle { get; set; } /// /// 线体1上单个空桶编号 /// public ushort EmptyRollerNum { get; set; } /// /// 上一个同时否是空桶 /// public bool IsEpmtyBefore { get; set; } public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 /// /// 线体2上所有空桶的编号集合 /// public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线3相关变量 /// public class RollerLineThree { /// /// 工位号1 /// public ushort StationOne { get; set; } /// /// 工位号2 /// public ushort StationTwo { get; set; } /// /// 工位号3 /// public ushort StationThree { get; set; } /// /// 工位号4 /// public ushort StationFour { get; set; } /// /// 工位号5 /// public ushort StationFive { get; set; } /// /// 工位号6 /// public ushort StationSix { get; set; } /// /// 工位号7 /// public ushort StationSeven { get; set; } /// /// 工位号8 /// public ushort StationEight { get; set; } /// /// 输送出料滚筒运行信号 /// public ushort OutMaterialingSingle { get; set; } /// /// 输送出料滚筒运行故障信号 /// public ushort OutMaterialingTroubleSingle { get; set; } /// /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } /// /// 线体1上空桶确认信号 /// public ushort EmptyRollerConfirmSingle { get; set; } /// /// 线体1上单个空桶编号 /// public ushort EmptyRollerNum { get; set; } /// /// 上一个同时否是空桶 /// public bool IsEpmtyBefore { get; set; } public bool CanRun { get; set; } = true;//配方料桶上料结束后,线体空桶AGV才能1号线装桶 /// /// 线体3上所有空桶的编号集合 /// public List EmptyRollerNums { get; set; } = new List(); } /// /// 滚筒线4相关变量 /// public class RollerLineFour { /// /// 工位号1 /// public ushort StationOne { get; set; } /// /// 工位号2 /// public ushort StationTwo { get; set; } /// /// 工位号3 /// public ushort StationThree { get; set; } /// /// 工位号4 /// public ushort StationFour { get; set; } /// /// 工位号5 /// public ushort StationFive { get; set; } /// /// 工位号6 /// public ushort StationSix { get; set; } /// /// 工位号7 /// public ushort StationSeven { get; set; } /// /// 工位号8 /// public ushort StationEight { get; set; } /// /// 输送出料滚筒运行信号 /// public ushort OutMaterialingSingle { get; set; } /// /// 输送出料滚筒运行故障信号 /// public ushort OutMaterialingTroubleSingle { get; set; } /// /// 当前线体配方完成信号 /// public ushort RecipeCompleteSingle { get; set; } } /// /// 炒锅1相关变量 /// public class FryPotOne { /// /// 进料滚筒运行信号 /// public ushort InputMaterialRollerRunningSingle { get; set; } /// /// 进料到位信号 /// public ushort InputMaterialArrivedSingle { get; set; } /// /// 空桶到位信号 /// public ushort EmptyBarrelArrivedSingle { get; set; } /// /// 空桶滚筒运行信号 /// public ushort EmptyBarrelRollerRunningSingle { get; set; } /// /// 滚筒故障信号 /// public ushort RollerTroubleSingle { get; set; } /// /// 用油量确认信号 /// public ushort OilConfirm { get; set; } /// /// 当前配方用油量 /// public double OilCapacity { get; set; } } /// /// 炒锅2相关变量 /// public class FryPotTwo { /// /// 进料滚筒运行信号 /// public ushort InputMaterialRollerRunningSingle { get; set; } /// /// 进料到位信号 /// public ushort InputMaterialArrivedSingle { get; set; } /// /// 空桶到位信号 /// public ushort EmptyBarrelArrivedSingle { get; set; } /// /// 空桶滚筒运行信号 /// public ushort EmptyBarrelRollerRunningSingle { get; set; } /// /// 滚筒故障信号 /// public ushort RollerTroubleSingle { get; set; } /// /// 用油量确认信号 /// public ushort OilConfirm { get; set; } /// /// 当前配方用油量 /// public double OilCapacity { get; set; } } /// /// 炒锅3相关变量 /// public class FryPotThree { /// /// 进料滚筒运行信号 /// public ushort InputMaterialRollerRunningSingle { get; set; } /// /// 进料到位信号 /// public ushort InputMaterialArrivedSingle { get; set; } /// /// 空桶到位信号 /// public ushort EmptyBarrelArrivedSingle { get; set; } /// /// 空桶滚筒运行信号 /// public ushort EmptyBarrelRollerRunningSingle { get; set; } /// /// 滚筒故障信号 /// public ushort RollerTroubleSingle { get; set; } /// /// 用油量确认信号 /// public ushort OilConfirm { get; set; } /// /// 当前配方用油量 /// public double OilCapacity { get; set; } } /// /// 炒锅4相关变量 /// public class FryPotFour { /// /// 进料滚筒运行信号 /// public ushort InputMaterialRollerRunningSingle { get; set; } /// /// 进料到位信号 /// public ushort InputMaterialArrivedSingle { get; set; } /// /// 空桶到位信号 /// public ushort EmptyBarrelArrivedSingle { get; set; } /// /// 空桶滚筒运行信号 /// public ushort EmptyBarrelRollerRunningSingle { get; set; } /// /// 滚筒故障信号 /// public ushort RollerTroubleSingle { get; set; } /// /// 用油量确认信号 /// public ushort OilConfirm { get; set; } /// /// 当前配方用油量 /// public double OilCapacity { get; set; } } /// /// 炒锅5相关变量 /// public class FryPotFive { /// /// 进料滚筒运行信号 /// public ushort InputMaterialRollerRunningSingle { get; set; } /// /// 进料到位信号 /// public ushort InputMaterialArrivedSingle { get; set; } /// /// 空桶到位信号 /// public ushort EmptyBarrelArrivedSingle { get; set; } /// /// 空桶滚筒运行信号 /// public ushort EmptyBarrelRollerRunningSingle { get; set; } /// /// 滚筒故障信号 /// public ushort RollerTroubleSingle { get; set; } /// /// 用油量确认信号 /// public ushort OilConfirm { get; set; } /// /// 当前配方用油量 /// public double OilCapacity { get; set; } } }