Omron SYSMAC C200HS Operation Manual page 212

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Data Conversion
5-18-15 2'S COMPLEMENT – NEG(––)
Description
Flags
Example
202
Ladder Symbols
NEG(––)
S
R
---
Converts the four-digit hexadecimal content of the source word (S) to its 2's
complement and outputs the result to the result word (R). This operation is effec-
tively the same as subtracting S from 0000 and outputting the result to R.
If the content of S is 0000, the content of R will also be 0000 after execution, and
EQ (SR 25506) will be turned on.
If the content of S is 8000, the content of R will also be 8000 after execution, and
UF (SR 25405) will be turned on.
Note Refer to page 29 for details on 16-bit signed binary data.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the content of S is 0000; otherwise OFF.
UF:
ON when the content of S is 8000; otherwise OFF.
The following example shows how to use NEG(––) to find the 2's complement of
the hexadecimal value 001F and output the result to DM 0020.
00000
@NEG(––)
S
R
---
Address Instruction
NEG(––)
00000
#001F
00001
DM 0020
---
#0000
#001F
#FFE1
Output to DM 0020.
Section 5-18
Operand Data Areas
S: Source word
IR, SR, AR, DM, HR, TC, LR, #
R: Result word
IR, SR, AR, DM, HR, LR
Operands
LD
NEG(––)
#
DM
00000
001F
0020

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents