Complement Of 2 Of 16-Bit Bin - Mitsubishi MELSEC-q Programming Manual

Melsec q series; melsec l series
Hide thumbs Also See for MELSEC-q:
Table of Contents

Advertisement

5 MELSEC FUNCTIONS
5.6.15 2' complement of 16-bit BIN
The sign of the specified BIN 16-bit data is inverted. (2's complement)
Function definition BOOL NEG_M (BOOL EN, ANY16 D);
5.6.16 2' complement of 32-bit BIN
The sign of the specified BIN 32-bit data is inverted. (2's complement)
Function definition
5 - 30
Argument Name
EN
D
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the sign of the BIN 16-bit data in D0
(* is inverted, and the result is stored into D0.
NEG_M (X0, D0);
Corresponding MELSEC command
NEG (Complement of 2 of BIN 16-bit data (sign reversal))
BOOL DNEG_M (BOOL EN, ANY32 D);
Argument Name
EN
D
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the sign of the BIN 32-bit data in
(* Result is inverted, and the result is stored into Result.
DNEG_M (X0, Result);
Corresponding MELSEC command
DNEG (Complement of 2 of BIN 32-bit data (sign reversal))
NEG_M
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
Data whose sign will be inverted, sign inversion result
IN/OUT
(BIN 16-bit data)
DNEG_M
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
Data whose sign will be inverted, sign inversion result
IN/OUT
(BIN 32-bit data)
For the usable data type, refer to "3.2.2
About ANY type".
Description
Description
Description
Description
*)
*)
*)
*)
5 - 30

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-l

Table of Contents