Installing, Connecting and Using the Encoder Mod-

Notes:

The command returns a signed hexadecimal number where 0 to +127 is represented by 00 to 7F, and -1 to -127 is represented by FF to 80 respectively. The hexadecimal format is intended to be deciphered by a microcontroller. When exercising the controller manually, you may use the Decimal to Hexadecimal conversion table on page 103.

Read Distance

Description:

This query will cause the controller to return the distance between the current position and the value in the destination register. The values are signed Hexadecimal numbers ranging from -127 to +127. The -127 value represents the relative distance according to the formu- las described in “Using the Encoder to Track Position” on page 140.

Syntax:

?d or ?D

Reply:nn mm

Where:nn = distance 1 value

mm= distance 2 value

Notes:

The command returns a signed hexadecimal number where 0 to +127 is represented by 00 to 7F, and -1 to -127 is represented by FF to 80 respectively. The hexadecimal format is intended to be deciphered by a microcontroller. When exercising the controller manually, you may use the Decimal to Hexadecimal conversion table on page 103.

Read Speed/Distance

Description:

This query is will cause the controller to return either the speed or the distance computed by the Encoder module, depending on the operating mode that is selected. This command is similar to either of the two previous ones, except that it is read from a different location inside the controller and is a filtered value that smoothened abrupt changes.

Syntax:

?k or K

Reply:nn mm

Where:nn = speed 1 or distance 1 value

mm= speed 2 or distance 2 value

Read Encoder Limit Switch Status

Description:

This query will cause the controller to return the status of the four optional Encoder limit switches. The returned value is a two-digit (8-bit) Hexadecimal number of which the each of the 4 least significant bit represents one of the hardware switches.

144

AX2500/2850 Motor Controller User’s Manual

Version 1.7. February 1, 2005

Page 144
Image 144
RoboteQ AX2550/2850 user manual Read Distance, Read Speed/Distance, Read Encoder Limit Switch Status