BASIC commands
PROGRAMMING MANUAL
92
R
e
vi
si
o
n
1
.0
3.2.108 ENCODER_READ
/i
3.2.109 ENCODER_STATUS
/i
3.2.110 ENCODER_TURNS
/i
Arguments
•
denominator
A number between 0 and 16777215 that is used to define the denomina-
tor in the above equation.
•
numerator
A number between 0 and 16777215 that is used to define the numerator
in the above equation.
Example
' 7200 is the closest to the encoder resolution that can be devided by an
' integer to give degrees. (7200/20=360)
ENCODER_RATIO(8192,7200)
UNITS=20 ' axis calibrated in degrees, resolution is 0.05 deg.
A rotary table has a servo motor connected directly to its centre of rotation. An
encoder is mounted to the rear of the servo motor and returns a value of 8192
counts per revolution. The application requires the table to be calibrated in
degrees, but so that one degree is an integer number of counts.
See also
N/A
Type
Axis command
Syntax
ENCODER_READ(address)
Description
The
ENCODER_READ
command is applicable only to Flexible axis absolute
EnDat axis with
ATYPE
value 47. The parameter returns a 16-bit encoder
parameter stored at specified address. Bits 8 -15 of the address are the EnDat
MRS field settings and bits 0 - 7 are the offset within the EnDat MRS block. If
a CRC error occurs, this command will return -1. For more information see
EnDat absolute encoder interface specification.
Arguments
•
address
Specifies the EnDat MRS field to read.
Example
VR(100) = ENCODER_READ($A10D) AXIS(7)
This command will read the number of encoder bits and put that value in
VR(10) memory location.
See also
AXIS
,
ENCODER
,
ENCODER_BITS
.
Type
Axis parameter (read-only).
Syntax
ENCODER_STATUS
Description
This parameter returns the status of the absolute encoder.
This parameter is applicable only to Flexible axis absolute Tamagawa axis
with
ATYPE
value 46. It returns both the status field SF and the ALMC
encoder error field. The SF field is in bits 0 - 7, while the ALMC filed is in bits 8
- 15. For more information see Tamagawa absolute encoder interface specifi-
cation.
If applied to axis of
ATYPE
value other than 46, this parameter returns 0.
Arguments
N/A
Example
PRINT (ENCODER_STATUS AXIS (1) AND 255)
This command will print SF field of the Tamagawa absolute encoder for axis 1.
See also
AXIS
,
ENCODER
,
ENCODER_BITS
.
Type
Axis parameter (read-only)
Syntax
ENCODER_TURNS
Description
The
ENCODER_TURNS
parameter returns the number of multi-turn count
from the encoder.
This is applicable only to Flexible axis absolute Tamagawa axis with
ATYPE
value 46 and Flexible axis absolute EnDat axis with
ATYPE
value 47.
The multi-turn data is not automatically applied to the axis
MPOS
parameter
after initialization. The application programmer must apply this from the pro-
gram using
OFFPOS
or
DEFPOS
commands as required.
If applied to axis of
ATYPE
value other than 46 or 47, the parameter returns 0.
Arguments
N/A
Example
PRINT ENCODER_TURNS AXIS (1)
This command will print absolute encoder multi-turn counts for axis 1.
See also
AXIS
,
ENCODER
,
ENCODER_BITS
.