All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other
countries for OMRON factory automation products.
• Microsoft, Windows, Windows Vista, Excel, and Visual Basic are either registered trademarks or trademarks of
Microsoft Corporation in the United States and other countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
• Safety over EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany.
• ODVA, CIP, CompoNet, DeviceNet, and EtherNet/IP are trademarks of ODVA.
• The SD and SDHC logos are trademarks of SD-3C, LLC.
Other company names and product names in this document are the trademarks or registered trademarks of their
respective companies.
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
Page 3
Introduction
Thank you for purchasing Machine Automation Controller NX-series Safety Control Units.
This manual contains information that is necessary to use the NX-series Safety Control Units. Please
read this manual and make sure you understand the functionality and performance of the NX-series
Safety Control Units before you attempt to use them in a control system.
Keep this manual in a safe place where it will be available for reference during operation.
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of introducing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of installing and maintaining FA systems.
• Personnel in charge of managing FA systems and facilities.
• Personnel with the qualifications, authority, and responsibility for providing safety at each phase of
the lifecycle of the machine: design, installation, operation, maintenance, and disposal.
• Personnel with a knowledge of functional safety.
For programming, this manual is intended for personnel who understand the programming language
specifications in international standard IEC 61131-3 or Japanese standard JIS B 3503.
Introduction
Applicable Products
This manual covers the following products.
• NX-series Safety Control Units
NX-SL
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Special Information...................................................................................................................................... 9
Terms and Conditions Agreement........................................................................10
Warranty, Limitations of Liability ................................................................................................................ 10
Precautions for Safe Use.......................................................................................14
Precautions for Correct Use..................................................................................15
Regulations and Standards...................................................................................16
Conformance to EC Directives .................................................................................................................. 16
Conformance to EN ISO 13849-1 and EN 62061...................................................................................... 17
Conformance to UL and CSA Standards ................................................................................................... 17
Conformance to KC Standards.................................................................................................................. 18
Software Licenses and Copyrights ............................................................................................................ 18
Unit Versions ..........................................................................................................19
Unit Versions.............................................................................................................................................. 19
Unit Versions and Sysmac Studio Versions............................................................................................... 21
Unit Version Notation ................................................................................................................................. 21
Related Manuals .....................................................................................................22
NX-series Safety Control Unit Instructions Reference Manual (Z931)
5
Page 8
CONTENTS
6
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 9
Relevant Manuals
The information for this product is divided between two manuals as shown in the following table.
Read all of the manuals that are relevant to your system configuration and application before you use
the product. Most operations are performed from the Sysmac Studio Automation Software.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on the Sysmac Studio.
Relevant Manuals
Purpose of use
Learning about Safety Control Units
Mounting, installing, and making hard-
ware settings for Safety Control Units
Making software settings for Safety
Control Units
Creating safety programs
Verifying and debugging safety programs
Troubleshooting Safety Control Units
Maintaining Safety Control Units
NX-series Safety Control Unit
User’s Manual
NX-series Safety Control Unit
Instructions Reference Manual
NX-series Safety Control Unit Instructions Reference Manual (Z931)
7
Page 10
Manual Structure
Level-2 heading
Level-2
heading
Manual name
Level-1
section number
Gives the number
of the section.
This page is for illustration only. It may not literally appear in this manual.
snoitcurtsnI margaiD reddaL
2
2-13
NJ-series Instructions Reference Manual (W502)
Ladder Diagram Instructions
InstructionNamePage
LD and LDNLoad/
Load NOT
2-14
AND and ANDNAND/
AND NOT
2-16
OR and ORNOR/
OR NOT
2-18
Out and OutNotOutput/
Output NOT
2-20
Manual Structure
Page Structure
The following page structure is used in this manual.
8
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 11
Manual Structure
Additional Information
Version Information
2-17
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
s
no
itcu
rt
s
n
I
m
a
r
ga
iD
re
dd
aL
2
N
RO dn
a
RO
OR and ORN
None
OR
The OR instruction takes the logical OR of the value of a specified BOOL variable and the execution
condition and outputs it to the next instruction. Use the OR instruction for a NO bit connected in parallel
with the previous instruction. Use the OR instruction to configure a logical OR between an NO bit and
one of the following : a LD or LDN instruction connected directly to the bus bar, or the logic block starting
with a LD or LDN instruction and ending with the instruction immediately before the OR instruction.
ORN
The ORN instruction takes the logical OR of the inverse of the value of a specified BOOL variable and
the execution condition and outputs it to the next instruction. Use the ORN instruction for a NC bit connected in parallel with the previous instruction. Use the ORN instruction to configure a logical OR
between an NC bit and one of the following: a LD or LDN instruction connected directly to the bus bar,
or the logic block starting with a LD or LDN instruction and ending with the instruction immediately
before the ORN instruction.
The following figure shows a programming example of the OR instruction. It takes the logical OR of variable A and variable B and outputs it to variable C.
OR:Takes the logical OR of the value of a BOOL variable and the execution condition.
ORN: Takes the logical OR of the inverse of the value of a BOOL variable and the execution condi-
tion.
Instruction Name FB/FUNGraphic expression ST expression
OROR ---result:=vBool1 OR vBool2;
ORNOR NOT ---result:=vBool1 OR NOT
vBool2;
Variables
Function
Variable
Downward differentiation
Upward differentiation
Variable
Variable
Variable
Variable
Variable
Downward differentiation
Upward differentiation
Vari abl e
Downward
differentiation
Upward
differentiation
Vari abl e
Vari abl e
Vari abl e
Vari abl e
Vari abl e
Downward
differentiation
Upward
differentiation
B
A
C
LD instruction
Out instruction
OR instruction
Level-3
heading
Level-1
section number
Gives the number
of the section.
Level-1 heading
Level-2 heading
Level-3 heading
Manual name
This page is for illustration only. It may not literally appear in this manual.
Give the current
headings.
Special Information
Special information in this manual is classified as follows:
References are provided to more detailed or related information.
Information on differences in specifications and functionality for CPU Units and EtherCAT Coupler Units with different unit versions and for different versions of the Sysmac Studio is given.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
9
Page 12
Terms and Conditions Agreement
Terms and Conditions Agreement
Warranty, Limitations of Liability
Warranties
Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and workmanship for a period of twelve months from the date of sale by Omron (or such other period expressed in
writing by Omron). Omron disclaims all other warranties, express or implied.
Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, ABOUT
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OF
THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses based
on infringement by the Products or otherwise of any intellectual property right.
Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form originally
shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-complying Product, (ii) repair the non-complying Product, or (iii) repay or credit Buyer an amount equal
to the purchase price of the non-complying Product; provided that in no event shall Omron be
responsible for warranty, repair, indemnity or any other claims or expenses regarding the Products
unless Omron’s analysis confirms that the Products were properly handled, stored, installed and
maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return of
any Products by Buyer must be approved in writing by Omron before shipment. Omron Companies
shall not be liable for the suitability or unsuitability or the results from the use of Products in combination with any electrical or electronic components, circuits, system assemblies or any other materials or substances or environments. Any advice, recommendations or information given orally or in
writing, are not to be construed as an amendment or addition to the above warranty.
See http://www.omron.com/global/ or contact your Omron representative for published information.
Limitation on Liability; Etc
OMRON COMPANIES SHALL NOT BE LIABLE FOR SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY
WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED IN CONTRACT,
WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual price of the Product on
which liability is asserted.
10
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 13
Application Considerations
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations
which apply to the combination of the Product in the Buyer’s application or use of the Product. At
Buyer’s request, Omron will provide applicable third party certification documents identifying ratings
and limitations of use which apply to the Product. This information by itself is not sufficient for a complete determination of the suitability of the Product in combination with the end product, machine, system, or other application or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system. Buyer shall take application responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS PROPERLY RATED AND
INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
Terms and Conditions Agreement
Programmable Products
Omron Companies shall not be responsible for the user’s programming of a programmable Product, or
any consequence thereof.
Disclaimers
Performance Data
Data presented in Omron Company websites, catalogs and other materials is provided as a guide for
the user in determining suitability and does not constitute a warranty. It may represent the result of
Omron’s test conditions, and the user must correlate it to actual application requirements. Actual performance is subject to the Omron’s Warranty and Limitations of Liability.
Change in Specifications
Product specifications and accessories may be changed at any time based on improvements and other
reasons. It is our practice to change part numbers when published ratings or features are changed, or
when significant construction changes are made. However, some specifications of the Product may be
changed without any notice. When in doubt, special part numbers may be assigned to fix or establish
key specifications for your application. Please consult with your Omron’s representative at any time to
confirm actual specifications of purchased Product.
Errors and Omissions
Information presented by Omron Companies has been checked and is believed to be accurate; however, no responsibility is assumed for clerical, typographical or proofreading errors or omissions.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
11
Page 14
Terms and Conditions Agreement
12
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 15
Safety Precautions
Refer to the following manual for safety precautions.
• NX-series Safety Control Unit User’s Manual (Cat No. Z930)
Safety Precautions
NX-series Safety Control Unit Instructions Reference Manual (Z931)
13
Page 16
Precautions for Safe Use
Precautions for Safe Use
Refer to the following manual for precautions for the safe use of the Safety Control Unit.
• NX-series Safety Control Unit User’s Manual (Cat No. Z930)
14
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 17
Precautions for Correct Use
Refer to the following manual for precautions for the correct use of the Safety Control Unit.
• NX-series Safety Control Unit User’s Manual (Cat No. Z930)
Precautions for Correct Use
NX-series Safety Control Unit Instructions Reference Manual (Z931)
15
Page 18
Regulations and Standards
Regulations and Standards
The NX-series Safety Control Units are certified for the following standards.
Certification bodyStandards
• EN ISO 13849-1:2008 + AC:2009
• EN ISO 13849-2:2012
• IEC 61508 parts 1-7:2010
TÜV Rheinland
UL• cULus: Listed (UL508) and ANSI/ISA 12.12.01
*1. Certification was received for applications in which OMRON FSoE devices are connected to each other.
The NX-series Safety Control Units allow you to build a safety control system that meets the following
standards.
• Requirements for SIL 3 (Safety Integrity Level 3) in IEC 61508, EN 62061 (Functional Safety of
Electrical/Electronic/Programmable Electronic Safety-related Systems)
• Requirements for PLe (Performance Level e) and for safety category 4 in EN ISO 13849-1
*1
• EN 62061:2005
• EN 61131-2:2007
• EN ISO 13850:2008
• EN 60204-1:2006 + A1:2009 + AC:2010
• EN 61000-6-2:2005
• EN 61000-6-4:2007
•NFPA 79:2012
• ANSI RIA 15.06-1999
• ANSI B11.19-2010
• UL1998
• IEC 61326-3-1:2008
The NX-series Safety Control Units are also registered for C-Tick and KC compliance.
Conformance to EC Directives
Applicable Directives
• EMC Directive
• Machinery Directive
Concepts
EMC Directives
OMRON devices that comply with EC Directives also conform to the related EMC standards so that
they can be more easily built into other devices or the overall machine. The actual products have
been checked for conformity to EMC standards.*1
Whether the products conform to the standards in the system used by the customer, however, must
be checked by the customer. EMC-related performance of the OMRON devices that comply with EC
Directives will vary depending on the configuration, wiring, and other conditions of the equipment or
control panel on which the OMRON devices are installed. The customer must, therefore, perform
the final check to confirm that devices and the overall machine conform to EMC standards.
16
*1. Applicable EMC (Electromagnetic Compatibility) standards are as follows:
EMS (Electromagnetic Susceptibility): EN 61131-2
EMI (Electromagnetic Interference): EN 61131-2 (Radiated emission: 10-m regulations).
Machinery Directive
The Machinery Directive demands that the safety components that are used to provide safety for the
relevant machinery are used according to the required levels of safety.
The applicable directives are EN ISO 13849-1:2008 and EN 62061 SIL CL3.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 19
Regulations and Standards
Conformance to EC Directives
The NX-series Units comply with EC Directives. To ensure that the machine or device in which the
NX-series Units are used complies with EC Directives, the following precautions must be observed.
• The NX-series Units must be installed within a metallic control cabinet.
• You must meet the following conditions for the DC power supplies that are connected as the Unit
power supplies and I/O power supplies for the NX-series Units.
(a) Use reinforced insulation or double insulation.
(b) Ensure an output hold time of 20 ms min.
(c) Use an SELV power supply that meets the requirements of IEC/EN 60950-1 and EN
50178.
Do not allow the power supply cable length to exceed 3 m.
We recommend that you use the OMRON S8JX-series Power Supplies. EMC standard compliance was confirmed for the recommended Power Supplies.
• NX-series Units that comply with EC Directives also conform to the Common Emission Standard
(EN 61131-2). Radiated emission characteristics (10-m regulations) may vary depending on the
configuration of the control panel used, other devices connected to the control panel, wiring, and
other conditions.
You must therefore confirm that the overall machine or equipment in which the NX-series Units
are used complies with EC Directives.
• This is a Class A product (for industrial environments). In a residential environment, it may cause
radio interference. If radio interference occurs, the user may be required to take appropriate measures.
Conformance to EN ISO 13849-1 and EN 62061
International standards EN ISO 13849-1 and EN 62061 demand that process controls be in place for
the creation of safety-related software when building a safety control system that uses Safety Control
Units. The process control must ensure that the software is easy to read, understand, test, and maintain
to avoid system failures during each phase (i.e., general software design, safety circuit system design,
and software upgrades) of the software design lifecycle.
This means that process controls must also be in place for the design and development of safety software, such as for equipment and machinery that use function blocks that are provided by the Safety
Control Units.
It is the customer’s responsibility to conform with all standards.
Conformance to UL and CSA Standards
The NX-series Safety Control Units comply with the following UL and CSA standards. The application
conditions for standard compliance are defined. Refer to the Instruction Sheet that is provided with
each Unit before application.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
17
Page 20
Regulations and Standards
Conformance to KC Standards
Observe the following precaution if you use NX-series Units in Korea.
Class A Device (Broadcasting Communications Device for Office Use)
This device obtained EMC registration for office use (Class A), and it is intended to be used in places
other than homes.
Sellers and/or users need to take note of this.
Software Licenses and Copyrights
This product incorporates certain third party software. The license and copyright information associated
with this software is available at http://www.fa.omron.co.jp/nj_info_e/.
18
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 21
Unit Versions
Notched
area
Unit
specifications
LOT No.
Unit version
Lot number
Unit model number
Lot number and unit version
This section describes the notation that is used for unit versions, the confirmation method for unit versions, and the relationship between unit versions and Sysmac Studio versions.
Unit Versions
A “unit version” has been introduced to manage the Units in the NX Series according to differences in
functionality accompanying Unit upgrades.
Notation of Unit Versions on Products
The unit version is given with the Unit specifications on the side of the Unit or in the notched area.
Unit Versions
The following information is provided in the Unit specifications on the Unit.
Unit model numberGives the model of the Unit.
Unit versionGives the unit version of the Unit.
Lot numberGives the lot number of the Unit.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
NameFunction
DDMYY: Lot number, : Used by OMRON.
“M” gives the month (1 to 9: January to September, X: October, Y: November, Z: December)
19
Page 22
Unit Versions
The following information is provided in the notched area on the Unit.
NameFunction
Lot number and
unit version
Confirming Unit Versions with the Sysmac Studio
You can use the Unit Production Information on the Sysmac Studio to check the unit versions EtherCAT
Coupler Unit and NX Units.
1Double-click EtherCAT under Configurations and Setup in the Multiview Explorer, and then
double-click the EtherCAT Coupler Unit. Or, right-click the EtherCAT Coupler Unit and select
Edit from the menu.
The Edit Slave Terminal Configuration Tab Page is displayed.
Gives the lot number and unit version of the Unit.
• DDMYY: Lot number, : Used by OMRON.
“M” gives the month (1 to 9: January to September, X: October, Y: November, Z: December)
•1: Unit version
The decimal portion of the unit version is omitted. (It is provided in the Unit specifications.)
You can also display the Edit Slave Terminal Configuration Tab Page with any of the following
operations.
Double-click EtherCAT under Configurations and Setup in the Multiview Explorer, right-click
the EtherCAT Coupler Unit in the EtherCAT Configuration Edit Tab Page, and select Edit Slave Terminal Configuration.
Or, select the EtherCAT Coupler Unit on the EtherCAT Configuration Edit Tab Page click the
Edit Slave Terminal Configuration Button.
2Go online.
3Right-click the EtherCAT Coupler Unit and select Display Production Information from the
menu.
The Production Information Dialog Box is displayed.
20
Simple Display
Detailed Display
In this example, “Ver.1.0” is displayed next to the Unit model.
The following items are displayed.
• Slot number
• Unit model number
• Unit version
• Serial number
• Lot number
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 23
• Hardware version
• Software version
The software version is displayed only for Units that contain software.
Unit Versions and Sysmac Studio Versions
The functions that are supported depend on the unit version of the Unit. The version of Sysmac Studio
that supports the functions that were added for an upgrade is also required to use those functions.
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930) for the relationship between
the unit versions of the CPU Units and the Sysmac Studio versions, and for the functions that are supported by each unit version.
Unit Version Notation
In this User’s Manual, unit versions are specified as shown in the following table.
Unit Versions
Unit version in Unit specifications
on the product
Ver. 1. or laterUnit version 1.0 or laterUnless unit versions are specified, the infor-
Notation in this manualRemarks
mation in this manual applies to all unit versions.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
21
Page 24
Related Manuals
Related Manuals
The following manuals are related. Use these manuals for reference.
Manual nameCat. No. Model numbersApplicationDescription
NX-series Safety Control Unit Instructions
Reference Manual
NX-series Safety Control Unit User’s Manual
Sysmac Studio Version 1 Operation Manual
Z931NX-SLLearning about the
Z930NX-SL
W504SYSMAC-
NX-SI
NX-SO
SE2
specifications of
instructions for the
Safety CPU Unit.
Learning how to use
NX-series Safety
Control Units.
Learning about the
operating procedures
and functions of the
Sysmac Studio.
The instructions for the Safety CPU Unit are described.
When programming, use this manual together with the
NX-series Safety Control Unit User’s Manual (Cat. No.
Z930).
The hardware, setup methods, and functions of the
NX-series Safety Control Unit are described.
Describes the operating procedures of the Sysmac Studio.
22
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 25
Terminology
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930) for the definitions of terms
that are used in this manual.
Terminology
NX-series Safety Control Unit Instructions Reference Manual (Z931)
23
Page 26
Revision History
Cat. No.
Z931-E1-04
Revision code
Revision History
A manual revision code appears as a suffix to the catalog number at the bottom left of the front and
back covers of the manual.
Revision codeDateRevised content
01June 2013Original production
02September 2013Corrected mistakes.
03December 2013Added information on timer set values.
04April 2016• Changed Section 2 Other Standard Instructions to Selection Instruc-
Corrected mistakes.
tions.
• Added DigitalCode (decimal) to FB-specific Error Codes and FB-spe-cific State Codes tables in Section 4 Safety Function Blocks.
24
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 27
1
2
3
4
3
4
1
2
Introduction to Instructions for Safety Control Units and
Interpreting Instruction Descriptions
Standard Functions
Safety Standard Function Blocks
Safety Function Blocks
I
I
Index
Sections in this Manual
Sections in this Manual
NX-series Safety Control Unit Instructions Reference Manual (Z931)
25
Page 28
Sections in this Manual
26
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 29
1
Introduction to Instructions for Safety
Control Units and Interpreting Instruction
This section provides an introduction to the instructions for Safety Control Units and
tells how to interpret the instruction descriptions.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
1 - 1
Page 30
1 Introduction to Instructions for Safety Control Units and Interpreting Instruction Descriptions
Precautions for Correct Use
1-1Types of Instructions
The following three types of instructions can be used with the Safety Control Units.
TypeDescription
Standard functionsThese function instructions do not use safety data. They include program
execution control instructions, data type conversion instructions, Boolean
operation instructions, math instructions, comparison instructions, etc.
Safety standard function blocksThese function block instructions use safety data. They include counter
instructions, up/down trigger instructions, timer instructions, etc.
Safety function blocksThese function block instructions use safety data and are based on the safety
standards defined by PLCopen. They include an antivalent instruction, emergency stop instruction, etc.
Instruction specifications are provided starting from section 2.
Some of the instructions have the same names as the instructions that are supported by the
NJ-series CPU Units. Operating specifications, however, are different.
1 - 2
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 31
1 Introduction to Instructions for Safety Control Units and Interpreting Instruction Descriptions
Instance specification
Input variable
name
Output variable
name
ADD
Instruction word
SF_CTU
CU
SF_CTU_instance
RESET
PV
Q
CV
Example for a FUN
Instruction
Example for a FB
Instruction
1-2Interpreting Instruction Descriptions
The notation that is used to describe instructions is explained in this section.
1-2-1Items
The following items are provided. The order of the items is not the same for all instructions. If there are
items that are specific to one type of instruction, they are explained in the section for each instruction
type.
ItemDescription
InstructionThe instruction word is given.
NameThe name of the instruction is given.
FB/FUNWhether the instruction is a function block (FB) instruction or a function (FUN) instruction
is given.
Graphic expressionThe figure that represents the instruction in a function block diagram is given.
1-2 Interpreting Instruction
Descriptions
1
1-2-1 Items
Variables• Variable
Instance specification: An instance of an instruction is indicated by “XX_instance” above a
FB instruction. You must assign an instance name to any instance of an instruction that
you specify.
The input variable or output variable is given.
•Name
The name of the variable is given.
Example: Up-counter
• I/O
Whether the variable is an input variable or output variable is given.
• Description
The meaning of the variable and any restrictions are given.
• Valid range
The range that the variable can take is given. “Depends on data type” indicates that the
valid range of the variable depends on the data type that you use. The valid ranges of
the data types are given later in this section.
•Default
The specified default value is automatically used for the variable if you do not assign a
parameter to the instruction before it is executed. “---” indicates the following:
Input variables: The default value of the data type of the input variable is assigned. The
default values of the data types are given later in this section.
Output variables: Default values are not set.
• Data type
The data type of the variable is given. Broadly speaking, there are two classifications of
data types: safety signals and non-safety signals. These two classifications of data
types are described later.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
1 - 3
Page 32
1 Introduction to Instructions for Safety Control Units and Interpreting Instruction Descriptions
ItemDescription
FunctionThe function of the instruction is described.
Additional Informa-
tion
Precautions for Correct Use
Additional information on the function of the instruction is provided. This includes related
instructions and helpful information for application of the instruction.
Precautions for application of the instruction are given. The conditions under which errors
occur for the instruction are also given here.
1-2-2Safety Data Types and Standard Data Types
The Safety Control Unit classifies the following two data types to distinguish between safety signals and
standard signals.
• Safety data types: These data types represent signals related to safety control.
• Standard data types: These data types represent signals related to standard control.
The safety data type variables are prefixed with the “SAFE” before the name of the standard data type,
as in SAFEBOOL and SAFEBYTE.
You can input a signal for a safety data type variable to a standard data type variable. You cannot input
a signal for a standard data type variable to a safety data type variable. A building error will occur.
1-2-3Valid Ranges and Default Values of Variables
The valid range of a variable indicates the range of values that variable can take. The default value of a
variable indicates the value that is assigned to an input variable when the instruction is executed without a parameter assigned to the input variable. These values are defined for each data type. If specific
values are not given for an instruction, then the valid ranges and default values of the data types are
applied. These variables are indicated by “depends on data type” in the valid range column of the table
that describes the variables and by “---” in the input variable default column. The valid ranges and
default values of the data types are given in the following tables.
Classification
Boolean
Bit strings
Integers
Durations
Safety/standard
data type
Standard data
type
Safety data typeSAFEBOOL
Standard data
type
Safety data typeSAFEBYTE
Standard data
type
Safety data typeSAFEWORD
Standard data
type
Safety data typeSAFEDWORD
Standard data
type
Safety data typeSAFEINT
Standard data
type
Safety data typeSAFEDINT
Standard data
type
Safety data typeSAFETIME
Data typeRange of valuesDefault
BOOL
BYTE
WORD
DWORD
INT
DINT
TIME
TRUE or FALSEFALSE
byte#16#00 to byte#16#FFbyte#16#00
word#16#0000 to
word#16#FFFF
dword#16#00000000 to
dword#16#FFFFFFFF
int#−32768 to int#32767int#0
dint#-2147483648 to
dint#2147483647
t#0ms to t#2147483647ms
and t#0d0h0m0s0ms to
t#24d20h31m23s647ms
word#16#0000
dword#16#00000000
dint#0
t#0s
1 - 4
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 33
1 Introduction to Instructions for Safety Control Units and Interpreting Instruction Descriptions
Precautions for Correct Use
1-2-4Timer Set Values
Time set values, such as those for DiscrepancyTime or the OFF-Delay Timer instruction, operate in
increments of the safety task period.
The timer error is +1 safety task period. Every safety task period, a timer value is checked to see if it
has reached the set time. If the timer value reaches the set time immediately after this check, the time
is delayed by one safety task period.
Examples are provided below.
1-2 Interpreting Instruction
Descriptions
1
When the OFF-Delay Timer Instruction Is Set to 500 ms and the Safety Task
Period Is Set to 16 ms
The timer will time out 512 ms (16 ms × 32) after the safety task is started.
When the OFF-Delay Timer Instruction Is Set to 500 ms and the Safety Task
Period Is Set to 20 ms
The timer will time out 520 ms (20 ms × 26) after the safety task is started. Care is required because
the timer will not operate at 500 ms.
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930) for details on the safety task
period.
The time when an OFF-Delay Timer instruction times out can affect the safety reaction times.
1-2-4 Timer Set Values
NX-series Safety Control Unit Instructions Reference Manual (Z931)
1 - 5
Page 34
1 Introduction to Instructions for Safety Control Units and Interpreting Instruction Descriptions
1 - 6
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 35
Standard Functions
This section gives the specifications of the standard functions that you can use for
NX-series Safety Control Units.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 1
Page 36
2 Standard Functions
Table of Standard Functions
TypeInstructionNameDescriptionPage
Execution controlJumpJumpMoves processing to the
jump destination specified
by a label.
ReturnReturnReturns control to the pro-
cess that called the POU
without executing any processing after RETURN.
Data type
conversion
Boolean to
integer
Boolean to
duration
Boolean to bit
string
Bit string to integer
Bit string to
duration
Bit string to bit
string
BOOL_TO_INTConvert
BOOL to INT
BOOL_TO_DINTConvert
BOOL to
DINT
BOOL_TO_TIMEConvert
BOOL to
TIME
BOOL_TO_WORDConvert
BOOL to
WORD
BYTE_TO_INTConvert
BYTE to INT
BYTE_TO_DINTConvert
BYTE to
DINT
WORD_TO_INTConvert
WORD to
INT
WORD_TO_DINTConvert
WORD to
DINT
DWORD_TO_DINTConvert
DWORD to
DINT
BYTE_TO_TIMEConvert
BYTE to
TIME
WORD_TO_TIMEConvert
WORD to
TIME
DWORD_TO_TIMEConvert
DWORD to
TIME
BYTE_TO _WORDConvert
BYTE to
WORD
WORD_TO_BYTEConvert
WORD to
BYTE
WORD_TO_DWORDConvert
WORD to
DWORD
Converts a BOOL variable
to an INT variable.
Converts a BOOL variable
to a DINT variable.
Converts a BOOL variable
to a TIME variable.
Converts a BOOL variable
to a WORD variable.
Converts a BYTE variable to
an INT variable.
Converts a BYTE variable to
a DINT variable.
Converts a WORD variable
to an INT variable.
Converts a WORD variable
to a DINT variable.
Converts a DWORD variable to a DINT variable.
Converts a BYTE variable to
a TIME variable.
Converts a WORD variable
to a TIME variable.
Converts a DWORD variable to a TIME variable.
Converts a BYTE variable to
a WORD variable.
Converts a WORD variable
to a BYTE variable.
Converts a WORD variable
to a DWORD variable.
P. 2 -6
P. 2 -8
P. 2-12
P. 2-13
P. 2-14
P. 2-15
P. 2-16
P. 2-17
P. 2-18
P. 2-20
P. 2-21
P. 2-23
P. 2-24
P. 2-25
P. 2-26
P. 2-27
P. 2-28
2 - 2
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 37
Data type
conversion
2 Standard Functions
TypeInstructionNameDescriptionPage
Integer to
Boolean
Integer to bit
string
Integer to integerDINT_TO_INTConvert
Integer to
duration
Duration to
Boolean
Duration to bit
string
Duration to
integer
Bit string to
Boolean
DINT_TO_BOOLConvert
DINT to
BOOL
INT_TO_BOOLConvert INT
to BOOL
DINT_TO_BYTEConvert
DINT to
BYTE
DINT_TO_DWORDConvert
DINT to
DWORD
DINT_TO_WORDConvert
DINT to
WORD
INT_TO_BYTEConvert INT
to BYTE
INT_TO_DWORDConvert INT
to DWORD
INT_TO_WORDConvert INT
to WORD
DINT to INT
INT_TO_DINTConvert INT
to DINT
DINT_TO_TIMEConvert
DINT to
TIME
INT_TO_TIMEConvert INT
to TIME
TIME_TO_BOOLConvert
TIME to
BOOL
TIME_TO_BYTEConvert
TIME to
BYTE
TIME_TO_DWORDConvert
TIME to
DWORD
TIME_TO_WORDConvert
TIME to
WORD
TIME_TO_DINTConvert
TIME to
DINT
TIME_TO_INTConvert
TIME to INT
WORD_TO_BOOLConvert
WORD to
BOOL
Converts a DINT variable to
a BOOL variable.
Converts an INT variable to
a BOOL variable.
Converts a DINT variable to
a BYTE variable.
Converts a DINT variable to
a DWORD variable.
Converts a DINT variable to
a WORD variable.
Converts an INT variable to
a BYTE variable.
Converts an INT variable to
a DWORD variable.
Converts an INT variable to
a WORD variable.
Converts a DINT variable to
an INT variable.
Converts an INT variable to
a DINT variable.
Converts a DINT variable to
a TIME variable.
Converts an INT variable to
a TIME variable.
Converts a TIME variable to
a BOOL variable.
Converts a TIME variable to
a BYTE variable.
Converts a TIME variable to
a DWORD variable.
Converts a TIME variable to
a WORD variable.
Converts a TIME variable to
a DINT variable.
Converts a TIME variable to
an
INT variable.
Converts a WORD variable
to a BOOL variable.
P. 2 -2 9
P. 2 -3 0
P. 2 -3 1
P. 2 -3 2
P. 2 -3 4
P. 2 -3 5
P. 2 -3 6
P. 2 -3 8
P. 2 -4 0
P. 2 -4 1
P. 2 -4 2
P. 2 -4 3
P. 2 -4 4
P. 2 -4 5
P. 2 -4 6
P. 2 -4 7
P. 2 -4 8
P. 2 -4 9
P. 2 -5 0
2
Table of Standard Functions
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 3
Page 38
2 Standard Functions
TypeInstructionNameDescriptionPage
Boolean operationsANDLogical ANDPerforms a logical AND on
multiple Boolean variables.
ORLogical ORPerforms a logical OR on
multiple Boolean variables.
XORExclusive
logical OR
NOTBit ReversalReverses the value of a
MathADDAdditionAdds integers or durations.P. 2-56
SUBSubtractionSubtracts integers or dura-
MULMultiplication Multiplies integers or a dura-
DIVDivisionDivides integers or a dura-
ComparisonEQEqualDetermines if the values of
NENot EqualDetermines if the values of
LTLess ThanPerforms a less than com-
LELess Than
Or Equal
GTGreater
Than
GEGreater
Than Or
Equal
SelectionSELBit SelectionSelects one of two selec-
MUXMultiplexerSelects one of multiple
Performs an exclusive logical OR on multiple Boolean
variables.
Boolean bit.
tions.
tion.
tion.
two variables are equivalent.
two variables are not equivalent.
parison between two values.
Performs a less than or
equal comparison between
two values.
Performs a greater than
comparison between two
values.
Performs a greater than or
equal comparison between
two values.
tions.
selections.
P. 2-52
P. 2-52
P. 2-52
P. 2-54
P. 2-58
P. 2-60
P. 2-62
P. 2-66
P. 2-67
P. 2-68
P. 2-68
P. 2-68
P. 2-68
P. 2-72
P. 2-74
2 - 4
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 39
Execution Control Instructions
TypeInstructionNameDescriptionPage
Execution controlJumpJumpMoves processing to the
jump destination specified
by a label.
ReturnReturnReturns control to the pro-
cess that called the POU
without executing any processing after RETURN.
2
P. 2 -6
P. 2 -8
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 5
Page 40
2 Standard Functions
Label
Label:
Programming A
Not executed due
to JUMP instruction.
ExecutionNetwork
4
Step1:
1
Programming A
3
Programming C
5
Programming D
2
Programming B
BOOL output
Step1:
FALSE Output from Programming B
Network
TRUE Output from Programming B
4
Step1:
1
5
Programming D
2
Programming B
BOOL output
Step1:
3
Programming C
Execution
JUMP and LABEL
This function moves processing to the jump destination specified by a label.
InstructionNameFB/FUNGraphic expression
JUMPJumpFUN
LABELLabelFUN
Variables
There are no variables for these instructions.
Function
When the execution condition is TRUE, the JUMP instruction moves processing to the jump destination
specified by a label in the program.
The label can be any text string.
The following figure shows a programming example. This example uses the text string Step1 as the
label.
When the JUMP instruction is executed, processing moves to the location marked Step1. In this example, programming C between the JUMP instruction and the label is not executed. The outputs in programming C retain the values that they had just before the JUMP instruction was executed.
2 - 6
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 41
Additional Information
• You cannot jump upward in the networks.
• You can use the same label as the jump destination for more than one JUMP instruction.
• You can set only a label in a network, or you can set both programming and a label in a network.
Precautions for Correct Use
• You must use either a BOOL or SAFEBOOL execution condition for the JUMP instruction.
If you connect an execution condition with any other data type, a building error will occur.
• You cannot omit labels. If you omit a label, a building error will occur.
• Place the JUMP instruction and label in the same POU.
• Programming between the JUMP instruction and the label is not executed when the JUMP instruction
is executed. The outputs retain the values that they had just before the JUMP instruction was executed.
2 Standard Functions
Execution Control Instructions
2
JUMP and LABEL
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 7
Page 42
2 Standard Functions
Not executed due to
RETURN instruction.
Not executed due to
RETURN instruction.
Network
1
Programming A
3
Programming C
4
Programming D
FALSE Output from Programming B
Network
TRUE Output from Programming B
1
Programming A
Programming B
BOOL output
2
RETURN
2
Programming B
BOOL output
RETURN
3
Programming C
4
Programming D
ExecutionExecution
RETURN
This function returns control to the process that called the POU without executing any processing after
RETURN.
InstructionNameFB/FUNGraphic expression
RETURNReturnFUN
Variables
There are no variables for these instructions.
Function
RETURN
When the execution condition is TRUE, control is returned to the location that called the POU without
executing any processing after RETURN.
The following figure shows a programming example. When the RETURN instruction is executed in the
example, programming C and D that follow it are not executed. The outputs in programming C and D
retain the values that they had just before the RETURN instruction was executed.
Precautions for Correct Use
• You must use either a BOOL or SAFEBOOL execution condition for the RETURN instruction.
If you connect an execution condition with any other data type, a building error will occur.
• If you use this instruction too often, the flow of processing will be difficult to understand. Use it with
caution.
• Programming after the RETURN instruction is not executed when the RETURN instruction is executed. The outputs retain the values that they had just before the RETURN instruction was executed.
2 - 8
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 43
Data type
conversion
Data Type Conversion Instructions
TypeInstructionNameDescriptionPage
Boolean to
integer
Boolean to
duration
Boolean to bit
string
BOOL_TO_INTConvert
BOOL to INT
BOOL_TO_DINTConvert
BOOL to
DINT
BOOL_TO_TIMEConvert
BOOL to
TIME
BOOL_TO_WORDConvert
BOOL to
WORD
Converts a BOOL variable
to an INT variable.
Converts a BOOL variable
to a DINT variable.
Converts a BOOL variable
to a TIME variable.
Converts a BOOL variable
to a WORD variable.
2
P. 2 -1 2
P. 2 -1 3
P. 2 -1 4
P. 2 -1 5
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 9
Page 44
2 Standard Functions
TypeInstructionNameDescriptionPage
Data type
conversion
Bit string to integer
Bit string to
duration
Bit string to bit
string
Integer to
Boolean
Integer to bit
string
Integer to integerDINT_TO_INTConvert
BYTE_TO_INTConvert
BYTE to INT
BYTE_TO_DINTConvert
BYTE to
DINT
WORD_TO_INTConvert
WORD to
INT
WORD_TO_DINTConvert
WORD to
DINT
DWORD_TO_DINTConvert
DWORD to
DINT
BYTE_TO_TIMEConvert
BYTE to
TIME
WORD_TO_TIMEConvert
WORD to
TIME
DWORD_TO_TIMEConvert
DWORD to
TIME
BYTE_TO _WORDConvert
BYTE to
WORD
WORD_TO_BYTEConvert
WORD to
BYTE
WORD_TO_DWORDConvert
WORD to
DWORD
DINT_TO_BOOLConvert
DINT to
BOOL
INT_TO_BOOLConvert INT
to BOOL
DINT_TO_BYTEConvert
DINT to
BYTE
DINT_TO_DWORDConvert
DINT to
DWORD
DINT_TO_WORDConvert
DINT to
WORD
INT_TO_BYTEConvert INT
to BYTE
INT_TO_DWORDConvert INT
to DWORD
O_WORDConvert INT
INT_T
to WORD
DINT to INT
INT_TO_DINTConvert INT
to DINT
Converts a BYTE variable to
an INT variable.
Converts a BYTE variable to
a DINT variable.
Converts a WORD variable
to an INT variable.
Converts a WORD variable
to a DINT variable.
Converts a DWORD variable to a DINT variable.
Converts a BYTE variable to
a TIME variable.
Converts a WORD variable
to a TIME variable.
Converts a DWORD variable to a TIME variable.
Converts a BYTE variable to
a WORD variable.
Converts a WORD variable
to a BYTE variable.
Converts a WORD variable
to a DWORD variable.
Converts a DINT variable to
a BOOL variable.
Converts an INT variable to
a BOOL variable.
Converts a DINT variable to
a BYTE variable.
Converts a DINT variable to
a DWORD variable.
Converts a DINT variable to
a WORD variable.
Converts an INT variable to
a BYTE variable.
Converts an INT variable to
a DWORD variable.
Converts an INT variable to
a WORD variable.
Converts a DINT variable to
an INT variable.
Converts an INT variable to
a DINT variable.
P. 2-16
P. 2-17
P. 2-18
P. 2-20
P. 2-21
P. 2-23
P. 2-24
P. 2-25
P. 2-26
P. 2-27
P. 2-28
P. 2-29
P. 2-30
P. 2-31
P. 2-32
P. 2-34
P. 2-35
P
. 2-36
P. 2-38
P. 2-40
P. 2-41
2 - 10
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 45
Data type
conversion
2 Standard Functions
TypeInstructionNameDescriptionPage
Integer to
duration
Duration to
Boolean
Duration to bit
string
Duration to
integer
Bit string to
Boolean
DINT_TO_TIMEConvert
DINT to
TIME
INT_TO_TIMEConvert INT
to TIME
TIME_TO_BOOLConvert
TIME to
BOOL
TIME_TO_BYTEConvert
TIME to
BYTE
TIME_TO_DWORDConvert
TIME to
DWORD
TIME_TO_WORDConvert
TIME to
WORD
TIME_TO_DINTConvert
TIME to
DINT
TIME_TO_INTConvert
TIME to INT
WORD_TO_BOOLConvert
WORD to
BOOL
Converts a DINT variable to
a TIME variable.
Converts an INT variable to
a TIME variable.
Converts a TIME variable to
a BOOL variable.
Converts a TIME variable to
a BYTE variable.
Converts a TIME variable to
a DWORD variable.
Converts a TIME variable to
a WORD variable.
Converts a TIME variable to
a DINT variable.
Converts a TIME variable to
an INT variable.
Converts a WORD variable
to a BOOL variable.
P. 2 -4 2
P. 2 -4 3
P. 2 -4 4
P. 2 -4 5
P. 2 -4 6
P. 2 -4 7
P. 2 -4 8
P. 2 -4 9
P. 2 -5 0
Data Type Conversion Instructions
2
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 11
Page 46
2 Standard Functions
BOOL_TO_INT
BOOL_TO_INT
This function converts a BOOL variable to an INT variable.
InstructionNameFB/FUNGraphic expression
BOOL_TO_INTConvert BOOL to
INT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
TRUE or FALSEFALSE
vert
INT#0 or INT#1INT#0
result
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts BOOL data In to INT data Out.
If the value of In is FALSE, the value of Out is INT#0.
If the value of In is TRUE, the value of Out is INT#1.
Additional Information
To check for INT data, refer to INT_TO_BOOL.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 12
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 47
BOOL_TO_DINT
This function converts a BOOL variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
BOOL_TO_DINTConvert BOOL to
DINT
FUN
2 Standard Functions
Data Type Conversion Instructions
BOOL_TO_DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
TRUE or FALSEFALSE
DINT#0 or DINT#1DINT#0
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts BOOL data In to DINT data Out.
SAFEDINT
TIME
2
BOOL_TO_DINT
SAFETIME
If the value of In is FALSE, the value of Out is DINT#0.
If the value of In is TRUE, the value of Out is DINT#1.
Additional Information
To check for DINT data, refer to DINT_TO_BOOL.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 13
Page 48
2 Standard Functions
BOOL_TO_TIME
BOOL_TO_TIME
This function converts a BOOL variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
BOOL_TO_TIMEConvert BOOL to
TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputDurationT#0ms or T#1msT#0ms
FUN
vert
TRUE or FALSEFALSE
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts BOOL data In to TIME data Out.
If the value of In is FALSE, the value of Out is 0 ms (T#0ms).
If the value of In is TRUE, the value of Out is 1 ms (T#1ms).
Additional Information
To check for TIME data, refer to TIME_TO_BOOL.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 14
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 49
BOOL_TO_WORD
This function converts a BOOL variable to a WORD variable.
InstructionNameFB/FUNGraphic expression
BOOL_TO_WORDConvert BOOL to
WORD
FUN
2 Standard Functions
Data Type Conversion Instructions
BOOL_TO_WORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
Function
This function converts BOOL data In to WORD data Out.
vert
result
SAFEWORD
DWORD
TRUE or FALSEFALSE
WORD#16#0000 or
WORD#16#0001
SAFEDWORD
INT
SAFEINT
WORD#16#0000
DINT
SAFEDINT
TIME
2
BOOL_TO_WORD
SAFETIME
If the value of In is FALSE, the value of Out is WORD#16#0000.
If the value of In is TRUE, the value of Out is WORD#16#0001.
Additional Information
To check for WORD data, refer to WORD_TO_BOOL.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 15
Page 50
2 Standard Functions
BYTE_TO_INT
BYTE_TO_INT
This function converts a BYTE variable to an INT variable.
InstructionNameFB/FUNGraphic expression
BYTE_TO_INTConvert BYTE to
INT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
BYTE#16#00 to FFBYTE#16#00
vert
INT#0 to 255INT#0
result
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts BYTE data In to INT data Out.
Additional Information
To convert INT data to BYTE data, refer to INT_TO_BYTE.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
2 - 16
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 51
BYTE_TO_DINT
This function converts a BYTE variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
BYTE_TO_DINTConvert BYTE to
DINT
FUN
2 Standard Functions
Data Type Conversion Instructions
BYTE_TO_DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
BYTE#16#00 to FFBYTE#16#00
DINT#0 to 255DINT#0
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts BYTE data In to DINT data Out.
SAFEDINT
TIME
2
BYTE_TO_DINT
SAFETIME
Additional Information
To convert DINT data to BYTE data, refer to DINT_TO_BYTE.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 17
Page 52
2 Standard Functions
WORD_TO_INT
WORD_TO_INT
This function converts a WORD variable to an INT variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_INTConvert WORD
to INT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
vert
OutputConversion
result
FUN
WORD#16#0000 to FFFF WORD#16#0000
INT#−32768 to 32767INT#0
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts WORD data In to INT data Out.
Example When Value of Out Is Positive (INT#0 to INT#32767)
• The value of Out is INT#0 to INT#32767 according to the value of In (WORD#16#0000 to
WORD#16#7FFF).
Example When Value of Out Is Negative (INT#−32768 to INT#−1)
• If the value of In is WORD#16#8000 (1000 0000 0000 0000 binary), the value of Out is INT#32768,
which is INT#−32768 as a 2-byte expression.
• If the value of In is WORD # 1 6 # FFFF (1111 1111 1111 1111 binary ) , t h e value o f Out is INT#65535,
which is INT#−1 as a 2-byte expression.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Additional Information
To convert INT data to WORD data, refer to INT_TO_WORD.
2 - 18
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 53
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Data Type Conversion Instructions
2
WORD_TO_INT
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 19
Page 54
2 Standard Functions
WORD_TO_DINT
WORD_TO_DINT
This function converts a WORD variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_DINTConvert WORD
to DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
WORD#16#0000 to FFFF WORD#16#0000
DINT#0 to 65535DINT#0
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts WORD data In to DINT data Out.
Example for the Range of WORD Data (WORD#16#0000 to WORD#16#FFFF)
• The value of Out is DINT#0 to DINT#65535.
Additional Information
To convert DINT data to WORD data, refer to DINT_TO_WORD.
SAFEDINT
TIME
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 20
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 55
DWORD_TO_DINT
This function converts a DWORD variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
DWORD_TO_DINTConvert DWORD
to DINT
FUN
2 Standard Functions
Data Type Conversion Instructions
DWORD_TO_DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
InputData to con-
vert
OutputConversion
result
DWORD#16#00000000
to FFFFFFFF
DINT#−2147483648 to
2147483647
DWORD#16#00000000
DINT#0
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts DWORD data In to DINT data Out.
SAFEDINT
TIME
2
DWORD_TO_DINT
SAFETIME
Example When Value of Out Is Positive (DINT#0 to DINT#2147483647)
• The value of Out is DINT#0 to DINT#2147483647 according to the value of In
(DWORD#16#00000000 to DWORD#16#7FFFFFFF).
Example When Value of Out Is Negative (DINT#−2147483648 to DINT#−1)
• If the value of In is DWORD#16#80000000 (1000 0000 0000 0000 0000 0000 0000 0000 binary), the
value of Out is DINT#−2147483648.
• If the value of In is DWORD#16#FFFFFFFF (1111 1111 1111 1111 1111 1111 1111 1111 b i n a r y), the
value of Out is DINT#−1.
Additional Information
To convert DINT data to DWORD data, refer to DINT_TO_DWORD.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 21
Page 56
2 Standard Functions
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 22
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 57
BYTE_TO_TIME
This function converts a BYTE variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
BYTE_TO_TIMEConvert BYTE to
TIME
FUN
2 Standard Functions
Data Type Conversion Instructions
BYTE_TO_TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
vert
OutputDurationT#0ms to T#255msT#0ms
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
BYTE#16#00 to FFBYTE#16#00
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts BYTE data In to TIME data Out.
2
BYTE_TO_TIME
SAFETIME
Additional Information
To convert TIME data to BYTE data, refer to TIME_TO_BYTE.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 23
Page 58
2 Standard Functions
WORD_TO_TIME
WORD_TO_TIME
This function converts a WORD variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_TIMEConvert WORD
to TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputDurationT#0ms to T#1m5s535msT#0ms
FUN
vert
WORD#16#0000 to FFFF WORD#16#0000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts WORD data In to TIME data Out.
Example When Value of In Is WORD#16#C549
• The value of Out is 50 s 505 ms (T#50s505ms).
Additional Information
To convert TIME data to WORD data, refer to TIME_TO_WORD.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 24
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 59
DWORD_TO_TIME
This function converts a DWORD variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
DWORD_TO_TIMEConvert DWORD
to TIME
FUN
2 Standard Functions
Data Type Conversion Instructions
DWORD_TO_TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
vert
OutputDurationT#0ms to
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
DWORD#16#00000000
to FFFFFFFF
T#49d17h2m47s295ms
SAFEDWORD
INT
SAFEINT
DWORD#16#00000000
T#0ms
DINT
SAFEDINT
TIME
Function
This function converts DWORD data In to TIME data Out.
2
DWORD_TO_TIME
SAFETIME
Example When Value of In Is DWORD#16#FFFFFFFF
• The value of Out is 49 days 17 h 2 min 47 s 295 ms (T#49d17h2m47s295ms).
Additional Information
To convert TIME data to DWORD data, refer to TIME_TO_DWORD.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 25
Page 60
2 Standard Functions
BYTE_TO_WORD
BYTE_TO_WORD
This function converts a BYTE variable to a WORD variable.
InstructionNameFB/FUNGraphic expression
BYTE_TO_WORDConvert BYTE to
WORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
BYTE#16#00 to FFBYTE#16#00
WORD#16#0000 to 00FFWORD#16#0000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
Function
This function converts BYTE data In to WORD data Out.
Additional Information
To convert WORD data to BYTE data, refer to WORD_TO_BYTE.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
2 - 26
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 61
WORD_TO_BYTE
This function converts a WORD variable to a BYTE variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_BYTEConvert WORD
to BYTE
FUN
2 Standard Functions
Data Type Conversion Instructions
WORD_TO_BYTE
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
Function
This function converts WORD data In to BYTE data Out.
vert
result
SAFEWORD
DWORD
WORD#16#0000 to 00FFWORD#16#0000
BYTE#16#00 to FFBYTE#16#00
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
2
WORD_TO_BYTE
SAFETIME
Additional Information
To convert BYTE data to WORD data, refer to BYTE_TO_WORD.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not between WORD#16#0000 and WORD#16#00FF, a cast error will occur and
the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 27
Page 62
2 Standard Functions
WORD_TO_DWORD
WORD_TO_DWORD
This function converts a WORD variable to a DWORD variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_DWORDConvert WORD
to DWORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
WORD#16#0000 to FFFF WORD#16#0000
DWORD#16#00000000
to 0000FFFF
DWORD#16#00000000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
Function
This function converts WORD data In to DWORD data Out.
Example for the Range of WORD Data (WORD#16#0000 to WORD#16#FFFF)
• The value of Out will be DWORD#16#00000000 to DWORD#16#0000FFFF.
Additional Information
There is no instruction that converts DWORD data to WORD data.
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 28
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 63
DINT_TO_BOOL
This function converts a DINT variable to a BOOL variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_BOOLConvert DINT to
BOOL
FUN
2 Standard Functions
Data Type Conversion Instructions
DINT_TO_BOOL
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
DINT#−2147483648 to
2147483647
TRUE or FALSEFALSE
SAFEDWORD
INT
SAFEINT
DINT#0
DINT
Function
This function converts DINT data In to BOOL data Out.
SAFEDINT
TIME
2
DINT_TO_BOOL
SAFETIME
If the value of In is DINT#0, the value of Out is FALSE.
If the value of In is DINT#−2147483648 to DINT#−1 or DINT#1 to DINT#2147483647 (i.e., not DINT#0),
the value of Out is TRUE.
Additional Information
To convert BOOL data to DINT data, refer to BOOL_TO_DINT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not DINT#-2147483648 to DINT#2147483647, a cast error will occur and the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 29
Page 64
2 Standard Functions
INT_TO_BOOL
INT_TO_BOOL
This function converts an INT variable to a BOOL variable.
InstructionNameFB/FUNGraphic expression
INT_TO_BOOLConvert INT to
BOOL
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
INT#−32768 to 32767INT#0
vert
TRUE or FALSEFALSE
result
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts INT data In to BOOL data Out.
If the value of In is INT#0, the value of Out is FALSE.
If the value of In is INT#−32768 to INT#−1 or INT#1 to INT#32767 (i.e., not INT#0), the value of Out is
TRUE.
Additional Information
To convert BOOL data to INT data, refer to BOOL_TO_INT.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not INT#-32768 to INT#32767, a cast error will occur and the program will stop.
2 - 30
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 65
DINT_TO_BYTE
This function converts a DINT variable to a BYTE variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_BYTEConvert DINT to
BYTE
FUN
2 Standard Functions
Data Type Conversion Instructions
DINT_TO_BYTE
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
DINT#0 to 255DINT#0
BYTE#16#00 to FFBYTE#16#00
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts DINT data In to BYTE data Out.
SAFEDINT
TIME
2
DINT_TO_BYTE
SAFETIME
Additional Information
To convert BYTE data to DINT data, refer to BYTE_TO_DINT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not DINT#0 to DINT#255, a cast error will occur and the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 31
Page 66
2 Standard Functions
DINT_TO_DWORD
DINT_TO_DWORD
This function converts a DINT variable to a DWORD variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_DWORDConvert DINT to
DWORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
DINT#−2147483648 to
2147483647
DWORD#16#00000000
to FFFFFFFF
DINT#0
DWORD#16#00000000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts DINT data In to DWORD data Out.
Example When Value of In Is Positive (DINT#0 to DINT#2147483647)
• The value of Out is DWORD#16#00000000 to DWORD#16#7FFFFFFF according to the value of
In (DINT#0 to DINT#2147483647).
Example When Value of In Is Negative (DINT#−2147483648 to DINT#−1)
• If the value of In is DINT#−2147483648 (1000 0000 0000 0000 0000 0000 0000 0000 binary), the
value of Out is DWORD#16#80000000.
• If the value of In is DINT#−1 ( 1111 1111 1111 1111 1111 1111 1111 1111 binary) , t h e v a lue of Out is
DWORD#16#FFFFFFFF.
SAFEDINT
TIME
SAFETIME
Additional Information
To convert DWORD data to DINT data, refer to DWORD_TO_DINT.
2 - 32
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 67
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Data Type Conversion Instructions
2
DINT_TO_DWORD
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 33
Page 68
2 Standard Functions
DINT_TO_WORD
DINT_TO_WORD
This function converts a DINT variable to a WORD variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_WORDConvert DINT to
WORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
DINT#0 to 65535DINT#0
WORD#16#0000 to FFFF WORD#16#0000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts DINT data In to WORD data Out.
Additional Information
To convert WORD data to DINT data, refer to WORD_TO_DINT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not DINT#0 to DINT#65535, a cast error will occur and the program will stop.
SAFEDINT
TIME
SAFETIME
2 - 34
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 69
INT_TO_BYTE
This function converts an INT variable to a BYTE variable.
InstructionNameFB/FUNGraphic expression
INT_TO_BYTEConvert INT to
BYTE
FUN
2 Standard Functions
Data Type Conversion Instructions
INT_TO_BYTE
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
INT#0 to 255INT#0
BYTE#16#00 to FFBYTE#16#00
SAFEDWORD
INT
Function
This function converts INT data In to BYTE data Out.
SAFEINT
DINT
SAFEDINT
TIME
2
INT_TO_BYTE
SAFETIME
Additional Information
To convert BYTE data to INT data, refer to BYTE_TO_INT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not INT#0 to INT#255, a cast error will occur and the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 35
Page 70
2 Standard Functions
INT_TO_DWORD
INT_TO_DWORD
This function converts an INT variable to a DWORD variable.
InstructionNameFB/FUNGraphic expression
INT_TO_DWORDConvert INT to
DWORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
INT#−32768 to 32767INT#0
DWORD#16#00000000
to FFFFFFFFF
DWORD#16#00000000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts INT data In to DWORD data Out.
Example When Value of In Is Positive (INT#0 to INT#32767)
• The value of Out is DWORD#16#00000000 to DWORD#16#00007FFF according to the value of
In (INT#0 to INT#32767).
Example When Value of In Is Negative (INT#−32768 to INT#−1)
• If the value of In is INT#−32 7 6 8 (1111 1111 1111 1111 1000 0000 0 0 0 0 0000 bi n a r y ) , the val ue of
Out is DWORD#16#FFFF8000.
• If the value of In is INT#−1 ( 1111 1111 1111 1111 1111 1111 1111 1111 bin a r y ) , the valu e o f Out is
DWORD#16#FFFFFFFF.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Additional Information
There is no instruction that converts DWORD data to INT data.
2 - 36
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 71
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Data Type Conversion Instructions
2
INT_TO_DWORD
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 37
Page 72
2 Standard Functions
INT_TO_WORD
INT_TO_WORD
This function converts an INT variable to a WORD variable.
InstructionNameFB/FUNGraphic expression
INT_TO_WORDConvert INT to
WORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
vert
OutputConversion
result
FUN
INT#−32768 to 32767INT#0
WORD#16#0000 to FFFF WORD#16#0000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
Function
This function converts INT data In to WORD data Out.
Example When Value of In Is Positive (INT#0 to INT#32767)
• The value of Out is WORD#16#0000 to WORD#16#7FFF according to the value of In (INT#0 to
INT#32767).
Example When Value of In Is Negative (INT#−32768 to INT#−1)
• If the value of In is INT#−32768 (1000 0000 0000 0000 binary), the value of Out is
WORD#16#8000.
• If the value of In is INT#−1 ( 1111 1111 1111 1111 b i n ary), the v a l u e of Out is WORD#16#FFFF.
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Additional Information
To convert WORD data to INT data, refer to WORD_TO_INT.
2 - 38
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 73
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Data Type Conversion Instructions
2
INT_TO_WORD
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 39
Page 74
2 Standard Functions
DINT_TO_INT
DINT_TO_INT
This function converts a DINT variable to an INT variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_INTConvert DINT to
INT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
DINT#−32768 to 32767DINT#0
vert
INT#−32768 to 32767INT#0
result
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts DINT data In to INT data Out.
Additional Information
To convert INT data to DINT data, refer to INT_TO_DINT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not DINT#−32768 to DINT#32767, a cast error will occur and the program will
stop.
SAFEDINT
TIME
SAFETIME
2 - 40
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 75
INT_TO_DINT
This function converts an INT variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
INT_TO_DINTConvert INT to
DINT
FUN
2 Standard Functions
Data Type Conversion Instructions
INT_TO_DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
OutputConversion
BYTE
SAFEBYTE
WORD
vert
result
SAFEWORD
DWORD
INT#−32768 to 32767INT#0
DINT#−32768 to #32767DINT#0
SAFEDWORD
INT
SAFEINT
DINT
Function
This function converts INT data In to DINT data Out.
SAFEDINT
TIME
2
INT_TO_DINT
SAFETIME
Example When Value of In Is INT#−32768 to INT#32767
• The value of Out will be DINT#−32768 to DINT#32767.
Additional Information
To convert DINT data to INT data, refer to DINT_TO_INT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 41
Page 76
2 Standard Functions
DINT_TO_TIME
DINT_TO_TIME
This function converts a DINT variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
DINT_TO_TIMEConvert DINT to
TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputIntegerDINT#0 to 2147483647DINT#0
OutputDurationT#0ms to
FUN
T#0ms
T#24d20h31m23s647ms
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts DINT data In to TIME data Out.
Example When Value of In Is DINT#90090090
• The value of Out is 1 day 1 h 1 min 30 s 90 ms (T#1d1h1m30s090ms).
Additional Information
To convert TIME data to DINT data, refer to TIME_TO_DINT.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not DINT#0 to DINT#2147483647, a cast error will occur and the program will
stop.
2 - 42
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 77
INT_TO_TIME
This function converts an INT variable to a TIME variable.
InstructionNameFB/FUNGraphic expression
INT_TO_TIMEConvert INT to
TIME
FUN
2 Standard Functions
Data Type Conversion Instructions
INT_TO_TIME
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputData to con-
vert
OutputDurationT#0ms to T#32s767msT#0ms
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
INT#0 to 32767INT#0
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts INT data In to TIME data Out.
2
INT_TO_TIME
SAFETIME
Example When Value of In Is INT#10500
• The value of Out is 10 s 500 ms (T#10s500ms).
Additional Information
To convert TIME data to INT data, refer to TIME_TO_INT.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not INT#0 to INT#32767, a cast error will occur and the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 43
Page 78
2 Standard Functions
TIME_TO_BOOL
TIME_TO_BOOL
This function converts a TIME variable to a BOOL variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_BOOLConvert TIME to
BOOL
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputDurationT#0ms to
OutputConversion
FUN
result
T#0ms
T#49d17h2m47s295ms
TRUE or FALSEFALSE
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to BOOL data Out.
If the value of In is 0 ms (T#0ms), the value of Out is FALSE.
If the value of In is 1 ms (T#1ms) to 49 days 17 h 2 min 47 s 295 ms (T#49d17h2m47s295ms) (i.e., not
T#0ms), the value of Out is TRUE.
Additional Information
To convert BOOL data to TIME data, refer to BOOL_TO_TIME.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 44
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 79
TIME_TO_BYTE
This function converts a TIME variable to a BYTE variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_BYTEConvert TIME to
BYTE
FUN
2 Standard Functions
Data Type Conversion Instructions
TIME_TO_BYTE
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputDurationT#0ms to T#255msT#0ms
OutputConversion
BYTE
SAFEBYTE
WORD
result
SAFEWORD
DWORD
BYTE#16#00 to FFBYTE#16#00
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to BYTE data Out.
2
TIME_TO_BYTE
SAFETIME
Additional Information
To convert BYTE data to TIME data, refer to BYTE_TO_TIME.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not TIME#0ms to TIME#255ms, a cast error will occur and the program will stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 45
Page 80
2 Standard Functions
TIME_TO_DWORD
TIME_TO_DWORD
This function converts a TIME variable to a DWORD variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_DWORDConvert TIME to
DWORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputDurationT#0ms to
OutputConversion
FUN
result
T#49d17h2m47s295ms
DWORD#16#00000000
to FFFFFFFF
T#0ms
DWORD#16#00000000
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to DWORD data Out.
Example When Value of In Is 49 days 17 h 2 min 47 s 295 ms (T#49d17h2m47s295ms)
• The value of Out will be DWORD#16#FFFFFFFF.
Additional Information
To convert DWORD data to TIME data, refer to DWORD_TO_TIME.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 46
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 81
TIME_TO_WORD
This function converts a TIME variable to a WORD variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_WORDConvert TIME to
WORD
FUN
2 Standard Functions
Data Type Conversion Instructions
TIME_TO_WORD
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputDurationT#0ms to T#65s535msT#0ms
OutputConversion
BYTE
SAFEBYTE
WORD
result
SAFEWORD
DWORD
WORD#16#0000 to FFFF WORD#16#0000
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to WORD data Out.
2
TIME_TO_WORD
SAFETIME
Example When Value of In Is 50 s 505 ms (T#50s505ms)
• The value of Out will be WORD#16#C549.
Additional Information
To convert WORD data to TIME data, refer to WORD_TO_TIME.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not TIME#0ms to TIME#65s535ms, a cast error will occur and the program will
stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 47
Page 82
2 Standard Functions
TIME_TO_DINT
TIME_TO_DINT
This function converts a TIME variable to a DINT variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_DINTConvert TIME to
DINT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputDurationT#0ms to
OutputIntegerDINT#0 to 2147483647DINT#0
FUN
T#0ms
T#49d17h2m47s295ms
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to DINT data Out.
Example When Value of In Is 1 day 1 h 1 min 30 s 90 ms (T#1d1h1m30s090ms)
• The value of Out will be DINT#90090090.
Additional Information
To convert DINT data to TIME data, refer to DINT_TO_TIME.
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 48
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 83
TIME_TO_INT
This function converts a TIME variable to an INT variable.
InstructionNameFB/FUNGraphic expression
TIME_TO_INTConvert TIME to
INT
FUN
2 Standard Functions
Data Type Conversion Instructions
TIME_TO_INT
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
InputDurationT#0ms to T#32s767msT#0ms
OutputConversion
BYTE
SAFEBYTE
WORD
result
SAFEWORD
DWORD
INT#0 to 32767INT#0
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function converts TIME data In to INT data Out.
2
TIME_TO_INT
SAFETIME
Example When Value of In Is 10 s 500 ms (T#10s500ms)
• The value of Out will be INT#10500.
Additional Information
To convert INT data to TIME data, refer to INT_TO_TIME.
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not TIME#0ms to TIME#32s767ms, a cast error will occur and the program will
stop.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 49
Page 84
2 Standard Functions
WORD_TO_BOOL
WORD_TO_BOOL
This function converts a WORD variable to a BOOL variable.
InstructionNameFB/FUNGraphic expression
WORD_TO_BOOLConvert WORD
to BOOL
Variables
NameI/ODescriptionValid rangeDefault
InData to con-
vert
OutConversion
result
If you omit an input or output parameter, a building error will occur.
InputData to con-
OutputConversion
FUN
vert
result
WORD#16#0000 to FFFF WORD#16#0000
TRUE or FALSEFALSE
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
Function
This function converts WORD data In to BOOL data Out.
If the value of In is WORD#16#0000, the value of Out is FALSE.
If the value of In is WORD#16#0001 to WORD#16#FFFF (i.e., not WORD#16#0000), the value of Out
is TRUE.
Additional Information
To convert BOOL data to WORD data, refer to BOOL_TO_WORD.
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Precautions for Correct Use
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If the input value is not WORD#0 or WORD#1, a cast error will occur and the program will stop.
2 - 50
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 85
Boolean Operation Instructions
TypeInstructionNameDescriptionPage
Boolean operationsANDLogical ANDPerforms a logical AND on
multiple Boolean variables.
ORLogical ORPerforms a logical OR on
multiple Boolean variables.
XORExclusive
logical OR
NOTBit ReversalReverses the value of a
Performs an exclusive logical OR on multiple Boolean
variables.
Boolean variable.
2
P. 2 -5 2
P. 2 -5 2
P. 2 -5 2
P. 2 -5 4
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 51
Page 86
2 Standard Functions
AND, OR, and XOR
These instructions perform Boolean operations.
AND: Logical AND
OR: Logical OR
XOR: Exclusive logical OR
InstructionNameFB/FUNGraphic expression
ANDLogical ANDFUN
AND
ORLogical ORFUN
XORExclusive logical ORFUN
Variables
NameI/ODescriptionValid rangeDefault
In1 to InNData to pro-
cess
OutProcessing
result
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.
BooleanBit stringsIntegersDurations
BOOL
SAFEBOOL
InputData to pro-
cess
OutputProcessing
result
BYTE
SAFEBYTE
WORD
SAFEWORD
TRUE or FALSEFALSE
TRUE or FALSE---
DWORD
SAFEDWORD
INT
SAFEINT
OR
XOR
DINT
SAFEDINT
TIME
SAFETIME
In1 to InN OKOK
OutOKOK
2 - 52
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 87
Function
These instructions perform operations for two or more Boolean variables In1 to InN.
The relationships between input and output variables are given in the following tables.
AND: If all inputs are TRUE, then the processing result is TRUE. Otherwise, the processing result is
FALSE.
OR: If all inputs are FALSE, then the processing result is FALSE. Otherwise, the processing result is
TRUE.
XOR: If both inputs have the same value, then the processing result is FALSE. If one bit is TRUE
and the other is FALSE, then the processing result is TRUE.
In1 bitIn2 bitOut bit
FALSEFALSEFALSE
FALSETRUETRUE
TRUEFALSETRUE
TRUETRUEFALSE
Additional Information
With AND and OR, you can perform an operation for two or more variables, In1 to InN, at the same
time. With XOR, however, you can perform an operation for only two variables, In1 and In2, at the same
time. A building error will occur if there are three or more input terminals for XOR.
Precautions for Correct Use
• You must use Boolean variables for In1 to InN and for Out.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
Setting a Safety Data Type Variable for the Output Terminal
AND: Set a safety data type variable for at least one of the input terminals.
OR/XOR: Set safety data type variables for all of the input terminals.
Setting a Standard Data Type Variable for the Output Terminal
AND/OR/XOR: Use either safety data type variable or standard data type variable for the input terminals.
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 53
Page 88
2 Standard Functions
NOT
NOT
This function reverses the value of a Boolean bit.
InstructionNameFB/FUNGraphic expression
NOTBit ReversalFUN
Variables
NameI/ODescriptionValid rangeDefault
InData to pro-
cess
OutProcessing
result
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.
InputData to pro-
cess
OutputProcessing
result
TRUE or FALSE---
TRUE or FALSEFALSE
BooleanBit stringsIntegersDurations
BOOL
InOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
Function
This function reverses the TRUE/FALSE value of the Boolean variable In.
The relationships between input and output variables are given in the following table.
In bitOut bit
FALSETRUE
TRUEFALSE
Precautions for Correct Use
• You must use Boolean variables for In and Out.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the
input terminal as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
2 - 54
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 89
Math Instructions
TypeInstructionNameDescriptionPage
MathADDAdditionAdds integers or durations.P. 2-56
SUBSubtractionSubtracts integers or dura-
tions.
MULMultiplication Multiplies integers or a dura-
tion.
DIVDivisionDivides integers or a dura-
tion.
P. 2 -5 8
P. 2 -6 0
P. 2 -6 2
2
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 55
Page 90
2 Standard Functions
ADD
This function adds integers or durations.
InstructionNameFB/FUNGraphic expression
ADDAdditionFUN
Variables
NameI/ODescriptionValid rangeDefault
In1 to InNValues to addInputValues to addDepends on data type.--OutOutput valueOutputOutput valueDepends on data type.---
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.
ADD
BooleanBit stringsIntegersDurations
BOOL
In1 to InNOKOKOKOKOKOK
OutOKOKOKOKOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
This function adds integers or durations, and outputs the result to output value Out.
An overflow occurs if the sum of In1 to InN exceeds the valid range of the data type of the addition
result. If an overflow occurs, the data types of In1 to InN, the data type of the addition result, and the
value of the addition result will be as shown in the following table.
I/O data typesValue of addition results
IntegersOf the sum of In1 to InN, the addition result will be the value that can be expressed by the
number of bits in the data type of the addition result.
DurationsOf the sum of In1 to InN, the addition result will be the value that can be expressed with
DWORD data.
*1. For example, if the value of In1 is INT#32767 and the value of In2 is INT#3, the addition result will be 32770.
If an INT variable is set for the output, the value of the addition result will be the value that can be expressed
with lower 16 bits of the sum (32,770), i.e., −32,766. If a DINT variable is set for the output, the addition result
is DINT#32770.
*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.
*3. For example, if the value of In1 is TIME#49d17h2m47s295ms and the value of In2 is TIME#5ms, the value of
the addition result is TIME#49d17h2m47s30ms. However, the maximum value of TIME is the same as for
DWORD (4294967295), so the addition result will be the value that can be expressed with 32 bits, i.e.,
TIME#4ms.
*3
*1*2
SAFETIME
2 - 56
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 91
Precautions for Correct Use
• The data types of In1 to InN and Out can be different. If they are different, calculations are performed
with the data type that includes the range of all of the data types. For example, if In0 is INT data and
In1 is DINT data, calculations are performed with DINT data. Therefore, addition result Out will be
DINT data.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set safety data type variables for all of
the input terminals.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Math Instructions
2
ADD
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 57
Page 92
2 Standard Functions
SUB
This function subtracts integers or durations.
InstructionNameFB/FUNGraphic expression
SUBSubtractionFUN
Variables
NameI/ODescriptionValid rangeDefault
In1MinuendInputMinuendDepends on data type.--In2SubtrahendInputSubtrahendDepends on data type.--OutOutput valueOutputOutput valueDepends on data type.---
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.
SUB
BooleanBit stringsIntegersDurations
BOOL
In1OKOKOKOKOKOK
In2OKOKOKOKOKOK
OutOKOKOKOKOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
Function
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.
I/O data typesValue of subtraction results
IntegersOf 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.
DurationsOf the difference between In1 and In2, the subtraction result will be the value that can be
expressed by DWORD data.
*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.
*3
*1*2
SAFETIME
2 - 58
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 93
*3. For example, if the value of In1 is TIME#10ms and the value of In2 is TIME#14ms, the value of the subtraction
result is TIME#−4ms. However, the maximum value of TIME is the same as for DWORD (4294967295), so the
subtraction result will be the value that can be expressed with 32 bits, i.e., T#49d17h2m47s292ms.
Although negative time does not actually exist, the value is expressed as a negative value.
Precautions for Correct Use
• The data types of In1, In2, and Out can be different. If they are different, calculations are performed
with the data type that includes the range of all of the data types. For example, if In0 is INT data and
In1 is DINT data, calculations are performed with DINT data. Therefore, subtraction result Out will be
DINT data.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the two
input terminals as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Math Instructions
2
SUB
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 59
Page 94
2 Standard Functions
MUL
This function multiplies integers or a duration.
InstructionNameFB/FUNGraphic expression
MULMultiplicationFUN
Variables
NameI/ODescriptionValid rangeDefault
In1 to InNValues to mul-
tiply
OutOutput valueOutputOutput valueDepends on data type.---
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.
InputValues to mul-
tiply
Depends on data type.---
MUL
BooleanBit stringsIntegersDurations
BOOL
In1OKOKOKOKOKOK
In2 to
InN
OutOKOKOKOKOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
OKOKOKOK
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Function
This function multiplies multiply values In1 to InN and outputs the result to output value Out.
An overflow occurs if the product of In1 to InN exceeds the valid range of the data type of the multiplication result. If an overflow occurs, the data types of In1 to InN, the data type of the multiplication result,
and the value of the multiplication result will be as shown in the following table.
I/O data typesValue of multiplication results
IntegersOf the product of In1 to InN, the multiplication result will be the value that can be expressed
by the number of bits in the data type of the addition result.
DurationsOf the product of In1 to InN, the multiplication result will be the value that can be expressed
with DWORD data.
*1. For example, if the value of In1 is INT#16390 and the value of In2 is INT#2, the multiplication result will be
32780. If an INT variable is set for the output, the value of the multiplication result will be the value that can be
expressed with lower 16 bits of the product (32,780), i.e., −32,756. If a DINT variable is set for the output, the
addition result is DINT#32780.
*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.
*3
*1*2
2 - 60
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 95
*3. For example, if the value of In1 is T#24d20h31m23s649ms and the value of In2 is INT#2, the value of the mul-
tiplication result is T#49d17h2m47s298ms. However, the maximum value of TIME is the same as for DWORD
(4294967295), so the multiplication result will be the value that can be expressed with 32 bits, i.e., T#2ms.
Additional Information
You cannot include more than one duration in the values to multiply.
To multiply a duration, set a duration for In1 and Out and set integers for In2 to InN.
Precautions for Correct Use
• When multiplying integers, the data types of In1 to InN and Out can be different. 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. Therefore, multiplication result Out will be DINT data.
• If you use duration data for the data to multiply, use duration data for one of In1 to InN and for Out.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur. If you set a safety data type variable for the output terminal, set
safety data type variables for all of the input terminals.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
• If you set a safety data type variable for the output terminal, set safety data type variables for all of
the input terminals.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Math Instructions
2
MUL
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 61
Page 96
2 Standard Functions
DIV
This function divides integers or a duration.
InstructionNameFB/FUNGraphic expression
DIVDivisionFUN
Variables
NameI/ODescriptionValid rangeDefault
In1DividendInputDividendDepends on data type.--In2DivisorInputDivisorDepends on data type.--OutOutput valueOutputOutput valueDepends on data type.---
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.
DIV
BooleanBit stringsIntegersDurations
BOOL
In1OKOKOKOKOKOK
In2OKOKOKOK
OutOKOKOKOKOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Function
This function divides dividend In1 by divisor In2 and outputs the result to output value Out.
Any remainder is truncated.
Additional Information
You cannot include more than one duration in the values to divide.
To divide a duration, set a duration for In1 and Out and set an integer for In2.
Do not allow the divisor to equal 0.
If the divisor is 0, a Division by Zero error will occur and the program will stop.
2 - 62
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 97
Precautions for Correct Use
• The data types of In1, In2, and Out can be different. 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. Therefore, division result Out will be
DINT data.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the two
input terminals as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 Standard Functions
Math Instructions
2
DIV
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 63
Page 98
2 Standard Functions
2 - 64
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Page 99
Comparison Instructions
TypeInstructionNameDescriptionPage
ComparisonEQEqualDetermines if the values of
two variables are equivalent.
NENot EqualDetermines if the values of
two variables are not equivalent.
LTLess ThanPerforms a less than com-
parison between two values.
LELess Than
Or Equal
GTGreater
Than
GEGreater
Than Or
Equal
Performs a less than or
equal comparison between
two values.
Performs a greater than
comparison between two
values.
Performs a greater than or
equal comparison between
two values.
2
P. 2 -6 6
P. 2 -6 7
P. 2 -6 8
P. 2 -6 8
P. 2 -6 8
P. 2 -6 8
NX-series Safety Control Unit Instructions Reference Manual (Z931)
2 - 65
Page 100
2 Standard Functions
EQ
This function determines if the values of two variables are equivalent.
InstructionNameFB/FUNGraphic expression
EQEqualFUN
Variables
NameI/ODescriptionValid rangeDefault
In1 or In2Comparison
data
OutComparison
result
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.
InputValues to com-
pare
OutputComparison
result
EQ
Depends on data type.---
Depends on data type.---
BooleanBit stringsIntegersDurations
BOOL
In1 or In2OKOKOKOKOKOKOKOKOKOKOKOKOKOK
OutOKOK
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
Function
This function determines if the values of two variables In1 and In2 are equivalent.
If they are equivalent, comparison result Out changes to TRUE. Otherwise, the value of Out is FALSE.
Precautions for Correct Use
• You can compare In1 and In2 even if they have different data types, such as a safety data type and a
standard data type, as long as the notations and sizes of the data types are the same. You cannot
compare data with data types that have different notations or sizes, such as WORD and INT. You can
compare integer data, such as INT data with SAFEINT data and DINT data with SAFEDINT data.
• The input condition depends on whether the output is safety data or standard data. If the condition is
not met, a building error will occur.
• If you set a safety data type variable for the output terminal, set a safety data type variable for the two
input terminals as well.
• If you set a standard data type variable for the output terminal, you can set either a safety data type
variable or a standard data type variable for the input terminal.
2 - 66
NX-series Safety Control Unit Instructions Reference Manual (Z931)
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.