Beispiel #1
0
        /// <summary>
        /// safe door /axis alarm
        /// </summary>
        private void AlarmReport()
        {
            #region 急停
            Globals.Invoker.SetCtl_BckColor(this.Btn_EMG, Gg.GetDi(0, Gg.InPutMMS0.紧急停止) == 1 ? Mycolor.Red : Color.LimeGreen);
            if (EmgSt.Bool_LDP(Gg.GetDi(0, Gg.InPutMMS0.紧急停止) == 1))
            {
                EMG();
                if (ShowList != null)
                {
                    ShowList("紧急停止按下!");
                }
            }
            EmgSt.Update(Gg.GetDi(0, Gg.InPutMMS0.紧急停止) == 1);
            if (EmgSt.PLF)
            {
                //PVar.LampStatus = 50;
                Globals.addList("紧急停止松开!", Mycolor.Red);
            }
            #endregion

            #region 实时扫描 安全门 等
            Globals.Invoker.SetCtl_BckColor(this.CurtionSts, Gg.GetDi(0, Gg.InPutMMS0.安全光幕) == 1 ? Mycolor.Red : Color.LimeGreen);
            Globals.Invoker.SetCtl_BckColor(this.AirSts, Gg.GetDi(0, Gg.InPutMMS0.正气源感应表) == 1 ? Color.LimeGreen : Mycolor.Red);
            if (Globals.settingFunc.打开安全门 && PVar.Stop_Flag == false && PVar.MacHold == false && PVar.AutoRunFlag)
            {
                string tempStr  = "";
                string tempStr1 = "";
                if (Gg.GetDi(0, Gg.InPutMMS0.后安全门感应器) == 0)
                {
                    tempStr = "后安全门";
                }
                if (Gg.GetDi(0, Gg.InPutMMS0.左安全门感应器) == 0)
                {
                    tempStr = "左安全门";
                }
                if (Gg.GetDi(0, Gg.InPutMMS0.右安全门感应器) == 0)
                {
                    tempStr = "右安全门";
                }
                if (!string.IsNullOrEmpty(tempStr))
                {
                    PVar.MacHold   = true;
                    PVar.Stop_Flag = false;
                    if (ShowList != null)
                    {
                        ShowList("请关闭" + tempStr);
                    }
                    if (PauseClick != null)
                    {
                        PauseClick(true);
                    }
                    PVar.LampStatus = 20;
                }
                if (CurtionLDPF.Bool_LDP(Gg.GetDi(0, Gg.InPutMMS0.安全光幕) == 1))
                {
                    tempStr1 = "光栅触发!";
                }
                if (!string.IsNullOrEmpty(tempStr1))
                {
                    PVar.MacHold   = true;
                    PVar.Stop_Flag = false;
                    Globals.addList(tempStr1, Mycolor.ErrorRed);
                    if (ShowList != null)
                    {
                        ShowList(tempStr1);
                    }
                    if (PauseClick != null)
                    {
                        PauseClick(true);
                    }
                    PVar.LampStatus = 20;
                }
                //this.SafeDoorSts.Checked = string.IsNullOrEmpty(tempStr);
                this.CurtionSts.BackColor = string.IsNullOrEmpty(tempStr1) ? Mycolor.LimeGreen : Color.Red;
                this.AirSts.BackColor     = (Gg.GetDi(0, Gg.InPutMMS0.正气源感应表) == 1) ? Mycolor.LimeGreen : Color.Red;
            }

            #endregion

            #region 轴报警

            if (Gg.Get_AlarmDi(0, Gg.InAlarmMMS0.测试Y轴) == 1)
            {
                Globals.PostAlarmMachine(XAlarmLevel.STOP, (int)AlarmCode.Y伺服电机驱动器报警, AlarmCategory.SYSTEM.ToString(), "Y伺服电机驱动器报警");
            }
            if (Gg.GetLimitDi_F(0, (short)Gg.InAlarmMMS0.测试Y轴) == 1 && GoHome.Instance.Reset.Result)
            {
                Globals.PostAlarmMachine(XAlarmLevel.STOP, (int)AlarmCode.Y伺服电机驱动器报警, AlarmCategory.SYSTEM.ToString(), "Y伺服电机负极限报警");
            }
            if (Gg.GetLimitDi_Z(0, (short)Gg.InAlarmMMS0.测试Y轴) == 1 && GoHome.Instance.Reset.Result)
            {
                Globals.PostAlarmMachine(XAlarmLevel.STOP, (int)AlarmCode.Y伺服电机驱动器报警, AlarmCategory.SYSTEM.ToString(), "Y伺服电机正极限报警");
            }
            #endregion
        }