Delta AH500 Programming Manual page 258

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

AH 5 00 Pr ogr am m ing Ma n ua l
API
Instruction code
0210
D
NEG
Device X
Y
M
D
Symbol:
Explanation:
1.
The instruction is used to convert the negative binary value into the absolute value.
2.
Only the instruction DNEG can use the 32-bit counter.
3.
Generally, the pulse instructions NEGP and DNEGP are used.
Example 1:
When X0.0 is switched from OFF to ON, all bits in D0 are inverted (0 becomes 1, and 1 becomes 0),
and 1 is added to the result. The final value is stored in the original register D10.
Example 2:
The absolute value of the negative value:
1.
When the value of the 15
2.
When M0 is ON, the instruction NEG is used to obtain the two's complement of the negative
value in D0. (The corresponding positive value is obtained.)
6 - 9 0
Operand
D
P
S
T
C
HC
D
Pulse instruction 16-bit instruction (3 steps) 32-bit instruction (3 steps)
AH500
Device in which the two's
D :
complement is stored
th
bit in D0 is 1, M0 is ON. (The value in D0 is a negative value.)
Two's complement
L
SM SR
E
PR
AH500
Word/Double word
Function
K
16# "$"
DF
AH500

Advertisement

Table of Contents
loading

Table of Contents