Abs; Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions

ABS

The ABS instruction finds the absolute value of an integer or real number.
Instruction
ABS
Absolute Value
Variables
Name
Meaning
In
Number to
process
Out
Absolute
value
*1 If you omit an input parameter, the default value is not applied. A building error will occur.
*2 Negative numbers are excluded.
Bit strings
In
Out
Function
The ABS instruction outputs the absolute value of the number to process In. The data types of In and
absolute value Out can have different data types.
The following example is for when In is REAL#−10.3. The value of variable abc will be REAL#10.3.
LD
REAL#-10.3
The ABS instruction outputs the absolute value of In.
The absolute value of REAL#−10.3 is found, so the value of abc will be REAL#10.3.
In
REAL#-10.3
2-194
Name
FB/FUN
FUN
I/O
Description
Input
Number to process
Output
Absolute value
OK OK OK OK OK OK OK OK OK OK
OK OK OK OK OK OK OK OK OK OK
ABS
EN
ENO
abc
In
|−10.3| is taken.
Out=abc
REAL#10.3
Graphic expression
(@)ABS
EN
ENO
In
Out
Valid range
Depends on data type.
Depends on data type.
*2
Integers
ST
abc:=ABS(REAL#-10.3);

NY-series Instructions Reference Manual (W560)

ST expression
Out:=ABS(In);
Unit
Default
---
*1
---
---
Times, durations, dates,
and text strings

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents