示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            long   pos, pos2;
            int    checkStauts;
            string str_DisplayPos;

            pos            = Dmc2610.d2610_get_position(0);//读取指定轴的当前位置
            str_DisplayPos = "X=" + Convert.ToString(pos) + "     " + (!Convert.ToBoolean(Dmc2610.d2610_check_done((ushort)AxisID.XAxis)) ? "...Run..." : "...Stop...");
            pos            = Dmc2610.d2610_get_position(1);
            str_DisplayPos = str_DisplayPos + "   Y=" + Convert.ToString(pos) + "     " + (!Convert.ToBoolean(Dmc2610.d2610_check_done((ushort)AxisID.YAxis)) ? "...Run..." : "...Stop...");

            str_DisplayPos += "\n";

            pos2           = Dmc2610.d2610_get_position(2);
            str_DisplayPos = str_DisplayPos + "Z=" + Convert.ToString(pos2) + "     " + (!Convert.ToBoolean(Dmc2610.d2610_check_done((ushort)AxisID.ZAxis)) ? "...Run..." : "...Stop...");
            pos2           = Dmc2610.d2610_get_position(3);
            str_DisplayPos = str_DisplayPos + "   U=" + Convert.ToString(pos2) + "     " + (!Convert.ToBoolean(Dmc2610.d2610_check_done((ushort)AxisID.UAxis)) ? "...Run..." : "...Stop...");


            //str_DisplayPos += "\n"  + ((Motion2610Control.GetAxisIsORGON(XAxis)) ? "X ORG IS ON" : "X ORG IS OFF");
            str_DisplayPos += "\n" + ((Motion2610Control.GetAxisIsORGON(XAxis)) ? "X ORG IS ON" : "X ORG IS OFF") + "   " + ((Motion2610Control.GetAxisIsORGON(YAxis)) ? "Y ORG IS ON" : "Y ORG IS OFF") + "   " + ((Motion2610Control.GetAxisIsORGON(CAxis)) ? "C ORG IS ON" : "C ORG IS OFF") + "   " + ((Motion2610Control.GetAxisIsORGON(LAxis)) ? "L ORG IS ON" : "L ORG IS OFF");

            str_DisplayPos += "\n" + ((Motion2610Control.GetAxisIsNELON(XAxis)) ? "X EL- IS ON" : "X EL- IS OFF") + "   " + ((Motion2610Control.GetAxisIsNELON(YAxis)) ? "Y EL- IS ON" : "Y EL- IS OFF") + "   " + ((Motion2610Control.GetAxisIsNELON(CAxis)) ? "C EL- IS ON" : "C EL- IS OFF") + "   " + ((Motion2610Control.GetAxisIsNELON(LAxis)) ? "L EL- IS ON" : "L EL- IS OFF");

            str_DisplayPos += "\n" + ((Motion2610Control.GetAxisIsPELON(XAxis)) ? "X EL+ IS ON" : "X EL+ IS OFF") + "   " + ((Motion2610Control.GetAxisIsPELON(YAxis)) ? "Y EL+ IS ON" : "Y EL+ IS OFF") + "   " + ((Motion2610Control.GetAxisIsPELON(CAxis)) ? "C EL+ IS ON" : "C EL+ IS OFF") + "   " + ((Motion2610Control.GetAxisIsPELON(LAxis)) ? "L EL+ IS ON" : "L EL+ IS OFF");

            str_DisplayPos += "\n\n" + ((Motion2610Control.GetAxisIsINPON(XAxis)) ? "X INP IS ON" : "X INP IS OFF") +
                              "   " + ((Motion2610Control.GetAxisIsINPON(YAxis)) ? "Y INP IS ON" : "Y INP IS OFF");

            Label_POSITION.Text = str_DisplayPos;//显示位置信

            StringBuilder axisStautsDetail = new StringBuilder();

            foreach (Axis axis in AxisGroup)
            {
                if (!Motion2610Control.AxisQueryStatus(axis))
                {
                    while (axis.AxisStatusStack.Count > 0)
                    {
                        axisStautsDetail.Append(axis.AxisStatusStack.Pop());
                    }
                }
            }
            if (axisStautsDetail.Length <= 0)
            {
                lbAxisStatus.Text = "Axis Status : \n" + "Every Axis is OK!";
            }
            else
            {
                lbAxisStatus.Text = "Axis Status : \n" + axisStautsDetail;
            }

            StringBuilder sb2 = new StringBuilder();

            for (int i = 0; i < 2; i++)
            {
                if (Motion2610Control.ReadInputKey((ushort)(i + 1)) != InputiskeyDown[i])
                {
                    InputiskeyDown[i] = Motion2610Control.ReadInputKey((ushort)(i + 1));
                    if (InputiskeyDown[i] != InputinitStatus[i])
                    {
                        inputstartTime[i] = DateTime.Now;
                        string str1 = "input  " + i.ToString() + ": StartTime= " + inputstartTime[i].ToString();
                        sb2.AppendLine(str1);
                    }
                    else
                    {
                        InputEndTime[i] = DateTime.Now;

                        string str1 = "input  " + i.ToString() + ": EndTime = " + InputEndTime[i].ToString();


                        sb2.AppendLine(str1);
                    }
                }
            }

            this.tbinputsig.Text += sb2.ToString();
        }
示例#2
0
        public static bool GetAxisIsDoWell(Axis axis)
        {
            bool result = (Dmc2610.d2610_check_done(axis.AxisId) == 1) ? true : false;

            return(result);
        }