Esempio 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]);
            }
        }
Esempio 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";
            }
        }