Exemplo n.º 1
0
        public void get_spindle_amount()//读取主轴数量,ok
        {
            short array;
            short ret = Fanuc.cnc_rdcurrent(Fanuc.h, out array);

            if (ret == 0)
            {
                listBox9.Items.Add("轴数" + array);
            }
            else
            {
                MessageBox.Show(ret + "");
            }
        }
Exemplo n.º 2
0
        public void get_current()//读取伺服调整的电流,ok
        {
            //可以先读取最大轴数号
            Fanuc.cnc_sysinfo(Fanuc.h, sys);
            int n = Convert.ToInt32(sys.axes.Length);

            short[] array = new short[n];
            short   ret   = Fanuc.cnc_rdcurrent(Fanuc.h, out array[0]);

            if (ret == 0)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    listBox9.Items.Add("电流" + array[i]);
                }
            }
            else
            {
                MessageBox.Show(ret + "");
            }
        }