hsioEncoderReset (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.52.00


hsioEncoderReset resets the position of an encoder.

By default it will reset it immediately. If wait is set to true, it will reset the position the next time Z is active.

 

 

Input:

id : INT (1..2) default 1

Identifier of the encoder to reset.

 

wait : BOOL default FALSE

Wait for the Z-input to be active before resetting. Can not be combined with mode 3.

 

Returns: INT

1

- Success

0

- Function is not supported.

-1

- Unspecified error.

-5

- Invalid ID.

-6

- The Z-input is used for calibration. It can not also be used for reset at the same time.

-7

- The encoder is not enabled or does not have Z.

 

 

Declaration:

FUNCTION hsioEncoderReset : INT;
VAR_INPUT
  id    : INT := 1;
  wait  : BOOL := FALSE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
BEGIN
  ...
  // Reset encoder
  hsioEncoderReset(id := 1, wait := TRUE);
  ...
END;
 
END_PROGRAM;