Double 2'S Complement - Negl - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Conversion Instructions
5-20-18 DOUBLE 2'S COMPLEMENT – NEGL(––)
Limitations
Description
Flags
Example
316
Ladder Symbols
NEGL(−−)
S
R
000
DM 6143 to DM 6655 cannot be used for R.
S and S+1 must be in the same data area, as must R and R+1.
Converts the eight-digit hexadecimal content of the source words (S and S+1)
to its 2's complement and outputs the result to the result words (R and R+1).
This operation is effectively the same as subtracting the eight-digit content S
and S+1 from $0000 0000 and outputting the result to R and R+1; it will calcu-
late the absolute value of negative signed binary data.
If the content of S is 0000 0000, the content of R will also be 0000 0000 after
execution and EQ (SR 25506) will be turned on.
If the content of S is 8000 0000, the content of R will also be 8000 0000 after
execution and UF (SR 25405) will be turned on.
Note Refer to 1-7 Calculating with Signed Binary Data for more details.
ER
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
EQ:
ON when the content of R+1, R is zero after execution; otherwise
OFF.
UF:
ON when the content of S+1, S is 8000 0000; otherwise OFF.
The following example shows how to use NEGL(––) to find the 2's comple-
ment of the hexadecimal value in IR 151, IR 150 (001F FFFF) and output the
result to HR 04, HR 03.
00000
@NEGL(−−)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
S
R
000
Address Instruction
NEGL(−−)
00000
150
00001
LR 03
000
0000
S+1: IR 151
S: IR 150
001F
FFFF
R+1: LR 04
R: LR 03
FFE0
Section 5-20
Operand Data Areas
S: First source word
R: First result word
IR, SR, AR, DM, EM, HR, LR
000
Not used. Set to 000.
Operands
LD
NEGL(−−)
LR
0000
0001
00000
150
03
000

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents