A H 5 0 0 M o t i o n C o n t r o l M o d u l e M a n u a l
API
Instruction code
Operand
Function
29
D
NEG
P
D
Taking the two’s
complement of a number
Device
X
Y
M
S
K
16#
F
KnM KnS
D
W
T
C
V
Z
D
Pulse instruction 16-bit instruction (3 steps) 32-bit instruction (3 steps)
E xp la nat io n
The instructions can be used to convert a negative binary value into an
absolute value.
D
: Device in which the two’s complement of the value in the device is
stored
Generally, the pulse instructions NEGP and DNEGP are used.
E xamp le 1
When X0.0 is turned from OFF to ON, all the bits in D0 are inverted (0
becomes 1, and 1 becomes 0), 1 is added to the result, and the final
value is stored in the original register D10.
X0.0
N EG P
D 10
E xamp le 2
Getting the aboluste value of a negative number
1. When bit 15 in D0 is 1, M0 is ON. (The value in D0 is a negative
value.)
2. When M0 is ON, the instruction NEG is used to take the two’s
complement of the negative value in D0. (The corresponding
positive value is gotten.)
M1000
BON
D0
M 0
K1 5
NEGP
D0
M 0
E xamp le 3
Getting the absolute value of the difference between two values
Suppose X0.0 is ON.
1. When the value in D0 is greater than that in D2, M0 is ON.
2. When the value in D0 is equal to that in D2, M1 is ON.
3. When the value in D0 is less than that in D2, M2 is ON.
4. The value in D4 is a positive value.
X0.0
C MP
D 0
D 2
M0
M0
S UB
D 0
D 2
D 4
M2
S UB
D 2
D 0
D 4
M1
5 - 4 6
Содержание AH500
Страница 9: ...viii...
Страница 52: ...Chapter 2 Hardware Specifications and Wiring Wiring AH10PM 5A and a Panasonic CN5 series servo drive 2 31...
Страница 53: ...AH500 Motion Control Module Manual Wiring AH10PM 5A and a Yaskawa servo drive 2 32...
Страница 54: ...Chapter 2 Hardware Specifications and Wiring Wiring AH10PM 5A and a Mitsubishi MJR2 series servo drive 2 33...
Страница 55: ...AH500 Motion Control Module Manual Wiring AH10PM 5A and a Fuji servo drive 2 34...
Страница 115: ...AH500 Motion Control Module Manual 4 16 MEMO...
Страница 375: ...AH500 Motion Control Module Manual 5 260 MEMO...
Страница 376: ...Chapter 6 Data Transmission Table of Contents 6 1 Functions 6 2 6 2 Parameters 6 2 6 3 Usage 6 5 6 1...
Страница 383: ...AH500 Motion Control Module Manual 6 8 MEMO...
Страница 419: ...AH500 Motion Control Module Manual 7 36 MEMO...
Страница 436: ...Chapter 8 Electronic Cam 8 17...
Страница 482: ...Chapter 10 High speed Counters and High speed Timers 3 The cyclic mode is used to measure a frequency 10 7...
Страница 483: ...AH500 Motion Control Module Manual 10 8 MEMO...
Страница 505: ...AH500 Motion Control Module Manual 12 8 MEMO...
Страница 515: ...AH500 Motion Control Module Manual 13 10 MEMO...
Страница 544: ...Appendix A Error Code Table Table of Contents A 1 Error Code Table A 2 A 1...
Страница 547: ...AH500 Motion Control Module Manual A 4 MEMO...