Numerical Functions (General Functions); Absolute Value - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.2 Numerical Functions (General Functions)

6.2.1 Absolute value

The absolute value of the specified data is operated.
Function definition
Function definition
6 - 21
ABS
ABS_E
ANY_NUM ABS ( ANY_NUM S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
ANY_NUM
Absolute value operation result
Example of use
Argument Type
REAL
r_data1 := ABS( r_data2 );
INT
D0 := ABS( D1 );
DINT
di_data1 := ABS( di_data2 );
BOOL ABS_E( BOOL EN, ANY_NUM S1, ANY_NUM D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
D1
OUT
Return value
Return Value
BOOL
Execution condition
Example of use
(*
When execution condition X0 turns ON, the absolute value of the data stored
(*
in iData is found, and the result is stored into Result.
M0 := ABS_E( X0, iData, Result ) ;
Data whose absolute value will be found
ST Program
Conversion Result
LD
EMOV
LDE<
E*
LD
MOV
LD<
NEG
LD
DMOV
LDD<
DCML
D+
Execution condition (Function is executed only when the result is TRUE)
Data whose absolute value will be found
Absolute value operation result
For the usable data type, refer to "3.2.2 About ANY type".
Description
Description
Used Instruction
SM400
LD,EMOV, LDE<, E*
r_data2
r_data1
r_data2
E0
E-1
r_data2
r_data1
SM400
LD,MOV, LD<, NEG
D1
D0
D1
K0
D0
SM400
LD,DMOV, LDD<, DCML
di_data2
D+
di_data1
di_data2 K0
di_data2
di_data1
K1
di_data1
Description
Description
*)
*)
6 - 21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents