private void xAxisEventObj_EventNotify(CML_AMP_EVENT match, bool hasError)
        {
            try
            {
                if (hasError)
                {
                    xAxisAmp.HaltMove();
                    DisplayErrorPopup("CMO Error", "Auto Move Error.");
                }

                if (match == CML_AMP_EVENT.AMPEVENT_MOVE_DONE)
                {
                    initLabel.BackColor = Color.Violet;
                }


                int Accel, Vel;
                Accel = Convert.ToInt32(accTextBox.Text);
                Vel   = Convert.ToInt32(velTextBox.Text);

                distMotor = distMotor * (-1);

                moveMotor(Vel, Accel, distMotor);
            }
            catch (Exception ex)
            {
                DisplayErrorPopup("Auto Move Error", "Auto Move Error.");
            }
        }
예제 #2
0
 private void xAxisEventObj_EventNotify(CML_AMP_EVENT match, bool hasError)
 {
     try
     {
         if (direction == false)
         {
             direction = true;
             totalReps = totalReps + 1;
             AutoMoveMotor(true);
         }
         else
         {
             direction = false;
             AutoMoveMotor(false);
         }
     }
     catch (Exception ex)
     {
         xAxisAmp.HaltMove();
         xAxisEventObj.Stop();
         xAxisAmp.ClearFaults();
         automove = false;
         motorButton.BackgroundImage = TeamMusclesAndMachine.Properties.Resources.Start_button;
         DisplayErrorPopup("Auto Move Error", "Auto Move Error: 200");
     }
 }
예제 #3
0
 public CopleyAmpC()
 {
     connecter = CopleyConnecter.GetInstance();
     motor     = new CopleyAmpObj();
     home      = new HomeSettingsObj();
     proJog    = new ProfileSettingsObj();
     e         = new CML_AMP_EVENT();
     status    = new CML_EVENT_STATUS();
     param     = new CopleyAxisParams();
     err       = new CML_AMP_FAULT();
 }
예제 #4
0
 private void EventObj_EventNotify(CML_AMP_EVENT match, bool hasError) // 检查并输出电机的错误。错误是16进制的数,需转成2进制与指导书表格对比,以此找出具体的电机错误
 {                                                                     // Handles EventObj.EventNotify
     try
     {
         if (hasError)
         {
             //Linkage.HaltMove();
             ampObj[0].ReadEventLatch(ref readstatus0);
             ampObj[1].ReadEventLatch(ref readstatus1);
             ampObj[2].ReadEventLatch(ref readstatus2);
             ampObj[3].ReadEventLatch(ref readstatus3);
             ampObj[0].ReadFaults(ref readfault0);
             ampObj[1].ReadFaults(ref readfault1);
             ampObj[2].ReadFaults(ref readfault2);
             ampObj[3].ReadFaults(ref readfault3);
             ampObj[0].ClearFaults();
             ampObj[1].ClearFaults();
             ampObj[2].ClearFaults();
             ampObj[3].ClearFaults();
             Trace.WriteLine(readstatus0 + "; " + readfault0 + "; " + match + "; " + "Num:0");
             Trace.WriteLine(readstatus1 + "; " + readfault1 + "; " + match + "; " + "Num:1");
             Trace.WriteLine(readstatus2 + "; " + readfault2 + "; " + match + "; " + "Num:2");
             Trace.WriteLine(readstatus3 + "; " + readfault3 + "; " + match + "; " + "Num:3");
             double a = 0;
             return;
         }
         if ((match & CML_AMP_EVENT.AMPEVENT_TRAJECTORY_DONE) == CML_AMP_EVENT.AMPEVENT_TRAJECTORY_DONE)
         {
             double a = 0;
         }
         if ((match & CML_AMP_EVENT.AMPEVENT_MOVE_DONE) == CML_AMP_EVENT.AMPEVENT_MOVE_DONE)
         {
             double a = 0;
         }
         Trace.WriteLine("Enter EventObj_EventNotify!");
     }
     catch (Exception ex)
     {
     }
 }