Toshiba PROSEC T1 User Manual page 252

Programmable controller
Hide thumbs Also See for PROSEC T1:
Table of Contents

Advertisement

7. Instructions
FUN 182
Expression
Input -[ A NEG B ]- Output
Function
When the input is ON, this instruction finds the 2's complement value of A , and stores it in B .
Execution condition
Input
OFF
No execution
ON
Execution
Operand
Name
A Source
B Destination
Example
When X007 is ON, the 2's complement value (sign inverted data) of RW39 is stored in D0122.
For example, if RW38 is 4660, the 2's complement value -4660 is stored in D0122.
2's complement data is calculated as follows.
F
E
RW39
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
1 1 1 0 1 1 0 1 1 1 0 0 1 0 1 1
D0122
1 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0
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 .
250
T1/T1S User's Manual
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net
NEG
2's complement
Operation
Device
X
Y
R
S
T.
C. XW YW RW SW T
D C
B
A
9
8
7
6
Bit inverse
+ 1
Output
OFF
ON
Register
Ö
Ö
Ö
Ö
Ö
Ö
Ö
Ö
Ö
5
4
3
2
1
0
(4660)
(-4661)
(-4660)
Constant Index
C
D
I
J
K
Ö
Ö
Ö
Ö
Ö
Ö
Ö
Ö
Ö
Ö
6F3B0250
Ö

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Prosec t1s

Table of Contents