Esempio n. 1
0
        Fanuc.ODBDIAGIF gif     = new Focas1.ODBDIAGIF(); // cnc_rddiaginfo
        public void get_diagnosr()                        //读取诊断的数据
        {
            short numer;
            short axes; //1表示x轴,2表示y轴,3表示z轴//attribute主要指哪个轴;

            if (textBox1.Text != null)
            {
                numer = Convert.ToInt16(textBox1.Text);
                for (short i = 1; i < 4; i++)
                {
                    axes = i;
                    short ret = Fanuc.cnc_diagnoss(Fanuc.h, numer, axes, 4 + 4 * 1, odbd_2);
                    if (ret == 0)
                    {
                        listBox2.Items.Add("诊断参数号" + odbd_2.datano + "  " + odbd_2.type + "      :" + odbd_2.rdata.dgn_val * Math.Pow(10, -odbd_2.rdata.dec_val));
                    }
                    else
                    {
                        MessageBox.Show(ret + " ");
                    }
                }
            }
            else
            {
                MessageBox.Show("您没有输入参数号", "警告");
            }
        }