EasyManuals Logo
Home>Omron>Control Unit>NX-SL series

Omron NX-SL series User Manual

Omron NX-SL series
270 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #92 background imageLoading...
Page #92 background image
2 Standard Functions
2 - 58
NX-series Safety Control Unit Instructions Reference Manual (Z931)
SUB
This function subtracts integers or durations.
If you omit an input or output parameter, a building error will occur.
An error will not occur if the output terminal is not used or if it is connected to an input terminal on the
next instruction.
This function subtracts subtrahend In2 from minuend In1 and outputs the result to output value Out.
An overflow occurs if the difference between In1 and In2 exceeds the valid range of the data type of the
subtraction result.
If an overflow occurs, the data types of In1 and In2, the data type of the subtraction result, and the
value of the subtraction result will be as shown in the following table.
Instruction Name FB/FUN Graphic expression
SUB Subtraction FUN
Variables
Name I/O Description Valid range Default
In1 Minuend Input Minuend Depends on data type. ---
In2 Subtrahend Input Subtrahend Depends on data type. ---
Out Output value Output Output value Depends on data type. ---
Boolean Bit strings Integers Durations
BOOL
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
In1 OK OK OK OK OK OK
In2 OK OK OK OK OK OK
Out OK OK OK OK OK OK
Function
I/O data types Value of subtraction results
Integers Of the difference between In1 and In2, the subtraction result will be the value that can be
expressed by the number of bits in the data type of the subtraction result.
*1*2
*1. For example, if the value of In1 is INT#5 and the value of In2 is INT#32767, the subtraction result will be
32772. If an INT variable is set for the output, the value of the subtraction result will be the value that can be
expressed with lower 16 bits of the difference (32772), i.e., 32764. If a DINT variable is set for the output, the
subtraction results is DINT#32772.
*2. If the result exceeds the valid range of DINT data, the result will be the value that can be expressed with the
lower 32 bits.
Durations Of the difference between In1 and In2, the subtraction result will be the value that can be
expressed by DWORD data.
*3
SUB

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NX-SL series and is the answer not in the manual?

Omron NX-SL series Specifications

General IconGeneral
BrandOmron
ModelNX-SL series
CategoryControl Unit
LanguageEnglish

Related product manuals