Ejemplo n.º 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();
        }
Ejemplo n.º 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);
            }
        }