コード例 #1
0
        public void Start()
        {
            if (_ch.IsConnected == false)
            {
                _ch.OpenCommEthernet(_ip, 701);
            }
            _motion = new EthercatMotion(_ch, 5);
            _motion.Setup();
            _io = new EthercatIo(_ch, 72, 7, 4);
            _io.Setup();
            _conveyor = new PickAndPlaceConveyor(_io);

            if (_gripperIsOnline)
            {
                if (_gripper == null)
                {
                    _gripper = new Stepper("COM3");
                }
                _gripper.Setup();
            }

            SetSpeed(10);

            SetupComplete = true;
        }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Api ch = new Api();
         ch.OpenCommEthernet("192.168.8.18", 701);
         EthercatIo iO = new EthercatIo(ch, 88, 8, 5);
         iO.Setup();
         conveyor = new PickAndPlaceConveyor(iO);
         conveyor.ErrorOccured += Conveyor_ErrorOccured;
         conveyor.Start();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }