Ejemplo n.º 1
0
        /// <summary>
        /// 判断当前位置是否是所在按区域的时候,对应IO是否安全,安全返回TRUE,否则FLASE
        /// </summary>
        /// <returns></returns>
        public static bool IOIsSafe(PointAggregate pa)
        {
            if (pa == null || pa.tag_AxisSafeManage == null || pa.tag_AxisSafeManage.tag_InIoList == null || pa.tag_AxisSafeManage.tag_InIoList.Count == 0)
            {
                return(true);
            }
            foreach (OutIOParameterPoint io in pa.tag_AxisSafeManage.tag_InIoList)
            {
                bool var = false;
                // io.tag_IniO1.tag_name
                if (io != null && io.tag_IniO2 != null && NewCtrlCardV0.GetInputIoBitStatus(io.tag_IniO2.tag_name, io.tag_IniO2.tag_IOName, out var) == 0)
                {
                    if (var == io.tag_IniO2.tag_var)
                    {
                    }
                    else
                    {
                        LogOutControl.OutLog("IO:<" + io.tag_IniO2.tag_IOName + "  >有安全隐患,可能撞机,请注意", 0);
                        return(false);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public MainUI(FrameUI frameUI, Work work)
        {
            //////////////////////////////////////////////////////////////////////////
            NewCtrlCardV0.tag_initResult = NewCtrlCardV0.initCard(work.tag_CardHave);
            if (NewCtrlCardV0.tag_initResult == 0)
            {
                NewCtrlCardIO.StartListenSignal(work.tag_CardHave);
            }
            work.AllAxismodeInit();

            //////////////////////////////////////////////////////////////////////////
            InitializeComponent();
            tag_Work     = work;
            this.frameUI = frameUI;
            if (frameUI != null)
            {
                this.Size = new Size(frameUI.Size.Width, frameUI.Size.Height - 50);
            }

            webControl_NG.RefreshURL("http://www.mirsyu.xyz/HTML/NG.html");
            panel_NG.Controls.Add(webControl_NG);
            webControl_NG.Location = new Point(0, 0);
            webControl_NG.Size     = webControl_NG.Parent.Size;

            webControl_Charts.RefreshURL("http://www.mirsyu.xyz/HTML/Charts.html");
            panel_Charts.Controls.Add(webControl_Charts);
            webControl_Charts.Location = new Point(0, 0);
            webControl_Charts.Size     = webControl_Charts.Parent.Size;


            groupBox_RunInfo.Controls.Add(logOutControl);
            logOutControl.Location = new Point(5, 20);
            logOutControl.Size     = new Size(groupBox_RunInfo.Size.Width - 10, groupBox_RunInfo.Size.Height - 25);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 轴,iO安全检查
        /// </summary>
        /// <returns></returns>
        public bool IoSafeCheck(StationModule sm)
        {
            try
            {
                int count = _Config.axisArray.Count;
                int i     = 0;

                int CountIo = _Config.arrWorkStation.Count;
                if (sm == null)
                {
                    return(true);
                }
                while (i < count)
                {
                    AxisConfig ac = _Config.axisArray[i];
                    if (ac.AxisNum >= 0 && NewCtrlCardV0.SR_GetAxisStatus(ac) == 1)
                    {
                        if (!AxisSafeManage.IoAxisIsSafe(sm, ac, 0, 0))
                        {
                            if (Global.WorkVar.tag_isFangDaiJieChu)
                            {
                                return(true);
                            }
                            return(false);
                        }
                    }
                    i++;
                }
                return(true);
            }
            catch
            {
                return(true);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 判断当前轴运动是否是在PA 的安全 配置列表里面(pa.tag_AxisSafeManage.tag_AxisSafeList)  在返回TRUE
        /// </summary>
        /// <param name="_ac"></param>
        /// <param name="pa"></param>
        /// <returns></returns>
        public static bool isIOAxisHavePoint(AxisConfig _ac, PointAggregate pa, double pos)
        {
            int i = 0;

            if (pa == null || pa.tag_AxisSafeManage == null || pa.tag_AxisSafeManage.tag_AxisSafeList == null)
            {
                return(false);
            }
            while (i < pa.tag_AxisSafeManage.tag_AxisSafeList.Count)
            {
                AxisSafe currac = pa.tag_AxisSafeManage.tag_AxisSafeList[i];
                if ((int)_ac.tag_MotionCardManufacturer * 1000 + _ac.CardNum * 100 + _ac.AxisNum == currac.tag_AxisId)
                {
                    double poen_ac = 0.0;
                    NewCtrlCardV0.SR_GetPrfPos((int)_ac.tag_MotionCardManufacturer, _ac.CardNum, _ac.AxisNum, ref poen_ac);
                    //  if (i == 0)
                    {
                        poen_ac = poen_ac / _ac.Eucf;
                        if (poen_ac <= currac.tag_max && poen_ac >= currac.tag_min)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                i++;
            }
            return(false);
        }
Ejemplo n.º 5
0
 private void MenuPause_Click(object sender, EventArgs e)
 {
     if (Global.WorkVar.tag_SuspendState == 1)
     {
         if (Global.WorkVar.tag_ResetState != 1)
         {
             IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
             IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
             IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");
             NewCtrlCardV0.SetOutputIoBit(redlight, 0);
             NewCtrlCardV0.SetOutputIoBit(yellowlight, 0);
             NewCtrlCardV0.SetOutputIoBit(greenlight, 1);
         }
         tag_Work.Continue(null);
     }
     else
     {
         if (Global.WorkVar.tag_ResetState != 1)
         {
             IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
             IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
             IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");
             NewCtrlCardV0.SetOutputIoBit(redlight, 0);
             NewCtrlCardV0.SetOutputIoBit(yellowlight, 1);
             NewCtrlCardV0.SetOutputIoBit(greenlight, 0);
         }
         tag_Work.Suspend(null);
     }
 }
Ejemplo n.º 6
0
        public void LightandBuzzer(string lightColor, bool bBuzzer = false)
        {
            IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
            IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
            IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");
            IOParameter buzzer      = StationManage.FindOutputIo("主控系统", "蜂鸣器");

            NewCtrlCardV0.SetOutputIoBit(redlight, 0);
            NewCtrlCardV0.SetOutputIoBit(yellowlight, 0);
            NewCtrlCardV0.SetOutputIoBit(greenlight, 0);
            if (bBuzzer)
            {
                NewCtrlCardV0.SetOutputIoBit(buzzer, 1);
            }
            if (lightColor == "红灯")
            {
                NewCtrlCardV0.SetOutputIoBit(redlight, 1);
            }
            else if (lightColor == "黄灯")
            {
                NewCtrlCardV0.SetOutputIoBit(yellowlight, 1);
            }
            else if (lightColor == "绿灯")
            {
                NewCtrlCardV0.SetOutputIoBit(greenlight, 1);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 执行复位步骤
 /// </summary>
 public void GoHomeRun(object o)
 {
     tag_work_state   = 1;
     tag_GohomeResult = NewCtrlCardV0.GoHome(tag_stationName, tag_AxisName);
     if (tag_GohomeResult == 0)
     {
         tag_work_state = 2;
     }
     else
     {
         tag_work_state = -1;
     }
 }
Ejemplo n.º 8
0
        private void MenuEmg_Click(object sender, EventArgs e)
        {
            IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
            IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
            IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");

            NewCtrlCardV0.SetOutputIoBit(redlight, 1);
            NewCtrlCardV0.SetOutputIoBit(yellowlight, 0);
            NewCtrlCardV0.SetOutputIoBit(greenlight, 0);
            Global.WorkVar.tag_ButtonStopState = 1;

            tag_Work.Stop();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 急停所有轴
 /// </summary>
 /// <returns></returns>
 public static short StopAllAxis()
 {
     foreach (StationModule sm in _Config.arrWorkStation)
     {
         foreach (AxisConfig af in sm.arrAxis)
         {
             if (NewCtrlCardV0.SR_AxisStop((int)af.tag_MotionCardManufacturer, af.CardNum, af.AxisNum) == 0)
             {
             }
             else
             {
                 return(-1);
             }
         }
     }
     return(0);
 }
Ejemplo n.º 10
0
        private void FrameUI_Load(object sender, EventArgs e)
        {
            //////////////////////////////////////////////////////////////////////////
            mainUI          = new MainUI(this, tag_Work);
            mainUI.TopLevel = false;
            mainUI.Parent   = this.PanelForm;

            debugUI          = new DebugUI(this, tag_Work);
            debugUI.TopLevel = false;
            debugUI.Parent   = this.PanelForm;
            alarmUI          = new AlarmUI();
            alarmUI.TopLevel = false;
            alarmUI.Parent   = this.PanelForm;
            formAdaptive.RecordOldSizeScale(this.PanelForm);
            timer_Main.Start();
            label_Version.Text = "版本号:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            portShowControl.tag_Work = tag_Work;
            portShowControl.Location = new Point(label_User.Location.X + label_User.Size.Width - 20, label_User.Location.Y - 8);
            portShowControl.Size     = new Size((label_Version.Location.X - portShowControl.Location.X - 10) / 5, panel_MainInfo.Size.Height - 5);
            panel_MainInfo.Controls.Add(portShowControl);

            modeSelectControl.tag_Work = tag_Work;
            modeSelectControl.Location = new Point(portShowControl.Location.X + portShowControl.Size.Width - 40, portShowControl.Location.Y);
            modeSelectControl.Size     = new Size((label_Version.Location.X - modeSelectControl.Location.X - 10) / 4, panel_MainInfo.Size.Height - 5);
            panel_MainInfo.Controls.Add(modeSelectControl);

            ShowSubWindow(Global.CConst.FRM_MAIN);

            //////////////////////////////////////////////////////////////////////////
            if (Global.WorkVar.tag_StopState == 1)
            {
                IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
                IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
                IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");
                NewCtrlCardV0.SetOutputIoBit(redlight, 1);
                NewCtrlCardV0.SetOutputIoBit(yellowlight, 0);
                NewCtrlCardV0.SetOutputIoBit(greenlight, 0);
            }
            IOParameter servoOnSwith = StationManage.FindOutputIo("总复位", "使能");

            if (servoOnSwith != null)
            {
                NewCtrlCardV0.SetOutputIoBit(servoOnSwith, 1);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 初始化轴的模式设置,初始化运用了那些卡
        /// </summary>
        /// <returns></returns>
        public short AllAxismodeInit()
        {
            int i = 0;

            while (i < _Config.axisArray.Count)
            {
                AxisConfig ax = _Config.axisArray[i];

                tag_CardHave[(int)ax.tag_MotionCardManufacturer] = 1;
                NewCtrlCardV0.set_limit_mode(ax);
                NewCtrlCardV0.set_pulse_mode(ax);
                // NewCtrlCardV0.set_io_mode(ax);
                i++;
            }



            return(0);
        }
Ejemplo n.º 12
0
 private void FrameUI_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBoxLog.Show("确定要退出程序吗?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
     {
         IOParameter redlight    = StationManage.FindOutputIo("主控系统", "三色灯_红");
         IOParameter yellowlight = StationManage.FindOutputIo("主控系统", "三色灯_黄");
         IOParameter greenlight  = StationManage.FindOutputIo("主控系统", "三色灯_绿");
         NewCtrlCardV0.SetOutputIoBit(redlight, 0);
         NewCtrlCardV0.SetOutputIoBit(yellowlight, 0);
         NewCtrlCardV0.SetOutputIoBit(greenlight, 0);
         Global.WorkVar.tag_ButtonStopState = 1;
         tag_Work.Stop();
         NewCtrlCardV0.CloseCard(tag_Work.tag_CardHave);
     }
     else
     {
         e.Cancel = true;
     }
 }
Ejemplo n.º 13
0
        public void IOoutputStatus_Load(IOParameter arrOutputIo_)
        {
            arrOutputIo = arrOutputIo_;
            if (arrOutputIo != null)
            {
                short var = NewCtrlCardV0.GetOutputIoBit(arrOutputIo, 0);

                OutputBT.BackColor = ((var > 0 && arrOutputIo.Logic == 1) ||
                                      (var < 1 && arrOutputIo.Logic == 0)) ? Color.Gainsboro : Color.LawnGreen;
                label1.Text = arrOutputIo.StrIoName;                 //从ArrAxis拿轴名称

                OutputBT.Text = ((var > 0 && arrOutputIo.Logic == 1) ||
                                 (var < 1 && arrOutputIo.Logic == 0)) ? "ON" : "OFF";
                label1.Text = arrOutputIo.StrIoName;                 //从ArrAxis拿轴名称

                btstatus = ((var > 0 && arrOutputIo.Logic == 1) ||
                            (var < 1 && arrOutputIo.Logic == 0)) ? true : false;
                label1.Text = arrOutputIo.StrIoName;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 卡初始化
        /// </summary>
        /// <param name="card"></param>
        /// <param name="axisCount"></param>
        /// <param name="configFileName"></param>
        /// <returns></returns>
        public short _SR_InitCard()
        {
            short returnValue;

            returnValue = (short)adt8960m.adt8960_initial();
            if (returnValue <= 0)
            {
                string str = "8960控制卡初始化失败!";


                if (returnValue == 0)
                {
                    str = str + "\r\n没有安装ADT卡";
                }
                if (returnValue == -1)
                {
                    str = str + "没有安装端口驱动程序!";
                }
                if (returnValue == -2)
                {
                    str = str + "PCI桥故障!";
                }

                MessageBoxLog.Show(str);
                return(-1);
            }

            IOParameter diancifaLeft  = StationManage.FindOutputIo("左工位", "左载具电磁阀");
            IOParameter diancifaRight = StationManage.FindOutputIo("右工位", "右载具电磁阀");

            NewCtrlCardV0.SetOutputIoBit(diancifaLeft, 1);
            NewCtrlCardV0.SetOutputIoBit(diancifaRight, 1);

            //int aaa = _SR_set_io_mode(0, 0, 0);
            //if (aaa != 0)
            //{
            //    return -1;
            //}

            return(returnValue);
        }
Ejemplo n.º 15
0
        public static bool IsRestExit()
        {
            bool axio    = false;
            bool stopIoS = false;

            NewCtrlCardV0.GetInputIoBitStatus("", "急停", out stopIoS);
            //NewCtrlCardV0.GetInputIoBitStatus("", "Z1报警", out axio);
            if (axio || !stopIoS)
            {
                LogOutControl.OutLog("轴报警", 0);

                return(true);
            }
            if (Global.WorkVar.tag_SuspendState == 1 || Global.WorkVar.tag_ButtonStopState == 1)
            {
                Global.WorkVar.tag_StopState    = 1;
                Global.WorkVar.tag_SuspendState = 0;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 16
0
        //往下移动停止
        private void Jog_minusBT_MouseUp(object sender, MouseEventArgs e)
        {
            Global.WorkVar.tag_isFangDaiJieChu = false;
            if (arrAxis == null)
            {
                return;
            }
            if (StationManage.Distancemode == "长距" || StationManage.Distancemode == "短距")
            {
                return;
            }

            else
            {
                resutl = NewCtrlCardV0.SR_AxisEmgStop((int)arrAxis.tag_MotionCardManufacturer, arrAxis.CardNum, arrAxis.AxisNum);
                if (resutl != 0)
                {
                    MessageBoxLog.Show("轴停止异常");
                }
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 判断当前位置是否是本点的安全区 安全返回TRUE
        /// </summary>
        /// <returns></returns>
        public bool PointIsSafe(PointAggregate point)
        {
            foreach (StationModule sm in StationManage._Config.arrWorkStation)
            {
                foreach (AxisConfig ac in sm.arrAxis)
                {
                    AxisSafe asf = GetAxisSafe((short)ac.tag_MotionCardManufacturer, ac.CardNum, ac.AxisNum);
                    if (asf != null)
                    {
                        double poen_ac = 0;
                        NewCtrlCardV0.SR_GetPrfPos((int)ac.tag_MotionCardManufacturer, ac.CardNum, ac.AxisNum, ref poen_ac);
                        poen_ac = poen_ac / ac.Eucf;

                        if (!asf.IsSafe(poen_ac))
                        //if (!asf.IsSafe(ac.dblEncPos))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 轴,iO安全检查
        /// </summary>
        /// <returns></returns>
        public bool AxisSafeCheck()
        {
            int count = _Config.axisArray.Count;
            int i     = 0;

            while (i < count)
            {
                AxisConfig ac = _Config.axisArray[i];
                if (ac.AxisNum >= 0 && ac.CardNum >= 0 && NewCtrlCardV0.SR_GetAxisStatus(ac) == 1)
                {
                    if (!AxisSafeManage.AxisIsSafe(_Config.tag_safeStationModule, ac, 0, 0))
                    {
                        if (Global.WorkVar.tag_isFangDaiJieChu)
                        {
                            return(true);
                        }
                        return(false);
                    }
                }
                i++;
            }
            return(true);
        }
Ejemplo n.º 19
0
 //输出按钮
 private void OutputBT_Click(object sender, EventArgs e)
 {
     if (arrOutputIo == null)
     {
         return;
     }
     if (arrOutputIo.tagPointAggregate != null && arrOutputIo.tagPointAggregate.tag_AxisSafeManage != null && !arrOutputIo.tagPointAggregate.tag_AxisSafeManage.PointIsSafe(arrOutputIo.tagPointAggregate))
     {
         MessageBoxLog.Show("失败");
         return;
     }
     if (btstatus == false)
     {
         result = NewCtrlCardV0.SetOutputIoBit(arrOutputIo, 1);
         if (result != 0)
         {
             MessageBoxLog.Show("置位IO失败");
             return;
         }
         OutputBT.Text      = "ON";
         OutputBT.BackColor = Color.LawnGreen;
         btstatus           = true;
     }
     else
     {
         result = NewCtrlCardV0.SetOutputIoBit(arrOutputIo, 0);
         if (result != 0)
         {
             MessageBoxLog.Show("复位IO失败");
             return;
         }
         OutputBT.Text      = "OFF";
         OutputBT.BackColor = Color.Gainsboro;
         btstatus           = false;
     }
 }
Ejemplo n.º 20
0
        public void CheckIoThread(object o)
        {
            while (true)
            {
                bool suspendIo      = false;
                bool stopIoS        = false;
                bool RestIoS        = false;
                bool AxisAlarm      = false;
                bool AxisLimitAlarm = false;
                bool SafetyDoorIoS  = false;             //安全门
                bool RasterIoS_L    = false;             //左安全光栅
                bool RasterIoS_R    = false;             //右安全光栅


                if (NewCtrlCardV0.tag_isInit == 0)
                {
                    Thread.Sleep(100);
                    continue;
                }
                IOParameter SuspendIo  = StationManage.FindInputIo("暂停");
                IOParameter StopIo     = StationManage.FindInputIo("急停");
                IOParameter RestIo     = StationManage.FindInputIo("复位");
                IOParameter Raster_L   = StationManage.FindInputIo("左安全光栅");
                IOParameter Raster_R   = StationManage.FindInputIo("右安全光栅");
                IOParameter SafetyDoor = StationManage.FindInputIo("安全门");


                //AxisAlarm =  IsAxisAlarm();
                AxisLimitAlarm = IsAxisLimitAlarm();
                if (SuspendIo == null)
                {
                    LogOutControl.OutLog("请配置<暂停IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }
                if (StopIo == null)
                {
                    LogOutControl.OutLog("请配置<急停IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }
                if (RestIo == null)
                {
                    LogOutControl.OutLog("请配置<复位IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }
                if (Raster_L == null)
                {
                    LogOutControl.OutLog("请配置<左安全光栅IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }
                if (Raster_R == null)
                {
                    LogOutControl.OutLog("请配置<右安全光栅IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }
                if (SafetyDoor == null)
                {
                    LogOutControl.OutLog("请配置<安全门IO>", 0);
                    Thread.Sleep(100);
                    continue;
                }


                NewCtrlCardV0.GetInputIoBitStatus("", "暂停", out suspendIo);
                NewCtrlCardV0.GetInputIoBitStatus("", "复位", out RestIoS);
                NewCtrlCardV0.GetInputIoBitStatus("", "急停", out stopIoS);
                NewCtrlCardV0.GetInputIoBitStatus("", "安全门", out SafetyDoorIoS);
                NewCtrlCardV0.GetInputIoBitStatus("", "左安全光栅", out RasterIoS_L);
                NewCtrlCardV0.GetInputIoBitStatus("", "右安全光栅", out RasterIoS_R);
                //if (!stopIoS || Global.WorkVar.tag_StopState == 2 || !IsafeIOOk() || !IoAllSafeCheck() || !AxisSafeCheck() || AxisAlarm || (AxisLimitAlarm && Global.WorkVar.tag_ResetState != 1))
                if (!stopIoS || Global.WorkVar.tag_StopState == 2 || !IsafeIOOk() || !IoAllSafeCheck() || !AxisSafeCheck() || AxisAlarm)
                {
                    IsafeIOInit();
                    Stop();
                    Thread.Sleep(100);
                    continue;
                }
                else if (((!SafetyDoorIoS && !_Config.tag_PrivateSave.tag_safeGateOffOn) || suspendIo) && Global.WorkVar.tag_SuspendState == 0 && (Global.WorkVar.bWork_L || Global.WorkVar.bWork_R))
                {
                    Suspend(null);
                    Thread.Sleep(500);
                }
                else if (RestIoS)
                {
                    Global.WorkVar.tag_StopState = 0;
                    if (Global.WorkVar.tag_ResetState != 1 && Global.WorkVar.tag_workState == 0)
                    {
                        Rest();
                    }
                    else
                    {
                    }
                    continue;
                }
                else if (suspendIo && Global.WorkVar.tag_SuspendState == 1)
                {
                    Continue(null);
                    Thread.Sleep(500);
                    continue;
                }
                else if (Global.WorkVar.bcanRunFalg == true && Global.WorkVar.tag_ResetState == 2 && Global.WorkVar.tag_workState == 0)
                {
                    Global.WorkVar.bcanRunFalg = false;
                    if (start())
                    {
                        Global.WorkVar.bcanRunFalg = true;
                    }
                    continue;
                }
                if (!RasterIoS_L && !_Config.tag_PrivateSave.tag_safeLightOffOn && Global.WorkVar.bWork_L && !Global.WorkVar.bSuspendState_L)
                {
                    Suspend_L(null);
                }
                else if (RasterIoS_L && Global.WorkVar.bSuspendState_L)
                {
                    Continue_L(null);
                }
                if (!RasterIoS_R && !_Config.tag_PrivateSave.tag_safeLightOffOn && Global.WorkVar.bWork_R && !Global.WorkVar.bSuspendState_R)
                {
                    Suspend_R(null);
                }
                else if (RasterIoS_R && Global.WorkVar.bSuspendState_R)
                {
                    Continue_R(null);
                }
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 21
0
        //往下移动
        private void Jog_minusBT_MouseDown(object sender, MouseEventArgs e)
        {
            if (!Work.IsMove(1))
            {
                return;
            }
            setspeed();
            if (arrAxis == null)
            {
                MessageBoxLog.Show("");
                return;
            }
            double pos = 0;

            if (arrAxis.SoftLimitEnablel == 0)
            {
                pos = arrAxis.SoftLimitMaxValue;
            }
            else
            {
                pos = -1000;
            }

            if (StationManage.Distancemode == "短距")
            {
                nowpset = StationManage.Shortdistanceset;

                /* if (!AxisSafeManage.AxisIsSafe(tag_work._Config.tag_safeStationModule, arrAxis, 0, (nowpoint - nowpset) * arrAxis.Eucf))
                 * {
                 *       return;
                 * }*/
                PointModule _pointModule = new PointModule();
                _pointModule.dblAcc             = arrAxis.Acc;
                _pointModule.blnPointEnable     = true;                     //表示点位是否启用
                _pointModule.blnIsSpecialPoint  = true;                     //表示此点位是否是特殊点位 方便对应轴速度快速改变
                _pointModule.dblPonitValue      = nowpoint - nowpset;       //点位数据
                _pointModule.dblPonitSpeed      = StationManage.Speedvalue; //点位速度
                _pointModule.dblAcc             = arrAxis.Acc;              //加速度
                _pointModule.dblDec             = arrAxis.Dec;              //减速度
                _pointModule.dblAccTime         = arrAxis.tag_accTime;      //加速时间
                _pointModule.dblDecTime         = arrAxis.tag_accTime;      //减速时间
                _pointModule.dblPonitStartSpeed = arrAxis.StartSpeed;       //初始速度
                _pointModule.db_S_Time          = arrAxis.tag_S_Time;       //初始速度
                resutl = NewCtrlCardV0.SR_AbsoluteMove(arrAxis, _pointModule);
                if (resutl != 0)
                {
                    MessageBoxLog.Show("轴运动异常");
                }
            }
            else
            {
                if (StationManage.Distancemode == "长距")
                {
                    nowpset = StationManage.Longdistanceset;

                    /*  if (!AxisSafeManage.AxisIsSafe(tag_work._Config.tag_safeStationModule, arrAxis, 0, (nowpoint - nowpset) * arrAxis.Eucf))
                     * {
                     *        return;
                     * }*/
                    PointModule _pointModule = new PointModule();
                    _pointModule.dblAcc             = arrAxis.Acc;
                    _pointModule.blnPointEnable     = true;                     //表示点位是否启用
                    _pointModule.blnIsSpecialPoint  = true;                     //表示此点位是否是特殊点位 方便对应轴速度快速改变
                    _pointModule.dblPonitValue      = nowpoint - nowpset;       //点位数据
                    _pointModule.dblPonitSpeed      = StationManage.Speedvalue; //点位速度
                    _pointModule.dblAcc             = arrAxis.Acc;              //加速度
                    _pointModule.dblDec             = arrAxis.Dec;              //减速度
                    _pointModule.dblAccTime         = arrAxis.tag_accTime;      //加速时间
                    _pointModule.dblDecTime         = arrAxis.tag_accTime;      //减速时间
                    _pointModule.dblPonitStartSpeed = arrAxis.StartSpeed;       //初始速度
                    _pointModule.db_S_Time          = arrAxis.tag_S_Time;       //初始速度
                    resutl = NewCtrlCardV0.SR_AbsoluteMove(arrAxis, _pointModule);
                    if (resutl != 0)
                    {
                        MessageBoxLog.Show("轴运动异常");
                    }
                }
                else
                {
                    /*   if (!AxisSafeManage.AxisIsSafe(tag_work._Config.tag_safeStationModule, arrAxis, 0, (nowpoint + nowpset) * arrAxis.Eucf))
                     * {
                     *         return;
                     * }*/
                    PointModule _pointModule = new PointModule();
                    _pointModule.dblAcc             = arrAxis.Acc;
                    _pointModule.blnPointEnable     = true;                     //表示点位是否启用
                    _pointModule.blnIsSpecialPoint  = true;                     //表示此点位是否是特殊点位 方便对应轴速度快速改变
                    _pointModule.dblPonitValue      = nowpoint - 6000;          //点位数据
                    _pointModule.dblPonitSpeed      = StationManage.Speedvalue; //点位速度
                    _pointModule.dblAcc             = arrAxis.Acc;              //加速度
                    _pointModule.dblDec             = arrAxis.Dec;              //减速度
                    _pointModule.dblAccTime         = arrAxis.tag_accTime;      //加速时间
                    _pointModule.dblDecTime         = arrAxis.tag_accTime;      //减速时间
                    _pointModule.dblPonitStartSpeed = arrAxis.StartSpeed;       //初始速度
                    _pointModule.db_S_Time          = arrAxis.tag_S_Time;       //初始速度
                    resutl = NewCtrlCardV0.SR_continue_move(arrAxis, _pointModule, 1);
                    if (resutl != 0)
                    {
                        MessageBoxLog.Show("轴运动异常");
                    }
                }
            }
        }