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]); } }
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"; } }
public void HomeMotor() { Connection_Service.Send(Command_Processor.SEND_MOTOR_HOME_COMMAND(_MotorId)); }
public void DisableMotor() { Connection_Service.Send(Command_Processor.DISABLE_MOTOR_COMMAND(_MotorId)); CheckMotorStatus(); }
public void HomeMotor() { Connection_Service.Send(Command_Processor.SEND_POSITION_COMMAND(_MotorId, 0)); }
public void EnableMotor() { Connection_Service.Send(Command_Processor.ENABLE_MOTOR_COMMAND(_MotorId)); }