hsioEncoderRead (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.52.00


hsioEncoderRead reads the current position of the encoder.

 

 

 

Input:

 

id : INT (1..2) default 1

Identifier of the encoder to read the position of.

 

Returns: DINT

The current position of the encoder.

Returns 0 on error.

 

 

Declaration:

FUNCTION hsioEncoderRead : DINT;
VAR_INPUT
  id    : INT := 1;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
BEGIN
  ...
  // Get position
  DebugFmt(message:="Position: \4", v4:= hsioEncoderRead(id := 1));
  ...
END;
 
END_PROGRAM;