Ejemplo n.º 1
0
        public void ReadEncoderPosition()
        {
            Connection_Service.Send(Command_Processor.READ_MOTOR_ENCODER_COMMAND(_MotorId));
            string recieved = Connection_Service.ReceiveMessage();

            if (recieved.Contains(Command_Processor.MOTOR_POSITION_MESSAGE(_MotorId)))
            {
                string[] splitMsg = recieved.Split('=');
                Position = Convert.ToDouble(splitMsg[1]);
            }
        }
Ejemplo n.º 2
0
        public void CheckMotorStatus()
        {
            Connection_Service.Send(Command_Processor.CHECK_MOTOR_STATUS_COMMAND(_MotorId));
            string received = Connection_Service.ReceiveMessage();

            if (received.Contains(Command_Processor.MOTOR_ENABLED_MESSAGE(_MotorId)))
            {
                MotorStatus = "Enabled";
            }
            else if (received.Contains(Command_Processor.MOTOR_DISABLED_MESSAGE(_MotorId)))
            {
                MotorStatus = "Disabled";
            }
        }
Ejemplo n.º 3
0
 public void HomeMotor()
 {
     Connection_Service.Send(Command_Processor.SEND_MOTOR_HOME_COMMAND(_MotorId));
 }
Ejemplo n.º 4
0
 public void DisableMotor()
 {
     Connection_Service.Send(Command_Processor.DISABLE_MOTOR_COMMAND(_MotorId));
     CheckMotorStatus();
 }
Ejemplo n.º 5
0
 public void HomeMotor()
 {
     Connection_Service.Send(Command_Processor.SEND_POSITION_COMMAND(_MotorId, 0));
 }
Ejemplo n.º 6
0
 public void EnableMotor()
 {
     Connection_Service.Send(Command_Processor.ENABLE_MOTOR_COMMAND(_MotorId));
 }