Sub; 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

SUB (-)

The SUB (-) instruction subtracts integers and real numbers.
Instruction
SUB (-)
Subtraction
Variables
Name
Meaning
In1
Minuend
In2
Subtrahend
Out
Output
value
* If you omit an input parameter, the default value is not applied. A building error will occur.
Bit string
In1
In2
Out
Function
The SUB (-) instruction subtracts subtrahend In2 from minuend In1 and outputs the result to output
value Out.
In1 and In2 can have different data types. However, use the combination that data types to include are
existed. If they are different, calculations are performed with the data type that includes the range of all
of the data types. For example, if In1 is INT data and In2 is DINT data, calculations are performed with
DINT data. Here, the subtraction result is DINT data.
In1
In2
2-174
Name
FB/FUN
FUN
I/O
Description
Minuend
Input
Subtrahend
Output
Output value
OK OK OK OK OK OK OK OK OK OK
OK OK OK OK OK OK OK OK OK OK
OK OK OK OK OK OK OK OK OK OK
Data type that includes In1 and In2
Examples:
If subtraction is performed for INT data, then INT data is used.
If subtraction is performed for INT and DINT data, then DINT data is used.
Subtraction result
Assignment
=
Graphic expression
(@)SUB
EN
ENO
In1
Out
In2
(@)-
EN ENO
In1
Out
In2
Valid range
Depends on data type.
Depends on data type.
Integers
Out

NY-series Instructions Reference Manual (W560)

ST expression
Out:=In1 - In2;
Unit
Default
0*
---
---
---
Times, durations, dates,
and text strings

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents