Sign inversion (Complement of 2): -
Format
-(S)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
device
(S)
■Description, data type of result
Setting data
(S)
Processing details
The sign-inverted value of the data specified with (S) is found.
Operation error
An operation error will occur if:
• (S) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which substitutes the sign-inverted value of #0 to D0
D0 = - #0
D0
-123
4 OPERATION CONTROL PROGRAMS
144
4.6 Bit Operations
Number of basic steps
4
Word device
16-bit
32-bit
64-bit
integer
integer
floating
type
type (L)
point
type (F)
Description
Data whose sign will be inverted
Usable steps
F/FS
Constant
16-bit
32-bit
64-bit
integer
integer
floating
type
type
point
(K/H)
(K/H, L)
type (K)
#0
123
G
Calculation
Bit
expression
conditional
expression
Data type of result
Data type of (S)
Comparison
conditional
expression