beautypg.com

Instruction 69- 2’s complement – Maple Systems MAPware-7000 User Manual

Page 118

background image

MAPware-7000 Ladder Logic Guide

110

1010-1041 rev. 00

Instruction 69- 2’s Complement

Expression:

Space Requirement: 1 line x 5 column Location Requirement: Middle, Right rail

Function:

When the input is ON, this instruction finds the 2’s compliment value of A, and stores it in B.

Execution Condition:

Input

Operation

Output

OFF

No execution

OFF

ON

Execution

ON

Operand:

Coil or Bit

Register

Constant

Index

Name

X

Y B

S

T.

C.

M

X
W

Y
W

B
W

S
W

T C

D

I

J

K

M
W

A

Source

√ √

B

Destination

√ √

Example:

When X007 is ON, the 2’s complement value (sign inverted data) of BW39 is stored in D0122.

For example, if BW38 is 4660, the 2’s complement value -4660 is stored in D0122.

2’s complement data is calculated as follows.

Note:

-

The data range of A is -32768 to 32767. If the data of A is -32768, the same data -32768
is stored in B.