RoboteQ AX2550/2850 ユーザーズマニュアル

ページ / 180
AX2500/2850 Motor Controller User’s Manual
143
RS232 Encoder Command Set
Set/Reset Encoder Counters and Destination Registers
Description:
Set one or both counters to zero or a user-defined value. The value is a signed 32 bit num-
ber that may range from -2,147,836,648 to +2,147,836,647 (Hexadecimal format of value 
80000000 to 7FFFFFFF respectively. 
While resetting is a single step command, setting the counters to a non-zero value requires 
two steps: 1- load a 4 byte buffer (32-bit) with the desired value. 2- Transfer the buffer’s 
content to the counter(s). Loading the buffer can be done using the commands described 
in “Read / Modify Encoder Module Registers and Parameters” on page 145. The buffer will 
also be altered after a Counter Read command, in which case it will contain the last read 
counter value.
Syntax:
!q or !Qn
Where n=
0: Reset Encoder 1 counter
1: Reset Encoder 2 counter
2: Reset both Encoder counters
4: Set Encoder 1 counter with value in buffer
5: Set Encoder 2 counter with value in buffer
6: Set both Encoder both counters with value in buffer
7: Set Encoder 1 destination register with value in buffer
8: Set Encoder 2 destination register with value in buffer
Reply:
if command was properly received and executed
- if an error occurred
Examples:
!Q2
Reset both counters
!Q5
Load value contained in buffer into counter 2
?Q0, followed by
!Q1
Read counter 1 and copy its value into counter 2
Read Speed
Description:
This query will cause the controller to return the speed computed by the Encoder module. 
The values are signed Hexadecimal numbers ranging from -127 to +127. The -127 value rep-
resents the maximum RPM in the reverse direction. +127 represents the maximum RPM 
in the forward direction. The relation of this relative number and the actual, absolute RPM 
value depends on the encoder’s resolution and a user programmable Time Base. See 
“Using the Encoder to Measure Speed” on page 139 for a detailed discussion.
Syntax:
?z or ?Z
Reply:
nn
mm
Where:
nn = speed 1 value
mm = speed 2 value