Esempio n. 1
0
        private void buttonTeach_Click(object sender, EventArgs e)
        {
            if (DensoControl.Only().Controller.ControllerPointsPVars.ContainsKey(comboBoxPointIndex.Text))
            {
                DensoControl.Only().Controller.ControllerPointsPVars[comboBoxPointIndex.Text].Value
                    = DensoControl.Only().Robot.CurPosVar.Value;

                MessageBox.Show("Teach " + comboBoxPointIndex.Text + ":" +
                                DensoControl.GetPString(DensoControl.Only().Robot.CurPosVar));
            }

            if (DensoControl.Only().Controller.ControllerPointsJVars.ContainsKey(comboBoxJointIndex.Text))
            {
                DensoControl.Only().Controller.ControllerPointsJVars[comboBoxJointIndex.Text].Value
                    = DensoControl.Only().Robot.CurAngVar.Value;

                MessageBox.Show("Teach " + comboBoxJointIndex.Text + ":" +
                                DensoControl.GetJString(DensoControl.Only().Robot.CurAngVar));
            }
        }
Esempio n. 2
0
        private void timerUpdate_Tick(object sender, EventArgs e)
        {
            #region

            //controller status
            try
            {
                textBoxMode.Text = DensoControl.Only().Controller.ControllerCaoVars["@MODE"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxMode.Text = "?";
            }

            try
            {
                textBoxAutoMode.Text = DensoControl.Only().Controller.ControllerCaoVars["@AUTO_ENABLE"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxAutoMode.Text = "?";
            }

            try
            {
                textBoxEmgency.Text =
                    DensoControl.Only().Controller.ControllerCaoVars["@EMERGENCY_STOP"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxEmgency.Text = "?";
            }


            try
            {
                textBoxNormalStatus.Text =
                    DensoControl.Only().Controller.ControllerCaoVars["@NORMAL_STATUS"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxNormalStatus.Text = "?";
            }


            try
            {
                textBoxErrorCode.Text = DensoControl.Only().Controller.ControllerCaoVars["@ERROR_CODE"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxErrorCode.Text = "?";
            }


            try
            {
                textBoxErrorCodeInfo.Text =
                    DensoControl.Only().Controller.ControllerCaoVars["@ERROR_DESCRIPTION"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxErrorCodeInfo.Text = "?";
            }


            ////robot slave task
            //try
            //{
            //    textBoxRobotSlaveTask.Text = DensoControl.Only().RobslaveTask.TaskCaoVars["@STATUS"].Value.ToString();
            //}
            //catch (Exception)
            //{
            //    textBoxRobotSlaveTask.Text = "?";
            //}


            //robot status
            try
            {
                textBoxMotorStatus.Text = DensoControl.Only().Robot.RobCaoVars["@SERVO_ON"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxMotorStatus.Text = "???";
            }

            try
            {
                textBoxBusyStatus.Text = DensoControl.Only().Robot.RobCaoVars["@BUSY_STATUS"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxBusyStatus.Text = "???";
            }

            try
            {
                // Current Position
                textBoxCurPos.Text = DensoControl.GetPString(DensoControl.Only().Robot.RobCaoVars["@CURRENT_POSITION"]);
            }
            catch (Exception)
            {
                textBoxCurPos.Text = "P(?,?,?,?,?,?,?)";
            }


            try
            {
                // Current Position
                textBoxCurAngle.Text = DensoControl.GetJString(DensoControl.Only().Robot.RobCaoVars["@CURRENT_ANGLE"]);
            }
            catch (Exception)
            {
                textBoxCurAngle.Text = "J(?,?,?,?,?,?,?)";
            }

            try
            {
                // Current Position
                textBoxCurTrans.Text = DensoControl.GetTString(DensoControl.Only().Robot.RobCaoVars["@CURRENT_TRANS"]);
            }
            catch (Exception)
            {
                textBoxCurTrans.Text = "T(?,?,?,?,?,?,?,?,?,?)";
            }

            try
            {
                textBoxWorkStatus.Text = DensoControl.Only().Robot.RobCaoVars["@CURRENT_WORK"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxWorkStatus.Text = "???";
            }

            try
            {
                textBoxToolStatus.Text = DensoControl.Only().Robot.RobCaoVars["@CURRENT_TOOL"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxToolStatus.Text = "???";
            }

            try
            {
                textBoxSpeed.Text = DensoControl.Only().Robot.RobCaoVars["@SPEED"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxSpeed.Text = "???";
            }

            try
            {
                textBoxExtSpeed.Text = DensoControl.Only().Robot.RobCaoVars["@EXTSPEED"].Value.ToString();
            }
            catch (Exception)
            {
                textBoxExtSpeed.Text = "???";
            }

            #endregion

            var sts = DensoControl.Only().ControllerStatus;
            for (var i = 0; i < sts.Count; i++)
            {
                dataGridViewController.Rows[i].Cells[1].Value = sts[i];
            }

            var sts1 = DensoControl.Only().RobotStatus;
            for (var i = 0; i < sts1.Count; i++)
            {
                dataGridViewRobot.Rows[i].Cells[1].Value = sts1[i];
            }


            if (timerIndex++ > 5)
            {
                timerIndex = 0;

                for (var i = 0; i < DensoControl.Only().Controller.ControllerPointsPVars.Count; i++)
                {
                    var str = DensoControl.GetPString(DensoControl.Only().Controller.ControllerPointsPVars["P" + i]);
                    dataGridViewPointsP.Rows[i].Cells[1].Value = str;
                }

                for (var i = 0; i < DensoControl.Only().Controller.ControllerPointsJVars.Count; i++)
                {
                    var str = DensoControl.GetJString(DensoControl.Only().Controller.ControllerPointsJVars["J" + i]);
                    dataGridViewPointsJ.Rows[i].Cells[1].Value = str;
                }
            }


            //List<string> sts2 = DensoControl.Only().RobslaveTaskStatus;
            //for (int i = 0; i < sts2.Count; i++)
            //{
            //    dataGridViewTask.Rows[i].Cells[1].Value = sts2[i];
            //}
        }
Esempio n. 3
0
 public void DefTool(int index, float[] p)
 {
     Execute("DefTool", "1", DensoControl.GetPString(p));
 }