Example #1
0
        /// <summary>選用的 Device 選項變動</summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CmbBoxDeviceName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                // Display Position File I
                this.DisplayCurrentPathFileItems();
                // Display Device IP
                this.DisplayCurrentDeviceInfoIP();
#if NO_DEVICE
#else
                groupBox1.Enabled = false;
                ldd = new MvFanucRobotLdd();
                this.ldd.RobotIp = this.RobotPathFileConfigSet.GetCurrentConfig(CmbBoxDeviceName.Text).DeviceIP;
                if (ldd.ConnectIfNo() != 0)
                {
                    throw new Exception("無法連接裝置");
                }
                ldd.ExecutePNS("PNS0101");
                groupBox1.Enabled = true;
#endif
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " (尚未完初始化,無法繼續操作)");
            }
            //   NumUdpSn.Value = this.GetPositionInstancesNextSn();
            //   this.Enabled = true;
            this.PositionInstances = new List <PositionInfo>();
            RefreshPositionInfoList();
            TxtBxDevicePath.Text = string.Empty;
            NumUdpSn.Value       = this.GetPositionInstancesNextSn();
        }
Example #2
0
        public void TestMethod1()
        {
            using (var robot = new MvFanucRobotLdd())
            {
                robot.RobotIp = "192.168.0.50";
                robot.ConnectIfNo();
                robot.SystemRecoverAuto();
                robot.AlarmReset();
                robot.ExecutePNS("PNS0101");



                Array target = new float[] { 0, 0, 5, 0, 0, 0 };


                robot.MoveStraightSync(target, 0, 0, 1, 20);
            }
        }
Example #3
0
        public void TestPosReg()
        {
            using (var ldd = new MvFanucRobotLdd())
            {
                ldd.RobotIp = "192.168.0.51";

                if (ldd.ConnectIfNo() != 0)
                {
                    Console.WriteLine("Connection Fail");
                }


                var robotInfo = ldd.ReadPosReg(1);
                robotInfo.x += 1;
                ldd.SetPosRegXyzWpr(1, robotInfo);
                robotInfo = ldd.ReadPosReg(1);

                Console.WriteLine(robotInfo.x);
            }
        }