|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace FryPot_DosingSystem.Control
- {
- /// <summary>
- /// plc变量
- /// </summary>
- internal class GlobalVariable
- {
-
-
- /// <summary>
- /// 滚筒线1
- /// </summary>
- public RollerLineOne rollerLineOne = new RollerLineOne();
- /// <summary>
- /// 滚筒线2
- /// </summary>
- public RollerLineTwo rollerLineTwo = new RollerLineTwo();
- /// <summary>
- /// 滚筒线3
- /// </summary>
- public RollerLineThree rollerLineThree = new RollerLineThree();
- /// <summary>
- /// 炒锅1
- /// </summary>
- public FryPotOne fryPotOne= new FryPotOne();
- /// <summary>
- /// 炒锅2
- /// </summary>
- public FryPotTwo fryPotTwo= new FryPotTwo();
- /// <summary>
- /// 炒锅3
- /// </summary>
- public FryPotThree fryPotThree= new FryPotThree();
- /// <summary>
- /// 炒锅4
- /// </summary>
- public FryPotFour fryPotFour= new FryPotFour();
- /// <summary>
- /// 炒锅5
- /// </summary>
- public FryPotFive fryPotFive= new FryPotFive();
- /// <summary>
- /// 洗桶进桶滚筒运行信号
- /// </summary>
- public ushort CleadBarrelEnterSingle { get; set; }
- /// <summary>
- /// 洗桶出桶滚筒运行信号
- /// </summary>
- public ushort CleadBarrelExitSingle { get; set; }
- /// <summary>
- /// PLC初始化状态
- /// </summary>
- public ushort PlcInite { get; set; }
- #region 上位机内部逻辑条件
- /// <summary>
- /// 退出线体1任务
- /// </summary>
- public bool ExitLineOneTask { get; set; }
- /// <summary>
- /// 退出线体2任务
- /// </summary>
- public bool ExitLineTwoTask { get; set; }
- /// <summary>
- /// 退出线体3任务
- /// </summary>
- public bool ExitLineThreeTask { get; set; }
- /// <summary>
- /// 允许AGV去线体1装桶条件
- /// </summary>
- public bool AllowAgvToLineLoadRoller { get; set; } = true;
- /// <summary>
- /// 允许AGV去线体2装桶条件
- /// </summary>
- public bool AllowAgvToLineTwoLoadRoller { get; set; } = true;
- /// <summary>
- /// 允许AGV去线体3装桶条件
- /// </summary>
- public bool AllowAgvToLineThreeLoadRoller { get; set; } = true;
- ///// <summary>
- ///// 配方唯一ID
- ///// </summary>
- //public string RecipeId { get; set; }
- /// <summary>
- /// 线体1对应的进桶出桶互锁
- /// </summary>
- public bool InOrOutputLock { get; set; }
- /// <summary>
- /// 线体2对应的进桶出桶互锁
- /// </summary>
- public bool LTwoInOrOutputLock { get; set; }
- /// <summary>
- /// 线体3对应的进桶出桶互锁
- /// </summary>
- public bool LThreeInOrOutputLock { get; set; }
- ///// <summary>
- ///// 线体1任务执行锁
- ///// </summary>
- //public bool LOneTaskLock { get; set; }
- ///// <summary>
- ///// 线体2任务执行锁
- ///// </summary>
- //public bool LTwoTaskLock { get; set; }
- ///// <summary>
- ///// 线体3任务执行锁
- ///// </summary>
- //public bool LThreeTaskLock { get; set; }
- /// <summary>
- /// 线体1当前正在制作的配方名称
- /// </summary>
- public string LOneCurrentRecipeName { get; set; } = string.Empty;
- /// <summary>
- /// 线体2当前正在制作的配方名称
- /// </summary>
- public string LTwoCurrentRecipeName { get; set; } = string.Empty;
- /// <summary>
- /// 线体3当前正在制作的配方名称
- /// </summary>
- 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 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 LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
-
- 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 LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
-
- public int LFourRollerNum { get; set; } = 0;
- #endregion
- }
- /// <summary>
- /// 滚筒线1相关变量
- /// </summary>
- public class RollerLineOne
- {
- /// <summary>
- /// 工位号1
- /// </summary>
- public ushort StationOne { get; set; }
- /// <summary>
- /// 工位号2
- /// </summary>
- public ushort StationTwo { get; set; }
- /// <summary>
- /// 工位号3
- /// </summary>
- public ushort StationThree { get; set; }
- /// <summary>
- /// 工位号4
- /// </summary>
- public ushort StationFour { get; set; }
- /// <summary>
- /// 工位号5
- /// </summary>
- public ushort StationFive { get; set; }
- /// <summary>
- /// 工位号6
- /// </summary>
- public ushort StationSix { get; set; }
- /// <summary>
- /// 工位号7
- /// </summary>
- public ushort StationSeven { get; set; }
- /// <summary>
- /// 工位号8
- /// </summary>
- public ushort StationEight { get; set; }
- /// <summary>
- /// 输送出料滚筒运行信号
- /// </summary>
- public ushort OutMaterialingSingle { get; set; }
- /// <summary>
- /// 输送出料滚筒运行故障信号
- /// </summary>
- public ushort OutMaterialingTroubleSingle { get; set; }
- /// <summary>
- /// 当前线体配方完成信号
- /// </summary>
- public ushort RecipeCompleteSingle { get; set; }
-
-
- }
- /// <summary>
- /// 滚筒线2相关变量
- /// </summary>
- public class RollerLineTwo
- {
- /// <summary>
- /// 工位号1
- /// </summary>
- public ushort StationOne { get; set; }
- /// <summary>
- /// 工位号2
- /// </summary>
- public ushort StationTwo { get; set; }
- /// <summary>
- /// 工位号3
- /// </summary>
- public ushort StationThree { get; set; }
- /// <summary>
- /// 工位号4
- /// </summary>
- public ushort StationFour { get; set; }
- /// <summary>
- /// 工位号5
- /// </summary>
- public ushort StationFive { get; set; }
- /// <summary>
- /// 工位号6
- /// </summary>
- public ushort StationSix { get; set; }
- /// <summary>
- /// 工位号7
- /// </summary>
- public ushort StationSeven { get; set; }
- /// <summary>
- /// 工位号8
- /// </summary>
- public ushort StationEight { get; set; }
- /// <summary>
- /// 输送出料滚筒运行信号
- /// </summary>
- public ushort OutMaterialingSingle { get; set; }
- /// <summary>
- /// 输送出料滚筒运行故障信号
- /// </summary>
- public ushort OutMaterialingTroubleSingle { get; set; }
- /// <summary>
- /// 当前线体配方完成信号
- /// </summary>
- public ushort RecipeCompleteSingle { get; set; }
- }
- /// <summary>
- /// 滚筒线3相关变量
- /// </summary>
- public class RollerLineThree
- {
- /// <summary>
- /// 工位号1
- /// </summary>
- public ushort StationOne { get; set; }
- /// <summary>
- /// 工位号2
- /// </summary>
- public ushort StationTwo { get; set; }
- /// <summary>
- /// 工位号3
- /// </summary>
- public ushort StationThree { get; set; }
- /// <summary>
- /// 工位号4
- /// </summary>
- public ushort StationFour { get; set; }
- /// <summary>
- /// 工位号5
- /// </summary>
- public ushort StationFive { get; set; }
- /// <summary>
- /// 工位号6
- /// </summary>
- public ushort StationSix { get; set; }
- /// <summary>
- /// 工位号7
- /// </summary>
- public ushort StationSeven { get; set; }
- /// <summary>
- /// 工位号8
- /// </summary>
- public ushort StationEight { get; set; }
- /// <summary>
- /// 输送出料滚筒运行信号
- /// </summary>
- public ushort OutMaterialingSingle { get; set; }
- /// <summary>
- /// 输送出料滚筒运行故障信号
- /// </summary>
- public ushort OutMaterialingTroubleSingle { get; set; }
- /// <summary>
- /// 当前线体配方完成信号
- /// </summary>
- public ushort RecipeCompleteSingle { get; set; }
- }
- /// <summary>
- /// 滚筒线4相关变量
- /// </summary>
- public class RollerLineFour
- {
- /// <summary>
- /// 工位号1
- /// </summary>
- public ushort StationOne { get; set; }
- /// <summary>
- /// 工位号2
- /// </summary>
- public ushort StationTwo { get; set; }
- /// <summary>
- /// 工位号3
- /// </summary>
- public ushort StationThree { get; set; }
- /// <summary>
- /// 工位号4
- /// </summary>
- public ushort StationFour { get; set; }
- /// <summary>
- /// 工位号5
- /// </summary>
- public ushort StationFive { get; set; }
- /// <summary>
- /// 工位号6
- /// </summary>
- public ushort StationSix { get; set; }
- /// <summary>
- /// 工位号7
- /// </summary>
- public ushort StationSeven { get; set; }
- /// <summary>
- /// 工位号8
- /// </summary>
- public ushort StationEight { get; set; }
- /// <summary>
- /// 输送出料滚筒运行信号
- /// </summary>
- public ushort OutMaterialingSingle { get; set; }
- /// <summary>
- /// 输送出料滚筒运行故障信号
- /// </summary>
- public ushort OutMaterialingTroubleSingle { get; set; }
- /// <summary>
- /// 当前线体配方完成信号
- /// </summary>
- public ushort RecipeCompleteSingle { get; set; }
-
-
- }
- /// <summary>
- /// 炒锅1相关变量
- /// </summary>
- public class FryPotOne
- {
- /// <summary>
- /// 进料滚筒运行信号
- /// </summary>
- public ushort InputMaterialRollerRunningSingle { get; set; }
- /// <summary>
- /// 进料到位信号
- /// </summary>
- public ushort InputMaterialArrivedSingle { get; set; }
- /// <summary>
- /// 空桶到位信号
- /// </summary>
- public ushort EmptyBarrelArrivedSingle { get; set; }
- /// <summary>
- /// 空桶滚筒运行信号
- /// </summary>
- public ushort EmptyBarrelRollerRunningSingle { get; set; }
- /// <summary>
- /// 滚筒故障信号
- /// </summary>
- public ushort RollerTroubleSingle { get; set; }
-
- /// <summary>
- /// 用油量确认信号
- /// </summary>
- public ushort OilConfirm { get; set; }
- /// <summary>
- /// 当前配方用油量
- /// </summary>
- public double OilCapacity { get; set; }
- }
- /// <summary>
- /// 炒锅2相关变量
- /// </summary>
- public class FryPotTwo
- {
- /// <summary>
- /// 进料滚筒运行信号
- /// </summary>
- public ushort InputMaterialRollerRunningSingle { get; set; }
- /// <summary>
- /// 进料到位信号
- /// </summary>
- public ushort InputMaterialArrivedSingle { get; set; }
- /// <summary>
- /// 空桶到位信号
- /// </summary>
- public ushort EmptyBarrelArrivedSingle { get; set; }
- /// <summary>
- /// 空桶滚筒运行信号
- /// </summary>
- public ushort EmptyBarrelRollerRunningSingle { get; set; }
- /// <summary>
- /// 滚筒故障信号
- /// </summary>
- public ushort RollerTroubleSingle { get; set; }
- /// <summary>
- /// 用油量确认信号
- /// </summary>
- public ushort OilConfirm { get; set; }
- /// <summary>
- /// 当前配方用油量
- /// </summary>
- public double OilCapacity { get; set; }
- }
- /// <summary>
- /// 炒锅3相关变量
- /// </summary>
- public class FryPotThree
- {
- /// <summary>
- /// 进料滚筒运行信号
- /// </summary>
- public ushort InputMaterialRollerRunningSingle { get; set; }
- /// <summary>
- /// 进料到位信号
- /// </summary>
- public ushort InputMaterialArrivedSingle { get; set; }
- /// <summary>
- /// 空桶到位信号
- /// </summary>
- public ushort EmptyBarrelArrivedSingle { get; set; }
- /// <summary>
- /// 空桶滚筒运行信号
- /// </summary>
- public ushort EmptyBarrelRollerRunningSingle { get; set; }
- /// <summary>
- /// 滚筒故障信号
- /// </summary>
- public ushort RollerTroubleSingle { get; set; }
- /// <summary>
- /// 用油量确认信号
- /// </summary>
- public ushort OilConfirm { get; set; }
- /// <summary>
- /// 当前配方用油量
- /// </summary>
- public double OilCapacity { get; set; }
- }
- /// <summary>
- /// 炒锅4相关变量
- /// </summary>
- public class FryPotFour
- {
- /// <summary>
- /// 进料滚筒运行信号
- /// </summary>
- public ushort InputMaterialRollerRunningSingle { get; set; }
- /// <summary>
- /// 进料到位信号
- /// </summary>
- public ushort InputMaterialArrivedSingle { get; set; }
- /// <summary>
- /// 空桶到位信号
- /// </summary>
- public ushort EmptyBarrelArrivedSingle { get; set; }
- /// <summary>
- /// 空桶滚筒运行信号
- /// </summary>
- public ushort EmptyBarrelRollerRunningSingle { get; set; }
- /// <summary>
- /// 滚筒故障信号
- /// </summary>
- public ushort RollerTroubleSingle { get; set; }
- /// <summary>
- /// 用油量确认信号
- /// </summary>
- public ushort OilConfirm { get; set; }
- /// <summary>
- /// 当前配方用油量
- /// </summary>
- public double OilCapacity { get; set; }
- }
- /// <summary>
- /// 炒锅5相关变量
- /// </summary>
- public class FryPotFive
- {
- /// <summary>
- /// 进料滚筒运行信号
- /// </summary>
- public ushort InputMaterialRollerRunningSingle { get; set; }
- /// <summary>
- /// 进料到位信号
- /// </summary>
- public ushort InputMaterialArrivedSingle { get; set; }
- /// <summary>
- /// 空桶到位信号
- /// </summary>
- public ushort EmptyBarrelArrivedSingle { get; set; }
- /// <summary>
- /// 空桶滚筒运行信号
- /// </summary>
- public ushort EmptyBarrelRollerRunningSingle { get; set; }
- /// <summary>
- /// 滚筒故障信号
- /// </summary>
- public ushort RollerTroubleSingle { get; set; }
- /// <summary>
- /// 用油量确认信号
- /// </summary>
- public ushort OilConfirm { get; set; }
- /// <summary>
- /// 当前配方用油量
- /// </summary>
- public double OilCapacity { get; set; }
- }
- }
|