Ejemplo n.º 1
0
 public async Task <bool> IsTargetPositionReachedAsync(MotorBank motorOrBank = default)
 {
     var reply = await SendCommandAsync(
         Command.GetAxisParameter,
         0, (byte)CommandParam.AxisParameter.TargetPositionReached,
         Address,
         motorOrBank,
Ejemplo n.º 2
0
 public virtual Task <Reply> SendCommandAsync(
     Command command, int argument,
     CommandParam param, MotorBank motorOrBank = default) =>
 SendCommandAsync(
     command,
     argument,
     param,
     Address,
     motorOrBank,
     TimeOut);
Ejemplo n.º 3
0
        public async Task <int> GetActualPositionAsync(MotorBank motorOrBank = default)
        {
            var reply = await SendCommandAsync(
                Command.GetAxisParameter,
                0,
                CommandParam.AxisParameter.EncoderPosition,
                motorOrBank);

            if (reply.IsSuccess)
            {
                Logger?.LogInformation("{StepMotor}: Actual position = {ActualPosition}", Id, reply.ReturnValue);
                return(reply.ReturnValue);
            }

            throw LogThenFail();
        }
Ejemplo n.º 4
0
 public override async Task <Reply> SendCommandAsync(
     Command command, int argument, byte type,
     Address address, MotorBank motorOrBank,
     TimeSpan timeOut, CancellationToken token = default)
 {
Ejemplo n.º 5
0
 public Task <Reply> MoveToPosition(int position,
                                    CommandParam.MoveType type = CommandParam.MoveType.Absolute,
                                    MotorBank motorOrBank      = default) =>
 SendCommandAsync(Command.MoveToPosition, position, type, motorOrBank);