RoboteQ AX2850 user manual Read Distance, Read Speed/Distance, Read Encoder Limit Switch Status

Models: AX2850

1 200
Download 200 pages 6.02 Kb
Page 157
Image 157

RS232 Encoder Command Set

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 81.

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 167.

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.

Note that for this function to work, limit switches must be connected to the encoder mod- ule using the special wiring diagram show in “Wiring Optional Limit Switches” on page 78. If no limit switches are present, this query will return the logic levels of each of the encoder’s quadrature outputs, which in most cases is not relevant information.

Syntax:

?w or ?W

AX2550 Motor Controller User’s Manual

157

Page 157
Image 157
RoboteQ AX2850 user manual Read Distance, Read Speed/Distance, Read Encoder Limit Switch Status