CPU Unit Software: User's Manual
CPU Unit Software: User's Manual
CPU Unit Software: User's Manual
NJ/NX-series
CPU Unit
Software
User’s Manual
NX701-1
NX102-1
NX102-90
NX1P2-1
NX1P2-9
NJ501-
NJ301-1
NJ101-10
NJ101-90
CPU Unit
W501-E1-40
NOTE
1. 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.
2. 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 infor-
mation contained in this manual is subject to change without notice.
3. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON as-
sumes 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, Excel, Visual Basic, and Microsoft Edge 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.
• ODVA, CIP, CompoNet, DeviceNet, and EtherNet/IP are trademarks of ODVA.
Other company names and product names in this document are the trademarks or registered trade-
marks of their respective companies.
Copyrights
• Microsoft product screen shots used with permission from Microsoft.
• This product incorporates certain third party software. The license and copyright information associ-
ated with this software is available at http://www.fa.omron.co.jp/nj_info_e/.
Introduction
Introduction
Thank you for purchasing an NJ/NX-series CPU Unit.
This manual contains information that is necessary to use the NJ/NX-series CPU Unit. Please read
this manual and make sure you understand the functionality and performance of the NJ/NX-series
CPU Unit before you attempt to use it 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 sys-
tems (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.
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.
Applicable Products
This manual covers the following products.
Part of the specifications and restrictions for the products may be given in other manuals.
Refer to Relevant Manuals on page 2 and Related Manuals on page 25.
Troubleshooting Manual
Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac
The following table provides the relevant manuals for the NJ/NX-series CPU Units. Read all of the
¡
User’s Manual
NJ-series SECS/GEM CPU Units
User's Manual
NJ/NX-series Database Connection CPU Units
User's Manual
NX-series CPU Unit
FINS User’s Manual
NJ/NX-series CPU Unit OPC UA
User’s Manual
NJ/NX-series CPU Unit
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit
¡
Motion Control User’s Manual
NJ/NX-series
Instructions Reference Manual
NX-series NX1P2 CPU Unit
Built-in I/O and Option Board User's Manual
Basic information
¡
Hardware User’s Manual
NX-series NX1P2 CPU Unit
¡
Hardware User’s Manual
NX-series NX102 CPU Unit
¡
¡
Hardware User’s Manual
NX-series CPU Unit
¡
Hardware User’s Manual
Using EtherNet/IP
Using EtherCAT
RON robots
trollers
Units
Units
Units
2
3
Relevant Manuals
NJ/NX-series
¡
Troubleshooting Manual
NJ/NY-series NC Integrated Controller
¡
¡
User’s Manual
NJ-series NJ Robotics CPU Unit
¡
¡
User's Manual
NJ-series Robot Integrated CPU Unit
¡
¡
User’s Manual
NJ-series SECS/GEM CPU Units
¡
¡
User's Manual
NJ/NX-series Database Connection CPU Units
¡
¡
User's Manual
NX-series CPU Unit
¡
¡
FINS User’s Manual
NJ/NX-series CPU Unit OPC UA
¡
¡
User’s Manual
NJ/NX-series CPU Unit
¡
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
¡
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit
¡
¡
Motion Control User’s Manual
NJ/NX-series
¡
Instructions Reference Manual
NX-series NX1P2 CPU Unit
¡
Built-in I/O and Option Board User's Manual
Basic information
¡
Software User’s Manual
Using EtherNet/IP
Using EtherCAT
Using EtherCAT
Using OPC UA
Using OPC UA
Software settings
botics function
botics function
RON robots
RON robots
Using FINS
Using FINS
tion service
tion service
functions
functions
ing
NJ/NX-series CPU Unit Software User’s Manual (W501)
NJ/NX-series
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the error management concepts and the error items. However,
refer to the manuals that are indicated with triangles for details on errors corresponding to the products with the manuals that are indi-
Troubleshooting Manual ¡
NJ/NY-series NC Integrated Controller
r
¡
User’s Manual
NJ-series NJ Robotics CPU Unit
r
¡
User's Manual
NJ-series Robot Integrated CPU Unit
r
¡
User’s Manual
NJ-series SECS/GEM CPU Units
r
¡
User's Manual
NJ/NX-series Database Connection CPU Units
r
¡
User's Manual
NX-series CPU Unit
r
¡
r
¡
User’s Manual
NJ/NX-series CPU Unit
¡
¡
Built-in EtherNet/IP Port User’s Manual
Manual
¡
Built-in EtherCAT Port User´s Manual
NJ/NX-series
Motion Control Instructions Reference Manual
NJ/NX-series CPU Unit
¡
¡
Motion Control User’s Manual
NJ/NX-series
Instructions Reference Manual
NX-series NX1P2 CPU Unit
¡
Built-in I/O and Option Board User's Manual
Basic information
¡
Software User’s Manual
NJ-series CPU Unit
¡
Hardware User’s Manual
NX-series NX1P2 CPU Unit
¡
Hardware User’s Manual
NX-series NX102 CPU Unit
¡
Hardware User’s Manual
NX-series CPU Unit
¡
Hardware User’s Manual
Using EtherNet/IP
Using EtherCAT
Using EtherCAT
Using OPC UA
botics function
RON robots
Using FINS
tion service
Maintenance
functions
ging
*1.
4
Manual Structure
Manual Structure
Page Structure
The following page structure is used in this manual.
A step in a procedure 1 Join the Units so that the connectors fit exactly.
4-3 Mo u n t i n g U n i t s
4 Page tab
2 Gives the number
Lock
Release
Slider
Manual name NJ-series CPU Unit Hardware User’s Manual (W500) 4-9
This illustration is provided only as a sample. It may not literally appear in this manual.
Special Information
Special information in this manual is classified as follows:
Additional Information
Additional information to read as required.
This information is provided to increase understanding or make operation easier.
Version Information
Information on differences in specifications and functionality for Controller with different unit versions
and for different versions of the Sysmac Studio is given.
Precaution on Terminology
In this manual, "download" refers to transferring data from the Sysmac Studio to the physical Control-
ler and "upload" refers to transferring data from the physical Controller to the Sysmac Studio.
For the Sysmac Studio, "synchronization" is used to both "upload" and "download" data. Here,
"synchronize" means to automatically compare the data for the Sysmac Studio on the computer with
the data in the physical Controller and transfer the data in the direction that is specified by the user.
1 10
2 11
Introduction to
1 NJ/NX-series Controllers 10 Communications Setup
3 12
CPU Unit Example of Actual
2 Operation 11 Application Procedures
4 A
I/O Ports, Slave
3 Configuration, and
Unit Configuration
12 Troubleshooting
5 I
7
5 Designing Tasks I Index
8
6 Programming
9
Checking Operation and
7 Actual Operation
9 Backup Functions
CONTENTS
Introduction .............................................................................................................. 1
Intended Audience...........................................................................................................................................1
Applicable Products .........................................................................................................................................1
Relevant Manuals..................................................................................................... 2
Manual Structure...................................................................................................... 5
Page Structure.................................................................................................................................................5
Special Information ..........................................................................................................................................6
Precaution on Terminology ..............................................................................................................................6
Safety Precautions................................................................................................. 20
Versions .................................................................................................................. 24
Unit Versions of CPU Units and Sysmac Studio Versions .............................................................................24
Related Manuals..................................................................................................... 25
Terminology............................................................................................................ 30
Revision History..................................................................................................... 35
Section 6 Programming
6-1 Overview of Programming Procedures ...............................................................................6-3
6-2 POUs (Program Organization Units) ....................................................................................6-5
6-2-1 What Are POUs?.........................................................................................................................6-5
6-2-2 Overview of the Three Types of POUs........................................................................................6-5
6-2-3 Differences between Programs, Functions, and Function Blocks ...............................................6-6
6-2-4 Details on Programs....................................................................................................................6-7
6-2-5 Details on Function Blocks ..........................................................................................................6-8
6-2-6 Details on Functions..................................................................................................................6-16
6-2-7 Operation That Applies to Both Functions and Function Blocks ...............................................6-22
6-2-8 POU Restrictions.......................................................................................................................6-25
6-3 Variables ...............................................................................................................................6-28
6-3-1 Variables....................................................................................................................................6-28
6-3-2 Types of Variables .....................................................................................................................6-28
6-3-3 Types of User-defined Variables in Respect to POUs...............................................................6-28
6-3-4 Attributes of Variables ...............................................................................................................6-30
6-3-5 Data Types ................................................................................................................................6-32
6-3-6 Derivative Data Types ...............................................................................................................6-41
6-3-7 Array Specifications and Range Specifications for Data Types ................................................6-51
6-3-8 Variable Attributes .....................................................................................................................6-60
6-3-9 Changes to Variables for Status Changes ................................................................................6-68
6-3-10 Function Block Instances ..........................................................................................................6-82
6-3-11 Monitoring Variable Values........................................................................................................6-82
6-3-12 Restrictions on Variable Names and Other Program-related Names........................................6-83
6-4 Constants (Literals) .............................................................................................................6-85
6-4-1 Constants ..................................................................................................................................6-85
6-4-2 Notation for Different Data Types ..............................................................................................6-85
6-5 Programming Languages....................................................................................................6-90
6-5-1 Programming Languages ..........................................................................................................6-90
6-5-2 Ladder Diagram Language .......................................................................................................6-90
6-5-3 Structured Text Language .........................................................................................................6-97
6-6 Instructions ........................................................................................................................6-133
6-6-1 Instructions ..............................................................................................................................6-133
6-6-2 Basic Understanding of Instructions........................................................................................6-133
6-6-3 Instruction Errors .....................................................................................................................6-135
6-7 Namespaces .......................................................................................................................6-141
6-7-1 Namespaces ...........................................................................................................................6-141
6-7-2 Namespace Specifications ......................................................................................................6-142
6-7-3 Procedure for Using Namespaces ..........................................................................................6-145
6-8 Libraries..............................................................................................................................6-146
6-8-1 Introduction to Libraries...........................................................................................................6-146
6-8-2 Specifications of Libraries .......................................................................................................6-146
6-8-3 Library Object Specifications...................................................................................................6-147
6-8-4 Procedure to Use Libraries .....................................................................................................6-148
6-9 Programming Precautions ................................................................................................6-150
6-9-1 Array Specifications for Input Variables, Output Variables, In-Out Variables ..........................6-150
6-9-2 Structure Variables for Input Variables, Output Variables, In-Out Variables............................6-150
6-9-3 Master Control.........................................................................................................................6-151
Section 12 Troubleshooting
12-1 Overview of Troubleshooting .............................................................................................12-2
Appendices
A-1 Specifications........................................................................................................................ A-3
A-1-1 General Specifications ............................................................................................................... A-3
A-1-2 Performance Specifications ....................................................................................................... A-3
A-1-3 Function Specifications ............................................................................................................ A-15
A-2 Calculating Guidelines for the Real Processing Times of Tasks for the NX701 SystemA-25
A-2-1 Calculating the Average Real Processing Times of Tasks ....................................................... A-26
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the
Task Period .............................................................................................................................. A-34
A-3 Calculating Guidelines for the Real Processing Times of Tasks for the NX102 SystemA-37
A-3-1 Calculating the Average Real Processing Times of Tasks ....................................................... A-38
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the
Task Period .............................................................................................................................. A-45
A-4 Calculating Guidelines for the Real Processing Times of Tasks for the NX1P2
System ................................................................................................................................. A-48
A-4-1 Calculating the Average Real Processing Times of Tasks ....................................................... A-49
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the
Task Period .............................................................................................................................. A-56
A-5 Calculating Guidelines for the Real Processing Times of Tasks for the NJ-ser-
ies System ........................................................................................................................... A-59
A-5-1 Calculating the Average Real Processing Times of Tasks ....................................................... A-60
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the
Task Period .............................................................................................................................. A-71
A-6 System-defined Variables .................................................................................................. A-75
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)................... A-76
A-6-2 PLC Function Module, Category Name: _PLC ........................................................................ A-86
A-6-3 PLC Function Module, Category Name: _CJB......................................................................... A-91
A-6-4 NX Bus Function Module, Category Name: _NXB ................................................................... A-93
A-6-5 Motion Control Function Module, Category Name: _MC ......................................................... A-97
A-6-6 EtherCAT Master Function Module, Category Name: _EC ...................................................... A-99
A-6-7 EtherNet/IP Function Module, Category Name: _EIP ............................................................ A-106
A-6-8 Meanings of Error Status Bits ................................................................................................ A-137
A-7 Specifications for Individual System-defined Variables ............................................... A-139
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)................. A-139
A-7-2 PLC Function Module, Category Name: _PLC ...................................................................... A-158
A-7-3 PLC Function Module, Category Name: _CJB....................................................................... A-164
A-7-4 NX Bus Function Module, Category Name: _NXB ................................................................. A-168
A-7-5 Motion Control Function Module, Category Name: _MC ....................................................... A-171
A-7-6 EtherCAT Master Function Module, Category Name: _EC .................................................... A-175
A-7-7 EtherNet/IP Function Module, Category Name: _EIP ............................................................ A-184
A-8 Attributes of CPU Unit Data ............................................................................................. A-210
A-9 Contents of Memory Used for CJ-series Units .............................................................. A-216
A-9-1 CIO Area ................................................................................................................................ A-216
A-9-2 Internal I/O Area ..................................................................................................................... A-219
A-9-3 Holding Area .......................................................................................................................... A-219
A-9-4 DM Area ................................................................................................................................. A-219
A-9-5 EM Area ................................................................................................................................. A-220
A-10 Variable Memory Allocation Methods ............................................................................. A-221
A-10-1 Variable Memory Allocation Rules.......................................................................................... A-221
A-10-2 Important Case Examples ...................................................................................................... A-230
A-11 Registering a Symbol Table on the CX-Designer........................................................... A-234
A-12 Enable/Disable EtherCAT Slave and Axes...................................................................... A-237
A-12-1 Project Settings When Using EtherCAT Slaves and Axes ..................................................... A-237
A-12-2 Using Instructions to Enable/Disable EtherCAT Slaves and Axes ......................................... A-237
A-12-3 System-defined Variables That Indicate EtherCAT Slave or Axis Status ............................... A-238
A-12-4 Enabling/Disabling Execution of Program .............................................................................. A-239
A-12-5 Checking Enabled/Disabled Program .................................................................................... A-239
Index
Warranties
l Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and work-
manship for a period of twelve months from the date of sale by Omron (or such other period ex-
pressed in writing by Omron). Omron disclaims all other warranties, express or implied.
l 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.
l 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-com-
plying 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 re-
sponsible 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 Compa-
nies 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.
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.
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 Buy-
er’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 par-
ticular Product with respect to Buyer’s application, product or system. Buyer shall take application re-
sponsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY OR IN LARGE QUANTITIES 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 EQUIP-
MENT OR SYSTEM.
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 per-
formance 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 oth-
er 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 estab-
lish key specifications for your application. Please consult with your Omron’s representative at any
time to confirm actual specifications of purchased Product.
It shall be the users sole responsibility to determine and use adequate measures and checkpoints to
satisfy the users particular requirements for (i) antivirus protection, (ii) data input and output, (iii) main-
taining a means for reconstruction of lost data, (iv) preventing Omron Products and/or software instal-
led thereon from being infected with computer viruses and (v) protecting Omron Products from unau-
thorized access.
Safety Precautions
Refer to the following manuals for safety precautions.
• NX-series CPU Unit Hardware User's Manual (Cat. No. W535)
• NX-series NX102 CPU Unit Hardware User's Manual (Cat. No. W593)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat No. W500)
• OpenSSL
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit
(http://www.openssl.org/).
Copyright (C) 1998-2019 The OpenSSL Project. All rights reserved.
Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved.
This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com)
For the products that support secure socket service, refer to 8-5-6 Secure Socket Services on page
8-42.
For the products that support secure communication, refer to 8-5-5 Secure Communication Function
on page 8-41.
Versions
Hardware revisions and unit versions are used to manage the hardware and software in NJ/NX-series
Units and EtherCAT slaves. The hardware revision or unit version is updated each time there is a
change in hardware or software specifications. Even when two Units or EtherCAT slaves have the
same model number, they will have functional or performance differences if they have different hard-
ware revisions or unit versions.
Related Manuals
The followings are the manuals related to this manual. Use these manuals for reference.
W566 NX-TS££££
NX-HB££££
W523 NX-PD1£££
NX-PF0£££
NX-PC0£££
NX-TBX01
W524 NX-EC0£££
NX-ECS£££
NX-PG0£££
W540 NX-CIF£££
W565 NX-RS££££
W567 NX-ILM£££
NX-series Z930 NX-SL££££ Learning how to use Describes the hardware, setup methods,
Safety Control Unit NX-SI££££ NX-series Safety and functions of the NX-series Safety Con-
User's Manual NX-SO££££ Control Units. trol Units.
Vision System Z340 FH-1£££ Learning how to use Describes the software functions, setup
FH/FZ5 Series Vision System FH-3£££ the FH/FZ5-series Vi- and operating methods required for using
User’s Manual FZ5-L35£ sion Systems. the FH/FZ5-series system.
FZ5-6££
FZ5-11££
Vision Sensor FQ-M-series Z314 FQ-MS12£ Learning how to use Describes the hardware, setup methods
Specialized Vision Sensor for the Specialized Vi- and functions of the Specialized Vision
Positioning sion Sensors for Po- Sensors for Positioning.
User’s Manual sitioning.
Vision Sensor FZ3 Series Z290 FZ3-££££ Learning how to use Describes the software functions, setup
User’s Manual the FZ3-series Vision and operating methods of the FZ3-series
Sensors. Vision Sensors.
Displacement Sensor ZW- Z332 ZW-CE1£ Learning how to use Describes the hardware, setup methods
series the ZW-series Dis- and functions of the ZW-series Displace-
Confocal Fiber Type Dis- placement Sensors. ment Sensors.
placement Sensors
User’s Manual
Terminology
Term Description
AT One of the attributes of a variable.
This attribute allows the user to specify what is assigned to a variable. An I/O
port or an address in memory used for CJ-series Units can be specified.
CJ-series Unit Any of the CJ-series Units that can be used with an NJ-series Controller.
memory used for CJ-series Units One type of I/O memory that contains addresses to which variables can be as-
signed, for example, when accessing a CJ-series Unit or CJ-series network. It
can be accessed only with variables with an AT attribute.
CPU Unit The Unit that serves as the center of control for a Machine Automation Control-
ler. The CPU Unit executes tasks, refreshes I/O for other Units and slaves, etc.
The NJ/NX-series CPU Units include the NX701-££££, NX102-££££,
NX1P2-££££, NJ501-££££.
EtherCAT Master Function Module One of the function modules. This function module controls the EtherCAT slaves
as the EtherCAT master.
EtherNet/IP Function Module One of the function modules. This function module controls the built-in
EtherNet/IP port.
FB An acronym for "function block."
FUN An abbreviation for "function."
I/O port A logical interface that is used by the CPU Unit to exchange data with an exter-
nal device (slave or Unit).
I/O map settings Settings that assign variables to I/O ports. Assignment information between I/O
ports and variables.
I/O refreshing Cyclic data exchange with external devices that is performed with predetermined
memory addresses.
MC Test Run A function to check motor operation and wiring from the Sysmac Studio.
NX bus An internal bus of the NX-series Controller. It is implemented on the NX102, and
NX1P2 CPU Units.
NX Units Any of the NX-series Units that perform I/O processing with connected external
devices. The Communications Coupler Units are not included with the NX Units.
PDO communications An abbreviation for process data communications. Data is exchanged between
the master and slaves on a process data communications cycle. (The process
data communications cycle is the same as the task period of the primary periodic
task.)
PLC Function Module One of the function modules. This function module executes the user program,
sends commands to the Motion Control Function Module, and provides an inter-
face to the USB and SD Memory Card.
POU An acronym for "program organization unit". A POU is a unit in a program execu-
tion model that is defined in IEC 61131-3.
A POU contains an algorithm and a local variable table and forms the basic unit
used to build a user program.
There are three types of POUs: programs, functions, and function blocks.
SDO communications One type of EtherCAT communications in which service data objects (SDOs) are
used to transmit information whenever required.
Sysmac Studio A computer software application for setting, programming, debugging, and trou-
bleshooting NJ/NX-series Controllers. It also provides operations for motion con-
trol and a Simulator.
upload To transfer data from the Controller to the Sysmac Studio with the synchroniza-
tion operation of the Sysmac Studio.
Term Description
information One of the event levels for Controller events or user-defined events. These are
not errors, but appear in the event log to notify the user of specific information.
Event Setup Settings that define user-defined errors and user-defined information.
event task A task that executes a user program only once when the task execution condi-
tions are met.
event log A function that recognizes and records errors and other events.
inline ST ST programming that is included within a ladder diagram.
edge One of the attributes of a variable.
This attribute makes a BOOL variable pass TRUE to a function block when the
variable changes from FALSE to TRUE or when it changes from TRUE to
FALSE.
cam data variable A variable that represents the cam data as a structure array.
A cam data variable is an array structure that consists of phases and displace-
ments.
observation One of the event levels for Controller events or user-defined events.
These are minor errors that do not affect control operations, but appear in the
event log to notify the user of specific information.
function module One of the functional units of the software configuration of the CPU Unit.
basic data type Any of the data types that are defined by IEC 61131-3.
They include Boolean, bit string, integer, real, duration, date, time of day, date
and time, and text string data types.
"Basic data type" is used as opposed to derivative data types, which are defined
by the user.
forced refreshing Forcing the refreshing of an input from an external device or an output to an ex-
ternal device, e.g., when the user debugs a program.
Addresses that are subject to forced refreshing can still be overwritten from the
user program.
union One of the derivative data types. It allows you to handle the same data as differ-
ent data types.
global variable A variable that can be read or written from all POUs (programs, functions, and
function blocks).
minor fault level Controller error An error for which some of the control operations for one of the function modules
in the NJ/NX-series Controller stop.
An NJ/NX-series CPU Unit continues operation even after a minor fault level
Controller error occurs.
Special Unit Setup A generic term for the settings for a Special Unit, including the settings in allocat-
ed DM Area words.
structure One of the derivative data types. It consists of multiple data types placed togeth-
er into a layered structure.
Constant One of the attributes of a variable.
If you specify the Constant attribute for a variable, the value of the variable can-
not be written by any instructions, ST operators, or CIP message communica-
tions.
Controller The range of devices that are directly controlled by the CPU Unit.
In the NX-series System, the Controller includes the CPU Rack and EtherCAT
slaves (including general-purpose slaves and Servo Drives).
In the NJ-series System, the Controller includes the CPU Rack, Expansion
Racks, and EtherCAT slaves (including general-purpose slaves and Servo
Drives).
Term Description
Controller error Errors that are defined by the NJ/NX-series System.
“Controller error” is a collective term for major fault level, partial fault level, minor
fault level, and observation Controller events.
Controller event One of the events in the NJ/NX-series System. Controller events are errors and
information that are defined by the system for user notification. A Controller
event occurs when the system detects a factor that is defined as a Controller
event.
Controller information Information that is defined by the NJ/NX-series System that is not an error. It rep-
resents an information Controller event.
Servo Drive/encoder input slave Any of the EtherCAT slaves that is assigned to an axis. In the NJ/NX-series Sys-
tem, it would be a Servo Drive or Encoder Input Slave Unit.
axis A functional unit within the Motion Control Function Module. An axis is assigned
to the drive mechanism in an external Servo Drive or the sensing mechanism in
an external Encoder Input Slave Unit.
axes group A functional unit that groups together axes within the Motion Control Function
Module.
Axes Group Variable A system-defined variable that is defined as a structure and provides status in-
formation and some of the axes parameters for an individual axes group.
An Axes Group Variable is used to specify an axes group for motion control in-
structions and to monitor the command interpolation velocity, error information,
and other information for the axes group.
Axis Variable A system-defined variable that is defined as a structure and provides status in-
formation and some of the axis parameters for an individual axis.
An Axis Variable is used to specify an axis for motion control instructions and to
monitor the command position, error information, and other information for the
axis.
system common processing System processing that is performed by the CPU Unit to perform I/O refreshing
and the user program execution within a task. Exclusive control of variables be-
tween tasks, data trace processing, and other processing is performed.
system service Processing that is performed by the CPU Unit in unused time between task proc-
essing. The system service includes communications processing, SD Memory
Card access processing, self-diagnosis processing, and other processing.
system-defined variable A variable for which all attributes are defined by the system and cannot be
changed by the user.
Initial Value One of the attributes of a variable. The variable is set to the initial value in the
following situations.
• When power is turned ON
• When the CPU Unit changes to RUN mode
• When you specify to initialize the values when the user program is transferred
• When a major fault level Controller error occurs
slave A device that performs remote I/O for a master.
Slave Terminal A building-block remote I/O terminal to which a Communications Coupler Unit
and NX Units are mounted. A Slave Terminal is one type of slave.
slave and Unit configurations A generic term for the EtherCAT configuration and Unit configuration.
absolute encoder home offset This data is used to restore in the CPU Unit the actual position of a Servo Drive
with an absolute encoder. The offset is the difference between the command po-
sition after homing and the absolute data that is read from the absolute encoder.
project unit version A unit version to be set for the project. It is set for the project in the Select Device
Area of the Project Properties Dialog Box on the Sysmac Studio.
Term Description
major fault level Controller error An error for which all NJ/NX-series Controller control operations stop. The CPU
Unit immediately stops user program execution and turns OFF the loads for all
slaves and Units (including remote I/O).
download To transfer data from the Sysmac Studio to the Controller with the synchroniza-
tion operation of the Sysmac Studio.
task An attribute that defines when a program is executed.
task period The interval at which the primary periodic task or a periodic task is executed.
Communications Coupler Unit The generic name of an interface unit for remote I/O communications on a net-
work between NX Units and a host network master. For example, an EtherCAT
Coupler Unit is a Communications Coupler Unit for an EtherCAT network.
periodic task A tasks for which user program execution and I/O refreshing are performed each
period.
device A general term for any Unit or slave that is refreshed by the I/O refreshing that is
performed by the CPU Unit. Specifically, it refers to EtherCAT slaves, NX Units
on the CPU Unit, built-in I/O, Option Boards, and CJ-series Units.
device output An output for any Unit or slave that is refreshed by the I/O refreshing that is per-
formed by the CPU Unit.
device variable A variable that is used to access a specific device through an I/O port.
synchronization A function that automatically compares the information in the NJ/NX-series Con-
troller with the information in the Sysmac Studio, displays any differences and lo-
cations in a hierarchical form, and can be used to synchronize the information.
namespace A system that is used to group and nest the names of functions, function block
definitions, and data types.
Network Publish One of the attributes of a variable.
This attribute allows you to use CIP message communications or tag data links
to read/write variables from another Controller or from a host computer.
array specification One of the variable specifications. An array variable contains multiple elements
of the same data type. The elements in the array are specified by serial numbers
called subscripts that start from the beginning of the array.
derivative data type A data type that is defined by the user. Structures, unions, and enumerations are
derivative data types.
Range Specification One of the variable specifications. You can specify a range for a variable in ad-
vance. The variable can take only values that are in the specified range.
general-purpose slave Any of the EtherCAT slaves that cannot be assigned to an axis.
function A POU that is used to create an object that determines a unique output for the
same input, such as for data processing.
function block A POU that is used to create an object that can have a different output for the
same input, such as for a timer or counter.
partial fault level Controller error An error for which all of the control operations for one of the function modules in
the NJ/NX-series Controller stop.
An NJ/NX-series CPU Unit continues operation even after a partial fault level
Controller error.
primary periodic task The task with the highest priority.
program Along with functions and function blocks, one of the three types of POUs.
Programs are assigned to tasks to execute them.
process data communications One type of EtherCAT communications in which process data objects (PDOs)
are used to exchange information cyclically and in realtime. Process data com-
munications are also called PDO communications.
Term Description
variable A representation of data, such as a numeric value or character string, that is
used in a user program.
You can change the value of a variable by assigned the required value. “Varia-
ble” is used as opposed to “constant,” for which the value does not change.
variable memory A memory area that contains the present values of variables that do not have AT
specifications. It can be accessed only with variables without an AT attribute.
Retain One of the attributes of a variable. The values of variables with a Retain attribute
are held at the following times. (Variables without a Retain attribute are set to
their initial values.)
• When power is turned ON after a power interruption
• When the CPU Unit changes to RUN mode
• When you specify to not initialize the values when the user program is trans-
ferred
instruction The smallest unit of the processing elements that are provided by OMRON for
use in POU algorithms.
There are ladder diagram instructions (program inputs and outputs), function in-
structions, function block instructions, and ST statements.
main memory The memory inside the CPU Unit that is used by the CPU Unit to execute the OS
and user program.
Motion Control Function Module One of the function modules. The MC Function Module performs motion control
based on commands from the motion control instructions that are executed in
the user program.
motion control instruction A function block instruction that executes motion control.
The Motion Control Function Module supports instructions that are based on
function blocks for PLCopen® motion control as well as instructions developed
specifically for the Motion Control Function Module.
user-defined event One of the events in the NJ/NX-series System. These events are defined by the
user. “User-defined events” is a generic term for user-defined errors and user-
defined information.
user-defined variable A variable for which all of the attributes are defined by the user and can be
changed by the user.
user program All of the programs in one project.
Unit A device that mounts to the CPU Rack or an Expansion Rack.
Unit configuration The configuration information for the Units that are set on the Sysmac Studio.
This information tells what Unit models are connected to the CPU Unit and
where they are connected.
literal A constant expression that is used in a user program.
enumeration One of the derivative data types. This data type takes one item from a prepared
name list of enumerators as its value.
enumerator One of the values that an enumeration can take expressed as a character string.
The value of an enumeration is one of the enumerators.
local variable A variable that can be accessed only from inside the POU in which it is defined.
“Local variable” is used as opposed to “global variable.”
Local variables include internal variables, input variables, output variables, in-out
variables, and external variables.
Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.
Revision
Date Revised content
code
01 July 2011 Original production
02 March 2012 • Added information on the NJ301-££££.
• Added information on the functions supported by unit version 1.01
of the CPU Units.
• Corrected mistakes.
03 May 2012 • Added information on the functions supported by unit version 1.02
of the CPU Units.
• Corrected mistakes.
04 August 2012 • Added information on the functions supported by unit version 1.03
of the CPU Units.
• Corrected mistakes.
05 February 2013 • Added information on the functions supported by unit version 1.04
of the CPU Units.
• Corrected mistakes.
06 April 2013 • Added information on the functions supported by unit version 1.05
of the CPU Units.
• Added information on the NX Series.
• Corrected mistakes.
07 June 2013 • Added information on the functions supported by unit version 1.06
of the CPU Units.
• Corrected mistakes.
08 September 2013 • Added information on the functions supported by unit version 1.07
of the CPU Units.
• Corrected mistakes.
09 December 2013 • Added information on the functions supported by unit version 1.08
of the CPU Units.
• Corrected mistakes.
10 July 2014 • Corrected mistakes.
11 January 2015 • Added information on the functions supported by unit version 1.10
of the CPU Units.
• Corrected mistakes.
12 April 2015 • Added information on the NX701-££££and NJ101-££££.
• Corrected mistakes.
13 October 2015 • Added information on the hardware revision.
• Corrected mistakes.
Revision
Date Revised content
code
14 April 2016 • Added information on the functions supported by unit version 1.11
of the CPU Units.
• Corrected mistakes.
15 July 2016 • Added information on the functions supported by unit version 1.12
of the CPU Units.
16 October 2016 • Added information on the NX1P2-££££££.
• Added information on the functions supported by unit version 1.13
of the CPU Units.
17 January 2017 • Corrected mistakes.
18 April 2017 • Added information on the functions supported by unit version 1.14
of the CPU Units.
• Corrected mistakes.
19 June 2017 • Corrected mistakes.
20 June 2017 • Added information on the functions supported by unit version 1.15
of the CPU Units.
21 October 2017 • Added information on the functions supported by unit version 1.16
of the CPU Units.
• Corrected mistakes.
22 January 2018 • Added information on the functions supported by unit version 1.17
of the CPU Units.
23 April 2018 • Added information on the functions supported by unit version 1.18
of the CPU Units.
• Corrected mistakes.
24 April 2018 • Added information on the NX102-££££.
• Added information on the functions supported by unit version 1.30
of the CPU Units.
• Made changes accompanying the transfer of explanation for event
codes and errors to theNJ/NX-series Troubleshooting Manual.
25 July 2018 • Added information on the hardware revision.
• Added information on the functions supported by unit version 1.19
of the NJ-series CPU Units.
• Added information on the functions supported by unit version 1.31
of the NX102-££££.
• Corrected mistakes.
26 January 2019 • Added information on the functions supported by unit version 1.20
of the NJ-series CPU Units.
• Corrected mistakes.
27 April 2019 • Added information on the functions supported by unit version 1.32
of the NX102-££££.
• Added information on the functions supported by unit version 1.21
of the NX1P2-££££££, NJ501-1£00, NJ301-££££, and
NJ101-££00.
• Corrected mistakes.
28 July 2019 • Added information on the functions supported by unit version 1.40
of the NX102-££00, NX1P2-££££££, NJ501-1£00, NJ301-£
£££, and NJ101-££00.
• Added information on the functions supported by unit version 1.21
of the NX701-££££, NJ501-4£00, NJ501-4£10, NJ501-1340,
and NJ501-5300.
• Corrected mistakes.
Revision
Date Revised content
code
29 October 2019 • Added information on the NX1P2-9B££££.
• Corrected mistakes.
30 July 2020 • Added information on the functions supported by unit version 1.35
of the NX102-££20.
• Added information on the functions supported by unit version 1.23
of the NX701-££££, NJ501-1£20, NJ501-4320, and NJ101-£
£20.
31 August 2020 • Added information on the NJ501-R£00.
32 October 2020 • Added information on the functions supported by unit version 1.42
of the NX102-££00, NX1P2-££££££, NJ501-1£00, NJ301-£
£££, and NJ101-££00.
33 January 2021 • Added information on the functions supported by unit version 1.43
of the NX102-££00 and NJ501-1£00.
• Added information on the functions supported by unit version 1.36
of the NX102-££20.
• Added information on the functions supported by unit version 1.24
of the NX701-1£££.
34 July 2021 • Added information on the HMC-SD292, HMC-SD492, and HMC-
SD1A2 SD Memory Cards.
• Added information on the functions supported by unit version 1.46
of the NX102-££00, NX1P2-£££££, NJ501-1£00, NJ501-R£
££, NJ301-££££, and NJ101-££00.
• Added information on the functions supported by unit version 1.26
of the NJ501-££20, NJ501-1340, NJ501-5300, NJ501-4£££,
NJ101-1£20, and NX701-££££.
• Added information on the functions supported by unit version 1.37
of the NX102-££20.
35 October 2021 • Added information related to the hardware revision A of the
NX701-££££.
36 November 2021 • Added information related to the hardware revision D of the NJ-ser-
ies CPU Unit.
37 April 2022 • Added information on the functions supported by unit version 1.48
of the NX102-££££ and NJ501-1£00.
• Added information on the functions supported by unit version 1.47
of the NJ501-1£20, J501-4£££, NJ501-1340, NJ501-5300, and
NJ101-££20.
• Added information on the functions supported by unit version 1.28
of NX701-££££.
38 April 2022 • Added information to Terms and Conditions Agreement.
39 June 2022 • Added information on the hardware revision B of NX701-££££.
• Added information on the hardware revision E of NJ501-££££.
• Changed descriptions on the accuracy of the built-in clock.
• Corrected mistakes.
40 October 2022 • Made changes accompanying the release of unit version 1.50 of
the NJ-series, NX102, and NX1P2 CPU Units.
• Corrected mistakes.
Sysmac Studio
Automation Software
IEC programming
1-1-1 Features
Hardware Features
1-1-1 Features
control system.
Version Information
A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are re-
quired to use the NX-series Safety Control Units.
• You cannot mount NX-series Safety Control Units on the NX1P2 CPU Unit and use them.
Use NX-series Safety Control Units as a subsystem on EtherCAT.
The NX701 CPU Unit of hardware revision A or later and CPU Units of NX102 and NX1P2 do
not provide a USB port.
Software Features
l Multitasking
You assign I/O refreshing and programs to tasks and then specify execution conditions and execu-
tion order for them to flexibly combine controls that suit the application.
Support Software
Sysmac Studio
NX-series Controller
Power
Supply Unit CPU Unit
LAN
EtherNet/IP
EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT
Built-in EtherCAT port
Servo Drive/encoder
Slave Terminal General-purpose slaves
input slaves
• NX Units should be connected to Slave Terminals. The NX bus connector of the CPU Unit is
provided for future expansion so that it cannot be used to connect any NX Unit.
• The NX701 CPU Unit of hardware revision A or later does not provide a USB port.
Additional Information
You can connect the Sysmac Studio directly to the Communications Coupler Unit to set up the
Slave Terminal. Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat. No. W519)
for details.
l Network Configurations
• Host computers, HMIs, and other NJ/NX-series Controllers are connected to the built-in Ether-
Net/IP port.
• An NX701 CPU Unit has two built-in EtherNet/IP ports.
EtherNet/IP
HMI
1
NX-series Controller EtherNet/IP
Power Supply Unit CPU Unit
Refer to Section 10 Communications Setup on page 10-1 for details on the network config-
uration.
l Support Software
You can use the following Support Software to set up, monitor, and debug an NX701 CPU Unit.
• Sysmac Studio
The Sysmac Studio is the main Support Software that you use for an NX701 CPU Unit. On it,
you can set up the Controller configurations, parameters, and programs, and you can debug
and simulate operation.
• Other Support Software
The following Support Software is also included in the Sysmac Studio Software Package
Standard Edition.
For the NX701 CPU Unit with unit version 1.29 or later, use Sysmac Studio on Windows 10 or
higher OS on the computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to
the Controller.
Support Software
NX Unit configuration
NX-series
NX102 CPU Unit
LAN
Built-in EtherNet/IP port 1
EtherNet/IP
Additional Information
You can connect the Sysmac Studio directly to the Communications Coupler Unit to set up the
Slave Terminal. Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat. No. W519)
for details.
1
EtherNet/IP
HMI
Refer to Section 10 Communications Setup on page 10-1 for details on the network configu-
ration.
l Support Software
You can use the following Support Software to set up, monitor, and debug an NX102 CPU Unit.
• Sysmac Studio
The Sysmac Studio is the main Support Software that you use for an NX102 CPU Unit. On it,
you can set up the Controller configurations, parameters, and programs, and you can debug
and simulate operation.
• Other Support Soft
The following Support Software is also included in the Sysmac Studio Software Package
Standard Edition.
For the NX102 CPU Unit with unit version 1.49 or later, use Sysmac Studio on Windows 10 or
higher OS on the computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to
the Controller.
NX Unit
Support Software Configuration
NX-series NX1P2
CPU Unit
LAN
EtherNet/IP
NX Units
Built-in EtherCAT port
CPU Rack
EtherCAT Network
EtherCAT
Configuration
Servo Drive/encoder
Slave Terminal input slaves General-purpose slaves
Additional Information
You can connect the Sysmac Studio directly to the Communications Coupler Unit to set up the
Slave Terminal. Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat. No. W519)
for details.
EtherNet/IP
Serial-communications devices
Refer to Section 10 Communications Setup on page 10-1 for details on the network configu-
ration.
l Support Software
You can use the following Support Software to set up, monitor, and debug an NX1P2 CPU Unit.
• Sysmac Studio
The Sysmac Studio is the main Support Software that you use for an NX1P2 CPU Unit. On it,
you can set up the Controller configurations, parameters, and programs, and you can debug
and simulate operation.
• Other Support Software
The following Support Software is also included in the Sysmac Studio Software Package
Standard Edition.
For the NX1P2 CPU Unit with unit version 1.49 or later, use Sysmac Studio on Windows 10 or
higher OS on the computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to
the Controller.
Support Software
Sysmac Studio
NX-series Controller
Power
Supply Unit CPU Unit
LAN
EtherNet/IP
EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT
Built-in EtherCAT port
Servo Drive/encoder
Slave Terminal General-purpose slaves
input slaves
Additional Information
You can connect the Sysmac Studio directly to the Communications Coupler Unit to set up the
Slave Terminal. Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat. No. W519)
for details.
l Network Configurations
• Host computers, HMIs, and other NJ-series Controllers are connected to the built-in EtherNet/IP
port or to a CJ1W-EIP21 EtherNet/IP Unit.
• A DeviceNet network is connected to a DeviceNet Unit. A CompNet network is connected to a
CompNet Unit. A serial communications network is connected to a Serial Communications Unit.
EtherNet/IP
EtherNet/IP Unit
CompoNet
Built-in EtherNet/IP port
MS NS WORD NODE ADR 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 MS NS WORD NODE ADR 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CRT1-OD16 CRT1-OD16
REMOTE TERMINAL REMOTE TERMINAL
Serial General-purpose
device with serial
DeviceNet Unit communications
DeviceNet
Refer to Section 10 Communications Setup on page 10-1 for details on the network config-
uration.
l Support Software
You can use the following Support Software to set up, monitor, and debug an NJ-series Controller.
• Sysmac Studio
The Sysmac Studio is the main Support Software that you use for an NJ-series Controller. On
it, you can set up the Controller configurations, parameters, and programs, and you can de-
bug and simulate operation.
• Other Support Software
The following Support Software is also included in the Sysmac Studio Software Package
Standard Edition.
For the NJ-series CPU Unit with unit version 1.49 or later, use Sysmac Studio on Windows 10
or higher OS on the computer. Sysmac Studio on Windows 8.1 or lower cannot connect online
to the Controller.
Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to
A-16 Version Information for NX-series Controllers on page A-258 and A-17 Version Information for NJ-series Control-
lers on page A-262 for information on version upgrades.
Step 4. Wiring
Connect the network cables and wire the I/O.
STEP1-3
Designing Programs
POU (Program Or- • Programs Section 6 Program-
ganization Unit) De- • Functions and function blocks ming on page 6-1
sign • Determining the algorithm languages
Variable Design • Defining variables that you can use in more than one POU and varia- 6-3 Variables on page
bles that you use in only specific POUs 6-28
• Defining the variables names for the device variables that you use to
access slaves and Units
• Defining the attributes of variables, such as the Name and Retain at-
tributes
• Designing the data types of variables
1
The following Controller Configurations and Setup and the Programming and Task Settings can be performed in either or-
2) Assigning Device Registering device variables in variable tables I/O Map 3-3 I/O Ports and De-
Variables to I/O (Variable names are user defined or automati- vice Variables on page
Ports cally created.) 3-8
STEP2-2 Setting the following parameters from the Sys- Section 4 Controller
Controller Setup mac Studio Setup on page 4-1
Setting the initial values for the PLC Configurations and 4-2 Initial Settings for
Function Module Setup - Controller the PLC Function
Setup - Operation Module on page 4-4
Settings
For NX1P2 CPU Units Each setting is given 8-1-2 Clock on page
• Setting the clock data with clock below. 8-3
function when a Battery is mounted • Controller - 4-2-4 Unit Configura-
• Initial settings for the NX Bus Func- Controller Clock tion and Unit Setup for
tion Module • Configuration and NX102 and NX1P2
• Initial Settings for NX Units Setup - CPU/ CPU Units on page
• Initial settings for built-in I/O Expansion 4-13
• Initial settings for Option Boards RacksCPU Rack 4-3 Initial Settings for
• Memory settings for CJ-series Units • Configurations NX Units on page
and Setup - 4-18
Controller Setup - NX-series NX1P2 CPU
Built-in I/O Unit Built-in I/O and
Settings Option Board User's
• Configurations Manual (Cat. No.
and Setup - W579)
Controller Setup -
Option Board
Settings
• Configurations
and Setup -
Controller Setup -
Memory Settings
for CJ-series Units
For NJ-series CPU Units Configurations and 4-4 Initial Settings for
Initial Settings for Special Units Setup - CPU/ Special Units on page
Expansion Racks 4-22
To use motion control Configurations and 4-5 Initial Settings for
Setting the initial settings for the Motion Setup - Motion the Motion Control
Control Function Module Control Setup Function Module on
page 4-24
Setting the initial values for the Ether- Configurations and 4-6 Initial Settings for
CAT Function Module Setup - EtherCAT the EtherCAT Master
Function Module on
page 4-26
Setting the initial values for the Ether- Configurations and 4-7 Initial Settings for
Net/IP Function Module Setup - Controller the EtherNet/IP Func-
Setup - Built-in tion Module on page
EtherNet/IP Port 4-27
Settings
Step 4. Wiring
Step Description Reference
1. Connecting Ether- • Connecting the built-in EtherCAT port NX-series CPU Unit
net Cable • Connecting the built-in EtherNet/IP port Hardware User's
Manual (Cat. No.
W535)
NX-series NX102
CPU Unit Hardware
User’s Manual (Cat.
No. W593)
NX-series NX1P2
CPU Unit Hardware
User’s Manual (Cat.
No. W578)
NJ-series CPU Unit
Hardware User's
Manual (Cat. No.
W500)
2. Wiring I/O • Wiring I/O to EtherCAT slaves Operation manuals for
• Wiring Basic I/O Units and Special Units the EtherCAT slaves
NX-series CPU Unit
Hardware User's
Manual (Cat. No.
W535)
NX-series NX102
CPU Unit Hardware
User’s Manual (Cat.
No. W593)
NX-series NX1P2
CPU Unit Hardware
User’s Manual (Cat.
No. W578)
NJ-series CPU Unit
Hardware User's
Manual (Cat. No.
W500)
• Checking wiring Sysmac Studio
Version 1 Operation
Manual (Cat. No.
W504)
3. Connecting the • Connecting the USB cable*1 Sysmac Studio
Computer That Runs • Connecting the built-in EtherNet/IP port Version 1 Operation
the Sysmac Studio Manual (Cat. No.
W504)
*1. The NX701 CPU Unit of hardware revision A or later and CPU Units of NX102 and NX1P2 do
not provide a USB port.
The CPU Unit also contains settings, the user program, variables, and other data. The CPU Unit uses
this data to perform processing. Of this data, variables are used to access the CPU Unit and I/O, and
for external communications.
The internal software and the use of variables for I/O acess enable the CPU Unit to execute both se-
quence control and motion control.
Software Data
Settings
User program execution
Accessing I/O
Sequence control User program
CJ-series Units
Other Controllers,
host computers, etc.
External communications
Note You can use CJ-series Units only on the NJ-series CPU Units.
Note You can use NX Units on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units. You can use
the built-in I/Os and Analog I/O Option Boards only with the NX1P2 CPU Units.
This section describes the following items to provide you with a basic understanding of how the CPU
Unit performs sequence control and motion control.
Description Reference
Software page 2-4
Accessing I/O page 2-12
Sequence control and motion control page 2-28
Overview of CPU Unit data page 2-35
Operation for CPU Unit status page 2-37
Refer to the following manuals for details on the use of variables for external communications.
Communication Manual
EtherNet/IP • For information on using variables with the built-in EtherNet/IP port, refer to the
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506).
• For information on using variables with an EtherNet/IP Unit, refer to the CJ-series
EtherNet/IP Units Operation Manual for NJ-series CPU Unit (Cat. No. W495).
Serial communi- CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit
cations (Cat. No. W494).
2
2-1-2 Overview of Operation According to CPU Unit Status
2-2 Software
This section describes the software configuration of the CPU Unit, and how the software components
operate.
2-2 Software
condition is met.
Tag data link service These services are performed Tag data links
Option board service*1 only upon requests from the I/O refreshing for An-
hardware or other external devi- alog Option Boards
System services ces.
USB port service*2,
SD Memory Card 2
service, and commu-
nications processing
Refer to 2-7-1 CPU Unit Status on page 2-37 for information on the CPU Unit status.
Initialization
Initialization is performed only when the power supply is turned ON.
The following processing is performed for initialization.
Processing Description
Self diagnosis at startup Operation is monitored for the following errors: Power Supply Error, CPU
Unit Reset, CPU Unit Watchdog Timer Error, and Incorrect Power Supply
Unit Connected. *1
Data check The _RetainFail (Retention Failure Flag) system-defined variable
changes to TRUE at the following time: when the values of variables for
which the Retain attribute was set to retain the values and the values in
DM, EM, and HR Areas in the memory used for CJ-series Units*2 were
not retained after a power interruption.
Detecting NX Units*3 The NX Units mounted in the Controller are detected.
Detecting CJ-series Units*4 The CJ-series Units mounted in the Controller are detected.
Recording Power Turned ON and The Power Turned ON and Power Interrupted events are recorded.
Power Interrupted events
*1. Refer to Types of Fatal Errors in the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for information
on the following errors: Power Supply Error, CPU Unit Reset, CPU Unit Watchdog Timer Error, and Incorrect
Power Supply Unit Connected.
*2. You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
*3. You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
*4. You can use CJ-series Units only on the NJ-series CPU Units.
Processing Description
I/O refreshing Data for EtherCAT slaves, NX Units on the CPU Unit*1, I/O built in the CPU
Unit*2, Analog I/O Option Boards in the CPU Unit*3, CJ-series*4 Basic I/O Units,
and CJ-series Special Units is input and output.
User program execution The user programming for sequence control is executed. It also sends com-
mands to the motion control process.
Motion control Motion control is executed based on commands from the user program.
System common proc- System common processing, such as data trace processing and tag data link
essing processing, is performed.
*1. You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
*2. You can use built-in I/O only with the NX1P2 CPU Units.
*3. You can use Analog Option Boards only with the NX1P2 CPU Units.
*4. You can use CJ-series Units only on the NJ-series CPU Units.
Refer to 5-3-3 Basic Operation of Tasks for NX701 CPU Units on page 5-12, 5-4-3 Basic Opera-
tion of Tasks for NX102 CPU Units and NX1P2 CPU Units on page 5-32, and 5-5-3 Basic Opera-
tion of Tasks for NJ-series Controllers on page 5-49 for details on the processing that is executed
with tasks.
l Task Operation
Processing is assigned to tasks. There are three kinds of tasks, as shown in the following table.
They are defined by their execution priorities and execution conditions.
Execution priority
Main processing con-
Type of periodic task (smaller values indi- Execution conditions
tent
cate higher priority)
Primary periodic task 4 The periodic task is peri- I/O refreshing, user pro-
The task has the highest odically executed. gram execution, and mo-
execution priority. tion control
Periodic task 5*1 The periodic task is peri- I/O refreshing, user pro-
This task has the next odically executed. gram execution, and mo-
highest execution priority The task period is an in- tion control
after the primary periodic teger multiple of the task
task. period of the primary pe-
riodic task.
16*2,17, or 18 The periodic task is peri- The processing that can
odically executed. be performed depends
The task period is an in- on the task execution pri-
teger multiple of the task ority.
period of the primary pe- Execution priority 16: I/O
riodic task. refreshing and user pro-
gram execution
Execution priority 17 or
18: User program execu-
tion
Execution priority
Main processing con-
Type of periodic task (smaller values indi- Execution conditions
tent
cate higher priority)
Event task 8 or 48 An event task is execut- User program execution
ed only once when the
specified condition is
2-2 Software
met.
*1. You can use the priority-5 periodic task only with the NX701 CPU Units.
*2. You cannot use the priority-16 periodic task with the NX102 CPU Unit or NX1P2 CPU Unit.
The CPU Unit executes the task with the highest execution priority first. The following operation ex-
ample is for the primary periodic task and a periodic task. If the primary periodic task is executed 2
while a periodic task is in execution, execution of the primary periodic task is prioritized.
The operation of tasks with lower priority during the execution of higher priority tasks differs be-
tween the NX701 CPU Unit, NX102 CPU Unit, NX1P2 CPU Unit, and NJ-series CPU Unit. Refer to
5-2 Overview of Tasks on page 5-6 for details on task operation.
Task Task
Processing
Command
Motion control instruction
Note The CPU Unit executes motion control in the primary periodic task and in the priority-5 periodic task.
Refer to 5-11-3 System Input and Output Response Times on page 5-115 for details.
Additional Information
With an NX701 CPU Unit, you can execute motion control in the primary periodic task and in
the priority-5 periodic task. If these two motion controls need to be identified, the motion control
in the primary periodic task is called motion control 1, while the motion control in the priority-5
periodic task is called motion control 2.
The execution priority of the tag data link service for an NJ-series CPU Unit is between the execu-
tion priorities of the priority-16 periodic task and the priority-17 periodic task. Therefore, the tag da-
ta link service will be given priority over execution of the priority-17 periodic task, but if the primary
periodic task or the priority-16 periodic task is executed, the execution of the primary periodic task
or the priority-16 periodic task is prioritized.
The tag data link service is executed with a priority that is between the execution
priorities of the priority-16 periodic task and the priority-17 periodic task.
The tag data link service for an NX-series CPU Unit is executed in parallel with the execution of
tasks.
For details on the tag data link service, refer to 5-6 Services Other Than Tasks on page 5-66.
2-2 Software
Note The option board service is executed only by an NX1P2 CPU Unit.
Option boad
service
The option board service is executed in parallel with the execution of tasks.
Refer to 5-6 Services Other Than Tasks on page 5-66 for details on the option board service.
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930-E1-12 or later) for infor-
mation on the CIP Safety communications.
Note The communications bridge service is executed by an NX102 CPU Unit with unit version 1.31 or later.
Communications
bridge service
The communications bridge service is executed in parallel with the execution of tasks.
Refer to 5-6 Services Other Than Tasks on page 5-66 for details on the communications bridge
service.
System Services
l System Services
System services include the following processing.
Processing Contents
USB port service*1 • Processing of service requests from the Sysmac Studio or host computers
Built-in EtherNet/IP port serv- • Processing of message service requests, such as CIP commands, from
ice the Sysmac Studio, an HMI, host computers, or other Controllers
• Execution of communications instructions for CIP and socket communica-
tions
Built-in EtherCAT port serv- • Execution of EtherCAT message communications
ice
Communications processing • Execution of communications processing for a Serial Communications
for a Serial Communications Option Board
Option Board*2
CJ-series Special Unit serv- • Event servicing for CJ-series Special Units
ice*3 • Execution of communications instructions (CIP)
SD Memory Card service • Access from FTP client
• SD Memory Card operations from the Sysmac Studio
• Execution of SD Memory Card instructions
Self-diagnosis • Hardware error detection
*1. The NX701 CPU Unit of hardware revision A or later and CPU Units of NX102 and NX1P2 do not pro-
vide a USB port.
*2. The communications processing for a Serial Communications Option Board is executed only by an
NX1P2 CPU Unit.
*3. The CPU Unit exchanges data between CJ-series Special Units and the memory words that are allocat-
ed to them during I/O refreshing.
You can use CJ-series Special Units only with NJ-series CPU Units.
For the NX102 CPU Units, if a request comes from the hardware or from outside of the CPU Unit,
2-2 Software
system services are executed in parallel with other processes. System services are executed at the
required time without being affected by the execution of tasks. However, during execution of the tag
data link service, system services are not executed.
For the NX1P2 CPU Units, if a request comes from the hardware or from outside of the CPU Unit,
system services are executed in parallel with other processes. System services are executed at the 2
required time without being affected by the execution of tasks. However, during execution of the tag
data link service or option board service, system services are not executed.
Task period of primary Task period of primary Task period of primary Task period of primary
periodic task periodic task periodic task periodic task
System
services
Refer to 5-6 Services Other Than Tasks on page 5-66 for details on the system services.
Attribute set-
Variables Accessed data
tings
User-defined variables All attributes can CPU Unit
be set.
Semi-user-defined Device Varia- Device variables Some attributes EtherCAT slaves*2*3
variables bles for EtherCAT can be set. *1
slaves
Device variables NX Units on the CPU Unit
for NX Units*4
Device variables Built-in I/O
for built-in I/O*5
Device variables Analog I/O Option Boards
for Option
Boards*5
Device variables CJ-series Basic I/O Units and
for CJ-series CJ-series Special Units
Units*6
Cam data variables Servo Drives, encoder input
slaves, and CPU Unit
System-defined System-defined variables for PLC No attributes can CPU Unit
variables Function Module be set.
System-defined MC Common Vari- Servo Drives, encoder input
variables for able slaves, and CPU Unit
motion control Axis Variables
Axes Group Varia-
bles
System-defined variables for Ether- Built-in EtherNet/IP Port
Net/IP
System-defined variables for Ether- Built-in EtherCAT master port
CAT master
System-defined variables for NX CPU Unit
bus*7
*1. Refer to Device Variable Attributes on page 3-11 for the attributes that can be set.
User-defined Variables
The user defines all of the attributes of a user-defined variable. Refer to 6-3 Variables on page 6-28
2
for details on user-defined variables.
l Device Variables
Device variables are used to access data in devices. A device is a general term for any Unit or
slave that is refreshed by the I/O refreshing that is performed by the CPU Unit. Specifically, it refers
to EtherCAT slaves, NX Units on the CPU Unit, built-in I/O, Analog I/O Option Boards, and CJ-ser-
ies Units.
The device and the data to access in that device determine the type of device variable, as shown
below.
Device variables are used to access data for EtherCAT slaves, NX Units on the CPU Unit, built-in
I/O, Analog Option Boards, and CJ-series Units through the I/O ports. The I/O ports are logical
ports that are used to access devices.
CPU Unit
User program
Instruction
Device variable
EtherCAT slave, NX
I/O port Unit, or CJ-series Unit
Refer to 3-3-1 I/O Ports on page 3-8 for details on I/O ports and device variables.
System-defined Variables
System-defined variables are provided in advance in an NJ/NX-series Controller. The names and all
attributes are defined by the system. They have specific functions. You cannot change the variable
names or any other attributes.
The system-defined variables are specific to a function module. There are system-defined variables
for each function module. The types of system-defined variables are listed in the following table.
The system-defined variables for motion control are classified according to what the Motion Control
Function Module does, as listed in the following table.
Refer to A-6 System-defined Variables on page A-75 for details on system-defined variables.
CPU Unit
User program
Variables
Axis variables Device variables Device variables Device Device Device variables User-defined
for for NX Units variables for variables for for CJ-series Units variables
EtherCAT slaves built-in I/O Option Boards
*1
*1
I/O
Note EtherCAT slaves that cannot be assigned to axes are called general-purpose slaves. EtherCAT slaves that
can be assigned to axes are called Servo Drive and encoder input slaves. Refer to the NJ/NX-series CPU
Unit Motion Control User's Manual (Cat. No. W507) for details on Servo Drive and encoder input slaves.
CPU Unit
Example: General-purpose slave
Device variables
for EtherCAT slaves I/O ports
PDO communications
00
CPU Unit
Servo Drive
System-defined variables
PDO communications
Axis variable
Servomotor
Servo Drive
PDO communications
Axis variable
Servomotor
Refer to 3-5-2 Axis Variables and Axes Group Variables on page 3-17 for details on axis varia-
bles.
Version Information
With the Sysmac Studio version 1.09 or higher, device variables can be assigned to the I/O
ports of Servo Drive and encoder input slaves that are assigned to axes.
The I/O port to which a device variable can be assigned must meet either of the following condi-
tions.
• The value of the R/W attribute is R (Read only).
• The value of the R/W attribute is W (Write only), and <Not assigned> is set for the process
data field under Detailed Settings on the Axis Basic Settings Display in the Sysmac Studio.
If you perform the following steps, the system will clear the assignment of the device variable to
the I/O port of a Servo Drive and encoder input slave that is assigned to an axis. Perform it with
caution.
1. With the Sysmac Studio version 1.09 or higher, assign device variables to the I/O ports of
Servo Drive and encoder input slaves that are assigned to axes.
2. Save the project data.
3. Open the saved project data with the Sysmac Studio version 1.08 or lower.
Additional Information
There are two types of EtherCAT communications, PDO communications and SDO communi-
cations. PDO communications are used for commands to refresh I/O data, such as data for Ser-
vomotor position control, on a fixed control period. SDO communications are used for com-
mands to read and write data at specified times, such as for parameter transfers. Refer to the
NJ/NX-series CPU Unit Built-in EtherCAT Port User's Manual (Cat. No. W505) for details.
Variable 00
Output Bit 00
…
…
Variable mm
Output Bit mm
Variable 00
Input Bit 00
…
…
Variable nn
Input Bit nn
CPU Unit
Object
Axis variable
Servomotor
Variable 00
Input Bit 00
to
to
Variable 01
Input Bit 01
Refer to 3-5-2 Axis Variables and Axes Group Variables on page 3-17 for details on axis varia-
bles.
The I/O port to which a device variable can be assigned in the NX Unit that is assigned to an
axis must meet either of the following conditions.
• The value of the R/W attribute is R (Read only).
• The value of the R/W attribute is W (Write only), and <Not assigned> is set for the process
data field under Detailed Settings on the Axis Basic Settings Display in the Sysmac Studio.
CPU Unit
Device variables
for built-in I/O I/O ports Built-in I/O
Variable 00
Output Bit 00
…
…
Variable mm
Output Bit mm
Variable 00
Input Bit 00
…
…
Variable nn
Input Bit nn
Variable 00
Ch1 Analog Output Value
…
…
Variable mm
Ch2 Analog Output Value
Variable 00
Ch1 Analog Input Value
…
…
Variable nn
Ch2 Analog Input Value
Variable 00
…
…
Variable 15
Ch1_In15
Variable 00
Ch2_In00
…
…
2
Variable 15
Ch2_In15
l Accessing Special Units through I/O ports by Using Device Variables for
CJ-series Units
The operating data and setup data are accessed through the I/O ports for the device variables for
the CJ-series Unit. The data is exchanged during I/O refreshing.
%3201.00
Variable 3201.00 Slave
Refer to A-9 Contents of Memory Used for CJ-series Units on page A-216 for information on the
memory used for CJ-series Units. Refer to 6-3-8 Variable Attributes on page 6-60 for information
on AT specifications.
The NX Bus Function Module of the NX102 CPU Unit and NX1P2 CPU Unit performs the data ex-
change cyclically with the NX Units on the CPU Unit.
The data exchange is executed by I/O refreshing in the primary periodic task. Therefore, the period of
I/O refreshing is the task period of the primary periodic task.
Only the NX102 CPU Units and NX1P2 CPU Units have the NX Bus Function Module.
Note NX Units with different I/O refreshing methods can be mixed on the NX102 CPU Unit and NX1P2 CPU Unit.
Note You cannot change the I/O refreshing methods for NX Units on the NX102 CPU Unit or NX1P2 CPU Unit.
An outline of the I/O refreshing methods that are actually operated in the NX102 CPU Unit and NX1P2
CPU Unit is listed below.
The I/O refreshing methods that you can use depend on the model of the NX Unit. Select the NX Units
according to the I/O refreshing method to use.
ule
Refer to the manuals for the specific Units for the I/O refreshing methods that are supported by individ-
ual NX Units.
2
2-4-2 I/O Refreshing Method Operation
The NX Units on the CPU Unit, EtherCAT slaves, and EtherCAT Slave Terminals do not read
inputs or refresh outputs simultaneously.
Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task processing Refreshing processing processing Refreshing processing
Synchronized
NX Unit (N1)
ON/OFF response time ON/OFF response time +
Input filter time
Synchronized
NX Unit (N2)
DA conversion time All Units with synchronous All Units with AD conversion time
for each Unit input refreshing read their synchronous output for each Unit
inputs simultaneously refreshing refresh their
outputs simultaneously
Additional Information
The timing when the input changed times are read is the same as that for reading the inputs for
NX Units that support synchronous input refreshing.
Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task processing Refreshing Refreshing
processing processing processing
Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task processing Refreshing Refreshing
processing processing processing
Free-run Internal processing of NX Unit (N1) Internal processing of NX Unit (N1) Internal processing of NX Unit (N1)
NX Unit (N1)
ule
2
other than
a motion Built-in I/O
control
instruction Option Boards
Command
Motion
control NX Units on the CPU
processing Unit that are assigned to
axes
Note You can use CJ-series Units only on the NJ-series CPU Units.
Note You can use the NX Bus Function Module only with the NX102 CPU Units and NX1P2 CPU Units.
Note You can use the built-in I/Os and Option Boards only with the NX1P2 CPU Units.
Version Information
With the Sysmac Studio version 1.09 or higher, device variables can be assigned to the I/O
ports of Servo Drive and encoder input slaves that are assigned to axes.
The I/O port to which a device variable can be assigned must meet either of the following condi-
tions.
• The value of the R/W attribute is R (Read only).
• The value of the R/W attribute is W (Write only), and <Not assigned> is set for the process
data field under Detailed Settings on the Axis Basic Settings Display in the Sysmac Studio.
If you perform the following steps, the system will clear the assignment of the device variable to
the I/O port of a Servo Drive and encoder input slave that is assigned to an axis. Program oper-
ations with caution.
1. With the Sysmac Studio version 1.09 or higher, assign device variables to the I/O ports of
Servo Drive and encoder input slaves that are assigned to axes.
2. Save the project data.
3. Open the saved project data with the Sysmac Studio version 1.08 or lower.
Servo Drive, encoder input, and general-purpose slaves that are not assigned to axes are refreshed in
the process data communications cycle. This means that I/O refreshing takes place in the task period
of the primary periodic task or the priority-5 periodic task. However, execution of the programs and re-
freshing of the device variables take place in the task period of the task to which the programs are
assigned. Therefore, the slave values are not reflected and not controlled by the device variables until
the task period of the task to which the programs are assigned.
If it is necessary to control a slave in the process data communications cycle, assign the program that
controls the slave to the primary periodic task or the priority-5 periodic task.
Refer to 5-11-3 System Input and Output Response Times on page 5-115 for details.
I/O ports
Device variables
Option Board
Executed.
Instruction CJ-series Unit Servo Drive, encoder
input, and general-pur-
pose slaves that are not
assigned to axes
EtherCAT
Master PDO communications
Function
Module 2
Additional Information
• You can use the priority-5 periodic task only with the NX701 CPU Unit.
• With an NX701 CPU Unit, you can perform process data communications in the primary peri-
odic task and the priority-5 periodic task. If these two process data communications cycles
need to be identified, the communications cycle for the primary periodic task is called process
data communications cycle 1, while the communications cycle for the priority-5 periodic task
is called process data communications cycle 2.
• The NX102 to CPU Units, NX1P2 CPU Units, and NJ-series CPU Units perform process data
communications only in the primary periodic task.
• You can use NX Units only on the NX102 and NX1P2 CPU Units.
• You can use the built-in I/Os and Option Boards only with the NX1P2 CPU Units.
• You can use CJ-series Units only on the NJ-series CPU Units.
l Control Period
The motion control period is the task period of the primary periodic task or the priority-5 periodic
task.
Motion control processing in the Motion Control Function Module is executed in the task period of
the primary periodic task or the priority-5 periodic task. The Motion Control Function Module also
exchanges data with Servo Drive and encoder input slaves that are assigned to the axes to control
in the process data communications cycle of the primary periodic task or the priority-5 periodic
task. The process data communications cycle is synchronized with the primary periodic task or the
priority-5 periodic task.
Furthermore, in the NX102 CPU Units and NX1P2 CPU Units, the Motion Control Function Module
exchanges data with NX Units on the CPU Unit that are assigned to the axes to control in the pri-
mary periodic task.
This makes the motion control period the same as the task period of the primary periodic task or
the priority-5 periodic task, which allows complete synchronization of multiple axes.
However, the following restrictions apply:
• The motion control instruction is executed and the command for motion control is sent in the se-
quence control period.
• The data refresh period in the EtherCAT slave depends on settings in the slave.
control processing
instruction Command
Axis variable
• You can use the priority-5 periodic task only with the NX701 CPU Unit.
• With an NX701 CPU Unit, you can execute motion control in the primary periodic task and in
the priority-5 periodic task. If these two motion controls need to be identified, the motion con-
trol in the primary periodic task is called motion control 1, while the motion control in the prior-
ity-5 periodic task is called motion control 2.
• The NX102 CPU Units, NX1P2 CPU Units, and NJ-series CPU Units perform motion control
only in the primary periodic task.
Additional Information
• Use the Sysmac Studio to assign an axis to an EtherCAT slave and NX Unit mounted on the
NX102 and NX1P2 CPU Units, which are controlled by the Motion Control Function Module.
This allows the PLC Function Module to send commands to the Motion Control Function
Module for motion control instructions that are executed in the user program. It also allows
the PLC Function Module to obtain information from the Motion Control Function Module
through the axis variables.
• The task to which the program that contains the motion control instructions is assigned deter-
mines the I/O response time of the motion control system. Refer to 5-11-3 System Input and
Output Response Times on page 5-115 for details.
Sequence control
period (i.e., period of
primary periodic task) Sequence control period Sequence control period
Additional Information
• Relationship among motion controls, tasks, and process data communications cycles for the
NX701 CPU Units
• Relationship among motion controls, tasks, and process data communications cycles for the
NX102 CPU Units, NX1P2 CPU Units, and NJ-series CPU Units
The normal operation state has these three states for operation: PROGRAM mode, RUN mode, and
downloading. A CPU Unit in the normal operation state changes to the other states due to user inter-
action. This state is defined as follows:
State Definition
PROGRAM mode The operating mode is PROGRAM mode.
RUN mode The operating mode is RUN mode.
Downloading Data is being downloaded from the Sysmac Studio.
Note Refer to 2-7-3 Operating Modes on page 2-40 for details on PROGRAM mode and RUN mode.
Power ON
Normal operation
PROGRAM
Controller error occurs
mode
Error state
Downloading Controller error is reset.
RUN mode
Additional Information
• You can check the operating status of the CPU Unit with the status indicators on the front
panel of the CPU Unit. Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503)
for troubleshooting procedures using the status indicators.
• Refer to A-8 Attributes of CPU Unit Data on page A-210 for information on data operations
when the CPU Unit status changes.
• Refer to 6-3-9 Changes to Variables for Status Changes on page 6-68 for the values that
variables take when the status of the CPU Unit changes.
Refer to 6-3-8 Variable Attributes on page 6-60 for information on the Initial Value attribute for var-
iables.
Refer to Device Output Hold Configurations on page 6-71 for details on the device output hold
configurations.
• You can use NX Units only on the NX102 and NX1P2 CPU Units.
• You can use the built-in I/Os and Analog I/O Option Boards only with the NX1P2 CPU Units.
• You can use CJ-series Units only on the NJ-series CPU Units.
Additional Information
Additional Information
The CPU Unit performs various operations when the operating mode is changed, i.e., the axes
are stopped, and motion control instructions are aborted. For details on how the Motion Control
Function Module operates when the operating mode is changed, refer to the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).
Always confirm the safety of the controlled system before you change the setting of the Startup
Mode or the current operating mode.
Additional Information
With an NX701 CPU Unit or NJ-series CPU Unit, if you want to output a signal when the CPU
Unit is in RUN mode, use the RUN output on the Power Supply Unit. Refer to the NX-series
CPU Unit Hardware User’s Manual (Cat. No. W535) and the NJ-series CPU Unit Hardware
User's Manual (Cat. No. W500) for details on the RUN output on the Power Supply Unit.
3-1 Procedure to Create the Slave and Unit Configurations ............................ 3-2
3-2 Creating and Comparing the Slave and Unit Configurations..................... 3-5
3-2-1 Creating the EtherCAT Slave Configuration .................................................... 3-5
3-2-2 Creating the Unit Configuration ....................................................................... 3-6
3-2-3 Verifying the Unit Configuration....................................................................... 3-6
3-3 I/O Ports and Device Variables ..................................................................... 3-8
3-3-1 I/O Ports .......................................................................................................... 3-8
3-3-2 I/O Port Names................................................................................................ 3-9
3-3-3 Device Variables.............................................................................................3-11
3-4 Allocating Variables to Units....................................................................... 3-14
3-4-1 Procedure to Assign Variables to Units ......................................................... 3-14
3-4-2 Using Variables Assigned to Units ................................................................ 3-15
3-5 Creating the Axes and Assigning Them to the Servo Drives/
Encoder Input Slaves/NX Units.................................................................... 3-17
3-5-1 Introduction.................................................................................................... 3-17
3-5-2 Axis Variables and Axes Group Variables ..................................................... 3-17
3-5-3 Creating and Using Axes and Axis Variables ................................................ 3-19
Step 4. Wiring
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series on page 1-19 for details.
EtherCAT
tions
Slave configuration information
CPU
Unit
Step 3 Create the axes and assigning them to the slaves or Units (if motion control is
Reference
used).
1. Create the axes. 3-5 Creating the Axes
and Assigning Them to
2. Assign the axes to the slaves or Units in the EtherCAT configuration or Unit configuration.
the Servo Drives/Encoder
Axis Setup EtherCAT slave configuration/Unit configuraton Input Slaves/NX Units on
Servo Drives page 3-17
Axes Assigned.
A CPU
Axis variable a Unit
Sysmac Studio
EtherCAT
Axis variable b B
A B C D
Axis variable c C
rations
In the EtherCAT Tab Page of the Sysmac Studio, create the EtherCAT slave configuration that is rec-
ognized as “correct” by the CPU Unit.
3
CPU Unit
EtherCAT
The I/O ports are automatically registered for the slaves in the configuration. Later, the user assigns
device variables to the I/O ports.
You can specify device variables in the user program to access the slaves.
Refer to EtherCAT Configuration and Settings in the Sysmac Studio Version 1 Operation Manual (Cat.
No. W504) for specific procedures to create the EtherCAT slave configuration.
Additional Information
• If you connect EtherCAT Slave Terminals, create the EtherCAT slave configuration, create the
Slave Terminal configuration, and set the operation settings. Refer to the NX-series EtherCAT
Coupler Units User’s Manual (Cat. No. W519) for information on the Slave Terminal configu-
ration and operation settings.
• If you use built-in I/O or Option Boards with an NX1P2 CPU Unit, make the configuration set-
tings and other settings in the Controller Setup.
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to use EtherCAT Slave Terminals.
Additional Information
If the EtherCAT slaves are Servo Drives or encoder input slaves, after they are registered in the
EtherCAT slave configuration, Axis Variables are registered automatically by creating the axes.
Refer to Creating the Axes and Assigning Them to the Servo Drives/Encoder Input Slaves/NX
Units for details.
Unit configuration
CPU Unit
Basic I/O Unit
Special Unit
Special Unit
When the power is turned ON, an automatic check is performed to determine whether the correct Unit
configuration matches the physical Unit configuration.
The I/O ports are automatically registered for Units that are specified in the Unit configuration.
Later, the user assigns device variables to the I/O ports.
The device variables are used in the user program to access the Units in the Unit configuration.
Refer to CPU/Expansion Rack Configuration and Setup in the Sysmac Studio Version 1 Operation
Manual (Cat. No. W504) for specific procedures to create the Unit configuration.
• You can start the Controller without creating the Unit configuration. However, if you do so, the
I/O ports and device variables will not be registered automatically, so you will not be able to
access the Units from the user program.
• Create the Unit Configuration to use NX Units with an NX102 CPU Unit and NX1P2 CPU
Unit, or to use CJ-series Units with an NJ-series CPU Unit.
The NX701 CPU Units do not have the Unit configuration because NX Units are not used.
Compared.
rations
3
Compared.
CPU Unit
• You can use NX Units only on the NX102 and NX1P2 CPU Units.
• You can use the built-in I/Os and Analog I/O Option Boards only with the NX1P2 CPU Units.
• You can use CJ-series Units only with NJ-series CPU Units.
CPU Unit
Variables
Device variables
I/O ports are logical interfaces used by
the CPU Unit to exchange data with
external devices.
I/O ports
/O ports are automatically registered in the I/O Map when you create the EtherCAT slave configura-
tion, Unit configuration, and other configurations on the Sysmac Studio, or when you read either of
these configurations from the physical Controller from the Sysmac Studio.
You can check the I/O ports that were registered in the I/O Map of the Sysmac Studio.
I/O Map
Slave and Unit configuration I/O ports Variables assigned to I/O ports:
information created. created. Device variables
Assigned.
ch1_In00 J01_ch1_In00
ch1_In01 J01_ch1_In01
ch1_In02 J01_ch1_In02
3
CPU Unit
Device variables
I/O ports
Refer to 2-3-1 Type of Variables on page 2-12 for the relationship of device variables to other varia-
bles.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on registering de-
vice variables with the Sysmac Studio.
Changes
Attribute Setting to set-
tings
Variable Name Automatically generated variables: [device_name] + [I/O_port_name] Allowed.
Refer to 3-3-2 I/O Port Names on page 3-9 for more information on I/O port
names.
• Built-in I/O
BuiltInIO://cpu/#0/[I/O_port_name]
• Option Boards:
BuiltInIO://opt/#[physical_port_number]/[I/O_port_name]
• EtherCAT slave
ECAT://node#[node_address]/[I/O_port_name]
• CJ-series Units
IOBus://rack#[rack_number]/slot#[slot_number]/[I/O_port_name]
Retain • Device variables for EtherCAT slaves: Not retained. Not al-
• Device variables for NX Units: Not retained. lowed.
• Device variables for built-in I/O: Not retained.
• Device variables for Option Boards: Not retained.
• Device variables for CJ-series Units
Assigned to the Operating Data (CIO Area): Not retained
Assigned to the Setup Data (DM Area): Retained
Initial Value None Allowed.
Constant None Allowed.
Network Publish Do not publish. Allowed.
Edge None Not al-
lowed.
Note You can use CJ-series Units only on the NJ-series CPU Units.
Note You can use NX Units on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
Note You can use device variables for NX Units only with the NX102 CPU Units and NX1P2 CPU Units.
Note You can use the built-in I/Os and Option Boards only with the NX1P2 CPU Units.
Note You can use device variables for built-in I/Os and Option Boards only with the NX1P2 CPU Units.
Note The physical port number indicates a physical location for an I/O port. 0 is given for the option board slot 1
and 1 is given for the option board slot 2.
Refer to 6-3-4 Attributes of Variables on page 6-30 for the meanings of the attributes.
Additional Information
• You can specify forced refreshing for I/O ports in the I/O Map. You can force real I/O to turn
ON or OFF to check the wiring.
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to assign variables to Units.
Additional Information
You can assign variables to EtherCAT slaves other than Slave Terminals. This applies to Ether-
CAT slaves from other manufacturers. The variables are assigned to the EtherCAT slaves in the
same way as they are assigned to EtherCAT Coupler Units and NX Units.
1 On the Sysmac Studio, select Configurations and Setup - EtherCAT or Configurations and
Setup - CPU/Expansion Racks - CPU Rack and make configuation settings for EtherCAT
Slave Terminals or NX Units on the CPU Unit.
2 Select Configurations and Setup - I/O Map to display the I/O Map.
The I/O Map is displayed for the Units of the set EtherCAT Slave Terminals.
3 Right-click the model of Unit to which you want to assign variables and select Display Node
Location Port from the menu.
The Node location information port is added on the I/O Map.
4 Right-click the Node location information and select Create Device Variable.
The variable name is written to the Variable Field of the Node location information port.
The data type of variables assigned to the Units is _sNXUNIT_ID structure. The details on
the_sNXUNIT_ID structure data type are given in the following table.
The values of variables assigned to the Units will be set automatically when you register the
variables. Do not change the values of the variables. If you change the value of a variable, the
Controller may not perform the intended operation.
Additional Information
3
The data type of variables assigned to EtherCAT slaves other than Slave Terminals is _sE-
CAT_ID structure. The details are given in the following table.
Designating Units
The variables assigned to the Units are passed as parameters to the instructions for which specify the
Units.
NX_SaveParam_instance
A NX_SaveParam B
Execute Done
NX1 UnitProxy Busy
UINT#0 TimeOut Error
ErrorID
ErrorIDEx
Example: The following programming example changes multiple NX Units to the mode that enables
writing data.
NX0, NX1, and NX2 are the variables that were assigned to the NX Units. The variables are assigned
to the elements of the NXTable[0..2] and then the NX_ChangeWriteMode instruction is executed in or-
der for each.
• Variable Table
• ST Program
FOR i:= 0 TO 2 DO
NX_ChangeWriteMode_instance[i](Execute:=FALSE);
END_FOR;
NXTable[0] := NX0;
NXTable[1] := NX1;
NXTable[2] := NX2;
FOR i:= 0 TO 2 DO
NX_ChangeWriteMode_instance[i](Execute:=TRUE, UnitProxy:=NXTable[i]);
END_FOR;
3-5-1 Introduction
When you use the Motion Control Function Module for operation with EtherCAT Servo Drive, encoder
input slaves, or NX Units, create axes in the Sysmac Studio and define them as EtherCAT servo axes,
3
encoder axes, or NX Units.
At a result, Axis Variables are automatically created as system-defined variables.
3-5-1 Introduction
Controlled by the Motion Control Function Module.
CPU Unit NX Unit NX Unit
Axis A
Motion Control Function Module
Created. Created.
Assigned. Assigned.
EtherCAT
EtherCAT
slave
You can specify an Axis Variable in a motion control instruction in the user program to easily access
and perform operations with Servo Drive, encoder input slaves, and NX Units.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details
on Axis Variables and Axes Group Variables.
• Specifying Axis and Axes Group Variables
The variables can be specified with variable names that are created with the Sysmac Studio or with
system-defined variable names.
Names
Type
Axis Variables Axes Group Variables
Variable names cre- MC_Axis*** (“***” is assigned in ascending MC_Group*** (“***” is assigned in ascend-
ated with the Sys- order from 000 in the order the variables ing order from 000 in the order the varia-
mac Studio are created.) bles are created.)
You can change the names as required. You can change the names as required.
System-defined var- _MC_AX[***]*1 _MC_GRP[***]*1
iable names (The array element numbers are assigned (The array element numbers are assigned
in ascending order from 0 in the order the in ascending order from 0 in the order the
variables are created.) variables are created.)
*1. With the NX701 CPU Unit, you can also use _MC1_AX[***], _MC2_AX[***], _MC1_GRP[***], and
_MC2_GRP[***]. For details, refer to the .
• Application
There are two ways to use Axis Variables and Axes Group Variables.
1. Specifying Axes and Axes Groups in Motion Control Instructions:
If you specify an axis or axes group for an I/O variable for a motion control instruction, you can
perform operations for the OMRON Servo Drive, encoder input slave, or NX Unit.
2. Monitoring Axis Variable Members:
You can use instructions to monitor the actual position, error information, or other information on
the Servo Drive, encoder input slaves, and NX Units.
3. You can monitor the members of the axis variable with instructions.
Assigned
axis
Control operations
OMRON Servo Drives or
EtherCAT
encoder input slaves, or
supported Servo Drives or
encoder input slaves from
other companies
1 Right-click Axis Settings under Configurations and Setup − Motion Control Setup in the
Multiview Explorer and select Add − Axis Settings from the menu.
If necessary, you can change the axis variable names from the default names of MC_Axis***.
(“***” is incremented from 000 in the order that the axis variables are created.)
2 Assign the axes that you created to Servo Drives or encoder input slaves in the EtherCAT
slave configuration of the Sysmac Studio.
Set the Axis Basic Settings from the Sysmac Studio.
3 Use the Sysmac Studio to specify the settings required for Test Mode operation (Unit Conver-
sion, Count Mode, Limits, etc.) and the settings required for actual system operation. Then
transfer the settings to the CPU Unit with the project.
4 In the user program, an axis variable name is specified for the in-out variable Axis in motion
control instructions.
For the axis variable name, specify the axis name (axis variable name) that was specified in
the Motion Control Setup or a system-defined variable. You can execute motion control for the
assigned Servo Drive, encoder input slave, or NX Unit. An example that specifies the axis vari-
able name MyAxis1 is shown below.
Example:
Enable Status
ServoOn Busy MyAxis1OnBusy
Error MyAxis1OnError
ErrorID MyAxis1OnErrorID
• For an NX701 CPU Unit, use the system-defined variables that correspond to the Motion
Control parameter for Axis Settings or Axes Group Settings. A building error occurs if you use
the system-defined variables that do not correspond.
STEP 4. Wiring
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series on page 1-19 for details.
4-2-1 Introduction
The initial settings for the PLC Function Module are listed below.
• Controller Setup
• Task Settings
Select Controller Setup and Task Settings under Configurations and Setup on the Sysmac Studio
to make these settings.
l Basic Settings
The Basic Settings are for functions supported by the CPU Unit, such as the definitions of opera-
tions when the power is turned ON or when the operating mode changes.
Changes
Setting Update
Parameter Description Set value Default in RUN
group timing
mode
Changes
Setting Update
Parameter Description Set value Default in RUN
group timing
mode
SD Memory Restore by Set whether to use Use Do not use When Not al-
Card Re- system-de- the restore of SD Do not use download- lowed.
store Set- fined varia- Memory Card back- ed to CPU
ting*7 ble ups by the system- Unit
defined variable.
Password Sets the password 8 to 32 sin- None When Not al-
that is used for verifi- gle-byte al- download- lowed.
cation when you ex- phanumeric ed to CPU
ecute the restore of characters Unit
SD Memory Card (case sensi-
backups by the sys- tive)
tem-defined varia-
ble.
Event Log Instruction Sets whether to out- Do not use Do not use When Not al-
Settings*8 Error Output put events to an Use download- lowed.
event log when in- ed to CPU
struction errors oc- Unit
cur.
Security Set- Write protec- Sets whether to au- Do not use Do not use At power Allowed.
tings tion at start- tomatically enable or Use ON
up disable write protec-
tion when you turn
ON the power sup-
ply to the Controller.
Prohibit data Sets whether to ena- Do not use Do not use When Allowed.
backup to ble or disable SD Use download-
the SD Memory Card back- ed to CPU
Memory ups. Unit
Card*9
*1. This setting is enabled when an NS-series PT is connected to the built-in EtherNet/IP port on the CPU
Unit, and the power supplies for these devices are turned ON simultaneously.
A CPU Unit with unit version 1.10 or later and Sysmac Studio version 1.12 or higher are required to set
the Start delay time at startup.
*2. The processing time for verifying tags of an NS-series PT can be reduced with this setting. Set the value
to 10 if you want to give priority to the tag verifications. Otherwise, set the value to 0.
If you set the value to 10, after the power supply is turned ON, the CPU Unit gives priority to the tag
verifications of the NS-series PT for approximately 10 seconds during startup before the Unit changes
the startup state to the normal operation state. The time to complete the tag verifications can be reduced
because a part of the verification process is performed with priority during startup.
If you specify the value between 1 and 10, the time until the CPU Unit changes the state to the normal
operation state is increased because the Unit gives priority to the tag verifications for the specified time
regardless of whether an NS-series PT is used. Set the value to 0 if an NS-series PT is not connected,
or if you do not turn ON the power supplies for the NS-series PT and the CPU Unit simultaneously.
*3. For the following CPU Unit and Sysmac Studio, 0 to 30s can be set for the start delay time at startup.
Make this setting up to approximately 20 seconds because the time from when the power supply to the
CPU Unit is turned ON until the Unit changes to the normal operation is affected.
If Use is selected for Event Log Settings - Instruction Error Output, an instruction error is
output each time an error occurs when an instruction with an error is executed repetitively. This
may cause the event log to exceed the maximum number of events. If this occurs, older events
are overwritten.
l Task Settings
The Task Settings are used to add and set up tasks.
Changes
Setting Update
Parameter Description Set value Default in RUN
group timing
mode
Task Type Sets the task Primary periodic Primary peri- When Not al-
type. task odic task download- lowed.
Periodic task ed
Priority-5 periodic
task*1
Periodic task
Priority-16 period-
ic task*2
Periodic task
Priority-17 period-
ic task
Periodic task
Priority-18 period-
ic task
Event task
Priority-8 event
task
Event task
Priority-48 event
task
Execution Sets the task ex- Automatically set Primary peri- When Not al-
Priority ecution priority. according to the odic task: 4 download- lowed.
task type. ed
Task Name Sets the task Text string Primary peri- When Not al-
name. odic task: Pri- download- lowed.
maryTask ed
Periodic
tasks: Prio-
dicTask0
Event tasks:
EventTask0
Changes
Setting Update
Parameter Description Set value Default in RUN
group timing
mode
Changes
Setting Update
Parameter Description Set value Default in RUN
group timing
mode
Variable Sets the percent- Primary periodic 3% When Not al-
Access age of the task task and periodic download- lowed.
Time [%] period to assign tasks: ed
to variable ac- 1% to 50%
cess from outside Event tasks:
the Controller. None
*1. You can use the priority-5 periodic task only with the NX701 CPU Units.
*2. You cannot use the priority-16 periodic task with the NX102 CPU Unit or NX1P2 CPU Unit.
*3. For the NX102 CPU Unit, NX1P2 CPU Unit, and NJ101 CPU Unit, the default of the primary periodic
task is 2 ms.
However, for the NX1P2-9B££££ CPU Unit, the default of the primary periodic task is 4 ms.
• A program that contains the device variables used to access slaves and Units must be as-
signed to the same task as the one to which the slaves and Units that are set in the I/O Con-
trol Task Settings are assigned. A building error will occur if you assign the program to other
tasks.
• The default task set in the I/O Control Task Settings is the primary periodic task. If you want
to assign the program to a task other than the primary periodic task, change the setting in the
I/O Control Task Settings in advance to prevent a building error.
• For an NX-series CPU Unit, a program used to control slaves and Units that are assigned to
axes must be assigned to the tasks that correspond to the Motion Control parameter for Axis
Settings or Axes Group Settings. A building error will occur if you assign the program to the
tasks that do not correspond.
Use the system-defined variables that correspond to the setting values of the Motion control
parameter when you specify axes or axes groups in programs.
Changes
Update
Item Parameter Description Set value Default in RUN
timing
mode
Each Task Variables to Sets the variables to None When Not al-
be refresh- refresh in the primary download- lowed.
ed periodic task or peri- ed to CPU
odic task. Unit
Data Type Sets the data type of None
variable.
Variable Sets a comment for None
Comment the variable.
Accessing Sets the tasks that ac-
Task cess the variable.
4-2-4 Unit Configuration and Unit Setup for NX102 and NX1P2 CPU Units
l Task Execution Time Monitor
The Task Execution Time Monitor displays the execution times of the tasks.
4-2-4 Unit Configuration and Unit Setup for NX102 and NX1P2 CPU
Units
This section describes the Unit configurations and settings for the NX Units on the NX102 CPU Units
and NX1P2 CPU Units. These settings are not provided for NX701 CPU Units and NJ-series CPU
Units.
Create the configuration of the NX Units on the CPU Unit and set each Unit.
Configure the settings on the CPU and Expansion Racks Tab Page on the Sysmac Studio.
The settable items for the selected CPU Unit are listed below.
_NXB_UnitRegTbl (NX Unit Registration Status) and _NXB_UnitErrFlagTbl (NX Unit Error Status)
are examples of the system-defined variables to specify the NX Unit number. The system-defined
variable for this status information uses BOOL arrays, and the NX Unit number is specified as the
subscript.
For example, if an NX Unit D is added to the CPU Unit, the NX Unit numbers of all NX Units to the
right of the new NX Unit will change.
NX Unit Number 1 2 3
NX Unit Registration Status _NXB_UnitRegTbl[1] _NXB_UnitRegTbl[2] _NXB_UnitRegTbl[3]
4-2-4 Unit Configuration and Unit Setup for NX102 and NX1P2 CPU Units
The addition changes the NX Unit numbers,
NX Unit D added as 2nd NX Unit so you must correct the subscripts to specify
the same NX Units as before the addition in
the NX Unit Registration Status.
NX Unit Number 1 2 3 4
NX Unit Registration Status _NXB_UnitRegTbl[1] _NXB_UnitRegTbl[2] _NXB_UnitRegTbl[3] _NXB_UnitRegTbl[4]
If you specify the subscripts of arrays directly with numbers, the subscripts in the program must be
corrected to specify the same NX Unit as before the addition.
If you use _sNXUNIT_ID data type variables that are assigned to the Units to specify the array sub-
scripts, you do not need to correct the program even if the Unit configuration changes. The NX Unit
number of a Unit is stored in the UnitNo member of the _sNXUNIT_ID structure variable.
For example, if the _sNXUNIT_ID variable NXUnitB is assigned to NX Unit B in the above figure,
the program would not need to be corrected even if the Unit configuration changed as long as the
array subscript is specified with _NXB_UnitRegTbl[NXUnitB.UnitNo].
Additional Information
4-2-5 Unit Configuration and Unit Setup for NJ-series CPU Units
This section describes the Unit settings for NJ-series CPU Units. These settings are not provided for
NX-series CPU Units.
l Unit Information
Additional Information
The device names that are set here are placed before the I/O port name when device variables
are automatically created.
l Special Units
Set the unit numbers of the Special Units.
Make sure you set the same unit numbers as the unit numbers that are set on the rotary
switches on the front of the Special Units. If they are not the same, operation will be according
to the unit numbers that are set on the front-panel rotary switches.
4-2-5 Unit Configuration and Unit Setup for NJ-series CPU Units
The settable items for the selected NX Unit are listed below.
NX Unit Mounting Setting This setting enables or disables the mount- Enabled Enabled
ing of an NX Unit. Refer to 8-2-2 Mounting Disabled
Settings of NX Units on the CPU Unit on
page 8-11 for details on this setting.
I/O allocation settings These are the settings for which I/O data in --- Refer to the
the NX Unit to exchange. *3 manual for the
Click the Edit I/O Allocation Settings But- specific NX Unit.
ton to edit these settings. You cannot change
this setting for System Units. Refer to
4-3-2 I/O Allocation Settings on page 4-19
for an overview of I/O allocation settings and
how to edit the settings.
Unit operation settings These are the Unit operation settings for the --- Refer to the
*4
NX Unit. Click the Edit Unit Operation manual for the
Settings Button to edit these settings. You specific NX Unit.
cannot change this setting for System Units.
Refer to 4-3-3 Unit Operation Settings on
page 4-21 for the Unit operation settings.
Unit application data This data controls the functionality that is --- Refer to the
specific to each NX Unit. Not all NX Units manual for the
have Unit application data. specific NX Unit.
*1. The device name that is set here is placed before the I/O port name when device variables are automatically
created.
I/O data C
Selected. Not possible. I/O entry mapping B Not possible.
I/O data D
I/O data E
Not selected. Possible. I/O entry mapping C Not possible.
I/O data F
*The shaded I/O data is not exchanged with process data communications.
Name/Label Description
I/O Allocation The usage of I/O allocation for the entire CPU Unit is displayed here.
Status • (1)I/O data size: The size of the I/O data that is allocated for the entire CPU Unit is given.
The denominator is the maximum allocatable size.
The I/O data size gives the amount of memory that is used by the I/O data. This value will
not necessarily be the same as the total sum of all I/O entry sizes.
• (2)Number of I/O entry mappings: The number of I/O entry mappings that are allocated to
the entire CPU Unit is given. The denominator is the maximum number of allocatable I/O
data.
I/O Entry Map- This is a mapping list of the I/O entries in the corresponding Unit.
ping List The I/O entry mapping list shows up to four inputs and outputs respectively.
The I/O entry mapping list shows the following items.
• Selection: This column is used to select the I/O entry mappings that you wish to allocate.
Select the I/O entry mapping that you wish to allocate.
If you do not want to allocate the I/O entry mapping as part of the I/O allocation informa-
tion, select No option.
• Input/Output: This column shows whether the data is an input or an output in terms of the
CPU Unit.
• I/O entry mapping name: This column gives the name of the I/O entry mapping.
• Flag: If the I/O entry is editable, this column says "Editable."
• If the I/O entry is not editable, this column says "---."
I/O entries This pane allows you to view and edit the I/O entries for the I/O entry mappings that are se-
lected in the I/O Entry Mapping List.
Each I/O entry contains the following information.
• Index: This is the index number for the NX object.
The index is displayed after “0x” as index_number: subindex_number.
• Size: This column gives the size of the I/O entry data.
• Data Type: This column gives the data type of the I/O entry.
• I/O entry name: This column gives the name of the I/O entry.
• Comment: This column gives a description of the I/O entry.
Name/Label Description
Control buttons • Add I/O Entry Button: This button adds an I/O entry to the selected I/O entry mapping.
for the Edit I/O • Delete I/O Entry Button: This button deletes the selected I/O entry from the selected I/O
Allocation Set- entry mapping.
tings Pane • OK Button: This button confirms the settings in the Edit I/O Allocation Settings Pane, and
returns the display to the CPU and Expansion Racks Tab Page.
• Cancel Button: This button cancels the settings in the Edit I/O Allocation Settings Pane,
and returns the display to the CPU and Expansion Racks Tab Page.
If the connected position of an NX Unit is changed, the Unit operation settings return to initial
values.
Transfer the Unit operation settings again as necessary.
l Method 1: Setting from the Unit Setting Pane of the Sysmac Studio
2 Specify the settings in the Unit Settings Tab Page shown below.
3 Connect the CPU Unit online and transfer the settings to the CPU Unit.
l Method 2: Using the Sysmac Studio to Specify Initial Settings for the I/O
Ports in the I/O Map
1 Use the I/O Map in the Sysmac Studio to set values for the I/O ports.
2 Restart the Unit, reset the Controller, or cycle the power supply to the Controller.
l Method 3: Using the Sysmac Studio to Specify Initial Settings for the De-
vice Variables of the CJ-series Units
1 Use the Sysmac Studio to specify the initial values for the device variables of the CJ-series
Units.
3 Restart the Unit, reset the Controller, or cycle the power supply to the Controller.
l Method 4: Using Instructions to Set the Device Variables for the CJ-series
Units
1 Set the values for the device variables for the CJ-series Unit at the start of operation from the
user program (e.g., use the MOVE instruction) and then restart the Unit.
Example: 4
P_First_RunMode MOVE
EN ENO
First RUN
Period Flag
UINT#16#0101 In Out Unit0_RangeCfg
Instance
ResetUnit
Execute Done
_SIO_No00 UnitNo Busy
Error
ErrorID
Instance.Done
Processing after restarting
When you restart a Special Unit after you change the settings, confirm the safety of the devices
at the connection target before you restart the Unit.
4-5-1 Introduction
The initial settings for the Motion Control Function Module are called motion control parameters.
Motion control parameters include the following parameters.
• Axis Parameters: Settings for single-axis control
• Axes Group Parameters: Settings for multi-axes coordinated control
Sysmac Studio
Set the parameters in the
Motion Control Setup. CPU Unit
Motion control
parameters
Built-in non-vola-
tile memory When power is turned ON Main memory
When downloaded.
User program
Axes Group
Upload. Axes group
Parameter Settings
parameter settings MC_Write instruction
Temporarily changes
some parameters.
The initial settings for the EtherCAT Master Function Module include the following and other items.
• Device names
• Total Cable Length
• Fail-soft Operation Settings
• Wait Time for Slave Startup
• PDO Communications Timeout Detection Count
• Revision Check Method
• Serial Number Check Method
Double-click EtherCAT under Configurations and Setup and then select the master on the Sysmac
Studio. The Initial Setting Tab Page for the EtherCAT Master Function Module is displayed.
Refer to the NJ/NX-series CPU Unit Built-in EtherCAT Port User's Manual (Cat. No. W505) for details.
The initial settings for the EtherNet/IP Function Module are listed below.
• TCP/IP Settings
• Link Settings
• FTP Settings
• NTP Settings
• SNMP Settings
• SNMP Trap Settings
• FINS Settings
• CIP Settings
Select Configurations and Setup − Controller Setup − Built-in EtherNet/IP Port Settings on the 4
Sysmac Studio to make these settings.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506) for detail.
Version Information
CIP Settings can be made in the following CPU Units of the stated unit versions.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
The initial settings for the built-in I/Os are listed below.
• Input Filter Setting
• Load Rejection Output Setting
Select Configurations and Setup − Controller Setup − Built-in I/O Settings on the Sysmac Studio
to make these settings.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No. W579)
for details.
The initial settings for the Option Boards are listed below.
Select Configurations and Setup - Controller Setup - Option Board Settings on the Sysmac Stu-
dio to make these settings.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No. W579)
for details.
The initial settings for memory for CJ-series Units are listed below. Set whether to enable or disable
memory for CJ-series Units and set the memory size when it is enabled.
• CIO
• WR
• HR
• DM
• EM
Additional Information
You cannot use the EM Area for the NX1P2 CPU Units.
Select Configurations and Setup – Controller Setup – Memory Settings on the Sysmac Studio to
make these settings.
4-10-3 Settings
group ing RUN mode
Memory set- CIO*1 Enable Enable or disable the Enable Disable When down- Not allowed.
tings for CJ- generation of CIO area Disable loaded to
series Units type memory used for CPU Unit
CJ-series Units.
Size (Num- Specify the size of 1 to 6,144 6,144 When down- Not allowed.
ber of memory of area type loaded to
Words) CIO. CPU Unit
WR*1 Enable Enable or disable the Enable Disable When down- Not allowed.
generation of WR area Disable loaded to
type memory used for CPU Unit
CJ-series Units.
Size (Num- Specify the size of 1 to 512 512 When down- Not allowed.
ber of memory of area type loaded to
Words) WR. CPU Unit
HR*2 Enable Enable or disable the Enable Disable When down- Not allowed.
generation of HR area Disable loaded to
type memory used for CPU Unit
CJ-series Units.
Size (Num- Specify the size of 1 to 1,536 512 When down- Not allowed.
ber of memory of area type loaded to
Words) HR. CPU Unit
DM*2 Enable Enable or disable the Enable Disable When down- Not allowed.
generation of DM area Disable loaded to
type memory used for CPU Unit
CJ-series Units.
Size (Num- Specify the size of 1 to 4,096 When down- Not allowed.
ber of memory of area type 32,768 loaded to
Words) DM. CPU Unit
4-10-3 Settings
CJ-series Units.
Size (Num- Specify the size of 1 to 1,536 512 When down- Not allowed.
ber of memory of area type loaded to
Words) HR. CPU Unit
DM*2 Enable Enable or disable the Enable Disable When down- Not allowed.
generation of DM area Disable loaded to
type memory used for CPU Unit
CJ-series Units.
Size (Num- Specify the size of 1 to 4,096 When down- Not allowed.
ber of memory of area type 16,000 loaded to
Words) DM. CPU Unit
*1. Variables without a Retain attribute are used. The value can be set in 1-word increments.
*2. Variables with a Retain attribute are used. The value can be set in 1-word increments.
Additional Information
The setting for memory used for CJ-series Units can also be made when you use the NX701-£
£20 Units. The settings for memory used for CJ-series Units for an NX701-££20 Unit are as
follows.
5-6-2 Processing Performed in and Execution Timing of the Tag Data Link
Service .......................................................................................................... 5-72
5-6-3 Processing Performed in and Execution Timing of the Option Board
Service .......................................................................................................... 5-75
5-6-4 Processing Performed in and Execution Timing of the Communica-
tions Bridge Service ...................................................................................... 5-76
5-6-5 Processing Performed in and Execution Timing of the System Services...... 5-77
5-7 Assignment and Settings Related to Tasks............................................... 5-81
5-7-1 Assigning I/O Refreshing to Tasks ................................................................ 5-81
5-7-2 Assigning Tasks to Programs ........................................................................ 5-88
5-7-3 Parameters for Primary Periodic Task and Periodic Tasks............................ 5-89
5-8 Ensuring Concurrency of Variable Values ................................................. 5-93
5-8-1 Ensuring Concurrency of Variable Values between Tasks ............................ 5-93
5-8-2 Variable Access from Outside the Controller................................................. 5-99
5-9 Errors Related to Tasks ............................................................................. 5-104
5-10 Monitoring Task Execution Status and Task Execution Times.............. 5-107
5-11 Task Design Methods and I/O Response Times...................................... 5-112
5-11-1 Checking the Task Execution Time ..............................................................5-112
5-11-2 Examples of Task Design .............................................................................5-115
5-11-3 System Input and Output Response Times..................................................5-115
The shaded steps in the overall procedure that is shown below are related to the task designing proce-
STEP 4. Wiring
Refer to the 1-3 Overall Operating Procedure for the NJ/NX-series on page 1-19 for detail.
Determine which programs to assign to the primary periodic task, to the priori- 5-7-2 Assigning Tasks
ty-5, priority-16, priority-17, and priority-18 periodic tasks, and to the priority-8 to Programs on page
and priority-48 event tasks. 5-88
Design the exclusive control methods for variables between tasks. 5-8-1 Ensuring Concur-
Design the exclusive control methods for variables between tasks when the same rency of Variable Values
global variables are used in different tasks. between Tasks on page
5-93
Design the tasks to access variables from outside of the Controller. 5-8-2 Variable Access
Design the tasks to enable synchronization of accessing variables in the CPU Unit from Outside the Con-
from outside of the Controller with the execution of a program in a specific task. troller on page 5-99
EtherNet/IP tag data links are included in accessing variables.
5-2-1 Tasks
Tasks are used to assign an execution condition and execution order to a series of processes, such as
I/O refreshing and user program execution.
There are three kinds of tasks, as shown in the following table. They are defined by their execution
conditions and execution priorities.
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are re-
quired to use event tasks.
Additional Information
With an NX701 CPU Unit, you can execute motion control in the primary periodic task and in
the priority-5 periodic task. If these two motion controls need to be identified, the motion control
in the primary periodic task is called motion control 1, while the motion control in the priority-5
periodic task is called motion control 2.
From 1 to 128 programs can be assigned to one task. The programs that are assigned to a task
are executed in the order that they are assigned. Execution of the all of the programs assigned to
each task is called user program execution. 5
Exchanging data with CJ-series Units or EtherCAT slaves is called I/O refreshing.
You can assign I/O refreshing for each slave and Unit to the primary periodic task or the priority-5
5-2-1 Tasks
or priority-16 periodic task. By default, I/O refreshing for all slaves and Units is assigned to the pri-
mary periodic task.
l Event Tasks
An event task is executed only once when the specified execution condition is met. There are the
following two types of execution conditions for event tasks.
From 1 to 128 programs can be assigned to one task. The programs that are assigned to a task
are executed in the order that they are assigned.
• I/O refreshing and motion control are not executed in event tasks. This means that you can-
not assign programs to event tasks if the program performs I/O control or executes motion
control instructions.
• Event tasks are not executed repeatedly every task period. Therefore, you cannot assign a
program to an event task if that program contains an instruction whose execution is not com-
pleted within one task period. Instructions that are executed over more than one task period
include some of the basic instructions, such as instructions for SD Memory Cards and com-
munications, all motion control instructions, and all simulation instructions. Refer to the
NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the basic instruc-
tions that cannot be used in event tasks.
Additional Information
Tasks operate differently between the NX701 CPU Units, NX1P2 CPU Units, and NJ-series
CPU Units. Refer to 5-3 Specifications and Basic Operation of Tasks for NX701 on page 5-11,
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU Units
on page 5-31, and 5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers
on page 5-48 for details.
Flag Operation
Event task
(execution priority
UPG
of 8): Task B
_TaskB_Active
Task execution
condition is met.*
Task period
Priority-16
periodic task:
IO UPG IO UPG
Task C
_TaskC_Active
Primary
periodic task: IO IO IO UPG M
IO UPG M
Task A M
C C
UPG C
Period exceeded.
_TaskA Exceeded
Item Specification
Type of task • Primary periodic task
• Periodic task (priority 5, 16, 17, or 18)
• Event task (priority 8 or 48)
Numbers of tasks • Primary periodic task: 1
• Periodic tasks: 0 to 4 tasks*1
• Event tasks: 0 to 32 tasks*2
Number of programs per task 128 max.
Task period of the primary periodic 125 μs 5
task 250 μs to 8 ms (in 250 μs increments)
Task periods of periodic tasks • Priority 5
Set the task period of each periodic task to an integer multiple of the task
period of the primary periodic task.
You cannot select any combination of task periods whose least common
multiple exceeds 600 ms.
*1. There can be no more than one task with each of the following execution priorities: 5, 16, 17, and 18.
*2. There can be up to 32 tasks with each of the following priorities as long as there are no more than a total of
32 tasks with these priorities: 8 and 48.
Do not set the task period of primary periodic task to 4 ms or more when you use the priority-5
periodic task. If you set the task period to 4 ms or more, a Slave Application Error may occur.
Additional Information
With an NX701 CPU Unit, you can execute multiple tasks, the tag data link service, and system
services in parallel.
Execution priori-
Task Tasks with the same execution priority
ty
Primary periodic task 4 ---
Primary
4 1
periodic task
5 Periodic task 0 or 1
Event tasks 0 to 32
8
Execution priority
(0 to 63)
5
16 Periodic task 0 or 1
A total of up to 32
18 Periodic task 0 or 1
Event tasks 0 to 32
48
Low
Task Periods for the Primary Periodic Task and Periodic Tasks
The CPU Unit repeatedly and cyclically execute the primary periodic task and periodic tasks.
The task periods for periodic tasks must be assigned as integer multiples of the task period of the pri-
mary periodic task (called the primary period). Therefore, execution of both tasks will start at the same
time every few cycles.
For example, if the primary period is set to 1 ms and the task period of the priority-16 periodic task is
set to 4 ms, the execution timing of the primary periodic task and the priority-16 periodic task is
synchronized after each four executions of the primary periodic task.
Additional Information
An event task is not executed periodically. Instead, it is executed only once when the specified
execution condition is met. Therefore, execution of an event task depends on when its execu-
tion condition is met and on its execution priority.
Low
IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
SS: Indicates system services.
l Project with the Primary Periodic Task, Priority-5 Periodic Task, Priority-16
Periodic Task, and Priority-17 Periodic Task
• The tasks are classified into the following two groups and executed.
Execution priority Primary period Primary period Primary period Primary period Primary period
High Primary
periodic task IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
Priority-5
IO UPG MC IO UPG MC IO UPG MC
periodic task
Priority-16
UPG UPG
periodic task
Priority-17
UPG
periodic task
5
Precautions for Correct Use
Task Specification
Primary periodic task • These tasks are executed in both RUN mode and PROGRAM mode.
Periodic tasks • The user program is executed only in RUN mode.
Event tasks Event tasks are executed only in RUN mode.
• Even if the execution condition for an event task is already met when you change the operat-
ing mode to RUN mode, the event task will not be executed. An event task is executed only
when its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
*1 : Task period The CPU Unit executes tasks in this fixed period. This is a preset, fixed time.
*2 : Task execution time This is the actual time it takes from the point that the execution condition is met
until execution is completed.
Note The processes in each cell in the above table are executed in the order of description.
Output data
processing
processing
processing
User
processing
Input data
Input data
processing 2
common
System
Motion
control
program
Refreshing execution Refreshing
MC_
5
The system-defined variables for motion control When the CPU Unit executes a motion
are updated for use in the following motion control instruction, it executes the result of During output data processing in the next primary
control instructions.
When there is a motion control instruction in user program execution in the priority-16 periodic task,
the Controller executes the result from that instruction in the motion control processing (MC) of the
next primary periodic task.
Refer to 5-11-3 System Input and Output Response Times on page 5-115 for details.
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
Note The processes in each cell in the above table are executed in the order of description.
Output data
processing
processing
processing
User
processing
Input data
Input data
processing 2
common
System
Motion
control
program
Refreshing execution Refreshing
MC_
The system-defined variables for motion control When the CPU Unit executes a motion
are updated for use in the following motion control instruction, it executes the result of During output data processing in the next task period
control instructions. that instruction in motion control processing of priority-5 periodic task, the CPU Unit sends the
immediately afterward. results of motion control processing to the Servo Drive
via EtherCAT.
processing 2
processing 1
tasks in the NX-series CPU Unit will not
common
common
System
User
System
Note The processes in each cell in the above table are executed in the order of description.
System
User
System
Note The processes in each cell in the above table are executed in the order of description.
l Event Tasks
An event task is executed only once when the specified execution condition is met. You can use 0
to 32 event tasks.
The processing details for event tasks are shown in the following figure.
System common
processing 2
User program
execution not refer to the pausing task
scenario.
Task execution
condition is met.
If the following variables are specified for a condition expression when the execution condition
is a condition expression for a variable, event tasks may not be executed when conditions are
met or event tasks may be executed when conditions are not met.
• Structure members whose data size is 16 bits or more, except for system-defined variables
for motion control
• Array elements whose data size is 16 bits or more
5
When the above variables are specified and the match evaluation is performed, perform either
of the followings.
• Copy the above variables to the internal variables with a basic data type other than a data
BoolVar @ActEventTask
EN ENO
'Task1' TaskName
Execution
priority
Primary period
High
Primary
periodic task
Task1
event task
Low
TRUE
BoolVar
FALSE
Example 2: Executing an Event Task Repeatedly While the Value of a Variable Matches a Specified
Value
In the following example, the upward differentiation option is not used for the ActEventTask instruc-
tion. This causes the Task1 event task to be executed as long as the BoolVar BOOL variable is
TRUE. Any ActEventTask instructions that specify Task1 will be ignored if Task1 is already in exe-
cution. After the execution of the event task has started, it is executed to the end even if the value
of BoolVar changes to FALSE during execution.
BoolVar ActEventTask
EN ENO
'Task1' TaskName
Execution
priority
Primary period
High
Primary
periodic task
ActEventTask instruction
is executed.
Task1
event task
Task1 is already in execution so any ActEventTask After the execution of the event
instructions that specify Task1 are ignored. task has started, it is executed
to the end even if the value of
Low
The event task is executed repeatedly the BoolVar variable changes
while the BoolVar variable is TRUE. to FALSE.
TRUE
BoolVar
FALSE
Classification of data
Data type Specification
type
Basic data types Boolean, bit string, integer, and real Possible.
Duration, date, time of day, date and time, or text Not possible.
string data
Data type specifica- Array specification Arrays Not possible.
tions Elements Possible.*1
Derivative data type Structures Structures Not possible.
Members Possible.*2
Unions Unions Not possible.
Members Possible.*2
Enumerations Possible.
*1. The elements of the array must be Boolean variables, bit strings, integer data, or real data.
*2. The members must be Boolean, bit strings, integer data, or real data.
Execution
priority
Primary period
High
Event task
TRUE is assigned to
Program1.trigger1 variable.
Low
TRUE
Program1.trigger1
FALSE
Example 2: Execution Condition for an Event Task Set to When Program1.curVal (INIT variable) ≥
10
The event task is executed only once when the value of Program1.curVal changes from less
than 10 to 10 or higher.
Execution
priority
Primary period
High
Program1.curVal 0 9 10 11 9
If the value of a specified variable changes in the primary periodic task, the CPU Unit evaluates
whether the condition expression is met in the next primary periodic task. This means that the
event task will be executed on completion of this evaluation against the condition expression in 5
the next primary periodic task after the CPU Unit evaluates that the condition expression is met.
If you have multiple tasks that read and write to the same variables, make sure to use the following
functions to control how an event task is executed with the primary periodic task, periodic tasks, or
other event tasks with different execution priorities.
Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks on page 5-93 for details.
Event task
(execution priority of 8)
Task period
Priority-16
periodic task
ActEventTask instruction
Low is executed.
Example 2: Executing an Event Task with an Execution Priority Lower Than the Task That Exe-
cutes an Instruction
Execution
Primary period
priority
High
Primary
periodic task
ActEventTask instruction
is executed.
Event task
(execution priority of 8)
Low
Execution
priority
High Primary period
Priority-16
periodic task
Low
Example 2: Project with a Priority-16 Periodic Task and an Event Task Execution with a Priority of
48
Execution
priority
Primary period
High
Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
5
task
Priority-16
periodic task Event task is executed
only once.
Low
• For the NX701 CPU Units, the timing at which the execution condition for an event task is
met is the same regardless of whether the condition expression match is triggered by I/O re-
freshing in the primary periodic task, or by execution of a program that is assigned to the pri-
mary periodic task.
Execution Timing for Event Tasks with the Same Execution Priority
You can also set the same execution priority for more than one event task. If the execution conditions
for more than one event task with the same execution priority are triggered by an ActEventTask in-
struction, the event tasks will be executed in the order that the instruction is executed.
Primary
periodic task
Execution priority
is the same.
T2 event task
(execution priority of 8)
Low
Example 2: When Both Condition Expressions for Variables and the ActEventTask Instruction Are
Used
In this example, the execution conditions of the T1, T2, and T3 event tasks are set as given below.
• T1: Condition expression for the VarA variable is met.
• T2: Condition expression for the VarB variable is met.
• T3: ActEventTask instruction
The operation would proceed as described below if the condition expression for VarA was met during
I/O refreshing, the ActEventTask instruction was executed in the user program, and the condition ex-
pression for VarB was met during execution of the user program all in the same primary period.
1. The condition expression for VarA is met during I/O refreshing.
2. The condition expression for VarB is met during execution of the user program.
3. At this point, T1 and T2 are not executed because the condition expressions are not yet evaluated.
5. When I/O refreshing is executed in the primary periodic task, the match is detected that the condi-
tion expressions for VarA and VarB are met, so T1 and T2 are executed.
If the match is detected that more than one condition expression is met in the same execution peri-
od, the order of execution of event tasks is undefined. The following figure shows an example
when T1 is executed first.
Execution
priority
High Primary period
T2 event task
(execution priority of 8)
T3 event task
(execution priority of 8)
Low
5-3-6 Operation When Execution Condition Is Met Again Before Execution of the Event Task Is Completed
tion of the event task has started, it is executed to the end even if the condition expression is no longer
met.
Execution
priority
High Primary period
Primary
periodic task
ActEventTask ActEventTask
instruction is instruction is
executed for T1. executed for T1.
Execution of the event task has not completed yet,
so the second ActEventTask instruction is ignored.
T1 event task
(execution priority of 8)
Low
Execution
priority
High Primary period
Primary periodic
task
T1 event task
(execution priority of 8)
Low
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
5-4 Specifications and Basic Operation of
Tasks for NX102 CPU Units and
NX1P2 CPU Units
This section describes the specifications and basic operation of tasks for the NX102 CPU Units and
NX1P2 CPU Units with a multi-core processor.
5-4-1 Specifications of Tasks for NX102 CPU Units and NX1P2 CPU
Units
The specifications of tasks are given in the following table.
5-4-1 Specifications of Tasks for NX102 CPU Units and NX1P2 CPU Units
grams per task
Task period of • NX102-££££ CPU Units: 1 ms to 32 ms (in 250-μs increments)
the primary peri- • NX1P2-1£££££ CPU Units: 2 ms to 8 ms (in 250-μs increments)
odic task • NX1P2-90££££ CPU Units: 2 ms to 8 ms (in 250-μs increments)
• NX1P2-9B££££ CPU Units: 4 ms to 8 ms (in 250-μs increments)
Task periods of • Priority 17 or 18
periodic tasks • NX102-££££ CPU Units: 1 ms to 32 ms (in 250-μs increments)
• NX1P2-1£££££ CPU Units: 2 ms to 100 ms (in 250-μs increments)
• NX1P2-90££££ CPU Units: 2 ms to 8 ms (in 250-μs increments)
• NX1P2-9B££££ CPU Units: 4 ms to 8 ms (in 250-μs increments)
Set the task period of each periodic task to an integer multiple of the task period of the pri-
mary periodic task.
You cannot select any combination of task periods whose least common multiple exceeds
600 ms.
*1. There can be no more than one task with each of the following execution priorities: 17 and 18.
*2. There can be up to 32 tasks with each of the following priorities as long as there are no more than a total of
32 tasks with these priorities: 8 and 48.
5-4-2 Guidelines for Separating Tasks for NX102 CPU Units and
NX1P2 CPU Units
All programs must be assigned to one of the tasks. Use the guidelines in the following table to deter-
mine which tasks to assign your programs to based on the requirements of the programs.
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU
Units
The NX102 CPU Units and NX1P2 CPU Units cannot execute more than one task at the same time.
The order in which tasks are executed depends on the execution priority that is set for each task.
Additional Information
• With an NX102 CPU Unit, you can execute the communications bridge service, tag data link
service and system services without being affected by the task execution.
• With an NX1P2 CPU Unit, you can execute the tag data link service, option board service,
and system services without being affected by the task execution.
Execution
Task Tasks with the same execution priority
priority
Primary periodic task 4 ---
Periodic task 17 or 18 You cannot set the same execution priority for more than one task.
Event task 8 or 48 You can set the same execution priority for more than one event
task.
Refer to 5-4-5 Event Task Execution Timing for NX102 CPU Units
and NX1P2 CPU Units on page 5-42 for the order of execution.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
High Numbers of tasks
Primary
4 1
periodic task
Event tasks 0 to 32
8
Execution priority
(0 to 63)
A total of up to 32
tasks for both
priority levels.
17 Periodic task 0 or 1
18 Periodic task 0 or 1
Low
5
Task Periods for the Primary Periodic Task and Periodic Tasks
The CPU Unit repeatedly and cyclically executes the primary periodic task and periodic tasks.
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU Units
The task periods for periodic tasks must be assigned as integer multiples of the task period of the pri-
mary periodic task (called the primary period). Therefore, execution of both tasks will start at the same
time every few cycles.
For example, if the primary period is set to 2 ms and the task period of the priority-17 periodic task is
set to 8 ms, the execution timing of the primary periodic task and the priority-17 periodic task is
synchronized after each four executions of the primary periodic task.
Additional Information
An event task is not executed periodically. Instead, it is executed only once when the specified
execution condition is met. Therefore, execution of an event task depends on when its execu-
tion condition is met and on its execution priority.
Low
IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
SS: Indicates system services.
l Project with the Primary Periodic Task and Priority-17 Periodic Task
• The primary periodic task has the highest execution priority, so it is always executed in the pri-
mary period.
• The priority-17 periodic task has a lower execution priority than the primary periodic task, so it is
executed when the primary periodic task is not being executed.
• In this example, the task period for the priority-17 periodic task is set to four times the primary
period. This means that execution of the priority-17 periodic task will start at the same time once
every four primary periods.
• The system services are executed at the required time without being affected by the tasks.
Primary period Primary period Primary period Primary period Primary period
Execution priority
High Primary
periodic IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task
Task execution Task Task execution Task Task execution Task Task execution Task Task execution Task
condition is execution condition is execution condition is execution condition is execution condition is execution
met. is completed. met. is completed. met. is completed. met. is completed. met. is completed.
Task period
Priority-17
periodic task
Pausing UPG Pausing Pausing UPG
System
SS
services
Low
If you have multiple tasks that read and write to the same variables, make sure to use exclusive
control of variables between the tasks. Otherwise, a task other than the one currently in execu-
tion may change the variable values. Refer to 5-8-1 Ensuring Concurrency of Variable Values
between Tasks on page 5-93 for details.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Task Specification
Primary periodic task • These tasks are executed in both RUN mode and PROGRAM mode.
Periodic tasks • The user program is executed only in RUN mode.
Event tasks Event tasks are executed only in RUN mode.
• Even if the execution condition for an event task is already met when you change the operat-
ing mode to RUN mode, the event task will not be executed. An event task is executed only
when its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU Units
Task execution time*2 (varies)
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
*1 : Task period The CPU Unit executes tasks in this fixed period. This is a preset, fixed time.
*2 : Task execution time This is the actual time it takes from the point that the execution condition is met
until execution is completed.
Note The processes in each cell in the above table are executed in the order of description.
Output data
processing
processing
processing
User
processing
Input data
Input data
processing 2
common
System
Motion
control
program
Refreshing execution Refreshing
MC_
The system-defined variables for motion control When the CPU Unit executes a motion
are updated for use in the following motion control instruction, it executes the result of During output data processing in the next primary
control instructions. that instruction in motion control processing period, the CPU Unit sends the results of motion
immediately afterward. control processing to the Servo Drive via EtherCAT.
processing 2
common
common
System
System
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Processing Processing contents
System common proc- • Processing for exclusive control of variables in tasks is performed (when re-
essing 2 freshing tasks are set).
• Processing for variables accessed from outside of the Controller is performed
to maintain concurrency with task execution (executed for the variable access
time that is set in the Task Settings).
• If there is processing for EtherNet/IP tag data links and refreshing tasks are
set for the tags (i.e., variables with a Network Publish attribute), variable ac-
cess processing is performed.
Note The processes in each cell in the above table are executed in the order of description.
l Event Tasks
An event task is executed only once when the specified execution condition is met. You can use 0
to 32 event tasks.
processing 2
5
common
common
System
System
5-4-4 Event Task Execution Conditions for NX102 CPU Units and NX1P2 CPU Units
Task execution
condition is met.
5-4-4 Event Task Execution Conditions for NX102 CPU Units and
NX1P2 CPU Units
An event task is executed only once when the specified execution condition is met. There are the fol-
lowing two types of execution conditions for event tasks.
If the following variables are specified for a condition expression when the execution condition
is a condition expression for a variable, event tasks may not be executed when conditions are
met or event tasks may be executed when conditions are not met.
• Structure members whose data size is 16 bits or more, except for system-defined variables
for motion control
• Array elements whose data size is 16 bits or more
When the above variables are specified and the match evaluation is performed, perform either
of the followings.
• Copy the above variables to the internal variables with a basic data type other than a data
size of 64 bits, and access the copied internal variables.
• Use the settings for exclusive control of variables in tasks, and set the primary periodic task
as a refreshing task.
BoolVar @ActEventTask
EN ENO
'Task1' TaskName
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Execution
priority
Primary period
High
Primary
periodic task
Task1 Interrupted.
event task
Low
TRUE
Example 2: Executing an Event Task Repeatedly While the Value of a Variable Matches a Specified
Value
In the following example, the upward differentiation option is not used for the ActEventTask instruc- 5
tion. This causes the Task1 event task to be executed as long as the BoolVar BOOL variable is
TRUE. Any ActEventTask instructions that specify Task1 will be ignored if Task1 is already in exe-
5-4-4 Event Task Execution Conditions for NX102 CPU Units and NX1P2 CPU Units
cution. After the execution of the event task has started, it is executed to the end even if the value
of BoolVar changes to FALSE during execution.
BoolVar ActEventTask
EN ENO
'Task1' TaskName
Execution
priority
Primary period
High
Primary
periodic task
ActEventTask instruction
is executed.
Task1 is already in execution so any ActEventTask After the execution of the event
instructions that specify Task1 are ignored. task has started, it is executed
to the end even if the value of
Low
The event task is executed repeatedly the BoolVar variable changes
while the BoolVar variable is TRUE. to FALSE.
TRUE
BoolVar
FALSE
Classification of data
Data type Specification
type
Basic data types Boolean, bit string, integer, and real Possible.
Duration, date, time of day, date and time, or text Not possible.
string data
Data type specifica- Array specification Arrays Not possible.
tions Elements Possible.*1
Derivative data type Structures Structures Not possible.
Members Possible.*2
Unions Unions Not possible.
Members Possible.*2
Enumerations Possible.
*1. The elements of the array must be Boolean variables, bit strings, integer data, or real data.
*2. The members must be Boolean, bit strings, integer data, or real data.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Data type Possible condition expressions
Boolean, Boolean array elements, Boolean structure members, and Change to TRUE
Boolean union members FALSE to TRUE
Change to FALSE
TRUE to FALSE
Bit string, real number, integer, as well as array element, structure Variable = {Comparison constant}
member, or union member with one of those data types Variable ≠ {Comparison constant}
Variable > {Comparison constant}
Variable ≥ {Comparison constant}
Variable < {Comparison constant}
Variable ≤ {Comparison constant}
5-4-4 Event Task Execution Conditions for NX102 CPU Units and NX1P2 CPU Units
l Example of Executing Event Tasks When Condition Expressions for Varia-
bles Are Met
Example 1: Execution Condition for Event Task Set to a Change to TRUE of the Program1.trigger1
Boolean Variable
When the value of Program1.trigger1 changes to TRUE, the event task is executed only once.
Execution
priority
High Primary period
Primary IO UPG MC
IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Condition expression Condition expression The event task is executed only once.
is not met. is met.
Event task
TRUE is assigned to
Program1.trigger1 variable.
Low
TRUE
Program1.trigger1
FALSE
Example 2: Execution Condition for an Event Task Set to When Program1.curVal (INIT variable) ≥
10
The event task is executed only once when the value of Program1.curVal changes from less
than 10 to 10 or higher.
Execution
priority
Primary period
High
Primary
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Program1.curVal 0 9 10 11 9
If the value of a specified variable changes in the primary periodic task, the CPU Unit evaluates
whether the condition expression is met in the next primary periodic task. This means that the
event task will be executed on completion of this evaluation against the condition expression in
the next primary periodic task after the CPU Unit evaluates that the condition expression is met.
5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2
CPU Units
The execution priority of event tasks is 8 or 48. If the execution conditions for an event task are met
while another task is in execution, the task with the higher execution priority is given priority. The task
with the lower execution priority is interrupted. This is the same as with the primary periodic task and
periodic tasks.
If you have multiple tasks that read and write to the same variables, make sure to use the following
functions to control how an event task is executed with the primary periodic task, periodic tasks, or
other event tasks with different execution priorities.
Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks on page 5-93 for details.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Differences in Execution Timing Based on the Execution Condi-
tions of Event Tasks
The execution timing for event tasks depends on whether the execution condition is triggered by an
ActEventTask instruction or by when a condition expression for a variable is met.
Task period
5
Priority-17 Interrupted.
periodic task
5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2 CPU Units
ActEventTask
Low instruction is executed.
Example 2: Executing an Event Task with an Execution Priority Lower Than the Task That Exe-
cutes an Instruction
Execution
Primary period
priority
High
Primary
periodic task
ActEventTask instruction
is executed.
Event task
(execution priority of 8)
Low
The execution priority of the event task (execution priority of 8) is higher than the execution pri-
ority of the priority-17 periodic task. The priority-17 periodic task is therefore executed after the
event task is executed.
Execution
priority
Primary period
High
Task period
Priority-17 Interrupted.
periodic task
Low
Example 2: Project with a Priority-17 Periodic Task and an Event Task Execution with a Priority of
48
The execution priority of the event task is lower than the execution priority of the priority-17 peri-
odic task. The event task is therefore executed after the priority-17 periodic task is executed.
Execution
priority
Primary period
High
Low
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Precautions for Correct Use
• For the NX102 CPU Units and NX1P2 CPU Units, the timing at which the execution condition
for an event task is met is the same regardless of whether the condition expression match is
triggered by I/O refreshing in the primary periodic task, or by execution of a program that is
assigned to the primary periodic task.
5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2 CPU Units
In the example given below, two ActEventTask instructions are used to execute two event tasks. The
T1 event task is executed before the T2 event task because the ActEventTask instruction that trig-
gered T1 was executed first.
Execution
priority
High Primary period
Primary
periodic task
Execution priority
is the same.
T2 event task
(execution priority of 8)
Low
Example 2: When Both Condition Expressions for Variables and the ActEventTask Instruction Are
Used
In this example, the execution conditions of the T1, T2, and T3 event tasks are set as given below.
• T1: Condition expression for the VarA variable is met.
• T2: Condition expression for the VarB variable is met.
• T3: ActEventTask instruction
The operation would proceed as described below if the condition expression for VarA was met during
I/O refreshing, the ActEventTask instruction was executed in the user program, and the condition ex-
pression for VarB was met during execution of the user program all in the same primary period.
2. The condition expression for VarB is met during execution of the user program.
3. At this point, T1 and T2 are not executed because the condition expressions are not yet evaluated.
5. When I/O refreshing is executed in the primary periodic task, the match is detected that the condi-
tion expressions for VarA and VarB are met, so T1 and T2 are executed.
If the match is detected that more than one condition expression is met in the same execution peri-
od, the order of execution of event tasks is undefined. The following figure shows an example
when T1 is executed first.
Execution
priority
High Primary period
Condition expression
for VarA is met. ActEventTask
Condition expression instruction The match for the condition
for VarB is met. is executed. expression for VarA and
T1 event task VarB is detected.
(execution
priority of 8)
T2 event task
(execution
priority of 8)
T3 event task
(execution
priority of 8)
Low
Primary
periodic task
ActEventTask ActEventTask
instruction is instruction is Execution of the event task has not completed yet,
executed for T1. executed for T1. so the second ActEventTask instruction is ignored.
T1 event task
Interrupted.
(execution priority of 8)
Low
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and
Execution
priority
Primary period
High
Primary
periodic task
T1 priority-17
periodic task Interrupted. Interrupted.
Low
5-4-6 Operation When Execution Condition Is Met Again Before Execution of the Event Task Is Completed
Item Specification
Type of task • Primary periodic task
• Periodic task (priority 16, 17, or 18)
• Event task (priority 8 or 48)
Numbers of tasks • Primary periodic task: 1
• Periodic tasks: 0 to 3 tasks*1
• Event tasks: 0 to 32 tasks*2
Number of programs per task 128 max.
Task period of the primary periodic 500 μs*3, 1 ms, 2 ms, or 4 ms
task
Task periods of periodic tasks Set the task period of each periodic task to an integer multiple of the task
period of the primary periodic task.
Refer to the table of valid task periods for periodic tasks that is given be-
low.
*1. There can be no more than one task with each of the following execution priorities: 16, 17, and 18.
*2. There can be up to 32 tasks with each of the following priorities as long as there are no more than a total of
32 tasks with these priorities: 8 and 48.
*3. With the NJ301-££££, you can use this setting with unit version 1.03 or later.
You cannot use this setting with the NJ101-££££.
Execution priori-
Task Tasks with the same execution priority
ty
Primary periodic task 4 ---
Periodic task 16, 17, or 18 You cannot set the same execution priority for more than one
task.
Event task 8 or 48 You can set the same execution priority for more than one event
task.
Refer to 5-5-5 Event Task Execution Timing for NJ-series Con-
trollers on page 5-61 for the order of execution.
Event tasks 0 to 32
8
Execution priority
(0 to 63)
16 Periodic task 0 or 1
A total of up to 32
tasks for both
priority levels.
17 Periodic task 0 or 1
18 Periodic task 0 or 1
Event tasks 0 to 32
48
Low
Task Periods for the Primary Periodic Task and Periodic Tasks
The CPU Unit repeatedly and cyclically executes the primary periodic task and periodic tasks.
The task periods for periodic tasks must be assigned as integer multiples of the task period of the pri-
mary periodic task (called the primary period). Therefore, execution of both tasks will start at the same
time every few cycles.
For example, if the primary period is set to 1 ms and the task period of the priority-16 periodic task is
set to 4 ms, the execution timing of the primary periodic task and the priority-16 periodic task is
synchronized after each four executions of the primary periodic task.
Additional Information
An event task is not executed periodically. Instead, it is executed only once when the specified
execution condition is met. Therefore, execution of an event task depends on when its execu-
tion condition is met and on its execution priority.
Low
IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
SS: Indicates system services.
l Project with the Primary Periodic Task, Priority-16 Periodic Task, and Pri-
ority-17 Periodic Task
• The primary periodic task has the highest execution priority, so it is always executed in the pri-
mary period.
• The priority-16 periodic task has a lower execution priority than the primary periodic task, so it is 5
executed when the primary periodic task is not being executed.
• The priority-17 periodic task has an even lower execution priority, so it is executed when the
High Primary
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task execution Task Task execution Task Task execution Task Task execution Task Task execution Task
condition is execution is condition is execution is condition is execution is condition is execution is condition is execution is
met. completed. met. completed. met. completed. met. completed. met. completed.
Task period
Task period
Task execution
Task execution
condition is met.
is completed.
System SS
Low services
If you have multiple tasks that read and write to the same variables, make sure to use exclusive
control of variables between the tasks. Otherwise, a task other than the one currently in execu-
tion may change the variable values.
Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks on page 5-93 for de-
tails.
Task period
Priority-17 Interrupted.
UPG UPG
periodic task
Even if unused time occurs in the primary periodic task, the priority-16 periodic task is always
executed after the primary periodic task is completed.
However, for NJ-series CPU Units, this restriction does not apply to the priority-17 or priority-18
periodic task.
This restriction also does not apply to I/O refreshing in the priority-16 periodic task. I/O refresh-
ing for the priority-16 periodic task may be executed during the unused time of the primary peri-
odic task.
Task Specification
Primary periodic task • These tasks are executed in both RUN mode and PROGRAM mode.
Periodic tasks • The user program is executed only in RUN mode.
Event tasks Event tasks are executed only in RUN mode.
• Even if the execution condition for an event task is already met when you change the operat-
ing mode to RUN mode, the event task will not be executed. An event task is executed only
when its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.
Control processing
5
I/O refreshing
Output data
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
Note The processes in each cell in the above table are executed in the order of description.
Output data
processing
processing
processing
User
processing
Input data
Input data
processing 2
common
System
Motion
control
program
Refreshing execution Refreshing
MC_
The system-defined variables for motion control When the CPU Unit executes a motion
are updated for use in the following motion control instruction, it executes the result of During output data processing in the next primary
control instructions. that instruction in motion control processing period, the CPU Unit sends the results of motion
immediately afterward. control processing to the Servo Drive via EtherCAT.
When there is a motion control instruction in user program execution in the periodic task, the CPU
Unit executes the result from that instruction in the motion control processing (MC) of the next pri-
mary periodic task.
Refer to 5-11-3 System Input and Output Response Times on page 5-115 for details.
l Periodic Tasks
A periodic task executes its programs every task period. The task period is specified as an integer
multiple of the primary period. You can use 0 to 3 periodic tasks.
The priority-16 periodic task can also refresh I/O.
Processing for periodic tasks that do not control I/O is different from processing for periodic tasks
that do control I/O.
• Periodic Tasks That Do Not Control I/O
common
common
System
User
System
program
execution
Note The processes in each cell in the above table are executed in the order of description.
processing
processing
Input data
processing 1
processing 2
common
common
System
User
System
Refreshing program
execution
*2.If the input refresh data loaded in the priority-16 periodic task is accessed in the primary periodic task
for the NJ-series CPU Unit, copy the input refresh data to access in the priority-16 periodic task to a
global variable and access the values of the copied global variable in the primary periodic task. En-
sure concurrency of variable values for the global variable. Refer to 5-8-1 Ensuring Concurrency of
Variable Values between Tasks on page 5-93 for details.
If you do not perform the above processing, when an execution of the primary periodic task is started
during I/O refreshing in the priority-16 periodic task, the concurrency of values of the input refresh da-
ta accessed in the primary periodic task may not be ensured.
Note The processes in each cell in the above table are executed in the order of description.
l Event Tasks
An event task is executed only once when the specified execution condition is met. You can use 0
to 32 event tasks.
The processing details for event tasks are shown in the following figure.
processing 2
System common
User program
execution
Task execution
condition is met.
If the following variables are specified for a condition expression when the execution condition
is a condition expression for a variable, event tasks may not be executed when conditions are
met or event tasks may be executed when conditions are not met.
• Structure members whose data size is 16 bits or more, except for system-defined variables
for motion control
• Array elements whose data size is 16 bits or more
When the above variables are specified and the match evaluation is performed, perform either
of the followings.
• Copy the above variables to the internal variables with a basic data type other than a data
size of 64 bits, and access the copied internal variables.
• Use the settings for exclusive control of variables in tasks, and set the primary periodic task
as a refreshing task.
BoolVar @ActEventTask
EN ENO
'Task1' TaskName
Execution
priority
Primary period
High
Primary
periodic task
Task1 Interrupted.
event task
Low
TRUE
BoolVar
FALSE
Example 2: Executing an Event Task Repeatedly While the Value of a Variable Matches a Specified
Value
In the following example, the upward differentiation option is not used for the ActEventTask instruc-
tion. This causes the Task1 event task to be executed as long as the BoolVar BOOL variable is
TRUE. Any ActEventTask instructions that specify Task1 will be ignored if Task1 is already in exe-
cution. After the execution of the event task has started, it is executed to the end even if the value
of BoolVar changes to FALSE during execution.
BoolVar ActEventTask
EN ENO
'Task1' TaskName
Execution
priority
Primary period
High
Primary
periodic task
ActEventTask instruction
is executed.
Task1 is already in execution so any ActEventTask After the execution of the event
instructions that specify Task1 are ignored. task has started, it is executed
to the end even if the value of
Low
The event task is executed repeatedly the BoolVar variable changes
while the BoolVar variable is TRUE. to FALSE.
TRUE
BoolVar
FALSE
Classification of data
Data type Specification
type
Basic data types Boolean, bit string, integer, and real Possible.
Duration, date, time of day, date and time, or text string Not possible.
data
Data type specifica- Array specification Arrays Not possible.
tions Elements Possible.*1
Derivative data type Structures Structures Not possible.
Members Possible.*2
5
Unions Unions Not possible.
Refer to Basic Data Types and Derivative Data Types on page 6-32 for the valid range of values
for each data type.
For example, if the variable that you specify for the condition expression is a BYTE variable, the
valid range of comparison constant values is from BYTE#16#00 to BYTE#16#FF.
Execution
priority
Primary period
High
Event task
TRUE is assigned to
Program1.trigger1 variable.
Low
TRUE
Program1.trigger1
FALSE
Example 2: Execution Condition for an Event Task Set to When Program1.curVal (INIT variable) ≥
10
The event task is executed only once when the value of Program1.curVal changes from less
than 10 to 10 or higher.
Execution
priority
Primary period
High
Primary
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Program1.curVal 0 9 10 11 9
The CPU Unit evaluates whether the condition expression is met before the programs that are
assigned to the primary periodic task are executed. Even if the specified value of the variable
matches the condition expression during execution of the program in the primary periodic task,
the condition is not evaluated until just before the next execution of the primary periodic task.
This means that the event task will be executed after the end of the execution of the primary
periodic task that follows the execution of the primary periodic task in which the value of the
variable meets the condition expression.
Event task
(execution priority of 8)
Task period
Priority-16 Interrupted.
periodic task
ActEventTask instruction
Low is executed.
Execution
Primary period
priority
High
Primary
periodic task
ActEventTask instruction
is executed.
Event task
(execution priority of 8)
Low
Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task
Task period
Priority-16 Interrupted.
Interrupted.
periodic task
Low
Example 2: Project with a Priority-16 Periodic Task and an Event Task Execution with a Priority of
48
The execution priority of the event task is lower than the execution priority of the priority-16 peri-
odic task. The event task is therefore executed after the priority-16 periodic task is executed.
Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task
Priority-16
Interrupted. Interrupted.
periodic task
Low
• The execution timing of an event task depends on how the condition expression is met. The
match can be triggered by I/O refreshing in the primary periodic task, or by execution of a
program that is assigned to the primary periodic task. This difference is described in the fol-
lowing table. This difference occurs because the condition expression is evaluated for a
match by system common processing 1 inside the primary periodic task. Processing in the
primary periodic task takes place in this order: I/O refreshing, system common processing 1, 5
and user program execution.
Execution Timing for Event Tasks with the Same Execution Priority
You can also set the same execution priority for more than one event task. If the execution conditions
are met for more than one event task that has the same execution priority, the event tasks will be exe-
cuted in the order that their execution conditions are met.
Execution
priority
High Primary period
Primary
periodic task
Execution priority
is the same.
T2 event task
(execution priority of 8)
Low
Example 2: When Both Condition Expressions for Variables and the ActEventTask Instruction Are
Used
In this example, the execution conditions of the T1, T2, and T3 event tasks are set as given below.
• T1: Condition expression for the VarA variable is met.
• T2: Condition expression for the VarB variable is met.
• T3: ActEventTask instruction
The operation would proceed as described below if the condition expression for VarA was met during
I/O refreshing, the ActEventTask instruction was executed in the user program, and the condition ex-
pression for VarB was met during execution of the user program all in the same primary period.
1. The condition expression for VarA is met during I/O refreshing.
2. In system common processing 1, the match is detected for the condition expression for VarA and
T1 is executed. The condition expression for VarB is not yet met, so T2 is not executed.
3. The condition expression for VarB is met during execution of the user program.
5. In system common processing 1 in the next primary period, the match is detected for the condition
expression for VarB and T2 is executed.
Execution
priority
High Primary period
Primary periodic
IO UPG MC IO UPG MC
task
Condition expression
for VarA is met. ActEventTask
The match for the condition Condition instruction is executed. The match for the condition
expression for VarA is detected. expression for expression for VarB is
VarB is met. detected.
T1 event task
(execution priority of 8)
T2 event task
(execution priority of 8)
T3 event task
(execution priority of 8)
Low
Primary
periodic task
ActEventTask ActEventTask
instruction is instruction is Execution of the event task has not completed yet,
executed for T1. executed for T1. so the second ActEventTask instruction is ignored.
T1 event task
Interrupted.
(execution priority of 8)
Low
Execution
priority
5
High Primary period
5-5-6 Operation When Execution Condition Is Met Again Before Execution of the Event Task Is Completed
Primary periodic
task
Priority-16
Interrupted. Interrupted.
periodic task: T1
Low
Item Tag data link service Option board service System services
Execu- The tag data link service is execut- The option board service is System services are executed
tion pri- ed in parallel with the task execu- executed in parallel with the in parallel with the task execu-
ority tion. task execution. However, dur- tion. However, during execu-
5
It is prioritized than the option ing execution of the tag data tion of the tag data link service
5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks
board service and system serv- link service, the option board or option board service, sys-
ices. service is not executed. tem services are not executed.
It is prioritized than system
services.
Proc- Data is exchanged by using tags I/O refreshing for Analog I/O System services include serv-
essing with other controllers and devices Option Boards is executed. ices with low execution priority,
on an EtherNet/IP network. You such as the SD Memory Card
can use the built-in EtherNet/IP service.
port on the CPU Unit. *1
Execu- The execution interval and the The option board service is System services are executed
tion tim- time that is required for each exe- executed depending on the depending on the execution
ing cution depend on the model of the execution priority if a request priority if a request comes
CPU Unit and on the tag data link comes from the Option Board. from the hardware or from out-
settings. *2 side of the CPU Unit.
*1. Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506) for details on
the processing that is performed for tag data links.
*2. Refer to 5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service on page 5-72
for details on the execution interval and the time that is required for execution of tag data links.
Execution The execution interval and the time that is required for each The system services are executed
timing execution depend on the model of the CPU Unit and on the in the unused time between execu-
tag data link settings. *2 tion of the tasks and tag data link
service. *3
*1. For details on the processing that is performed for tag data links, refer to the NJ/NX-series CPU Unit Built-in
EtherNet/IP Port User's Manual (Cat. No. W506) or the CJ-series EtherNet/IP Unit Operation Manual for NJ-
series CPU Unit (Cat. No. W495).
You can use CJ-series Units only on the NJ-series CPU Units.
*2. Refer to 5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service on page 5-72
for details on the execution interval and the time that is required for execution of tag data links.
*3. If sufficient time cannot be obtained to execute the system services with an NJ-series CPU Unit, the proc-
essing of tasks with an execution priority of 17 or higher will be interrupted to allocate sufficient time. You
can set the time for execution of the system services in the System Service Monitoring Settings on the Sys-
mac Studio.
High
Numbers of tasks
Primary periodic
4 1
task
8 Event tasks 0 to 32
16 Periodic task 0 or 1
18 Periodic task 0 or 1
Event tasks 0 to 32
48
5
System services
Low
5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks
Examples of the Order of Execution for Services Other Than Tasks
As an example, the order of execution for the primary periodic task, priority-16 periodic task, priority-17
periodic task, tag data link service, option board service, and system services is shown below.
Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task period
Priority-16
periodic task
IO UPG Execution period of the IO UPG
tag data link service
Task period
Low
Communications
bridge service
Execution period of the tag data link service
Priority-17
UPG Interrupted.
periodic task
System
services
Low
Option board
service
Task period
Priority-17
UPG Interrupted.
System
services
Low
5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks
Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task period
Priority-16
periodic task
IO UPG Execution period of the IO UPG
tag data link service
Task period
Priority-17
UPG Interrupted.
periodic task
The execution interval and the execution time for one execution depend on the model of the CPU
Unit and on the tag data link settings. Refer to 5-6-2 Processing Performed in and Execution Tim-
ing of the Tag Data Link Service on page 5-72 for details.
Task set as
refreshing task
Task set as
refreshing task
Refreshing task Reads values Tag data
is specified. from variables. Tag data
link service Tag set
Creates the is sent.
System service tag set.
Refreshing task Reads values
is not specified. from variables. Tag data
Additional Information
Differences in the Timing of Processing Tag Data Links Depending on Whether a Re-
freshing Task Is Set
The process to write values to and read values from variables is different depending on whether
a refreshing task is set. If a refreshing task is set, the values are read and written in that task. If
a refreshing task is not set, the values are read and written in a system service. This means
there is a difference in the execution timing of processing tag data links.
The difference in the execution timing when data is received for tag data links with an NJ-series
CPU Unit is shown below.
• When a Refreshing Task Is Specified
In this example, the primary periodic task is set as the refreshing task. Values are written to
the variables in the next primary periodic task after the tag data link service.
Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task period
Priority-16
IO UPG IO UPG
periodic task
5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service
Task period
Priority-17
UPG Interrupted.
periodic task
Tag data is read
from the tag set.
System
service
Low
Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task period
Priority-16
IO UPG IO UPG
periodic task
Task period
Priority-17 Interrupted.
UPG
periodic task
Tag data is read
from the tag set.
System
services
Low The values are written to the variables
in a system service.
Task period
Priority-16
periodic task
IO UPG Execution interval of the tag data IO UPG
link service
Task period
Priority-17
UPG Interrupted.
periodic task
Additional Information
For an NX-series CPU Unit, the priority-17 and priority-18 periodic tasks and the system service
are not affected by execution of the tag data link service.
5-6-3 Processing Performed in and Execution Timing of the Option Board Service
Receive 25 2.36
Version Information
Execution of processing for tag data links depends on the unit version of the CPU Unit and the
Sysmac Studio version as given below.
The option board service is executed depend on the execution priority if a request comes from the Op-
tion Board. The internal processing of an Option Board, the option board service for an NX1P2 CPU
Unit, and the task execution are performed asynchronously.
When you input the data, the input data is imported in the internal processing of an Option Board and
processed in the option board service for an NX1P2 CPU Unit. When the processing in the option
board service is completed, you can use the input data in user program execution in the next primary
periodic task.
Option Board
Option board
service
Primary
MC
MC
MC
MC
IO UPG IO UPG IO UPG IO UPG
periodic task
Primary period
When you output data, the output data is processed in the option board service after user program
execution is completed. When the processing in the option board service is completed, the output data
is output in the next internal processing of an Option Board.
Option Board
Option board
service
Primary
MC
MC
MC
MC
Primary period
Note The communications bridge service is executed by an NX102 CPU Unit with unit version 1.31 or later.
The communications bridge service is executed when the frames of the CIP Safety communications
are sent and received by the built-in EtherNet/IP port.
Execution Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
5
Execution interval of the communications bridge service
Task period
Priority-17
periodic task Execution time of UPG Interrupted.
the communications
bridge service
System
service
Low
The execution interval and execution time for the communications bridge service depend on the set-
tings of CIP Safety communications.
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930-E1-12 or later) for informa-
tion on the CIP Safety communications.
For the NX102 CPU Units, the system services are executed without being affected by the tasks. How-
ever, during execution of the communications bridge service or tag data link service, system services
are not executed.
For the NX1P2 CPU Units, the system services are executed without being affected by the tasks.
However, during execution of the tag data link service or option board service, system services are not
executed.
For NJ-series CPU Units, the system services are executed in the unused time between execution of
the tasks and tag data link service.
If sufficient time cannot be obtained to execute the system services, the processing of tasks with an
execution priority of 17 or higher will be interrupted to allocate sufficient time.
You can set the time for execution of the system services in the System Service Monitoring Settings
on the Sysmac Studio.
There is no priority in the processing of system services. All of the processing is executed in parallel
with time slicing.
l Execution Timing When Sufficient Execution Time for the System Services
Cannot Be Obtained
With an NJ-series CPU Unit, if there is not enough unused time between execution of the tasks and
tag data link service to execute the system services, the execution of tasks with an execution priori-
ty of 17 or higher will be interrupted to allocate sufficient time.
If the system service execution time cannot be obtained even if execution of tasks with an execu-
tion priority of 17 or higher is temporarily interrupted, an Insufficient System Service Time Error oc-
curs and user program execution stops.
You can set the time for execution of the system services in the System Service Monitoring Set-
tings on the Sysmac Studio.
High Primary
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task
Task
period
Priority-16
IO UPG
periodic task
Task
period
Priority-17
periodic task Pausing
Low
5
System
services
Changes
Access Setting Setting Set val- Update
Description Default in RUN
point group [unit] ue timing
mode
Opera- System System Sets the interval of 10 ms to 10 ms When Not al-
tion Set- Service Service Ex- system service exe- 1s down- lowed.
tings, Op- Monitor- ecution In- cution. loaded to
eration ing Set- terval [ms] CPU Unit
Settings tings System Sets the ratio for 5% to 10% When Not al-
Tab, Ba- Service Ex- monitoring system 50% down- lowed.
sic Set- ecution service execution. loaded to
tings Time Ratio CPU Unit
[%]
Additional Information
NX-series CPU Units are designed to always secure sufficient time for system service execu-
tion, so the System Service Monitoring Settings are not provided. Also an Insufficient System
Service Time Error will not occur.
• For NJ-series CPU Units, set the System Service Monitoring Settings to the minimum values
that are required to meet the response performance of the system services so that sufficient
time can be allocated to the system services and task execution. The System Service Moni-
toring Settings are used to monitor whether the specified system service execution time can
be obtained. System services will not necessarily be executed for the specified time.
• For NJ-series CPU Units, design the tasks so that sufficient time can be allocated to execu-
tion of the system services. Refer to 5-11 Task Design Methods and I/O Response Times on
page 5-112 for the setting procedures for tasks.
• To increase the system service execution time with an NJ-series CPU Unit, increase the task
period or take other steps to increase the unused time between task execution.
• With an NJ-series CPU Unit, if the time that is specified in the System Service Monitoring
Settings cannot be allocated to the system service execution time even if execution of tasks
with an execution priority of 17 or higher is interrupted, an Insufficient System Service Time
Error occurs and user program execution stops.
• With an NJ-series CPU Unit, if sufficient system service execution time cannot be allocated
and execution of tasks with an execution priority of 17 or higher is interrupted, a Task Period
Exceeded error will occur for the tasks that are interrupted. Design the tasks so that the exe-
cution of tasks with an execution priority of 17 or higher is completed within the task periods
even if the execution time of the system services satisfies the System Service Monitoring Set-
tings.
If two different function modules are used together, such as when you use CJ-series Basic
Units and EtherCAT slaves, take suitable measures in the user program and external controls
to ensure that safety is maintained in the controlled system if one of the function modules stops.
The relevant outputs will behave according to the slave or Unit specifications if a partial fault
level error occurs in one of the function modules.
Refer to Non-fatal Errors in the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for infor-
mation on the partial fault level Controller error.
Additional Information
When using both EtherCAT slaves and CJ-series Units, you can reduce the task execution time
of the primary periodic task by assigning the I/O refreshing to different tasks. Assign I/O refresh-
ing for EtherCAT slaves to the primary periodic task and assign I/O refreshing for CJ-series
Units to the priority-16 periodic task.
l Unit Configuration
A Slave Terminal is used. The following table shows the Unit configuration of the Slave Terminal.
l I/O Map
The following I/O map is used. The table below shows the bits that are used in the sample pro-
gramming.
l I/O Specifications
The I/O specifications are as follows:
• OutA1 changes from FALSE to TRUE one second after the value of ComIn changes from FALSE
to TRUE. In the same way, OutA2 changes to TRUE two seconds, OutB1 three seconds and
OutB2 four seconds.
• When the value of ComIn changes from TRUE to FALSE, the values of OutA1, OutA2, OutB1
and OutB2 change from TRUE to FALSE.
TRUE
ComIn
FALSE
1s
TRUE
OutA1
FALSE
2s
OutA2 TRUE
FALSE
3s
OutB1 TRUE
FALSE
4s
OutB2 TRUE
FALSE
l Task Processing
The primary periodic task and priority-16 periodic task are used. The I/O refreshing is assigned to
the primary periodic task.
OutA1 and OutA2 are controlled in the primary periodic task. A series of processing, i.e., input of
ComIn, calculations and outputs of OutA1 and OutA2 , is performed in the primary periodic task.
For controls of OutB1 and OutB2, the processing from input of ComIn to calculations is performed
in the periodic task. The calculation results of the periodic task are assigned to the temporary glob-
al variables tmp_OutB1 and tmp_OutB2. In the primary periodic task, the values of tmp_OutB1 and
tmp_OutB2 are assigned to OutB1 and OutB2. Then, OutB1 and OutB2 are output.
The Controller may pause the periodic task in order to execute the primary periodic task. The as-
signment of calculation results to tmp_OutB1 and tmp_OutB2 may be performed before or after the
pause of the periodic task. And the timing of assignment determines the timing of output of calcula-
tion results in the primary periodic task.
The following figure shows an example of processing flow. The task period of the periodic task is
set to twice as long as that of the primary periodic task.
Task period
Primary
periodic task IO UPG IO UPG IO UPG IO UPG
Task period
Priority-16
If the values are assigned to tmp_OutB1 If the values are assigned to tmp_OutB1
and tmp_OutB2 in step (4), they are and tmp_OutB2 in step (7), they are
output in step (8). output in step (10).
2. The calculation is performed during the user program execution in the primary periodic task and
the values are assigned to OutA1 and OutA2.
Also, the values of tmp_OutB1 and tmp_OutB2 are assigned to OutB1 and OutB2. However,
the values of tmp_OutB1 and tmp_OutB2 are the initial values because the values are not as-
signed to tmp_OutB1 and tmp_OutB2 in the periodic task. Therefore, the values of OutB1 and 5
OutB2 are also the initial values.
4. The calculation is performed during the user program execution in the periodic task.
If the primary periodic task is executed while the periodic task execution is in progress, the peri-
odic task is paused. Depending on the timing of processing in the periodic task, the assignment
of the values to tmp_OutB1 and tmp_OutB2 may be performed before or after the pause of the
periodic task.
5. OutA1, OutA2, OutB1 and OutB2 are output during I/O refreshing in the primary periodic task.
Also, ComIn is input again.
6. The calculation is performed during the user program execution in the primary periodic task and
the values are assigned to OutA1 and OutA2.
Also, the values of tmp_OutB1 and tmp_OutB2 are assigned to OutB1 and OutB2. If the values
are assigned to tmp_OutB1 and tmp_OutB2 in step (4), the calculation results of the periodic
task are reflected in OutB1 and OutB2. If the values are not assigned to tmp_OutB1 and
tmp_OutB2 in step (4), the values of tmp_OutB1 and tmp_OutB2 are the initial values. There-
fore, the values of OutB1 and OutB2 are also the initial values.
7. The calculation is performed during the user program execution in the periodic task that follows
step (4).
If the values are not assigned to tmp_OutB1 and tmp_OutB2 in step (4), they are assigned
here.
8. OutA1, OutA2, OutB1 and OutB2 are output during I/O refreshing in the primary periodic task.
If the values are assigned to tmp_OutB1 and tmp_OutB2 in step (4), the calculation results of
the periodic task are output as OutB1 and OutB2.
If the values are assigned to tmp_OutB1 and tmp_OutB2 in step (7), the initial values of OutB1
and OutB2 are output.
9. The calculation is performed during the user program execution in the primary periodic task and
the values are assigned to OutA1 and OutA2.
Also, the values of tmp_OutB1 and tmp_OutB2 are assigned to OutB1 and OutB2. If the values
are assigned to tmp_OutB1 and tmp_OutB2 in step (7), the calculation results of the periodic
task are reflected in OutB1 and OutB2.
10. OutA1, OutA2, OutB1 and OutB2 are output during I/O refreshing in the primary periodic task.
If the values are assigned to tmp_OutB1 and tmp_OutB2 in step (7), the calculation results of
the periodic task are output as OutB1 and OutB2.
You can use the Lock and Unlock instructions to perform the task exclusive controls to prevent the
values of tmp_OutB1 and tmp_OutB2 from being overwritten by the periodic task before they are
accessed by the primary periodic task. Refer to 5-8-1 Ensuring Concurrency of Variable Values be-
tween Tasks on page 5-93 for details on task exclusive control.
Initial val-
Name Data type AT specification Comment
ue
ComIn BOOL FALSE ECAT://node#[1,1]/Input Bit 00 Common input val-
ue
OutA1 BOOL FALSE ECAT://node#[1,2]/Output Bit 00 Output value A1
OutA2 BOOL FALSE ECAT://node#[1,2]/Output Bit 01 Output value A2
OutB1 BOOL FALSE ECAT://node#[1,2]/Output Bit 02 Output value B1
OutB2 BOOL FALSE ECAT://node#[1,2]/Output Bit 03 Output value B2
tmp_OutB1 BOOL FALSE Temporary variable
for B1
tmp_OutB2 BOOL FALSE Temporary variable
for B2
Algorithm
Input of ComIn, calculations and outputs and output of OutA1 and OutA2
A1_Wait
T#1s PT ET
A2_Wait
TON OutA2
In Q
T#2s PT ET
Assignment of the values tmp_OutB1 and tmp_OutB2 to OutB1 and OutB2, and output of OutB1 and OutB2
P_On
Lock
En ENO
USINT#1 Index
tmp_OutB1 OutB1
5
tmp_OutB2 OutB2
USINT#1 Index
USINT#1 Index
ComIn
B1_Wait
TON tmp_OutB1
In Q
T#3s PT ET
B2_Wait
TON tmp_OutB2
In Q
T#4s PT ET
Unlock
En ENO
USINT#1 Index
Version Information
The CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are re-
quired to use the Initial Status setting for programs at the start of operation, the PrgStart instruc-
tion and the PrgStop instruction.
Changes
Update
Parameter Setting range Default in RUN
timing
mode
Task Timeout Detection Time Set the time to detect a timeout if 5
task execution does not end, e.g., if
there is an infinite loop.
Set a multiple of the task period.
1 to 5
Refer to Task Execution Timeout on
page 5-105 for details.
Variable Access Time [%] Set the percentage of the task peri- 3%
od to assign to variable access.
1% to 50%
Refer to Settings for Variable Ac-
cess Time on page 5-101 for de-
tails.
*1. The process data communications cycle (process data communications cycle 1) in the EtherCAT set-
tings will be the same as this period.
*2. However, for the NX1P2-9B££££ CPU Unit, the setting range of the task period is 4 ms to 8 ms (in
250-μs increments).
*3. You can use this setting with the NJ301-££££ unit version 1.03 or later.
You cannot use this setting with the NJ101-££££.
*4. For the NX102-££££ CPU Unit, NX1P2-££££££ CPU Unit, and NJ101-££££ CPU Unit, the de-
fault of the primary periodic task is 2 ms.
However, for the NX1P2 9B££££ CPU Unit, the default of the primary periodic task is 4 ms.
*1. You can use the priority-5 periodic task only with the NX701 CPU Unit.
*2. The process data communications cycle 2 in the EtherCAT settings will be the same as this period.
*1. You cannot use the priority-16 periodic task with the NX102 CPU Units or NX1P2 CPU Units.
Method 1: Write the global variable from only one task and read the variable from the other tasks.
Use the settings for exclusive control of variables in tasks.
Method 2: Write the global variable from more than one task.
Use the task exclusive control instructions.
5
Method 1: Settings for Exclusive Control of Variables in Tasks
A single task is set to read and write the value of a specified global variable. That task is called the
refreshing task. Tasks that only read the value of the global variable are also specified. These tasks
are called accessing tasks. This ensures the concurrency of the value of the global variable.
Accessing
Read only
task: Task B
Read/write
Refreshing
Global variable
task: Task A
Refreshing task is specified.
Refreshing task: Task A
Accessing
Read only
task: Task C
l Application Example
The refreshing task specification is used to ensure the concurrency of the value of a global variable
within a periodic task when the variable is written in the primary periodic task.
Program Program
Read/write Read only
External variable GVar1 Global variable GVar1 External variable GVar1
l System
If a refreshing task is set for a global variable, the accessing task, at the start of accessing task
execution, always reads the most recent value of the variable that was written at the completion of
refreshing task execution.
This will allow you to maintain the concurrency of the values of global variables within the tasks
without performing any special programming.
If an instruction that writes the value to a global variable is used in the accessing task, an error will
occur when you check the program on the Sysmac Studio.
If you are using the ActEventTask instruction between two tasks, you must keep in mind when
the global variables are accessed, and when they are refreshed.
For example, in the following diagram, the value of the GVarA global variable that is accessed
from the event task is the value that was current at the end of task period 1. Therefore, even if
the periodic task in task period 2 writes the value of GVarA, that value will not be reflected in the
event task.
Execution of
ActEventTask
The value that is written The value that the event task
here is not reflected in writes cannot be accessed.
the event task.
Because of this, do not use exclusive control of variables in tasks to pass the values of global
variables if you are using the ActEventTask instruction to execute event tasks.
To ensure the concurrency of global variables when using the ActEventTask instruction, you
should use the Task_IsActive (Determine Task Status) instruction. The Task_IsActive instruction
determines whether the specified task is in execution or waiting to be executed. Use this in-
struction to prevent other tasks from accessing variables that the event task writes to while it is
in execution. Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for de-
tails on the Task_IsActive instruction.
l Restrictions
• Only one refreshing task can be set for each global variable. If it is necessary to write a global
variable from more than one task, use the task exclusive control instructions described below to
ensure concurrency.
• If you specify a refreshing task for a structure or union variable, you must specify only one re-
freshing task for the entire structure or union variable. You cannot specify a different refreshing
task for different structure or union members.
• If you specify a refreshing task for an array variable, you must specify only one refreshing task
for the entire array variable. You cannot specify a different refreshing task for different array ele-
ments.
Do not write the value of a variable for which concurrency is required from any task that is not
the refreshing task, e.g., do not write the value from the accessing task. If you read or write the
value of a variable for which a refreshing task is set from any task that is not a refreshing or
accessing task, the concurrency of the global variable may be lost. If you write such a program,
a warning is given when the program is checked.
Additional Information
• You can use a data trace to sample an external variable for a global variable for which set-
tings for exclusive control of variables in tasks are used. This allows you to sample the values
of the global variable in the refreshing and accessing tasks in a data trace. Refer to
8-6-4 Data Tracing on page 8-59 for information on data tracing.
Example:
In this example, task A and task B both have lock region 1. The priority of task B is higher than the
priority of task A.
If the execution condition for task B is met during execution of lock region 1 in task A, execution of
task A is paused during lock region 1 and task B is executed. However, in this case, lock region 1 in
task A is not completed, so task B is paused before it processes lock region 1. When task B is paused,
execution of lock region 1 in task A is started again.
Task A
Program
Executed.
Lock instruction Global variable
Refreshed. Higher priority
Task B
Lock region 1
Executed. Executed.
Program
Execution is not
started until
execution of region Lock region 1
1 in task A is
completed.
Unlock instruction
When execution of lock region 1 in task A is completed, task A is paused again and the remainder of
lock region 1 in task B is executed. The concurrency of the value of the global variable is maintained
by implementing exclusive control of the write processing of the global variable between the tasks.
Task A
Program
Lock instruction
5
Task B
Lock region 1
Lock instruction
Unlock instruction
Executed.
Lock region 1
Refreshed.
Global variable
Unlock instruction
• Do not make the locked regions any longer than necessary. If the lock regions are too long,
the task execution period may be exceeded.
• Always use the Lock and Unlock instructions together as a set in the same section of the
same POU.
A sample programming that uses the task exclusive control instructions (i.e., the Lock and Unlock in-
structions) to perform exclusive control is shown.
l Global Variables
Name Data type Comment
gReq BOOL Request flag
gPar1 ULINT Parameter 1
gPar2 DATA_AND_TIME Parameter 2
• ST Program
cCnt:=Get100msCnt(); (*Get the 100-ms counter value.*)
cTime:=GetTime(); (*Get the current time.*)
• ST Program
Lock(1); (*Start an exclusive lock between tasks.*)
IF gReq=TRUE AND ReqBusy=FALSE THEN (*Access the exclusive flag.*)
ReqBusy:=TRUE;
UserDefFB_ins.PutData:=gPar1; (*Read the parameter from MainTask.*)
UserDefFB_ins.PutDate:=gPar2; (*Read the parameter from MainTask.*)
gReq:=FALSE; (*Reset the exclusive flag.*)
UserDefFB_ins.Execute:=TRUE;
END_IF;
Unlock(1); (*Stop an exclusive lock between tasks.*)
UserDefFB_ins();
IF UserDefFB_ins.Done:=TRUE THEN
UserDefFB_ins.Execute:=FALSE;
ReqBusy:=FALSE;
END_IF;
l Accessing Variables from Outside the Controller during the System Serv-
ice 5
Whether you use an NX-series CPU Unit or an NJ-series CPU Unit, access to multiple variables
may not be completed in the same task period.
l Accessing Variables from Outside the Controller during the System Com-
mon Processing 2
Whether you use an NX-series CPU Unit or an NJ-series CPU Unit, access to multiple variables is
securely executed in the same task period.
This section particularly describes how to execute the variable access from outside the Controller
during the system common processing 2 of the task.
If the Sysmac Studio is used to access variables, it can only refresh the variable values during the sys-
tem common processing 2 of the task. Values are accessed during the system services.
Note You can use CJ-series Units only on the NJ-series CPU Units.
Note You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
When you use EtherNet/IP tag data links, always specify the same task as the refreshing task
Variable access time [μs] = total size of variables [bytes] * a + number of variables * b + number of
accesses * c + d
The values of the constants a to d in above equation vary depending on the model of the CPU Unit.
Using the equation, the variable access time for Access No.1 is calculated as follows.
Variable access time for Access No.1 = 600 * 0.001 + 8 * 0.49 + 1 * 1.41 + 6.68
= 12.61 [μs]
In the same way, you can calculate the access time for the other accesses and get the following
values.
If only one of these accesses occurs in one task period, you set the variable access time to the one
for Access No.1, which requires the longest access time.
The variable access time for Access No.1 is 12.61 μs. Therefore, when the task period is 500 μs,
the variable access time is set to 12.61/500 ≈ 3%.
If every access occurs once in one task period, the variable access time is calculated with the
equation as follows.
Variable access time = (600 + 200 + 1000) * 0.001 + (8 + 4 + 1) * 0.49 + ( 1 + 1 + 1) * 1.41 + 6.68
= 19.08 [μs]
When the task period is 500 μs, the variable access time is set to 19.08/500 ≈ 4%.
l Processing in the Case That Actual Variable Access Time Became Longer
Than Set Value
If actual variable access time became longer than the set value, the following processing is per-
formed depending on the number of variable accesses in one task period.
Set a sufficiently long access time so that multiple variable accesses can be completed within a
task period.
You can also disable the Task Period Exceeded errors with a setting. Select Task Settings - Task
Settings on the Sysmac Studio and set it in Task Period Exceeded Detection setting. The default
setting is to detect the error.
Primary
periodic task
IO UPG MC IO IO IO UPG MC
UPG MC
Even if the Task Period Exceeded Detection setting is disabled, information will be output to the event
log and the following system-defined variables if task processing is not completed within the period:
_<TaskName\>_Exceeded (Task Period Exceeded Flag), _<TaskName>_ExceededCount(Task Period
Exceeded Count), _ErrSta (Controller Error Status).
I/O is refreshed as follows according to what the I/O is for if task processing is not completed within
the task period.
I/O refresh operation if task processing is not completed within the task
I/O is for
period
EtherCAT slaves*1 Outputs: The values from the previous period are output.
Inputs: Inputs are refreshed, but the input data is not updated in the executed
user program.
NX Units on the CPU Unit*2
Built-in I/O*3
CJ-series Units I/O is not refreshed until execution of the task is completed.
*1. This includes NX Units on EtherCAT Slave Terminals.
*2. You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
*3. You can use built-in I/O only with the NX1P2 CPU Units.
If the Task Period Exceeded error occurs, shorten the programs to fit in the task period or in-
crease the setting of the task period.
Primary
periodic task IO IO
UPG
Primary M M
IO UPG C IO UPG C
periodic task
Additional Information
NX-series CPU Units are designed to always secure sufficient time for system service execu-
tion, so the System Service Monitoring Settings are not provided. Also an Insufficient System
Service Time Error will not occur.
Additional Information
To check or estimate the system service execution time, the task execution time ratio, system
service execution ratio, estimated CPU usage rate, tag data service execution ratio, expanded
number of I/O points for CJ-series Unit, and built-in EtherNet/IP are displayed for NJ-series
CPU Units.
The above information are not displayed for NX-series CPU Units because the system services
are executed at the required time without being affected by the task.
Connect- Connected
Monitor item Description ed to the to the Sim-
Controller ulator
Task execution time*1 Min. The minimum value of the task execu- Displayed. Not dis-
tion time. played. 5
Average The average value of the task execu- Displayed.
tion time.
Max. The maximum value of the task execu-
tion time.
Set period The specified task period. *2
Period exceeded If the task execution time exceeds the
task period (i.e., if the Task Period
Exceeded Flag system-defined varia-
ble is TRUE), the amount by which the
time was exceeded is displayed in the
bar. *2
Task execution count Displays the number of executions of
the task.
The value of the Task Execution Count
system-defined variable is displayed.
Real processing time of tasks*3 The time ratios are displayed with bars Not dis- Displayed.
for the system common processing, played.
I/O refreshing, user program execu-
tion, and motion control processing.
(Specific time values are not dis-
played.)
Average The estimated average value of the re-
estimation al processing time of task is displayed.
Max esti- The estimated maximum value of the
mation real processing time of task is dis-
played.
Task execution time ratio*4 The percentage of the total task execu- Displayed. Not dis-
tion time per unit time. played.
*1. This is the actual time required from the point that task execution was started until it was completed. This
interval includes both the time to execute other tasks and the time for system services that were execut-
ed from when task execution was started until it was completed.
Only the primary periodic task is displayed when a Simulator for an NX701 CPU Unit is connected.
*2. This item is not displayed for event tasks.
*3. This interval is the time required to execute only the task itself.
It is the same as the task execution time for the primary periodic task.
For periodic tasks, this is the task execution time minus the time to execute other tasks and the time for
system services that were executed between the point that the execution condition is met until execution
is completed.
Real processing time of task (varies) Real processing time of task (varies)
System common
System common
Output data
processing
processing
Input data
processing 1
processing 2
Refreshing User program
execution
*4. This item was added for version 1.12 of the Sysmac Studio. It is not displayed for an NX-series CPU
Unit.
The above values when connected to the Simulator of the Sysmac Studio may contain more
error in comparison to the times when connected to the physical Controller. Use them as guide-
lines. Always confirm operation while connected to the physical Controller to study the designs
and before starting actual system operation.
Meaning of the Task Execution Time and the Real Processing Time
of the Task
The Task Execution Time and Real Processing Time of Tasks that are displayed in the Monitor View
for the execution time of tasks are described in the following table. The Real Processing Time of Tasks
shows only the time the Simulator was connected.
Execution
priority Task period of primary periodic task
Primary
periodic task
a
c d
Low b
The primary periodic task and periodic tasks of an NJ/NX-series Controller operate according to the
specified task periods.
If the actual execution time exceeds the task period, an error occurs.
This section uses an example that consists of one primary periodic task to describe estimation and
appraisal methods.
The task execution times in the physical Controller depend on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.
l Desktop Calculations
First, refer to A-2 Calculating Guidelines for the Real Processing Times of Tasks for the NX701
System on page A-25, A-3 Calculating Guidelines for the Real Processing Times of Tasks for the
NX102 System on page A-37, A-4 Calculating Guidelines for the Real Processing Times of Tasks
for the NX1P2 System on page A-48 and A-5 Calculating Guidelines for the Real Processing
Times of Tasks for the NJ-series System on page A-59 to make a rough estimate of the average
task execution time on paper.
You cannot estimate the maximum value on paper.
1 Create the Unit and slave configurations, create the global variables and device variables, and
create the axes (to create the Axis Variables).
5 Select the relevant hardware revision in the Unit that the hardware revision is displayed.
7 Estimate the task execution times in the Task Execution Time Monitor.
You can check the following values in the Task Execution Time Monitor when you start the Simula-
tor in Execution Time Estimation Mode.
• The average and maximum values of the task execution time
• The average and maximum values of the real processing times of the tasks
• Bar graph that shows the system common processing time, I/O refresh time, user program exe-
cution time, and motion control time 5
• CPU usage
Additional Information
You can check the following values when connected to the Simulator of the Sysmac Studio. You
cannot check these values when connected to the physical Controller.
• CPU usage:
Displays how much of the task period is used by the total of the maximum estimated task
processing time, the tag data link service execution time ratio, and the system service proc-
essing time of an NJ-series CPU Unit (as specified in the system service monitoring settings).
If CPU usage exceeds 100%, it means that there is not sufficient time for task processing and
the system service monitoring settings.
This is not displayed for an NX-series CPU Unit.
• Real processing time of tasks:
This is the time that was required for the task from when task execution is started until it is
completed. The time to execute other tasks that were executed from when task execution
was started until it was completed is not included.
The maximum values that are displayed on the Sysmac Studio are the results of operation on the
physical Controller.
As described previously, the maximum value of the task execution time varies depending on the
internal status of the physical Controller.
As a result, the maximum values obtained here may be exceeded in actual operation. Use the ob-
tained values or the larger values in the following calculating results as guidelines of maximum val-
ues.
NX-series CPU Units
(Average value of task execution time + (Average value of task execution time − Minimum value of
task execution time)) x 1.2 + 25 μs
NJ-series CPU Units
• Task period of 500 μs:
Average value of task execution time + (Average value of task execution time − Minimum value
of task execution time) + 100 μs
• Task period of 1, 2, or 4 ms:
Average value of task execution time + (Average value of task execution time − Minimum value
of task execution time) + 120 μs
For NJ-series CPU Units, you can also check whether sufficient system service execution time is
obtained.
Insufficient system service execution time may decrease the online operations of the Sysmac Stu-
dio or the communications response performance with external devices such as an HMI. For NJ-
series CPU Units, system services are executed during the unused time between execution of the
tasks.
Use the following guideline for the task execution time ratio.
Version Information
• The task execution time ratio is displayed when an NJ-series CPU Unit is used with Sysmac
Studio version 1.12 or higher.
• Use an NJ101-££££ CPU Unit with Sysmac Studio version 1.13 or higher. You cannot use
an NJ101-££££ CPU Unit with Sysmac Studio version 1.12 or lower.
• On an NJ101-££££, NJ301-££££, NJ501-££££, NX102-££££, and NX1P2-£££
££££ of unit version 1.47 or higher and an NX701-££££ of unit version 1.28 or higher,
performance (task time) will be improved if the number of registered device variable is large.
NX-series CPU Units are designed to always secure sufficient time for system service execu-
tion.
Therefore, the task execution time ratio is not displayed.
Additional Information
The average values of the task execution times that are displayed for task execution time moni-
toring are the averages for 10 task execution times.
2 From the system I/O response times, determine the task period for the primary periodic task.
3 See if the task execution time fits into the task period that you determined.
Then, work on paper or use the Task Execution Time Monitor of the Sysmac Studio to estimate
the average and maximum values of the task execution time.
4 For NJ-series CPU Units, see if the system service times are within the monitor settings.
If you use the Sysmac Studio, check the CPU usage.
5 Use the physical Controller to see if the task execution time fits into the task period.
Place the Sysmac Studio online with the physical Controller and use Task Execution Time
Monitor to check the task execution times. 5
l If only the primary periodic task is too large to fit within the specified task
l If a task is separated, the periodic task will vary greatly with the unused
time for primary periodic task execution.
For a periodic task, use twice the average and maximum values calculated for the task execution
time to set the task period and then fine-tune the setting from there.
Example: Controlling Unit A and Unit B with the Primary Periodic Task
Unit A Unit B
Primary IO UPG
M
IO UPG
M
IO UPG
M
periodic task C C C
Priority-16 UPG
periodic task
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit.
Example: Controlling Unit A and Unit B with the Priority-16 Periodic Task
Unit A Unit B
IN OUT
Primary period
Task period
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit.
Minimum I/O response time = Primary period (= process data communications cycle)
Example: Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Primary Peri-
odic Task
Slave A Slave B
Process data
communications period =
Primary period (t)
5
Primary M M M
IO UPG IO UPG IO UPG
periodic task C C C
Priority-16 UPG
periodic task
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
slave.
Maximum I/O response time = Primary period (= process data communications cycle) × 2
Minimum I/O response time = Priority-5 periodic task period (= process data communications cycle 2)
Example: Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Priority-5 Pe-
riodic Task
Slave A Slave B
Process data
communications cycle 2 =
Task period
Priority-5 IO UPG
M
IO UPG
M
IO UPG
M
periodic task C C C
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
slave.
Maximum I/O response time = Priority-5 periodic task period (= process data communications cycle 2) x 2
Example: Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Priority-16
Periodic Task
Slave A Slave B
IN
OUT
Process data
communications cycle
= Primary period (t)
Task period
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
slave.
Additional Information
Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat. No. W519) for the I/O re-
sponse times for EtherCAT Slave Terminals that the NX Units are mounted on the EtherCAT
Coupler Units.
For NX Units on the CPU Unit, the following describes both of the I/O response times for the CPU Unit
inside and I/O response times that include NX Unit processing times.
The I/O response times for the CPU Unit inside are given below.
Example: Controlling Input Unit A and Output Unit B with the Primary Periodic Task
Unit A Unit B
Primary
MC
MC
MC
IO UPG IO UPG IO UPG
periodic task
However, the I/O response time may be as follows depending on the timing of the input from the
Unit.
Example: Controlling Input Unit A and Output Unit B with the Priority-17 Periodic Task
Unit A Unit B
IN
OUT 5
Primary period (t)
Task period
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit.
Next, the I/O response times that include NX Unit processing times are given below.
The I/O response time is the time required for the following processing: The CPU Unit processes
an external signal input to one NX Unit, and another NX Unit outputs the processed result as an
external signal.
The I/O response times that include NX Unit processing times depend on the I/O refreshing method
of the NX Unit. The following provides a description to perform control with the programs in the pri-
mary periodic task for each of the I/O refreshing method of the NX Unit, including synchronous I/O
refreshing, time stamp refreshing, and Free-Run refreshing.
For each element, there is a unique value for each type of NX Unit. Refer to the appendix of the
NX-series Data Reference Manual (Cat. No. W525-E1-07 or later) for the value of each element.
Minimum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period + Tnx-OutDelay + Tnx-OutProc
Example: Controlling Input Unit A and Output Unit B with the Primary Periodic Task
Unit A Unit B
IN OUT
I/O response times that include
Signals to input NX Unit processing times
terminals on NX Unit
Input Unit A
Tnx-Indelay Tnx-InProc
Signals from output
terminals on NX
Output Unit B
Tnx-OutProc
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit.
With input refreshing with input changed times for time stamp refreshing, when there is more than
one NX Unit that is connected to the CPU Unit, the inputs for all NX Units that support synchronous
input refreshing and the changed times for all NX Units that support input refreshing with input
changed times are loaded at the same time. Therefore, Tnx-InProc (input data processing time of
the NX Unit) and Tnx-OutProc (output data processing time of the NX Unit) are the longest time of
the NX Units that support synchronous I/O refreshing.
Minimum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period + Tnx-OutDelay + Tnx-OutProc
Example: Controlling Input Unit A and Output Unit B with the Primary Periodic Task
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit. 5
Maximum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period x 2
l Free-Run Refreshing
With Free-Run refreshing, the refresh cycle of the NX bus and the I/O refresh cycle of the NX Units
operate asynchronously.
Minimum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period + Tnx-OutDelay + Tnx-OutProc
Example: Controlling Input Unit A and Output Unit B with the Primary Periodic Task
Unit A Unit B
IN OUT
I/O response times that include
Signals to input NX Unit processing times
terminals on NX Unit
Input Unit A
Tnx-Indelay Tnx-InProc
Signals from output
terminals on NX
Output Unit B
Tnx-OutProc
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
Unit and the timing of the output to the Unit.
Additional Information
With Free-Run refreshing, the Input Unit, CPU Unit and Output Unit operate asynchronously.
Therefore, an offset of timing that the Input Unit reads signals from input terminals, an offset of
timing that the CPU Unit reads the input data from the Input Unit, and an offset of timing that the
Output Unit outputs signals to output terminals will occur.
Tnx-InProc, primary period, and Tnx-OutProc will be the longest time of an offset of timing for
each Unit.
For , , and NJ-series CPU Units, motion control instructions can be used in the primary periodic task
and in a priority-16 periodic task.
In either case, the motion control instructions are processed in the "motion control processing (MC)"
section of the primary periodic task.
For the NX701 CPU Units, motion control instructions can be used in the primary periodic task, in the
priority-16 periodic task, and in the priority-5 periodic task.
The motion control instructions included in the primary periodic task and in a priority-16 periodic task
are executed in the "motion control processing (MC)" section of the primary periodic task.
The motion control instructions included in a priority-5 periodic task are executed in the "motion control
processing (MC)" section of the priority-5 periodic task.
The I/O response times that include EtherCAT communications times are given below.
Slave A Servo A
IN Execution command
Process data
communications cycle
= Primary period (t) Primary period (t)
Motion control
Processing is performed in the Commands to Servo A are sent via
instructions
motion control processing (MC) EtherCAT communications when I/O is
executed.
section in the same primary period. refreshed in the next primary period.
Priority-16 UPG
periodic task
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
slave.
Maximum I/O response time = Primary period (= process data communications cycle) × 2
I/O response time = Priority-5 periodic task period (= process data communications cycle)
Slave A Servo A
IN Execution comand
Process data
communications cycle 2
= Task period
Task period Task period
Motion control
Processing is performed in the instructions Commands to Servo A are sent via EtherCAT
motion control processing (MC) executed. communications when I/O is refreshed in the next
section in the same task period. task period.
Note: The above diagram shows only one input and one output.
However, the I/O response time may be as follows depending on the timing of the input from the
slave.
Maximum I/O response time = Priority-5 periodic task period (= process data communications cycle 2) x 2
Slave A Servo A
IN
Execution command
Process data
communications cycle
= Primary period (t)
Processing is performed in
the motion control processing Commands to Servo A are sent via
(MC) section of the next EtherCAT communications when I/O
primary periodic task. is refreshed in the next primary period.
Priority-16 UPG
UPG
periodic task FB FB
Note: The above diagram shows only one input and one output.
However, the response time may be as follows depending on the timing of the input from the slave.
Motion control
instructions
Axis A
Motion control
Axis C instructions
Additional Information
You can access the values of Axis Variables in the tasks other than those for axis control.
For detailed usage and precautions, refer to the NJ/NX-series CPU Unit Motion Control User's
Manual (Cat. No. W507).
Step 4. Wiring
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series on page 1-19 for detail.
The POUs consists of a combination of these three types of POUs. You can create many POUs.
You assign the programs to tasks to execute them.
Programs
l Notation
• The POUs must include at least one program. You can assign up to 128 programs to a single
task.
l Notation
• You can use any instruction, user-defined function, or user-defined function block in the algorithm
of a function block.
• You can retain the values of internal variables. Therefore, you can retain status, such as for
timers and counters.
• There are both user-defined and system-defined functions.
User-defined function blocks are called user-defined function blocks. System-defined function
blocks are sometimes called FB instructions.
For details on function blocks, refer to 6-2-5 Details on Function Blocks on page 6-8.
Functions
l Notation
• You cannot use FB instructions or user-defined function blocks in algorithms.
• The values of internal variables are not retained. Therefore, the output value remains constant if
the input values are the same.
• There are both user-defined and system-defined functions.
User-defined functions are called user-defined functions. System-defined functions are some-
times called FUN instructions.
POU type
Programs Function blocks Functions
Item
Execution condition Executed each period. Executed each period. Specify the execution
Specify the execution condition with the EN in-
condition with an input put.
variable.
The hierarchical relationships between programs, functions, and function blocks are shown in the fol-
lowing figure.
Task
Program 2
Function blocks
Functions Functions
Program
Task
Program
Local variable table Assigned.
Program
Algorithm
FUN
FB
l Order of Execution
You can set the order of execution of all programs in a task. You specify this order under Task
Settings - Program Assignment Settings in the Sysmac Studio.
Data Read/
Variable name Meaning Function
type write
P_First_Run- First RUN Peri- This flag is TRUE for only one task period after BOOL Read
Mode od Flag the operating mode of the CPU Unit is
changed from PROGRAM mode to RUN mode
if execution of the program is in progress.
This flag remains FALSE if execution of the
program is not in progress.
Use this flag to perform initial processing when
the CPU Unit begins operation.
P_First_Run*1 First Program This flag is TRUE for one task period after ex- BOOL Read
Period Flag ecution of the program starts. *2
Instance name
Function block name or instruction name
In-out variable
MyFB_instance Output variable
TRIG MyFB OUT
In Q
Algorithm
6
Instance name
Algorithm
• Written as a ladder diagram or in ST.
• You can use any instructions,
user-defined functions, and user-de-
fined function blocks.
l Instance Name
You give an instance name to a function block instance in a program to enable managing it.
You specify an instance name when you call a function block definition from a program or another
function block.
l Algorithm
You can code the algorithm either as a ladder diagram or in ST.
You can use any instruction, user-defined function, or user-defined function block in the algorithm.
l Parameters
Input Parameters to Input Variables
An input parameter passes a value to an input variable in a function block when function block exe-
cution begins. An input parameter can be either a variable or a constant.
Output Parameters from Output Variables
An output parameter receives a value from an output variable in a function block when function
block execution is completed. A variable is given as the parameter.
In-Out Parameters Shared between In-Out Variables
The value of the in-out parameter changes within the function block. The same variable is used for
both the input and output.
Additional Information
You can omit input and output parameters. Refer to information on operation when parameters
are omitted in Operation When Parameters Are Omitted on page 6-23 for details.
You can also omit input variable names and other variable names, and give only the parameters. (If
you do, the parameters must be given in the order that they are given in the function block definition.)
Also, the number of parameters must match the number of input variables and other variables in the
function block definition.
TON_instance
a TON c
In Q
b PT ET d
6
The specifications for variables in function blocks are given below.
Refer to 6-3-4 Attributes of Variables on page 6-30 for details on setting variable attributes.
Additional Information
If you define an external variable with the same name as a global variable in a function block, it
is defined automatically based on that global variable.
l ENO
When ENO is FALSE, the previous values of all other output variables are retained.
You can create instances of a function block definition to process different I/O data in the same
way.
Program POU
Variable
declarations Memory area reserved.
Algorithm
Instances cannot be read from other programs or function blocks. If an instance with the same
name as another instance is placed in a different program or another function block, that instance
will operate as a completely separate instance.
Array Specifications for Instances
Example:
timer2 NEXT
EN ENO
TON
IN[2] OUT[2]
In Q
PT[2] PT ET
PT[4] PT ET
Refer to 6-5-2 Ladder Diagram Language on page 6-90 for details on power flow output and parame-
ter output.
You can specify the edge for an input variable to make the variable TRUE only when the input param-
eter changes to TRUE.
Instance
A
Variable A FB 6
X
Instance
Variable A FB
A
X
Instance X
Specifies detecting a change to FALSE.
You can access the input and output variables for a function block only within the program that con-
tains the function block.
However, you cannot access these variables from within other function block instances even if they
are in the same program. You cannot access them from other programs.
Program P1
FB1_Instance
FB1
Cannot be
accessed.
FB2_Instance
FB2
C D
Program P2
Cannot be
accessed.
FB2_Instance.B
The following variables cannot be accessed from external devices. If these variables are accessed, a
building error will occur.
• In-out variables for function blocks
• Input variables for FB instructions for which an initial value is not applied when the input parameter
is omitted
Structure of Functions
In a ladder diagram, functions are represented as rectangular boxes as shown below.
Refer to Expressing Functions in ST on page 6-18 for details about how to express functions in ST.
EN input
ENO output
MyFUN
EN ENO
Return value
Para1 In1 ret_val
l Instance Name
Functions do not have instance names.
l Algorithm 6
You can code the algorithm either as a ladder diagram or in ST.
Function
Algorithm
FUN instruction
User-defined
function
l Parameters
Input Parameters to Input Variables
An input parameter passes a value to an input variable in a function when function execution be-
gins. An input parameter can be either a variable or a constant.
Output Parameters from Output Variables
An output parameter receives a value from an output variable in a function when function execution
is completed. A variable is given as the parameter.
In-Out Parameters Shared between In-Out Variables
The value of the in-out parameter changes within the function. The same variable is used for both
the input and output.
Expressing Functions in ST
The following example shows how to call functions from ST.
You can also omit input variable names and other variable names, and give only the parameters. (If
you do, the parameters must be given in the order that they are given in the function definition.) Also,
the number of parameters must match the number of input variables and other variables in the func-
tion definition.
MAX
EN ENO
Para1 In1 Para_MAX
Para2 In2
Function name
Function name
name or
or instruction
instructionname
name Value is assigned.
Input Internal
Input parameter Output Output parameter
variable variables
Variable assignment variable Variable assignment
itself is passed. itself is passed.
Refer to 6-3-4 Attributes of Variables on page 6-30 for details on setting variable attributes.
Additional Information
You can register global variables as external variables in a function variable table to access
global variables.
We recommend that you create your functions so that they produce output values uniquely
based on their input parameter values. Algorithms that access global variables and use them to
affect the output values are not recommended. When you check the program on the Sysmac
Studio, a message will appear that says that it is not recommended to use global variables in
functions. Take appropriate measures if necessary.
l ENO
• When ENO is FALSE, the previous values of all other output variables are retained.
l Return Values
• Return values are blank in ladder diagrams.
Variable i Variable q
IN
Variable i2 Variable q1
In2 OutEQ
OutGT
OutGE
Variable q4
OutNE
OutLT
OutLE
6
• The calling instruction is not required to use the return value in either a ladder diagram or ST.
• If you set the return value within a function algorithm, set the value to a variable with the same
Example:
BOOL variable B
in
EN
Function
execution
BOOL variable A
BOOL variable B
POU EN ENO
FB User-de- Cannot be used. Can be used or omitted.
fined func- A building error occurs if you try to de- You define ENO as an output variable in
tion blocks fine EN in the variable table from the the Sysmac Studio.
Sysmac Studio.
Instruction All FB instructions do not use EN. Some instructions use ENO, and others
do not.
FUN User-de- Required. Can be used or omitted.
fined func- When you create a function, the Sys- You define ENO as an output variable in
tions mac Studio automatically adds EN to the Sysmac Studio.
the variable table by default.
Instruction All FUN instructions use EN. Some instructions use ENO, and others
*1. You can access the input and output variables of a function block from outside of the function block (but only
within the same program) with InstanceName.VariableName. However, you cannot access the input and out-
put variables of a function from outside the function.
FBinstance
FB
Omitted.
Done
FBinstance.Done
Function
EN ENO
FALSE
x[i] IN1
When an error occurs in an input parameter, the power flow output changes to FALSE. If you
omit ENO for user-defined function blocks, the power flow output remains FALSE from the next
time you call the function blocks. The power flow output cannot change to TRUE. When an er-
ror may occur in an input parameter, define the ENO and write the algorithm so that the power
flow output changes to TRUE when you call function blocks.
Function
EN ENO
Example when variable i is outside the
range of the elements in array variable x
IN1 OUT1 x[9]
Function
OFF
EN ENO
x[i] x[i]
INOUT-- --INOUT
xyz Retained.
X
Recursive Calling
Names
6
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names on page 6-83 for
restrictions on POU names and function block instance names.
Additional Information
FB
x Do not assign INT variable x [0..199] to the function block input variable
IN1 OUT1
IN1 (Data type of the IN1 input variable in the function block:
ARRAY[0..199] OF INT).
FB
Instead, assign INT variable x [0..199] to the INOUT in-out variable of
x INOUT INOUT the function block. (Data type of INOUT in-out variable in the function
block: ARRAY[0..199] OF INT)
FB
Do not assign MyStructure variable x to the IN1 input
x IN1 OUT1 variable of the function block (Data type of IN1 input
variable of the function block: MyStructure).
FB
Instead, assign MyStructure variable x to the INOUT in-out
x INOUT INOUT variable of the function block. (Data type of INOUT in-out
variable of the function block: MyStructure)
Nesting Levels
Calling another function or function block from a function or function block that was called from a pro-
gram is called nesting. The limits that are given in the following table apply to the POUs that you can
call from a user-defined function or function block and the number of nesting levels. A building error
will occur if these limits are exceeded.
Example 1: From a program, you can call function blocks to a depth of 8 levels. You can then call func-
tions to a depth of 16 levels.
6-3 Variables
In the NJ/NX-series System, variables are used to exchange I/O information with external devices, to
perform data calculations, and to perform other processes.
This section describes variable designations in detail.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on setting varia-
bles with the Sysmac Studio.
6-3-1 Variables
Variables store I/O data for exchange with external devices or temporary data that is used for internal
POU processing. In other words, a variable is a container for data with a name, data type, and other
attributes.
You do not need to assign a memory address to a variable. However, you can assign a specific memo-
ry address if necessary (see notes). The NJ/NX-series CPU Unit automatically allocates memory ad-
dresses in the memory area for variables.
*1. This is done to use specific functions for some CJ-series Special Units or perform the serial communications
using the host link (FINS) protocol. You must specify the CJ-series Unit memory address in the AT Specifica-
tion attribute of the variable. Refer to AT Specification on page 6-61 for details.
*2. You can use CJ-series Units only with NJ-series CPU Units.
l User-defined Variables
The user defines all of the attributes of a user-defined variable.
The rest of this section describes user-defined variables.
l Semi-user-defined Variables
These variables are used to access specific devices and data.
There are two types of semi-user-defined variables: device variables and cam data variables.
Refer to 2-3-1 Type of Variables on page 2-12 and 3-3-1 I/O Ports on page 3-8 for details on device
variables.
l System-defined Variables
System-defined variables are provided in advance in an NJ/NX-series CPU Unit. The names and
all attributes are defined by the system. They have specific functions. System-defined variables are
supplied for each function module. Refer to A-6 System-defined Variables on page A-75 for de-
tails.
Refer to 2-3-1 Type of Variables on page 2-12 for details on the different types of variables.
¡: Supported.
POU type
Type of user-defined variable
Programs FB FUN
Local variables Internal variables ¡ ¡ ¡
Input variables Not supported. ¡ ¡
Output variables Not supported. ¡ ¡
In-out variables Not supported. ¡ ¡
Global variables ¡ (see note) ¡ (see note) ¡ (see note)
External variables ¡ ¡ ¡
*1. You can define global variables as external variables to access the global variables through the external varia-
bles.
Local Variables
Local variables can be read and written only in the POU (program, function, or function block) in which
it is defined.
Local variables are the same as internal variables if the POU is a program. If the POU is a function
6-3 Variables
block or a function, “local variable” is a collective term for internal variables, input variables, output var-
iables, in-out variables, and external variables.
l Internal Variables
An internal variable can be used only within one POU. 6
An internal variable is declared in the local variable table of the POU.
You cannot access the values of internal variables from outside of the POU.
l Input Variables
When a POU is called, the values of the input parameters are assigned to the input variables from
the calling POU. An input variable is declared in the local variable table of the POU.
l Output Variables
Before processing a POU is completed, the output parameters returned to the calling POU are as-
signed to the output variables. An output variable is declared in the local variable table of the POU.
l In-Out Variables
When a POU is called, the in-out variables are assigned to the in-out parameters themselves (vari-
able designations) from the calling POU. If you change the value of an in-out variable within a
POU, the value of the in-out parameter changes at that time.
An in-out variable is declared in the local variable table of the POU.
l External Variables
External variables are used to access data outside of a POU.
You can access global variables from POUs.
Global Variables
A global variable is declared in the global variable table.
Device variables that are automatically generated from the Unit configuration and slave configuration
and axis/axes group variables that are generated from the Axis Setting Table are automatically regis-
tered as global variables.
l Attributes of Variables
Attribute Description Specification Default
Variable name The variable name is used to identify --- ---
the variable.
Data Type The data type defines the format of --- BOOL
the data that is stored in the variable.
AT Specification If you want to handle a specific ad- • Not specified. Not specified.
dress for a CJ-series Unit as a varia- • Specify.
ble, specify the address to assign to
that variable. *1
Retain Specify whether to retain the value of • Retain: Value speci- Non-retain: Reset to
the variable in the following cases. fied on the left is re- initial value.
• When power is turned ON after a tained if there is a
power interruption Battery.
• When the CPU Unit changes to • Non-retain:
RUN mode Changes to initial
• When a major fault level Controller value.
error occurs
Initial Value You can select to set or not set an ini- Initial Value Depends on the data
tial value. • Yes type.
If the initial value is set, specify the • None (Refer to the section
value of the variable in the following on Initial Value on
cases and do not specify the Retain page 6-64.)
attribute.
• When power is turned ON
• When operating mode changes
• When a major fault level Controller
error occurs
If the initial value is not set, the value
is not retained.
Constant If you set the Constant attribute, you Specify making the ---
can set the initial value of the variable value a constant or not
when it is downloaded, but you can- a constant.
not overwrite the value afterwards.
Additional Information
6-3 Variables
Variable Data AT Spec- Initial Network
Type of variable Retain Constant Edge
Name Type ification Value Publish
Global variables Support- Support- Support- Support- Support- Support- Support- Not
ed. ed. ed. ed. ed. ed. ed. sup-
ported.
6
Pro- Internal Support- Support- Support- Support- Support- Support- Not sup- Not
grams variables ed. ed. ed. ed. ed. ed. ported. sup-
ported.
The amount of memory that is allocated when you declare a variable depends on the data type of that
variable. The more memory allocated, the larger the range of values that the variable can express.
The data types for the input, output, and in-out variables of instructions depend on the instruction. Set
the data types of input, output, and in-out parameters for the instruction arguments according to the
data types of the input, output, and in-out variables for that instruction.
Classification Definition
Boolean A data type with a value of either TRUE or FALSE.
Bit string A data type that represents a value as a bit string.
Integer A data type that represents an integer value.
Real number A data type that represents a real number.
Duration A data type that represents a time duration (days, hours, minutes, seconds, and millisec-
onds).
Time of day A data type that represents a specific time of day (hour, minutes, and seconds).
Date A data type that represents a date (year, month, and day).
Date and time A data type that represents a date and time (year, month, day, hour, minutes, seconds,
and milliseconds).
Text string A data type that contains a value that represents a text string.
There are a total of twenty different basic data types. The specifications are given in the following
table.
The meanings of the data size and alignment columns in the following table are as follows:
• Data size: The actual size of the value.
• Alignment: The unit used to allocate memory.
Classifica-
Data type Data size Alignment Range of values Notation
tion
Boolean BOOL 16 bits 2 bytes TRUE or FALSE BOOL#0 or BOOL#1
TRUE or FALSE
Bit strings BYTE 8 bits 1 byte BYTE#16#00 to FF BYTE#2#01011010
WORD 16 bits 2 bytes WORD#16#0000 to BYTE#2#0101_1010
FFFF BYTE#16#5A
DWORD 32 bits 4 bytes DWORD#16#00000000 You can also use the "_"
to FFFFFFFF character as a separa-
tor.
LWORD 64 bits 8 bytes LWORD#16#000000000
0000000 to
FFFFFFFFFFFFFFFF
6-3 Variables
Integers*1 SINT 8 bits 1 byte SINT#-128 to +127 100
INT 16 bits 2 bytes INT#-32768 to +32767 INT#2#00000000_01100
DINT 32 bits 4 bytes DINT#-2147483648 to 100
+2147483647 INT#8#144
INT#10#100
LINT 64 bits 8 bytes LINT#-92233720368547
75808 to
INT#16#64 6
-100
+922337203685477580
7
Classifica-
Data type Data size Alignment Range of values Notation
tion
Dura- TIME 64 bits 8 bytes T#-9223372036854.775 T#12d3h3s
tions*1*2 808ms T#3s56ms
(T#-106751d_23h_47m TIME#6d_10m
_16s_854.775808ms) to TIME#16d_5h_3m_4s
T# T#12d3.5h
+9223372036854.77580 T#10.12s
7ms T#61m5s (Equivalent to
(T# T#1h1m5s)
+106751d_23h_47m_16 TIME#25h_3m
s_854.775807ms)
Date DATE 64 bits 8 bytes D#1970-01-01 to Add “DATE#”, “date#”,
D#2106-02-06 “D#”, or “d#” to the be-
(January 1, 1970 to Feb- ginning of the string and
ruary 6, 2106) express the date in the
yyyy-mm-dd format.
Example:
d#1994-09-23
Time of TIME_OF_ 64 bits 8 bytes TOD#00:00:00.0000000 Add “TIME_OF_DAY#”,
day*2 DAY 00 to “time_of_day#”, “TOD#”,
TOD#23:59:59.9999999 or “tod #” to the begin-
99 ning of the string and ex-
(00:00:0.000000000 press the time of day in
to 23:59:59.999999999) the hh-mm-ss format.
Example:
tod#12:16:28.12
Date and DATE_AN 64 bits 8 bytes DT#1970-01-01-00:00:0 Add “DT#” or “dt#” to the
time*2 D_TIME 0.000000000 to beginning of the string
DT#2106-02-06-23:59:5 and express the date
9.999999999 and time in the yyyy-
(January 1, 1970 mm-dd-hh:mm:ss for-
00:00:0.000000000 to mat.
February 6, 2106, Example:
23:59.999999999 sec- dt#1994-09-23-12:16:28.
onds.) 12
Text STRING (Number of 1 byte The character code is Enclose the string in sin-
strings single-byte UTF-8. gle-byte single quotation
characters 0 to 1,986 bytes (1,985 marks (').
plus 1) × 8 single-byte alphanumer- Example:
bits*3 ic characters plus the fi- 'OMRON''PLC'
nal NULL character, for
Japanese, this is ap-
proximately equal to 0 to
661 characters) *4
The default size is 256
bytes.
*1. Use the NanoSecToTime and TimeToNanoSec instructions to convert between durations and integer
data. Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for detailed instruc-
tion specifications.
*2. Variables are compared with nanosecond precision for comparison instructions. To change the preci-
sion for comparison, use the TruncTime, TruncDt, or TruncTod instruction. Refer to the NJ/NX-series
Instructions Reference Manual (Cat. No. W502) for detailed instruction specifications.
*3. A NULL character (1 byte) is added to the end of text strings. Therefore, reserve memory for one
more character than the number of handled characters. For example, if a maximum of 10 single-byte
characters are handled, define a STRING variable for 11 characters (11 bytes). STRING[11]
*4. If you want to insert tabs, line break codes, or other special characters, you can use a single-byte dol-
lar sign ($) as an escape character before them. Refer to Text Strings on page 6-88 for a list of the
escape characters.
The total amount of memory required by all variables is not equal to the total of the data sizes of
each of those variables.
This is because the first position where data is stored in memory is automatically set to a multi-
ple of the alignment value for that data type. This results in some empty space in memory be-
tween data types.
For example, even if the data types are the same, the overall memory space required depends
on the order of data types.
You must be aware of the alignment values for different data types when you exchange data
such as structure variables between devices so that you can properly align the position of the
data in memory.
Refer to A-10 Variable Memory Allocation Methods on page A-221 for details.
6-3 Variables
Additional Information
• You cannot compare the sizes of bit string data types (BYTE, WORD, DWORD, and
LWORD). If value comparisons are necessary, use instructions such as the WORD_TO_UINT
instruction to convert to integer data and compare the values of the integer data variables.
Example:
BCD_data : WORD 6
IF WORD_BCD_TO _UINT (BCD_data) > UINT#1234 THEN
• You cannot perform logic processing on integer data types (SINT, INT, DINT, LINT, USINT,
Type Description
Structures This data type consists of multiple data types placed together into a single layered struc-
ture.
Unions This data type allows you to handle the same data as different data types depending on
the situation.
Enumerations This data type uses one item from a prepared name list as its value.
Type Description
Array specifica- An array is a group of elements with the same data type. You specify the number (sub-
tion script) of the element from the first element to specify the element.
You can specify arrays for both basic data types and derivative data types.
Range specifi- You can specify a specific range for a data type in advance.
cation You can specify a range for any integer basic data type.
Refer to 6-3-7 Array Specifications and Range Specifications for Data Types on page 6-51 for de-
tails.
Additional Information
In addition to basic data types and derivative data types, there are also POU instance data
types. A POU instance data type is the data type of a function block instance. To create a func-
tion block instance, the instance name is registered as a variable and the function block defini-
tion name is registered as a data type in the local variable table.
Bit 7 Bit 0
One-bit extraction
BYTE#16#3B 0 0 1 1 1 0 1 1 TRUE
Data Size
REAL data is 32 bits, while LREAL data is 64 bits.
Data Formats
The floating-point decimal format is a way to express a real number as a combination of a sign, an
exponent, and a mantissa.
To express a real number as shown below, the value of s is the sign, the value of e is the exponent,
and the value of f is the mantissa.
• REAL Data
Number = (−1)s2e-127(1 + f × 2-23)
• LREAL Data
Number = (−1)s2e-1023(1 + f × 2-52)
6-3 Variables
This floating-point decimal format follows the IEEE 754 standard. The formats are given below.
4. From the above expression we can determine that e−127 = 6, so e = 133 (or 10000101 in bina-
ry).
5. Next we take the value after the decimal part of 1.010110101, which is 010110101. This is not
enough for the 23-bit mantissa, so f is this number with the required amount of zeroes added to
the end. Therefore, f = 01011010100000000000000.
Therefore, you can express −86.625 as shown in the following figure.
Valid Ranges
The valid ranges for REAL and LREAL data are shown in the following table.
There are a range of values that you cannot express as you approach 0.
−∞ 0 +∞
Special Values
Values such as positive infinity, negative infinity, +0, −0, and nonnumeric data are called special
values.
Nonnumeric data refers to data that you cannot express as a floating-point number and therefore
cannot be treated as a numeric value.
Although +0 and −0 both mathematically mean 0, they are different for the purpose of data proc-
essing. Details are provided below.
The values for the sign s, exponent e, and mantissa f of special numbers are given in the following
table.
Subnormal Numbers
You cannot use the floating-point decimal format to express values close to 0 (i.e., values with an
extremely small absolute value). Therefore, you can use subnormal numbers to expand the valid
range of numbers near 0. You can use subnormal numbers to express values with a smaller abso-
lute value than with the normal data format (normal numbers).
Any number where the exponent e = 0 and the mantissa f ≠ 0 is a subnormal number and its value
is expressed as shown below.
• REAL Data
Number = (−1)s2-126(f × 2-23)
• LREAL Data
Number = (−1)s2-1022(f × 2-52)
Example: Expressing 0.75 × 2−127 as REAL Data
1. This is a positive number, so s = 0.
Therefore, you can express 0.75 × 2−127 as shown in the following figure.
Subnormal numbers have less effective digits than normal numbers. Therefore, if a calculation with
normal numbers results in a subnormal number or if a subnormal number results in the middle of
such a calculation, the effective digits of the result may be less than the effective digits of a normal
6-3 Variables
number.
Data Processing
The floating-point decimal format expresses only an approximate value. Therefore, there may be a
difference between the floating-point number and its true value. There is also a limited number of
effective digits for these values. Therefore, the following actions are taken when you perform calcu- 6
lations with the floating-point decimal format.
Generally, calculation results for real number data may be different if the hardware such as a
processor is different. Confirm the calculation results for real number data when you reuse pro-
grams and libraries with the different model number of the CPU Unit.
Rounding
If the real value exceeds the effective digits of the mantissa, the value is rounded off according to
the following rules.
• The result of the calculation will be the closest value to the value that can be expressed as a
floating-point number.
• If there are two values that are the closest to the real value (e.g., if the real value is the median
value of two approximate values), the mantissa with a least significant bit value of 0 is selected
as the result of the calculation.
When you determine if two values are equal, consider the true values and error.
A real number is expressed in the floating-point decimal format. Because of this, there is a
slight error from the actual value. When you try to determine if two values are equal, this error
may cause unintended results.
For example, if you compare 0.1 + 0.2 with 0.3 using boolv := (0.1 + 0.2 = 0.3); , the BOOL
variable boolv will not be TRUE. It will be FALSE.
To prevent this situation, do not use the EQ, =, NE, or <> instruction to determine if two real
numbers are equal. Instead, use the value comparison instructions and determine if the
absolute value of the difference between the two values is within a sufficiently small range.
For example, the following programming can be used to check to see if the sum of REAL varia-
bles real_a and real_b is equal to 0.3. If the value of boolv is TRUE, the two values are consid-
ered to be equal.
In order to assign the data in var1 to the data type of var3, the data must first be converted. This type
of conversion is called “data type conversion” or just “type conversion” for short.
6-3 Variables
2. Automatic Conversion for Assignments and Instructions
• ST assignments
• Connecting lines in ladder diagrams
Additional Information
6
Use the NanoSecToTime and TimeToNanoSec instructions to convert between INT and TIME
data. Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details.
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names on page 6-83 for
restrictions on the number of characters in data type names and other restrictions when you create a
derivative data type.
Additional Information
NJ/NX-series Controllers come with three different types of system-defined derivative data
types.
• System-defined variables that are structures
• Structures used for input, output, and in-out variables for instructions
• Structures for Special Unit expansion memory (You must register these in the Unit Editor to
use them.)
Structures
A structure is a derivative data type that groups together data with the same or different variable types.
You can easily change data and add new data if you place your data into a structure.
For example, you can define a “Box” structure that has three members (Width, Height, and Depth) in
order to organize and group your data.
You can then use this structure data type to add a variable called Box1. You can then use it to access
the different levels of the data by placing a period after the variable name followed by the name of the
data you want to access. For example, Box1.Width or Box1.Height.
If you need to create a new variable to store more box data, you can perform the same steps to add a
new variable called Box2 to the variable table.
When a structure is used for a variable in an instruction, it is necessary to select a structure for the
input parameter, output parameter, or in-out parameter, and register the variable.
Example: Communications Instructions
Example:
abc.x: Member x of structure variable abc
abc.Order.z: Memober z of member structure variable Order of structure variable a
bc
l Creating a Structure
2 Specify the member name and the structure data type from above as the data type and register
the variable in the variable table.
Variables
Desk red
green Data type RGB
6-3 Variables
blue
l Structure Specifications
The specifications of structure data types are given in the following table.
Item Specification
Structure names Names are not case sensitive.
Prohibited characters and character length restrictions are the same as for varia-
ble names.
Member data types Refer to the table on the data types of structure members that is given below for
details.
Member attributes Member name
Comment
Number of members 1 to 2,048
Nesting depth of struc- 8 levels max.
tures (however, a member name must be 511 bytes or less, including the variable
name)
Maximum size of one NX701-££££: 8 MB
structure variable NX102-££££: 4MB
NX1P2-££££: 1 MB
NJ501-££££: 4 MB
NJ301-££££: 2 MB
NJ101-££££: 2 MB
Version Information
The following table gives the unit version of the CPU Units and the Sysmac Studio version that
are required to specify member offsets.
Setting Offsets
If you set the memory offset type to User, you can set memory offsets for each member of the
structure. There are byte offsets and bit offsets. If you set the memory offset type to NJ or CJ, the
memory configuration is determined automatically. You do not need to set offsets.
The meanings of the offsets are as follows:
Range of val-
Offset Meaning Unit
ues
Byte offset The byte offset is the offset of a member from the start of Byte *1
the structure.
Bytes offsets are used for all basic data types and deriva-
tive data types.
Bit offset The bit offset is the offset of a member from the start of Bit 0 to 63
the byte position that is specified with the byte offset.
*1. For NX-series CPU Units, the range of values is 0 to 8191. For NJ-series CPU Units, the range of values
is 0 to 1023.
Example:
This example shows the memory configuration when the following settings are made with the
Structure Editor.
6-3 Variables
Name Data type Offset type Byte offset Bit offset
StrA STRUCT User
VarA DINT 0 0
VarB INT 4 0
VarC DINT 6 0 6
Bit 7 Bit 0
Memory
Classifica-
Data Type Byte offsets Bit offsets
tion
Boolean BOOL Can be set. Can be set.
Bit strings BYTE, WORD, DWORD, LWORD Can be set. Fixed.
Integers SINT, INT, DINT, LINT, USINT, Can be set. Fixed.
UINT, UDINT, ULINT
Real num- REAL, LREAL Can be set. Fixed.
bers
Classifica-
Data Type Byte offsets Bit offsets
tion
Durations TIME Can be set. Fixed.
Date DATE Can be set. Fixed.
Time of day TIME_OF_DAY Can be set. Fixed.
Date and DATE_AND_TIME Can be set. Fixed.
time
Text STRING Can be set. Fixed.
strings
Array spec- Can be set. Can be set only for BOOL
ifications elements.
Structures Can be set. Fixed.
Unions Can be set. Fixed.
Enumera- Can be set. Fixed.
tions
POU in- Fixed. Fixed.
stances
6-3 Variables
Passing Values to System-defined Structure Input Variables for Certain Instructions
Some instructions take a predefined structure variable as an input variable.
Example:
The Port input variable for the Serial Communications Instructions (which specifies the target port) 6
is a structure with a data type name of _sPORT.
When you use one of these instructions, follow the procedure provided below to create a user-de-
1 The system-defined data type for the instruction is registered in the Sysmac Studio in advance.
Select that system-defined data type in the Sysmac Studio and add a user-defined structure
variable to the variable table.
2 Use the user program or initial values to set the member values of that structure.
3 Specify the structure variable for the input parameter to the instruction.
Unions
A union is a derivative data type that enables access to the same data with different data types.
You can specify different data types to access the data, such as a BOOL array with 16 elements, 16
BOOL variables, or a WORD variable.
Example:
Define the data type as a union as shown for My Union in the following example.
Variable Table
Output.bit[0]: This notation specifies the 0th element, or value at bit 00, of union Output when it is
treated as a 16-bit BOOL array variable.
Output.data: This notation specifies the value when union Output is treated as a single WORD vari-
able.
l Creating Unions
2 Specify the union data type from above as the data type and register the variable in the varia-
ble table.
Example:
Here, OUT16_ACCESS is defined as the data type of a union.
The members of this union are a BOOL array with 16 elements and a WORD variable.
The variable Output is registered with a data type of OUT16_ACCESS.
You can now read/write variable Output as a BOOL value for any of the 16 bits and as a WORD
value.
Output.WordData := WORD#16#1234;
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BoolData 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
ByteData 16#12 16#34
WordData 16#1234
Output.BoolData[11] :=TRUE;
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BoolData * * * * 1 * * * * * * * * * * *
ByteData Bit 04 of ByteData[1] is TRUE No change
WordData Bit 11 of WordData is TRUE
l Union Specifications
6-3 Variables
Item Specification
Data types that can be specified Refer to the table on the valid data types for union members that is giv-
for members en below.
Number of members 4 max.
Setting initial values Not supported. Always zero. 6
Data Types of Union Members
l Restrictions
• The initial values for unions are always zero.
• You cannot move unions.
• You cannot specify unions for parameters to POUs.
Enumerations (ENUM)
An enumeration is a derivative data type that uses text strings called enumerators to express variable
values.
To use an enumeration, you must first set the values that can be obtained from that variable as enu-
merators (text strings).
Use enumerations to make it easier for humans to understand the meaning behind the values of a var-
iable.
l Expressing Enumerations
When you define an enumeration, you must define the possible values of the variable as enumera-
tors and give the enumeration a name.
l Creating Enumerations
2 Specify the enumeration data type from above as the data type and register the variable in the
variable table.
Example:
Here, Color is defined as the data type of an enumeration. For this example, we will set three enu-
merators: red, yellow, and green. The numbers associated with these enumerators are as follows:
red = 0, yellow = 1, green = 2.
The variable DiscColor is registered with a data type of Color. The variable DiscColor will change to
one of the following: red (0), yellow (1), or green (2).
Enumeration Table
FB Data type
Color ENUM
(Color)
Enumerator Value
Color#red IN
red 0
yellow 1
green 2
Variable Table
Variable name Data type
DiscColor Color
l Enumeration Specifications
Item Specification
Enumerator names Enumerator names consist of single-byte alphanumeric characters. They are not
case sensitive. Prohibited characters are the same as for variable names.
A building error will occur if you specify the same enumerator more than once.
A building error will occur if you specify an enumerator with the same name as a
variable in the user program or if you specify an enumerator that already exists
in another enumeration.
Values Valid range: Integers between −2,147,483,648 and 2,147,483,647
Values do not have to be consecutive.
A building error will occur if you specify the same value more than once.
Note: You cannot perform size comparisons with enumeration variables. You can
only test to see if the enumerators are the same.
Number of enumerators 1 to 2,048
Enumerator Only
For a function or function block for which the parameter specifies an enumerator, you can just
specify the enumerator.
Example: Passing an Enumerator to the BCDToBins_WORD Instruction
BinToBCDs_WORD
EN ENO
INT#1234 In BCDdata
_BCD1 Format
Enumeration#Enumerator Notation
For a function or function block for which the data type of the parameter is not specified, specifying
just the enumerator is not valid. A building error will occur. To clarify that the parameter is an enu-
merator, the following notation is used: Enumeration#Enumerator.
Example: Passing an Enumerator to the MOVE Instruction
MOVE
EN ENO
6-3 Variables
Color#red In Out ColorA
Additional Information 6
For a function or function block for which the parameter specifies an enumerator, you can also
l Value Checks
When a value is written to an enumerated variable through execution of an instruction, an error will
not occur even if that value is not defined as one of the enumerators of that variable. Therefore, if it
is necessary to confirm that a value is defined as an enumerator of an enumeration, write the user
program to check the value.
Arrays are useful when you want to handle multiple pieces of data together as you would, for example,
coordinate values for motion control.
Examples:
Variable Table
Variable name Data type
Mem ARRAY[0..99] OF INT
x:=10;
Mem[x]: This expression specifies the xth element of the array variable Mem (the variable x has a
value of 10, so this would point to the 10th element).
Variable Table
Variable name Data type
Data ARRAY[0..99] OF INT
x:=10;
y:=20;
Data[x+y]: This expression specifies the x+yth element of the array variable Data
(the variable x has a value of 10 and variable y has a value of 20, so this would point to the 30th
element).
l Creating an Array
1 Enter A into the Data type Column of the variable table and select ARRAY[?..?] OF ? from the
list of possible data type name candidates.
2 Enter the number of the first element in the array for the left question mark and the last number
for the right question mark in the “[?..?]” section. Next, enter the data type for the question
mark in the “OF ?” section and register the variable.
Variable Table
Variable name Data type
abc ARRAY [ 0 .. 4 ] OF INT
Additional Information
You can use a fixed-length array specification for a variable when you specify the first number
6-3 Variables
and last number for the subscripts. You can use a variable-length array specification for a varia-
ble when you specify a single-byte asterisk (*) for the subscript.
There are the restrictions on fixed-length array specifications when you use a variable-length
array specification. Refer to Variable-length Array Specifications on page 6-56 for details on
variable-length array specifications.
6
Version Information
A CPU Unit with unit version 1.18 or later and Sysmac Studio version 1.22 or higher are re-
Variable Table 0 1 2 3
0
Variable name Data type
1
abc ARRAY [0..5 , 0..3 ] OF INT 2 abc[ 2 , 3 ]
3
4
5
Variable Table
Variable name Data type
Y( 0 . 2 ) 2
ITEM ARRAY [ 0..1, 0..2, 0..3 ] OF INT
1
Z( 0 . 3 ) 0 3
2
1
0 1 0
X( 0 . 1 )
6-3 Variables
l Instructions with an Array Parameter
Some instructions pass array variables as parameters. To do so, specify only the name of the array
variable as the input parameter. 6
Example: Passing a Single Array Element to the MOVE Instruction and Passing an Array to the
Restrictions:
When you specify an array variable, it must be moved to a variable of the same data type with the same range of element numbers.
Additional Information
× MOVE
EN ENO
x[0,1] y[0,1]
In Out
l Array Protection
The following errors occur if you attempt to access an element that exceeds the number of ele-
ments in an array.
When you declare an array variable with two or three dimensions as a variable-length array varia-
ble, you need to specify a single-byte asterisk (*) for all dimensions. You cannot declare a variable
which uses both variable-length dimension and fixed-length dimension.
l Restrictions on Processing
If an in-out variable for a function (FUN) and function block (FB) is a variable-length array variable,
an array variable that you can specify for the in-out parameter is only the one whose data type and
number of dimensions are the same as the in-out variable. You can use either a variable-length ar-
ray variable or fixed-length array variable as long as its data type and number of dimensions are
the same as the in-out variable. You cannot specify an array variable whose data type or number of
dimensions is different.
If an in-out variable for a function (FUN) and function block (FB) is a fixed-length array variable, you
6-3 Variables
cannot specify a variable-length array variable for the in-out parameter.
Example of in-out variable for function and Example of in-out parameter to speci- Allowed or
function block fy not allowed
Variable-length array whose data type is INT Variable-length array whose data type is Allowed.
and dimension is one INT and dimension is one
6
Variable-length array whose data type is INT Fixed-length array whose data type is Allowed.
and dimension is one INT and dimension is one
When you write an assignment expression for the entire array in an ST, if you include a variable-
length array variable in either the left side or right side of the expression, a building error will occur.
Similarly, when you transfer the entire array with the MOVE instruction in a ladder diagram, if you
include a variable-length array variable in either the output parameters or input parameters, a build-
ing error will occur.
Example of expression
Left side/ Output parame- Right side/ Input parame- Allowed or not al-
in ST
ter ter lowed
*1
Variable-length array varia- Variable-length array varia- varlen_ary := varlen_ary; Not allowed.
ble ble
Variable-length array varia- Fixed-length array variable varlen_ary := fixed_ary; Not allowed.
ble
Fixed-length array variable Variable-length array varia- fixed_ary := varlen_ary; Not allowed.
ble
Fixed-length array variable Fixed-length array variable fixed_ary := fixed_ary; Allowed.
*1. varlen_ary shows a variable-length array variable, and fixed_ary shows a fixed-length array variable.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for the details on the
LOWER_BOUND and UPPER_BOUND instructions.
You can check to make sure that the entered value is within the allowed range in the following cases.
• When you specify an initial value for a variable
• When you write a value to a variable with CIP message communications
Variable Table
Variable name Data type
abc INT (0 ..100)
Case Operation
An error does not occur and the value is written.
The CPU Unit does not perform a range check when the val-
User program
ue of a variable changes due to the execution of an instruc-
tion.
Case Operation
When the value is an integer A command error occurs.
For an element of an integer
array variable
Write from the Sysmac For a member of an integer
Studio or a CIP message structure
Communica- For entire an integer struc- A command error does not
tions ture occur and the value is writ-
For an entire integer array ten.
Tag data links An error occurs if you attempt to write to a single member
(both via built-in that specifies a range.
EtherNet/IP ports and An error does not occur if you attempt to write to a structure
EtherNet/IP Units) that contains a member for which a range is specified.
Input refreshing from slaves and Units An error does not occur and the value is written.
Forced refreshing values An error does not occur and the value is written.
6-3 Variables
6
Variables with range specifications are not checked for changes in variable values that result
from the execution of instructions in the user program. To check the range of values for a varia-
ble that are set from execution of the user program, use instructions that perform range checks.
Variable Table
Variable name Data type
Variable x INT(10 .. 100)
ChkRange MOVE
EN EN ENO
Variable x
In Variable i In Out Variable x
Variable i
Val
You cannot perform any checks beforehand if you set data with arithmetic processing results. In
this case, check the range of values after arithmetic processing (e.g., ADD).
Variable Table
ADD Variable name Data type
EN ENO
Variable A INT(10 .. 100)
In1 Variable tmp
In2
ChkRange MOVE
EN EN ENO
Variable A Val
Make sure that the initial value is within the range specified for the Range Specification.
If the initial value field on the Sysmac Studio is left blank, an initial value of 0 is used. This ap-
plies even if a range that does not include 0 is set for a Range Specification.
Variable Name
The variable name is used to identify the variable.
Each variable in a POU must have a unique name. However, you can declare local variables with the
same variable name in different POUs. These are treated as two separate variables.
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names on page 6-83 for
restrictions on variable names.
AT Specification
Use the AT Specification attribute to specify the internal I/O memory address of a variable in memory
used for CJ-series Units.
AT specifications are used mainly to specify specific memory addresses for the following Special
Units.
• Addresses in fixed allocations for DeviceNet Units
• Addresses in user-specified allocations for DeviceNet Units or CompoNet Master Units from the CX-
Integrator (A CompoNet Master Unit must be set to communications mode 8 to use the CX-Integra-
tor.)
• Addresses in expansion memory for High-speed Counter Units
• Addresses in expansion memory for Process I/O Units
• Addresses in target node information and user-defined status areas that are used with EtherNet/IP
Units
6-3 Variables
If this attribute is not set, the variable is automatically assigned to an address in variable memory.
You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102
CPU Units, and NX1P2 CPU Units. 6
When you assign a device variable to an I/O port, they are automatically given an AT specifica-
tion internally.
l Allocation Areas
You can specify addresses in the following areas.
Area Expression
CIO 0 to 6143
WR W0 to W511
HR H0 to H1535
DM D0 to D32767*1
EM*2 NX102-££££: E0_0 to E18_32767
NJ501-££££: E0_0 to E18_32767
NJ301-££££: E0_0 to E3_32767
NJ101-££££: E0_0 to E3_32767
*1. For the NX1P2-££££, the address is D0 to D15999.
*2. For the NX1P2-££££, the EM Area is not supported.
The following table gives the data assignments by variable data type.
The following variables are also allocated an address internally. The following is displayed in the AT
field.
6-3 Variables
Device variables for built- BuiltInIO://cpu/#0/[I/O_port_name] BuiltInIO://cpu/#0/Input Bit 00
in I/O*2
Device variables for Option BuiltInIO://opt/#[physical_port_num- BuiltInIO://cpu/#1/Ch1 Analog Input
Boards*2 ber*3]/[I/O_port_name] Value
Axis Variables MC://_MC_AX[] MC://_MC_AX[1] 6
MC://_MC1_AX[]*4
MC://_MC2_AX[]*4
You can assign the same address to more than one variable. However, this is not recommend-
ed as it reduces readability and makes the program more difficult to debug. If you do this, set an
initial value for only one of the variables. If you set a different initial value for each individual
variable, the initial value is undefined.
Retain
Use the Retain attribute to specify whether a variable should retain its value in the following cases.
• When power is turned ON after a power interruption
• When the operating mode is changed
• When a major fault level Controller error occurs
If the Retain attribute is not set, the value of the variable is reset to its initial value in the above situa-
tions.
You can specify the Retain attribute when you need to retain the data that is stored in a variable (such
as the manufacturing quantities) even after the power to the CPU Unit is turned OFF.
For a variable with an AT specification, the setting of the Retain attribute must agree with address in
the memory area where the address is assigned.
(Retained areas: Holding, DM, and EM Areas
Non-retained areas: CIO and Work Areas)
Additional Information
For the NX102 and NX1P2 CPU Units, retained variables are retained in the non-volatile mem-
ory.
Value of variables
Case Retain attribute Retain attribute not
specified specified
When power is turned ON after a power interruption Retained. Not retained.
When the operating mode is changed
When a major fault level Controller error occurs
When you download When the Clear the present
the user program values of variables with Retain
attribute Check Box is not se-
lected.
When the Clear the present Not retained.
values of variables with Retain
attribute Check Box is selected.
Initial Value
The variable is set to the initial value in the following situations.
• When power is turned ON
• When changing between RUN mode and PROGRAM mode
• When you select the Clear the present value of variables with Retain attribute Check Box, and
download the user program
• When a major fault level Controller error occurs
You can set an initial value for a variable in advance so that you do not have to write a program to
initialize all of the variables. For example, you can preset data such as a recipe as initial values.
You do not have to set any initial values.
6-3 Variables
Initial Value Specified
Initial value Initial value
Or
(Blank) 3.14
The following table shows the variables for which you can set an initial value.
Additional Information
Some Basic I/O Units have more than one access method for the same I/O port, such as bit
string data and BOOL data. If you use initial values for this type of I/O port, set the initial values
for one of the access types to None.
For the CPU Unit that is retained variables by the Battery, if the CPU Unit has no Battery, the
above variables are also initialized.
Constant
If you specify the Constant attribute, the value of the variable cannot be written by any instructions, ST
operators, or CIP message communications. Setting the Constant attribute will prevent any program
from overwriting the variable.
The values of variables with a Constant attribute cannot be written from instructions after the initial val-
ue is set.
If there is an instruction in a POU that attempts to write a value to a variable with the Constant attrib-
ute, an error will occur when the user program is built.
l Operation
If there is an instruction or operator in a POU that attempts to write a value to a variable with the
Constant attribute, the following operations will occur.
6-3 Variables
Communica- Writing from Sysmac Stu- Not supported.
tions dio
CIP messages A command error occurs.
Tag data links An error occurs when a tag data link starts. The tag data link
will continue to operate.
However, the values of variables with the Constant attribute 6
are not written.
Input refreshing from slaves and Units An error does not occur and the value is written.
Additional Information
You cannot write to variables with the Constant attribute from the user program.
Network Publish
The Network Publish attribute allows a variable to be read/written from external devices (other Control-
lers, host computers, etc.) through CIP message communications or tag data links.
If this attribute is not set, you can read/write the variable from the Controller that declared the variable
and external devices (other Controllers, host computers, etc.) cannot read/write that variable.
Variables that have been published to the network are called network variables.
Edge
The Edge attribute makes the variable pass TRUE to a function block when a BOOL variable changes
from FALSE to TRUE or from TRUE to FALSE.
You can specify the Edge attribute only for BOOL input variables to function blocks.
l Application
Use the Edge attribute when you want the function block to accept the input only when the input
parameter changes from FALSE to TRUE or from TRUE to FALSE.
For example, you can use this attribute when you want to execute the function block any time there
is a change detected in an input parameter.
l Operation
• If you specify a change to TRUE, the input variable changes to TRUE only when the input pa-
rameter connected to that input variable changes from FALSE to TRUE.
• If you specify a change to FALSE, the input variable changes to TRUE only when the input pa-
rameter changes from TRUE to FALSE.
Version Information
When you are using the or the CPU Unit Ver.1.13 or later and Sysmac Studio Ver.1.17 or higher
in combination, you can set the operations when the operating mode changes or when down-
loading according to the setting of the _DeviceOutHoldCfg (Device Output Hold Configuration)
system-defined variable.
The values of variables in the CPU Unit will change as shown in the following table when the power is
turned ON, when the operating mode changes, or when downloading.
After downloading
When the Clear the When the Clear the
Retain at- When the operat-
When power is present values of present values of
tribute of Type of variable ing mode is
turned ON variables with Retain variables with Retain
variable changed
attribute Check Box attribute Check Box
is selected. is not selected.
Non-retain User-defined variables • If initial values are set, the variables change to the initial values.
• If initial values are not set (None), the variables change to 16#00. *1
AT specifica- • If initial values are set, the variables • If initial values are set, the variables change
tions for CIO change to the initial values. to the initial values.
• •
6-3 Variables
and Work If initial values are not set (None), the If initial values are not set (None), the previ-
Area ad- variables change to 16#00. *1 ous value is retained.
dresses in
the memory
used for CJ-
series Units
Device variables for Ether- • If initial values are set, the variables change to the initial values. 6
CAT slaves*2 • If initial values are not set (None), the variables change to 16#00. *1
Device variables for NX • If initial values are set, the variables change to the initial values.
After downloading
When the Clear the When the Clear the
Retain at- When the operat-
When power is present values of present values of
tribute of Type of variable ing mode is
turned ON variables with Retain variables with Retain
variable changed
attribute Check Box attribute Check Box
is selected. is not selected.
Retain User-de- Retain condi- No change No change • If initial values are The values before the
fined vari- tion is met. *4 (retains values be- (retains values when set, the variables download are re-
ables fore power inter- the operating mode change to the initial tained.
ruption). is changed). values.
Retain condi- • If initial values are • If initial values are
tion is not not set (None), the set, the variables
met. *3 variables change to change to the initial
16#00. *1 values.
• If initial values are
not set (None), the
variables change to
16#00. *1
At specifica- • If initial values are
tions for set, the variables
Holding, DM, change to the initial
and EM Area values.
addresses in • If initial values are
the memory not set (None), the
used for CJ- variables change to
series Units the values of the
memory addresses
in the AT specifica-
tions.
Device variables for CJ- • If initial values are The variables change
series Units set, the variables to the values of the
change to the initial memory addresses in
values. the AT specifications.
• If initial values are
not set (None), the
variables change to
the values of the
memory addresses
in the AT specifica-
tions.
Holding, DM, and EM Area The previous values The previous values
addresses in the memory are retained. are retained.
used for CJ-series Units • If device variables
*2 for CJ-series Units
are assigned to
setup data in the
DM Area, the initial
values that are set
for the variables
are used.
• If user-defined vari-
ables are assigned,
the initial values of
the variables are
used.
*1. Values other than 16#00 may be used depending on the data type. Refer to When the Initial Value Specification Is Left Blank on page
6-66 for details.
*2. Device outputs are retained even when the operating mode changes or when downloading if the device output hold configuration is set
to enable (16#A5A5) in the _DeviceOutHoldCfg (Device Output Hold Configuration) system-defined variable.
Refer to Device Output Hold Configurations on page 6-71 for the device output hold configurations.
*3. This does not include user-defined variables and device variables for CJ-series Units if they have AT specifications.
*4. Refer to Retain Condition on page 6-73 for the retain conditions.
The values of variables in the CPU Unit will change as shown in the following table when a major fault
level Controller error occurs, or during online editing.
6-3 Variables
bles and device vari- (retains value before error). the variables change to
ables the initial values.
• If initial values are not
set, the variables
change to 16#00.
Holding, DM, and EM No change
memory areas for 6
CJ-series Units
You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102
CPU Units, and NX1P2 CPU Units.
If the device output hold configuration is set to disable (other than 16#A5A5), device outputs will
change as given in 6-3-9 Changes to Variables for Status Changes on page 6-68.
Device outputs are retained even when the operating mode changes or when downloading if the de-
vice output hold configuration is set to enable (16#A5A5).
Item
EtherCAT Backup Parameter Settings of EtherCAT slaves
CPU/Expansion Racks Special Unit Settings of CJ-series Units
I/O Map Variable Name
Variable Comment
Variable Type
Event Settings
Task Settings Program Assignment Settings
Programming - POUs Program
Section
Internal/External Variable
Function
Function Block
Programming - Data Data Type
Global Variable
EtherNet/IP Connection Settings
DB Connection Settings
If items other than those given in the above table are changed and downloaded, device outputs are
not retained.
Also, in the Synchronization Window of the Sysmac Studio, select the check box for the Do not
transfer the following. (All items are not transferred.) - CJ-series Special Unit parameters
and EtherCAT slave backup parameters. If you do not select the check box, device outputs are
not retained.
Perform the following procedure if you want to retain device outputs, and change EtherCAT slave
backup parameters or Unit operation settings of the NX bus.
3 Click the Edit Backup Parameter Settings Button in the Slave Parameter Settings Area on
the right of the network configuration.
4 Click the Transfer to Slave Button in the Edit Backup Parameter Settings Tab Page.
5 Right-click a Unit in the CPU and Expansion Racks Tab Page and select Edit Unit Operation
Settings.
6 Click the Transfer to Unit Button for the Unit operation settings.
If you execute Transfer to Slave or Transfer to Unit, the slave or Unit is restarted after the data is
transferred. In this case, device outputs of the slave or Unit are not retained. However, device out-
puts are retained for the slave or Unit that the data is not transferred.
6-3 Variables
Variable name Meaning Function Data type R/W
_DeviceOutHoldCfg Device Output It is 16#A5A5 if you retain the target device WORD RW
Hold Configu- output when the operating mode is changed
ration or when downloaded.
In the case other than 16#A5A5, the target
6
device output is initialized when the operat-
ing mode is changed or when downloaded.
Retain Condition
Retain condition indicates that all of the following conditions are met both before and after the down-
load.
• The variable name is the same.
• The data type (name) is the same.
• The Retain attribute is set to retain the value of the variable.
Refer to Values of Retain Variables After New Creations or Changes of POU Names on page 6-74
for the value of a variable with a Retain attribute after its POU name is changed. Also refer to Variable
Values When Data Types of Retained Variables Are Changed on page 6-76 for the value of a varia-
ble when its data type is changed.
Version Information
For the CPU Unit with unit version 1.10 or earlier, the retain condition indicates that all of the
following conditions are met both before and after the download.
• The variable name is the same.
• The data type name and data type size are the same.
• The Retain attribute is set to retain the value of the variable.
This section describes how the Controller treats POU names and the values of local variables with a
Retain attribute when POU names are changed or newly created on the Sysmac Studio and down-
loaded.
Assume the POU that is displayed as POU_A on the Sysmac Studio is treated as POU_XXX on
the Controller. Also, assume the present value of the local variable VarA on the Controller is
changed to 20.
6-3 Variables
POU name: POU_A_copy POU name: POU_ZZZ
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 0
The present value of the local variable VarB does not change on the Controller if you create a local
variable VarB that was nonexistent in the Project_A when the Project_A was copied, add VarB to
the Project_A and download it while you add a local variable VarB of the same definition to the
Project_A_copy and download it.
In the same manner, the present value of the local variable VarB does not change on the Controller
if you copy the local VarB from the Project_A or merge the variable table.
and as a new local variable VarA. Therefore, the value of the new local variable VarA is the initial
value, 0.
Treatment pattern of
Operation
variable value
• Restoring with Sysmac Studio Controller backups Pattern 1
• Restoring with SD Memory Card backups
• Automatic transfer from SD Memory Cards
• Program transfer from SD Memory Card
• Restoring with variable and memory backup functions on the Sysmac Studio Pattern 2
• Downloading from the Sysmac Studio Pattern 2*1
*1. Pattern 1 applies for a CPU Unit with unit version 1.10 or earlier. The pattern difference depends only on
the unit version of the CPU Unit. It does not depend on the unit version settings for project devices.
The following section gives further description on the treatments of pattern 1 and 2 for each data
type.
Assume the Retain attribute of each variable is set to retain, and the following present values are
given.
Assume the following present values are given for the memory used for CJ-series Units, DM100
and DM101.
The relationship between changes in the data types and how the Controller treats the variables are
6-3 Variables
given below.
l Changes in a Structure
Assume the structure before changes on the Sysmac Studio is defined as in below.
Assume the data type of the variable ABC is STR_1, the Retain attribute is set to retain, and the
members have the following present values.
The relationship between changes in the data types and how the Controller treats the variables are
given below.
If the condition applies both to retain and to change to the initial value, the variable value changes
to the initial value.
6-3 Variables
*2. You can retain the value of the existing member if you upload the variable value before downloading and
then download the variable value after downloading.
l Changes in a Union
Assume the union before changes on the Sysmac Studio is defined as in below.
6
Data type name Member Data type of the member
UNI_1 x WORD
Assume the data type of the variable ABC is UNI_1, the Retain attribute is set to retain, and the
members have the following present values.
The relationship between changes in the data types and how the Controller treats the variables are
given below.
If the condition applies both to retain and to change to the initial value, the variable value changes
to the initial value.
Assume the Retain attribute of the variable ABC is set to retain, and the elements have the follow-
ing present values.
The relationship between changes in the data types and how the Controller treats the variables are
given below.
If the condition applies both to retain and to change to the initial value, the variable value changes
to the initial value.
6-3 Variables
ABC[4] = Initial value
Changing the first number of the The element value will be the ini- The values of the existing element
array element from 1 to 0*2 tial value. numbers are retained. The values
(Expanding the number of ele- ABC[0] = Initial value of the new element numbers will
ments from 3 to 4) ABC[1] = Initial value be the initial values.
ABC[2] = Initial value ABC[0] = Initial value 6
ABC[3] = Initial value ABC[1] = 100
ABC[2] = 200
l Changes in an Enumeration
Assume the enumeration before changes on the Sysmac Studio are defined as in below.
Assume the data type of the variable ABC is ENU_1, the Retain attribute is set to retain, and the
variable has the following present value.
The relationship between changes in the data types and how the Controller treats the variables are
given below.
Additional Information
A function block instance is treated as a local variable of the program in which the instance is
created. As such, the instance is added to and displayed in the local variable table of the pro-
gram. You cannot treat these instances as global variables.
2 Establish an online connection with the Controller and register the variables in one of the fol-
lowing ways.
1) Enter the variable in the name cell in the Watch Tab Page.
2) Drag variables to the Watch Tab Page from an editor or variable table.
The present values of the variables are displayed.
Character Restrictions
Multi-
Maxi-
byte
Re- Case mum
Program-related charac- Charac-
Applicable characters served sensitiv- size
name ter com- ter code
words ity (without
patibili-
NULL)
ty
Variable name Usable characters Refer to Support- Not case 127 UTF-8*1
(including POU in- • 0 to 9, A to Z, and a to z Reserve ed. sensi- bytes
stance names) • Single-byte kana d Words tive.
POU definition • _ (underlines) below.
names • Multibyte characters (e.g.,
Data type names Japanese)
6-3 Variables
Refer to Reserved Words below
Structure member
for a list of the reserved words.
names
Characters that cannot be
and union member
used together
names
• A text string that starts with a
Enumerator names
number (0 to 9) 6
Task names 63 bytes
• Strings that start with “P_”
Name of name- • A text string that starts in an 93 bytes
*1. For UTF-8, single-byte alphanumeric characters each use 1 byte. Multibyte characters each use more than
1 byte. Japanese characters require approximately 3 bytes.
Reserved Words
An error is detected during the program check for the following names.
• A name that is the same as any of the instructions that are described in the NJ/NX-series
Instructions Reference Manual (Cat. No. W502)
• A name that is the same as any of the instructions that are described in the NJ/NX-series Motion
Control Instructions Reference Manual (Cat. No. W508)
• Words that are reserved by the system
6-4-1 Constants
The value of a variable changes depending on the data that is assigned to that variable. The value of
a constant never changes.
Unlike variables, constants are not stored in memory. You can use constants in the algorithm of a POU
without the need to declare them.
In the NJ/NX-series Controllers, constants have a data type in the same way as variables.
Boolean Data
“BOOL” is used as the data type name for Boolean data. You can use the following values: 1, 0,
TRUE, and FALSE. The meanings of the notations are given in the following table. 6
Notation Meaning
6-4-1 Constants
TRUE or FALSE All of the following are equivalent: TRUE, BOOL#1, BOOL#TRUE,
BOOL#1 or BOOL#0 and 1.
BOOL#TRUE or BOOL#FALSE All of the following are equivalent: FALSE, BOOL#0,
BOOL#FALSE, and 0.
1 or 0*1
*1. Sysmac Studio version 1.03 or higher is required to use 1 and 0. A building error will occur if you use 1 or 0
on Sysmac Studio version 1.02 or lower.
Bit Strings
You can use any of the following data type names for bit string data: BYTE, WORD, DWORD, and
LWORD. You can use any of the following bases: 2, 8, 10, and 16. The notations and notation exam-
ples are given in the following table.
{numeric_value}*1*2 100
*1. Sysmac Studio version 1.03 or higher is required to omit the data type name. A building error will occur if
you omit the data type name on Sysmac Studio version 1.02 or lower.
*2. A base of 10 (i.e., a decimal number) is assumed.
Version Information
Sysmac Studio version 1.03 or higher is required to use base 10 for bit string data. A building
error will occur if you use 10 on Sysmac Studio version 1.02 or lower.
Integers
You can use any of the following data type names for integer data: SINT, USINT, INT, UINT, DINT,
UDINT, LINT, and ULINT. You can use any of the following bases: 2, 8, 10, and 16.
The notations and notation examples are given in the following table.
{data_type_name}#{numeric_value}*2 INT#−1
{numeric_value}*1*2 -1
*1. Sysmac Studio version 1.03 or higher is required to omit the data type name. A building error will occur if
you omit the data type name on Sysmac Studio version 1.02 or lower.
*2. A base of 10 (i.e., a decimal number) is assumed.
Real Numbers
You can use any of the following data type names for real number data: REAL and LREAL. You can
use only base 10 for real number data. The notations and notation examples are given in the following
table.
{data_type_name}#{numeric_value}*2 LREAL#−3.14
{numeric_value}*1*2 -3.14
*1. Sysmac Studio version 1.03 or higher is required to omit the data type name. A building error will occur if
you omit the data type name on Sysmac Studio version 1.02 or lower.
*2. A base of 10 (i.e., a decimal number) is assumed.
Durations
You can use any of the following data type names for durations: TIME and T. The notations and nota-
tion examples are given in the following table.
• It is not necessary to give all of the following: days, hours, minutes, seconds, and milliseconds. You
must give at least one of them.
• You can use decimal points, such as in TIME#12d3.5h.
• You can give times that exceed the valid time ranges. For example, T#-61m5s expresses the same
duration as T#-1h1m5s.
• All numeric values are interpreted as decimal values. A building error will occur if any number that is
not a decimal number is used.
• You can change the order of the duration units. For example, T#1h2d expresses the same duration
as T#2d1h.
Dates
You can use any of the following data type names for date data: DATE and D. The notations and nota-
tion examples are given in the following table.
Times of Day
You can use any of the following data type names for time of day data: TIME_OF_DAY and TOD. The
notations and notation examples are given in the following table.
Text Strings
To give text string data, enclose the text string in single-byte single quotation marks ('). You can also
use “STRING” as the data type name. The notations and notation examples are given in the following
table.
• You can also directly designate character codes. To do so, add $ to the front of the character code.
Give the character code with two hexadecimal digits. For example, the character code for a line
Enumerations
For enumeration data, the enumeration data type name and enumerator are given. The notations and 6
notation examples are given in the following table.
Additional Information
To pass an enumerator to a function or function block for which the parameter specifies an enu-
merator, you can omit the enumeration data type name and give only the enumerator.
For example, the _eBCD_FORMAT enumeration is specified for the Format input variable in the
BinToBCDs instruction. Therefore, you can give either the enumeration data type name and
enumerator as _eBCD_FORMAT#_BCD0 or omit the enumeration data type name and give on-
ly _BCD0.
* Only Jump instructions and Label instructions are expressed with symbols that indicate the jumps and labels.
Rungs
Logic blocks
l Bus Bars
The vertical lines on the left and right sides of a ladder diagram are called the bus bars.
These bus bars always have a status of either TRUE or FALSE. If you think of the ladder diagram
as an electrical circuit, these states represent the flow of current through the circuit.
When a POU that is written as a ladder diagram is executed, the value of the left bus bar changes
to TRUE. As a result, all inputs and other configuration elements connected to the left bus bar also
become TRUE. Execution progresses as elements to the right are also changed to TRUE based on
the operation of these configuration elements.
This cascade of the TRUE state is called the “power flow.” The left bus bar is the source of this
power flow.
l Connecting Lines
The straight horizontal lines that connect the bus bar and the configuration elements are called
l Inputs
Inputs are placed along the connecting line to receive the power flow and operate accordingly.
There are several different types of inputs and, depending on their specifications, they will either
transfer the power flow from the left to the right or prevent the power flow from passing through.
When an input transfers the power flow to the right, the connecting line to the right of the input will
become TRUE. If the power flow is inhibited, the connecting line to the right of the input will remain 6
FALSE.
For detailed specifications on inputs, refer to the NJ/NX-series Instructions Reference Manual (Cat.
l Outputs
Outputs are placed along the connecting line to receive the power flow and operate accordingly.
An output writes the TRUE or FALSE value to a variable.
There are different types of outputs. For detailed specifications on outputs, refer to the NJ/NX-
series Instructions Reference Manual (Cat. No. W502).
Input a
Label: ExceptionProcessing
Input b Input c
Label: ExceptionProcessing
Input d Input e
l Connection Configurations
You use the following two types of connections for functions or function blocks.
1. Power Flow Input and Output
In a ladder diagram, the line that connects an input variable of a function or function block
and the left bus bar indicates a BOOL input and the line that connects an output variable to
the right bus bar indicates a BOOL output.
Example:
Inputs are connected in the power flow that connects to the left bus bar. Outputs are con-
nected in the power flow that connects to the right bus bar.
x1 FB y2
IN1 OUT1
x2 IN2 OUT2 y2
x1 FB y2
IN1 OUT1
x2 IN2 OUT2 y2
As shown below, you can specify either variables or constants for input and output parameters.
Top BOOL
variable MyFB
(BOOL) (INT) Top BOOL variable
IN Val_Out
(INT) (BOOL)
Power flow Val_In Q
Power flow
There is only one power flow input and one power flow output for each function or function block.
All other BOOL variables that are not at the top are for parameter inputs and parameter outputs.
MyFB
(BOOL) (INT)
IN1 Val_Out
BOOL variable BOOL variable that is not
(INT) (BOOL)
that is not at the at the top
Val_In Q1
top
(BOOL) (BOOL)
a b
IN2 Q2
Parameter output
Parameter input
You cannot connect multiple BOOL variables to the left bus bar or the right bus bar as shown be-
low.
RS
(BOOL) (BOOL)
NG Set Q1
(BOOL)
Reset1
MyFB
(BOOL) (INT)
IN Val_Out
(INT) (BOOL)
Val_In Q1
(BOOL)
NG
Q2
You do not have to connect an OUT instruction to the right bus bar. You can connect the function or
function block directly.
MyFB
(BOOL) (BOOL)
OK
IN Q
(INT)
Val_In
A LD instruction is not necessarily required. You can also connect directly to the left bus bar.
OK MyFB
(BOOL) (BOOL)
IN Q
(INT)
Val_In
l Cascade Connections
Cascade connections in which the output of a function or function block is connected to the input of
another function or function block are allowed only for power flow outputs and inputs.
CIPRead CIPRead
GO (BOOL) (BOOL) (BOOL) (BOOL)
Execute Done Execute Done
(BOOL) (BOOL) (BOOL) (BOOL)
Handle Busy Handle Busy
(BOOL) (BOOL) (BOOL) (BOOL)
SrcDat Error SrcDat Error
(BOOL) (BOOL) (BOOL) (BOOL)
Size ErrorID Size ErrorID
(BOOL) (BOOL)
DstDat DstDat
(BOOL) (BOOL)
ErrorIDEx ErrorIDEx
(BOOL) (BOOL)
RcvSize RcvSize
MyFB
OK 6
CIPRead CIPRead
GO (BOOL) (BOOL) (BOOL) (BOOL)
Execute Done Execute Done
CIPRead
(BOOL) (BOOL)
Execute Done
(BOOL) (BOOL)
Handle Busy
(BOOL) (BOOL)
SrcDat Error
(BOOL) (BOOL)
Size ErrorID
(BOOL)
DstDat
(BOOL)
ErrorIDEx
(BOOL)
RecvSize
Restriction
• You cannot create closed loops or intersect connecting lines.
Example:
FB1 FB2
EN ENO EN ENO
IN2 OUT2
NG
No closed loops
l Reversing Inputs
You can reverse the value of a BOOL input variable when you input it to an instruction.
NOT input
FB
(BOOL) (BOOL)
IN Q
TRUE→FALSE
FALSE→TRUE
Inline ST
l Introduction
Inline ST is a ladder diagram programming element in which you can write ST language code in a
box called an inline ST box (a blank text input area) within a ladder diagram.
This allows you to easily code numeric data processing and text string processing within ladder dia-
grams.
The connecting line to an inline ST box becomes its execution condition. The ST code inside of the
box is executed based on that connecting line. Refer to the following figure.
Inline ST box
i1 i2
taiseki := 4.0 * 3.14 * radius *radius * radius / 3.0;
Inline ST is treated as a rung element in a ladder diagram. Therefore, unlike functions and function
blocks, they have no input, output, or in-out variables.
Status Operation
TRUE execution condition Operation follows the execution condition.
You can use the execution condition at any point in the power flow
(e.g., you can connect the inline ST directly to the left bus bar).
To specify a change to TRUE or a change to FALSE, specify it for an
input in the execution condition.
FALSE execution condition Nothing is done.
Resetting in a master control region Nothing is done.
6
6-5-3 Structured Text Language
Structure of ST
ST code consists of one or more statements. One statement is the equivalent of one process.
Statements are executed from top to bottom, one line at a time, until the process is completed.
Statements are made up of keywords and expressions. A keyword is a symbol or string that expresses
assignment or execution control. An expression is a code that calculates a value from variables, con-
stants, function return values, and/or a combination of those, along with various operators. A state-
ment represents a process that completes by itself. Expressions form a statement by using a combina-
tion of values and keywords.
A:= B + 100 * ABC (10, 20) ; (*Assign A to B + 100 * ABC (10, 20)*)
Expression
Example of an IF Construct:
IF keyword IF keyword
Expression
G := H ; (*TRUE if D and E+100*DEF(10,20) are equal, otherwise FALSE*)
Statement IF keyword
END_IF ;
ST Language Expressions
l Statement Separators
• Statements must end with a single-byte semicolon (;). Statements are not considered complete
with only a carriage return at the end. This allows you to write long statements across multiple
lines.
• One statement must end with one single-byte semicolon (;). In the following example, the IF con-
struct contains a single assignment statement. Each statement must be ended with a single-byte
semicolon (;).
IF A=B THEN
C := D; Assignment
IF construct
statement
END_IF;
l Comment
• You can write comments in your program to make the code easier to understand.
l Text Strings
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names on page 6-83
for restrictions on text strings.
l Statement Keywords
Keyword Meaning Example
:= Assignment d := 10;
Calling functions and function FBname(para1 := 10, para2 := 20);
blocks Refer to Function Block Calls on page 6-120.
RETURN Return
l Operators
The following table gives the operators and their order of priority.
If operators with different priorities are mixed in one expression, the operators with the highest pri-
orities are executed first. You can use up to 64 operators in one expression.
Example: X:=(1+2)−3*4; In this case, variable X is assigned a value of −9.
2**3**2
Value: 64
If there is more than one exponent operator, calculations
are performed for them left to right. Therefore, 2**3**2 in
the above example is the same as (2**3)**2, so the val-
ue is 64.
Multiplication * 100*200 5
Value: 20000 6
Division / 100/200
Value: 0.5
-17 MOD 6
Value: -5
17 MOD 6
Value: 5
17 MOD (−6)
Value: 5
Addition + 100+200 6
Value: 300
Subtraction --- 100-200
Value: -100
Comparison <, >, <=, >= 100<200 7
If the comparison result is TRUE, the value is set to
TRUE. Otherwise, the value is set to FALSE.
In the above example, 100 is less than 200, so the value
is TRUE.
0101 OR 1100
Value: 1101
The intended operation may not occur if a function is nested under itself. Always separate the
functions into different statements as shown below.
The order of priority for operators is sometimes different for different standards and manufac-
tures. Special attention is necessary for the priority of exponent operators. We therefore recom-
mend that you use parentheses to ensure that calculations are performed in the intended order.
Example: For X:= -2**3**4; we recommend that you use the following expression: X:=
((-2)**3)**4;.
Additional Information
¡: Possible
Modu- Posi-
Assign- Argu- Com-
Numer- lo-divi- Power Equali- Logic tive/
ment ment parison
ic oper- sion opera- ty oper- opera- nega-
opera- setting opera-
ators opera- tor ators tors tive
tor operator tors
tor signs
Data type
NOT
+ <
AND
:= - <= = +
:= MOD ** &
=> * >= <> -
/ >
OR 6
XOR
Boolean ¡ ¡ × × × × ¡ ¡ ×
ST Language Statements
l Assignment
Overview:
This statement assigns the right side (i.e., the value of the expression) to the left side (i.e., the vari-
able).
Reserved Words:
:=
Combination of a colon (:) and an equals sign (=)
Statement Structure:
<variable>:=<expression>;
<variable>:=<variable>;
<variable>:=<constant>;
Application:
Use this statement to assign a value to a variable.
For example, use it to set initial values or to store the results of a calculation.
Description:
This statement assigns (or stores) the <expression_value> to the <variable>.
Example:
Example 1: The following statement assigns the result of the expression X+1 to variable A.
A:=X+1;
A:=B;
A := 10;
Precautions:
• Either the source data type must match the destination data type, or the combination of data
types must allow implicit casting. A building error will occur if you do not use this notation.
• If the value that is assigned is STRING data, make the size of the destination STRING variable
larger than that of the source string. Otherwise, an error will occur.
• For STRING variables, assignment is allowed if the size of left-hand variable is greater than the
size of the text string stored in right-hand variable.
Example:
Assignment is allowed in the following case.
• Variable Table:
You cannot make assignments to union variables. You must make the assignments to individual
members of the unions.
l RETURN
Overview:
The following actions occur depending on where the ST statement is used.
ST
The ST program is ended during operation and the next program is executed.
ST in a Function Inside a Function Block Instance
The function or function block is ended during operation and the next instruction after the calling
instruction is executed.
Inline ST
The POU that contains inline ST with a RETURN statement is ended.
Statement Structure:
RETURN;
Application:
Use this statement to force the current program, function, or function block to end.
Reserved Words:
IF, THEN, (ELSE), END_IF
Note: You can omit ELSE.
Statement Structure:
IF <condition_expression> THEN
<statement_1>;
ELSE
<statement_2>;
END_IF;
Condition FALSE
expression
TRUE
Statement 1 Statement 2
Application:
Use this construct to perform one of two processes depending on evaluation of a condition (condi-
tion expression).
Description:
If <condition_expression> is TRUE, <statement_1> is executed.
If <condition_expression> is FALSE, <statement_2> is executed.
Precautions:
• IF must always be used together with END_IF.
• Write a statement that evaluates to TRUE or FALSE (for example IF A>10) or a BOOL variable
(for example IF A) for the condition expression.
• You can write <statement_1> and <statement_2> on multiple lines. Separate statements with a
semicolon (;).
IF <condition_expression_1> THEN
IF <condition_expression_2> THEN
<statement_1>;
ELSE
<statement_2>;
END_IF;
END_IF;
Condition FALSE
expression 1
TRUE
Condition FALSE
expression 2
TRUE
Statement 1 Statement 2
• You can execute more than one statement for both <statement_1> and <statement_2>. Separate
statements with a semicolon (;).
• You can omit the ELSE statement. If it is omitted, nothing is executed when <condition_expres-
sion> is FALSE.
FALSE
Condition
TRUE
Statement
IF A>0 THEN
X:=10;
ELSE
X:=0;
END_IF; 6
Example 2: A value of 10 is assigned to variable X and a value of 20 is assigned to variable Y
Example 3: A value of 10 is assigned to variable X when the BOOL variable A is TRUE. A value of
0 is assigned to variable X when variable A is FALSE.
IF A THEN X:=10;
ELSE X:=0;
END_IF;
Reserved Words:
Statement Structure:
Condition FALSE
expression 1
Statement 3
Statement m
Application:
Use this construct to perform a process depending on evaluation of multiple conditions (condition
expressions).
Description:
If <condition_expression_1> is TRUE, <statement_1> is executed.
If <condition_expression_1> is FALSE and <conditon_expression_2> is TRUE, then
<statement_2> is executed.
If <condition_expression_2> is FALSE and <conditon_expression_3> is TRUE, then
<statement_3> is executed.
·
·
·
If <condition_expression_n> is TRUE, <statement_n> is executed.
If none of the conditions is TRUE, <statement_m> is executed.
Precautions:
• IF must always be used together with END_IF.
• Write statements that can be TRUE or FALSE for the condition expressions. Example: IF(A>10)
You can also specify a BOOL variable (including functions that return a BOOL value) for the con-
dition expressions instead of an actual expression. In that case, when the variable is TRUE, the
evaluated result is TRUE and when the variable is FALSE, the evaluated result is FALSE.
• You can write any of the statements on multiple lines. Separate statements with a semicolon (;).
• You can omit the ELSE statement. If it is omitted, and none of the conditions produces a match,
nothing is done.
Example:
A value of 10 is assigned to variable X when the statement A > 0 is TRUE.
A value of 1 is assigned to variable X when the statement A > 0 is FALSE and statement B = 1 is
TRUE.
A value of 2 is assigned to variable X when the statement A > 0 is FALSE and statement B = 2 is
TRUE.
If none of the conditions is TRUE, a value of 0 is assigned to the variable X.
l CASE
Overview:
This construct executes a statement that corresponds to an integer set value that matches the val-
ue of an integer expression.
Reserved Words:
CASE 6
Statement Structure:
Equal to Yes
value 1?
No
Yes
Equal to
value 2?
No
Yes
Equal to
value n?
No
Application:
Use this construct to perform different actions based on the value of an integer.
Description:
If <integer_expression> matches <integer_expression_value_n>, <statement_n> is executed.
If <integer_expression> does not match any of the integer values, <statement_m> is executed.
Precautions:
• CASE must always be used together with END_CASE.
• Use one of the following for the <integer_expression>:
• An integer or enumeration variable (example: abc)
• An integer expression (example abc+def)
• A function that returns an integer value (example: xyz())
• You can write any of the statements on multiple lines. Separate statements with a semicolon (;).
• To specify OR logic of multiple integers for <integer_expression_value_n>, separate the values
with commas. To specify a continuous range of integers, separate the start integer and the end
integer with two periods (..).
Example 1: You can specify a condition for a specific integer value, or the same condition for multi-
ple integer values.
CASE A OF
1: X:=1; A value of 1 is assigned to variable X when variable A is 1.
2: X:=2; A value of 2 is assigned to variable X when variable A is 2.
3: X:=3; A value of 3 is assigned to variable X when variable A is 3.
ELSE
X:=0; If none of the values is matched, a value of 0 is assigned to
the variable X.
END_CASE;
CASE A OF
1: X:=1; A value of 1 is assigned to variable X when variable A is 1.
2,5: X:=2; A value of 2 is assigned to variable X when variable A is 2 or 5.
6..10: X:=3; A value of 3 is assigned to variable X when variable A is between 6 and 10.
11,12,15..20: X:=4; A value of 4 is assigned to variable X when variable A is 11, 12,
or between 15 and 20.
ELSE
X:=0; If none of the values is matched, a value of 0 is assigned to the
END_CASE; variable X.
CASE ColorVar OF
RED:
X := 0;
6
BLUE:
X := 1;
CASE FUN( ) OF
0: Branches depending on the return value of FUN( ).
X := 10;
1:
X := 11;
ELSE
X := 12;
END_CASE;
¡: Supported
×: Not supported
l FOR
Overview:
This construct repeatedly executes the same statements until a variable (called the FOR variable)
changes from one value to another value.
The following expressions are used to specify whether the condition is met.
TRUE: The condition is met.
FALSE: The condition is not met.
Reserved Words:
FOR, TO, (BY), DO, END_FOR
Note: You can omit BY.
Statement Structure:
TRUE
FOR variable >
end value?
Repeated
FALSE
Statement
FOR variable +
Increment/decrement value
Application:
Use this construct when you know in advance how many times you want to repeat a process.
This type of repeat construct is particularly effective to specify each element of an array variable
based on the value of a FOR variable.
Description:
A decision is made based on the evaluation of <initial_value>, <end_value>, and <increment/ 6
decrement>.
When <FOR_variable> is <initial_value>, <statement> is executed.
Precautions:
• If the FOR variable is signed, <increment/decrement> can be a negative number.
• FOR must always be used together with END_FOR.
• The FOR variable becomes the end value plus increment/decrement after execution of the proc-
ess is completed for the end value. This ends the FOR construct.
Example: When the FOR construct is completed in the following ST statements, the value of i is
101.
• Do not write code that directly modifies the FOR variable inside the FOR construct. Unintended
operation may result.
Example:
• You can write any of the statements on multiple lines. Separate statements with a semicolon (;).
• You can omit BY<increment/decrement>. If it is omitted, the statement is executed with an incre-
ment value of 1.
• You can specify an integer (SINT, INT, DINT, LINT, USINT, UINT, UDINT, or ULINT) variable or
integer value for the <initial_value>,<end_value>, and <increment/decrement>. You can also
specify a function that returns an integer value.
Example 1: A value of 100 is assigned to array variable elements SP[n]. The FOR variable is varia-
ble n, the initial value is 0, the end value is 50, and the increment is 5.
FOR n := 0 TO 50 BY 5 DO
SP[n] := 100;
END_FOR;
Example 2: The total of elements DATA[1] through DATA[50] of array variable elements DATA[n] is
calculated and the result is assigned to the variable SUM.
IF a THEN
FOR n := 0 TO 50 BY 1 DO
DATA[n]:= 1 ;
END_FOR;
FOR n := 0 TO 50 BY 1 DO
SUM:= SUM + DATA[n] ;
END_FOR;
a:=FALSE;
END_IF;
Example 3: The maximum and minimum values of elements DATA[1] through DATA[50] of array
variable elements DATA[n] are found. The maximum value is assigned to the MAX variable, and
the minimum value is assigned to the MIN variable. The value of DATA[n] is from 0 to 1,000.
MAX :=0;
MIN :=1000;
FOR n :=1 TO 50 BY 1 DO
IF DATA[n] > MAX THEN
MAX :=DATA[n];
END_IF;
IF DATA[n] < MIN THEN
MIN :=DATA[n];
END_IF;
END_FOR;
• If the total execution time of the statements in the FOR construct from when the FOR variable is
incremented/decremented from the initial value until it reaches the end value exceeds the task
period, a Task Period Exceeded error occurs.
• When the FOR Variable Cannot Logically Reach the End Value
Example:
FOR i := 0 TO 100 BY 1 DO
intArray[i] := i;
i := INT#50; An infinite loop occurs and results in a Task
END_FOR; Period Exceeded error.
Example:
• When an Overflow or Underflow Occurs Because the FOR Variable Exceeds the End Value
Example:
FOR i := 0 TO 254 BY 2 DO
INTArray[i] := i;
END_FOR;
Version Information
With the Sysmac Studio version 1.08 or higher, you can specify arithmetic expressions for
<end_value> and <increment/decrement>. 6
However, the evaluation is performed for <end_value> or <increment/decrement> only before
the execution of FOR loop operation. The values of <end_value> and <increment/decrement>
A := INT#1;
B := INT#2;
C := INT#10;
FOR i := 0 TO C BY A+B DO
INTArray[i] := i;
A := B + i;
C := C + i;
END_FOR;
¡: Supported
×: Not supported
<FOR_variable>, <initial_value>,<end_value>,
Classification Data type
and <increment/decrement>1
Basic data types Boolean, bit string, real, du- ×
ration, date, time of day, date
and time, or text string data
Integers ¡
Data type specifi- Array specifi- Arrays ×
cations cations Elements ¡ For integers and enumerations only.*2
Derivative data Structures Structures ×
types Members ¡ For integers and enumerations only.*2
Unions Unions ×
Members ×
Enumerations ¡*2
*1. You must use the same data type for the <FOR_variable>, <end_value> and <increment/decrement>.
Otherwise, an error occurs when the program is built on the Sysmac Studio.
*2. You cannot use enumerations for <FOR_variable>, <end_value> and <increment/decrement>.
l WHILE
Overview:
This construct repeatedly executes the specified statements as long as a condition expression is
TRUE.
Reserved Words:
WHILE, DO, END_WHILE
Statement Structure:
WHILE <condition_expression> DO
<statement>;
END_WHILE;
Repeated
Condition FALSE
expression
TRUE
Statement
End
Application:
Use this type of repeat construct when you do not know how many times to repeat a process (i.e.,
when you do not know how many times based on the condition) and you want to repeat a process
for as long as a certain condition is met.
You can also use this type of repeat construct to execute a process only when a condition expres-
sion is TRUE (pre-evaluation repeat construct).
Description:
The <condition_expression> is evaluated before <statement> is executed.
If <condition_expression> is TRUE, <statement> is executed. Then the <condition_expression> is
evaluated again. This process is repeated.
If the <condition_expression> is FALSE, <statement> is not executed and the <condition_expres-
sion> is no longer evaluated.
Precautions:
• WHILE must always be used together with END_WHILE.
• If the <condition_expression> is FALSE before <statement> is executed, the WHILE construct is
exited and <statement> is not executed.
• You can write <statement_1> and <statement_2> on multiple lines. Separate statements with a
semicolon (;).
• You can execute more than one statement for <statement>. Separate statements with a semico-
Example 1: The first multiple of 7 that exceeds 1,000 is calculated and assigned to variable A.
A := 0;
WHILE A <= 1000 DO
A := A+INT#7;
END_WHILE;
6
Example 2: The value of variable X is doubled if X is less than 3,000 and the value is assigned to
array variable element DATA[1]. Next, the value of X is doubled again and the value is assigned to
n := 1;
X := 1;
WHILE X < 3000 DO
X:= X*INT#10#2;
DATA[n]:= X;
n := n+INT#1;
END_WHILE;
• If you do not write correct condition expressions, the program execution time increases and may
cause a Task Period Exceeded error.
Example:
boolVar := TRUE;
WHILE boolVar DO
intVar := intVar + INT#1;
END_WHILE;
l REPEAT
The following expressions are used to specify whether the condition is met.
TRUE: The condition is met.
FALSE: The condition is not met.
Overview:
This construct repeatedly executes one or more statements until a condition expression is TRUE.
Reserved Words:
REPEAT, UNTIL, END_ REPEAT
Statement Structure:
REPEAT
<statement>;
UNTIL <condition_expression>
END_REPEAT;
Statement
Repeated
Condition FALSE
expression
TRUE
End
Application:
Use this type of repeat construct when you do not know how many times to repeat a process (i.e.,
when you do not know how many times based on the condition) and you want to repeat a process
for as long as a certain condition is met after processing.
Use this type of repeat construct to determine whether to repeat execution based on the result of
the execution of a process (post-evaluation repeat construct).
Description:
First, <statement> is executed unconditionally. Then the <condition_expression> is evaluated.
If <condition_expression> is FALSE, <statement> is executed.
If <condition_expression> is TRUE, <statement> is not executed and the REPEAT construct is exit-
ed.
Precautions:
• REPEAT must always be used together with END_REPEAT.
• Even if the <condition_expression> is TRUE before <statement> is executed, <statement> is
executed.
In other words, <statement> is always executed at least one time.
• <statement> can contain multiple lines of code for the statement. Separate statements with a
semicolon (;).
• You can also specify a BOOL variable (including functions that return a BOOL value) for the con-
dition expressions instead of an actual expression.
Example: Numbers from 1 to 10 are added and the values are assigned to the variable TOTAL.
A := 1;
TOTAL := 0;
REPEAT
TOTAL := TOTAL + A;
A := A+INT#1;
UNTIL A>10
END_REPEAT;
• If you do not write correct condition expressions, the program execution time increases and may
cause a Task Period Exceeded error.
Example:
intVar := INT#1;
REPEAT
intVar := intVar + INT#1;
UNTIL intVar = INT#0
l EXIT
Overview:
Use this statement only inside a repeat construct (FOR construct, WHILE construct, or REPEAT
construct) to exit the repeat construct.
Use this statement inside an IF construct to exit from the repeat construct when a condition is met.
Reserved Words:
EXIT 6
Statement Structure (e.g., in an IF Construct):
Application:
Use EXIT to end a repeating process before the end condition is met.
Example:
Variable n is repeatedly incremented by 1 from 1 to 50 while the value of n is added to array varia-
ble elements DATA[n]. However, if DATA[n] exceeds 100, the repeat construct is exited.
IF A THEN
DATA[3] :=98;
FOR n := 1 TO 50 BY 1 DO
DATA[n] := DATA[n] + n;
IF DATA[n] > 100 THEN EXIT;
END_IF;
END_FOR;
A :=FALSE;
END_IF;
Statement Structure:
Give the argument specifications (to pass the values of the specified variables to the input varia-
bles of the called function block) and the return value specification (to specify the variable that will
receive the value of the output variable of the called function block) in parenthesis after the in-
stance name of the function block.
There are two methods of writing this statement, as shown in (1) and (2) below.
We recommend method 1 for program readability.
Notation Method 1:
Give both the variable names of the called function block and the parameter names of the calling
POU.
ABC(A:=x1, B:=x2, C=>y1);
ABC: Function block instance name
A and B: Input or in-out variable names of called function block
x1 and x2: Input or in-out parameter of calling POU (can be a constant)
C: Output variable of called function block
y1: Output parameter of calling POU
ABC
y1
x1 MyFB
A C
x2 B
• You can give the arguments and return values in any order.
• You can omit the input variable names and input parameter names. If you omit these names, the
values assigned to the input variables for the previous call are assigned to the input variables
again. If this is the first time that the function block is called, the input variables are set to their
initial values.
• You can omit the output variables and output parameters. If they are omitted, the value of the
output variable is not assigned to anything.
Notation Method 2:
Omit the variable names of the called function block and give the parameter names of the calling
POU.
ABC(x1, x2, y1);
ABC: Function block instance name
A and B: Omitted. (Input or in-out variable of called function block)
x1 and x2: Input or in-out parameter of calling POU (can be a constant)
C: Omitted. (Output variable of called function block or constant)
y1: Output parameter of calling POU
ABC
y1
x1 MyFB
A C
• The order of parameters is based on the function block definition. The order is the same as the
local variable definition for the function block, from top to bottom.
Application:
This statement calls a function block.
Example
• Programming 6
• Notation 1
ChangeFixToFloat(Execute:=Exe,Data32_1:=FixPointData1,
• Notation 2
ChangeFixToFloat(Exe, FixPointData1, FixPointData2, FixPointPos1, FixPointPos2,
Done, RealData1, RealData2);
ChangeFixToFloat
Exe ConvData32ToDouble Done
Execute OK
• Program Variables
Omitting Parameters
When you call a function block, you can omit parameters that are not required.
The following table shows when you can omit parameters.
¡: Possible (initial used).
x: A building error will occur.
l Function Calls
Overview:
Statement Structure:
Give the output parameter to which the return value is assigned on the left side of the assignment
keyword (:=). On the right side, give the argument specifications (to pass the values of the speci-
fied variables to the input variables of the called function) inside the parenthesis after the function
name.
There are two methods of writing this statement, as shown in (1) and (2) below.
We recommend method 1 for program readability.
Notation Method 1:
IF (x0=TRUE) THEN
y1 := MyFUN (A:=x1, B:=x2, C=>y2);
MyFUN
x0
EN ENO
x1 y1
A
x2 y2
B C
6
MyFUN :Function name
Notation Method 2:
Omit the variable names of the called function and give the parameter names of the calling POU.
IF (x0=TRUE) THEN
y1 := MyFUN (x1, x2, y2);
END_IF;
MyFUN
x0
EN ENO
x1 y1
A
x2 y2
B C
• The order of parameters is based on the function definition. The order is the same as the local
variable definition for the function, from top to bottom.
Example
• Programming
• Notation 1
ConvData32ToDouble(Data32_1:=FixPointData1,Data32_2:=FixPointData2,
NoOfDigit_1:=FixPointPos1, NoOfDigit_2:=FixPointPos2,
Double_1=>RealData1, Double_2=>RealData2);
• Notation 2
ConvData32ToDouble(FixPointData1, FixPointData2, FixPointPos1, FixPointPos2,
RealData1, RealData2);
P_On ConvData32ToDouble
EN
• Function Definition
Function name: ConvData32ToDouble
Function Variables
• Program Variables
Application:
Omitting Parameters
When you call a function, you can omit parameters that are not required.
The following table shows when you can omit parameters.
l Implicit Casts
If the data types of the operands do not match, as shown below, the data types are converted auto-
matically according to the implicit cast rules.
If the implicit cast rules are not satisfied, a building error occurs.
1. When the data types of the operands in the expression on the right side of the assignment
statement are not the same
Example:
A: = INT#10 + SINT#2;
2. When the data types of the operands on the right and left sides of the assignment statement
are not the same
Example:
A: = B + C;
REAL INT
3. When the data types of the operands in statement are not the same
Example:
INT LINT
CASE A+B OF
INT#1:
def:=INT#10;
The casting rules are described for the following three cases.
Casting Rules When the Right-hand Side of an Assignment Statement Is an Arithmetic Ex-
pression
• For the right-hand operand, you can use any combination of the data types that are supported for
the operator operand.
• Of the operands on the right side, the operand with the highest rank is considered the data type
of the entire side.
(Refer to the Data Type Ranking Table given below for the data type ranks.)
Casting Rules When You Assign the Right-hand Value to the Left-hand Side
In the following chart, a cast is performed if an arrow connects the data type of the source to the
data type of the assignment destination.
Any combination that is not connected will cause a building error.
REAL LREAL
When you assign the value, the sign and absolute value of the number do not change.
When you assign the value, the sign and absolute value of the number may change.
Even if the arrow does not connect directly to a data type, you can still perform assignments for the
data types.
For example, SINT->USINT->UINT->UDINT->ULINT are all connected, so you can write an assign-
ment such as ULINT:=SINT.
6
Precautions for Correct Use
In a case like this one, convert the data to 64-bit data before you perform the calculation. To do
this for the above example, change the assignment status as shown below.
LintTmp1 := UDINT_TO_LINT(UDINT#16#FFFF_FFFF); // Convert UDINT to LINT data.
LintTmp2 := DINT_TO_LINT(DINT#1); // Convert DINT to LINT data.
LintVar := (LintTmp1 + LintTmp2) / DINT#2;
to;
END_CASE;
Expressions That Contain More Than One Function That Access the Same Global Variable
In the following example, the order of execution of the three functions is not necessarily the same
as the order of execution of the calculations, which is determined by the priority of the operators.
Therefore, it is possible that the functions are executed in the following order: FUN2, FUN3, and
then FUN1.
result := FUN1() + FUN2() * FUN3();
If all three of the functions in the above expression access and write the same global variable, the
value of the result variable may change depending on the order of execution of the functions.
To ensure that the three functions are always executed in the same order, the expression is broken
up. The following notation is used to execute the functions in the following order: FUN2, FUN3, and
then FUN1.
tmp2 := FUN2();
tmp3 := FUN3();
result := FUN1() + tmp2 * tmp3;
Expressions That Contain a Function and a Variable Whose Value Is Changed by That Func-
tion
The following expression contains a function and a variable whose value is changed by that func-
tion.
result := varA + FUN4(out => varA);
In the above expression, the first element on the right side, variable varA, is not necessarily evalu-
ated before FUN4 is executed. Therefore, the value of the result variable may change depending
on the order of varA evaluation and FUN4 execution.
To ensure that that varA evaluation and FUN4 execution always occur in the same order, the ex-
pression is broken up.
The following notation is used to evaluate varA first and then execute FUN4.
tmp := varA;
result := tmp + FUN4(out => varA);
The following notation is used to execute FUN4 first and then evaluate varA.
tmp := FUN4(out => varA);
result := varA + tmp;
Notation of Constants
If a constant is given without a decimal point, such as 100, it is processed as an integer. If a con-
stant is given with a decimal point, such as 100.0, it is processed as a real number.
No
6
Constant or variable greater Yes
than 32 bits in expression or
No
END
Example:
realv := 2 + 3 *4; // The data type of the realv variable is REAL.
The realv variable is a real number, so the calculation is performed with long real precision. The
calculation result is 14.0.
realv := 2 + 3.0 *4; // The data type of the realv variable is REAL.
The 3.0 constant and the realv variable are real numbers, so the calculation is performed with long
real precision. The calculation result is 14.0.
However, the calculation precision of division is determined only by the divisor and dividend. The
rules for determining the calculation precision are the same as those in the previous flowchart.
Example:
realv := 2 / 3 *4; // The data type of the realv variable is REAL.
Dividing 2 by 3 does not include an integer that exceeds 32 bits for the divisor or dividend, so the
calculation is performed with 32-bit integer precision. The calculation result is 0.
In the next step, the realv variable is a real number, so the calculation of 0 * 4 is performed with
long real precision. The calculation result is 0.0.
The calculation precision of an expression that contains a constant without a data type specifi-
cation is automatically determined by the notation of the constant and the data types of the vari-
ables that are given in the expression. Therefore, calculations may be performed with unintend-
ed precision. We recommend that you specify the data type for real numbers, such as RE-
AL#1.0.
start Clk Q do
• Method 3
Up
start In do
Function/ Add a circle to indicate reversal at the inter- Add a NOT operator to the argument.
function block section of the BOOL argument and the func- * You can add NOT operators to any BOOL
argument re- tion/function block. variable, not just arguments.
versal specifi- IF (NOT emergency) THEN
cations emergency Func Func();
EN ENO END_IF;
Func2
EN ENO
tmp in
Post-connect- You can connect only other Out instructions You cannot continue the ladder diagram after
ing ladder in- after an Out instruction. inline ST.
structions
NG
// Inline ST
str :=‘ABC’;
Program divi- You can create sections. You cannot create sections.
sions
6-6 Instructions
This section describes the instructions that are pre-defined by the NJ/NX-series Controller.
For details on these instructions, refer to the NJ/NX-series Instructions Reference Manual (Cat. No.
W502) and NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508).
6-6-1 Instructions
Instructions are the smallest unit of the processing elements that are provided by OMRON for use in
POU algorithms.
Instructions are classified as shown below.
FB instructions
6-6 Instructions
Instructions
FUN instructions
ST language statements
6
Programs, user-defined functions, and user-defined function blocks consist of these instructions.
6-6-1 Instructions
6-6-2 Basic Understanding of Instructions
The fundamental specifications of the instructions follow the specifications of functions and function
blocks.
This section describes specifications that are unique to instructions.
l Locations
Instructions for ladder diagram inputs and outputs have certain positions where they can be placed,
as shown below.
l Instruction Options
Some ladder diagram instructions for inputs also detect changes to TRUE or changes to FALSE if
you add an upward arrow or downward arrow to them.
l Execution Conditions
The operation of the execution condition for an FB instruction depends on the instruction.
A specific input variable for the execution condition is defined for each instruction.
Example:
Execute specifies a change to TRUE or a change to FALSE in the execution condition.
Enable causes the instruction to be executed each task period according to the current execution
condition.
Function block instructions are unconditionally executed for as long as the POU that called them is
executed.
l Instruction Options
Instruction options cannot be specified.
FUN Instructions
l Execution Conditions
All FUN instructions have EN inputs as execution conditions. The FUN instruction is executed each
task period as long as EN is TRUE.
l Instruction Options
In a ladder diagram, you can add the following instruction options to specify a change to TRUE or a
change to FALSE as the execution condition for that instruction. ST statements do not have op-
tions.
To add an instruction option, add one of the option symbols listed in the table above before the in-
struction.
Example:
@ MAX
EN ENO
In1
6-6 Instructions
In2
l Output variable ENO, output variable Error, and output variable ErrorID
ENO (enable out), Error, and ErrorID (error code) are the output variables that indicate whether an
error exists or not. Each instruction has different output variables. The meaning of each variable
and its value on an instruction error are shown below. The values vary by the timing when an in-
struction error occurs.
l Events
When an instruction error occurs, an event is created for it. For details on events, refer to Events
for Instruction Errors on page 6-140.
Version Information
A CPU Unit with unit version 1.02 or later is required to create events for instruction errors.
6-6 Instructions
or user-defined function block that is created in a ladder diagram ends normally or has an instruction
error.
5 a = b / (c + d) + e ∗ f + ABS(g);
6 x := 1;
For example, if a division by zero error occurs
in (b/(c+d)) on line 5, execution of line 5 is
cancelled (the value of a is not changed) and
line 6 is executed.
This operation is the same as when the output ENO of a user-created function is FALSE.
5 a = User-created_function (b) + c;
6 x := 1;
When the ENO output from the user-created
function is FALSE, execution of line 5 is
cancelled (the value of a is not changed) and
line 6 is executed.
l Errors in IF Constructs
If a syntax error occurs in ST, perform error processing for the syntax error.
When the value of (c+d), below, is zero, the lines between the IF and END_IF are not executed.
POU"AA"
5 IF a = b / (c + d) THEN
6 x := 1;
7 ELSE
8 x := 2;
9 END_IF;
10 y := 10;
: : The user must include a safety
IF P_PRGER = TRUE THEN processing for possible errors.
x:= initial_value; (*Processing when an error occurs*)
y:= initial_value;
END_IF;
l Syntax Errors in ST
The following syntax errors can occur in ST.
• Exceeding the number of elements in an array
• No parameter set for in-out variable
• STRING assignment: When the text string size (bytes) of the left side is less than the text string
length (bytes) of the right side
• Division by zero (excluding floating-point number calculations)
* When the value of a floating-point number is nonnumeric, the result of the calculation will also be
nonnumeric. This is not considered an error.
The P_PRGER Flag is a local variable for the program. This flag changes to TRUE when an instruc-
tion error occurs in the program, and remains TRUE during the next task period.
6-6 Instructions
You can write the P_PRGER Flag. You can temporarily set the value of this flag to FALSE through a
user operation to determine if the error occurs within a specific range, for example. After this flag
changes to TRUE, it remains TRUE until the operating mode is changed or the flag is overwritten by a
program.
Example:
6
User Program
P_PRGER
The P_PRGER Flag also changes to TRUE when an instruction error occurs inside a user-defined
function block that is used by the program.
Example:
Program
P_PRGER : OFF
Inside function block definition
User-defined P_PRGER : OFF
function block
Instruction error
P_PRGER : ON
P_PRGER : ON
• To create events for instruction errors, you must select Use for Event Log Settings −
Instruction Error Output on the Sysmac Studio. Refer to 4-2-2 Controller Setup on page 4-4
and to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on the
Controller Setup.
• If you change the user program after an instruction error occurs, the information in the event
log may no longer be correct.
• If an instruction with an error is executed repeatedly, an instruction error or event is created
each time the instruction is executed. This may cause the event log to exceed the maximum
number of events. If this occurs, older events are overwritten.
Version Information
• A CPU Unit with unit version 1.02 or later is required to create events for instruction errors.
• A CPU Unit with unit version 1.02 or later and Sysmac Studio version 1.03 or higher are re-
quired to specify whether to output instruction errors when they occur.
Additional Information
• If an error occurs in a motion control instruction, two events are created, one for the instruc-
tion error and one for the motion control instruction. For details on events for motion control
instructions, refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat.
No. W508).
• Events for motion control instruction are created even if you select Do not use for Event Log
Settings − Instruction Error Output in the Controller Setup on the Sysmac Studio.
6-7 Namespaces
This section provides the specifications for namespaces and the procedures to use them. Refer to the
Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the procedures to manipulate them.
Version Information
A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are re-
quired to use namespaces.
6-7-1 Namespaces
Namespaces are a system for grouping function block definitions and other entities to manage them in
nested structures. They are similar to grouping files in folders to manage them in a directory structure.
If you do not use namespaces, the name of each function block definition or other entity must be
unique. If you use namespaces, you can use the same name more than once by setting namespaces.
6-7 Namespaces
Using namespaces is not required.
Features of Namespaces
Namespaces provide the following features.
6
l Preventing Duplicated Names
As long as different namespaces are used, you can use the same name for a function block or oth-
6-7-1 Namespaces
er entity more than once.
For example, assume that several systems must be programmed, and that a different programmer
will program each of them. Here, it would be likely that the same names would be used for different
function block definitions or other entities. If you did not use namespaces, you would have to create
naming rules to prevent the duplication of names. However, if you set a different namespace for
each system, programming would be possible without worrying about duplicating names with other
systems.
Namespace Usage
You can use namespaces for the entities that are listed in the following table.
Namespace Notation
Separate the levels in a namespace with backslashes (\). To use a namespace in a POU algorithm,
place two backslashes (\\) at the front of the namespace.
Example:
Example:
System_A\Read_recipe
• An error will occur when you build the program if the short name of a variable is also used in
the name of the namespace.
System_A\Process_A\Read_recipe\Process_A
System_A\Read_recipe\System_A\Process_A
Not The same name is used twice within the overall name of
allowed.
the namespace.
• You can use the short name of a POU definition in the algorithm of a POU definition if it is in
the same namespace. However, an error will occur when you build the program if there is a
POU definition or data type with the same short name at a higher level in that namespace.
For example, assume that the following POU definitions are used. You can use the short
name to call System_A\Read_recipe\Process_A from within the algorithm of the Process_B
function block definition (which is in the System_A\Read_recipe namespace) because Proc-
ess_A is in the same namespace.
POU Definitions
6-7 Namespaces
System_A\Read_recipe\Process_A
System_A\Read_recipe\Process_B
Process_A 6
POU Definitions
Process_A (no namespace)
System_A\Process_A
• If any names are the same as a reserved word, an error will occur when you check the pro-
gram.
Namespace Declarations
To program with namespaces, you can declare the namespaces in advance before you use them in
the algorithm of a POU definition.
After you declare the namespace in the POU definition, you can use the short name of any POU defi-
nition or other entity that has the same namespace. You can also use the fully qualified name even if
you declare the namespace.
In the algorithm in a POU definition, you can use the short name of any function definition or function
block definition that has the same namespace as the POU definition of the algorithm even if you do
not declare the namespace.
You can declare more than one namespace for the same POU definition.
l Notation Examples
Notation examples are provided below for creating a function block definition when declaring the
namespaces to use in the function block definition and when not declaring the namespaces.
Example:
In this example, the Read_recipe and Calculate_upper_limit function block definitions are used in
the algorithm for the Lifter function block definition.
Each of these function block definitions is in a different namespace. In the Lifter function block defi-
nition, only the System_C namespace is declared.
The fully qualified name must be given for the Read_recipe function block definition, which is not in
the System_C namespace. The short name can be given for the Calculate_upper_limit function
block definition, which is in the System_C namespace.
Calculate_upper_limit
l Restrictions of Declarations
You can use short names only in the algorithm of a POU definition.
6-7 Namespaces
The following notation is used in the namespace
declaration for the Process_A function block definition.
System_B
Additional Information
You cannot set a namespace for a program name. However, you can declare namespaces for 6
objects that are used in the algorithm of the program.
1 In the Data Type Editor, set the namespace for the data type.
2 Set the namespace in the properties of the function definition or function block definition.
3 In the Ladder Editor or ST Editor, declare the namespace in the properties of the function defi-
nition or function block definition.
4 Use the data types, function definitions, and function block definitions in the user program.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
6-8 Libraries
This section describes the specifications of libraries. Refer to the Sysmac Studio Version 1 Operation
Manual (Cat. No. W504) for specific procedures.
Version Information
A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are re-
quired to use libraries.
The following figure illustrates the use of library objects. Here, program A uses FUN:A1 and FB:B1
from the objects in the library, and program B uses Type:C1 and FB:B1.
Library
Sysmac Studio
Library objects
FUN:A2 FB:B2
Type:C1 FB:B3
Type:C2
Reuse objects.
FUN:A1 Type:C1
FB:B1 FB:B1
Program A Program B
Library Settings
The following settings are supported for libraries.
Setting Description
Name The name of the library.
Version The version of the library.
Setting Description
Author The creator of the library. (optional)
Creation date The date that the library was created.
Update date The date that the library was last updated.
Comment A comment on the library. (optional)
Company name The name of the company that created the library. (optional)
ID A unique ID that is used to access the library. The ID is generated auto-
matically. You cannot change it.
Display/hide source You can specify whether to display or hide the source. *1
Attached files You can attach one or more files.
*1. If data protection is set for a library object, a password is required to display the source code.
You can also access other libraries to create library objects. When you do, you can select whether to
include the library data from the accessed library.
Additional Information
When you select to include accessed library data, the accessing library is created so that it con-
tains a copy of the accessed library data. This means that only one library file is required. How-
6-8 Libraries
ever, if there is more than one accessing library, you must change each one of them to make
any changes.
When you select not to include accessed library data, the accessing library is created without
the accessed library data. This means that there will be two library files, the accessing file and
the accessed file. However, even if there is more than one accessing library, you need to
change only the accessed library to make changes.
6
l Selecting Library Objects
Library Synchronization
You can download a library to a Controller, upload a library from a Controller, or verify a Controller li-
brary against one on the computer.
Additional Information
• If you transfer a project for which transferring the source program is disabled from the Sys-
mac Studio to a Controller that contains libraries for which the source is displayed, the source
data for the library is not transferred.
• The libraries in the Controller are deleted for the Clear All Memory operation.
Property Definition
Name The name of the library object.
Namespace The namespace of the library object.
Version*1 The version of the library object.
Creation date*1 The date that the library object was created.
Update date*1 The date that the object library was last updated.
Comment A comment on the library object. (optional)
*1. These items can be set only for functions and function blocks. They are set in the POU definition properties
on the Sysmac Studio.
Additional Information
• You can change an existing project to a library project as long as the only device that is regis-
tered in the project is a Controller. Simply change the project type in the project properties to
a library project.
• You can create data that cannot be used as library objects in a library project. However, you
cannot select any of this data as library objects.
• We recommend that you use namespaces for names of the functions, function block defini-
tions, and data types that you create as library objects to prevent duplicating names with oth-
er libraries. For details on namespaces, refer to 6-7 Namespaces on page 6-141.
6-8 Libraries
2 Use the library objects in programming.
Use the library objects from the library that you read in the project. Use the library objects in
the same way as you use any other functions, function block definitions, or data types.
6
Example:
SetBlock
EN ENO
INT#0 In Out
data[0] AryOut data[0]
UINT#5 Size
Example:
SerialRcv_instance
Operating SerialRcv
Execute Done
InPort Port Busy
UINT#13 Size Error
DstDat
RecvDat[0] RecvDat[0]
ErrorID
ErrorIDEx
RcvSize RecvSize
In this case, you must create a structure variable for the input, output, and in-out parameters, then use
the MOVE instruction to set the values.
Example:
Variable Table
Variable name Data type
InPort _sPORT
SerialRcv_instance
SerialRcv
Execute Done
InPort Port Busy
UINT#13 Size Error
DstDat
RecvDat[0] RecvDat[0]
Introduction
Master control is used to make output FALSE for all processing between the MC (Master Control Start) 6
instruction and the MCR (Master Control End) instruction.
Master control is useful to control the execution conditions of a relatively long series of instructions.
7-1 Overview of Steps in Checking Operation and Actual Operation ............. 7-2
7-2 Offline Debugging .......................................................................................... 7-3
7-2-1 Features of Simulation .................................................................................... 7-3
7-2-2 Simulation Execution....................................................................................... 7-3
7-2-3 Setting Up Simulations .................................................................................... 7-6
7-3 Checking Operation on the Actual System and Actual Operation ............ 7-8
7-3-1 Checking Operation on the Actual System and Actual Operation................... 7-8
7-3-2 Downloading the Project ................................................................................. 7-8 7
7-3-3 Checking I/O Wiring ........................................................................................ 7-9
7-3-4 MC Test Run.................................................................................................... 7-9
7-3-5 Checking the Operation of the User Program ............................................... 7-10
7-3-6 Starting Actual Operation ...............................................................................7-11
Step 4. Wiring
1 Select Simulation Pane from the View Menu of the Sysmac Studio.
The Simulation Pane is displayed on the lower right of the window.
Simulation Pane
3 After you complete checking operation, click the Stop Button in the Simulation Pane to stop the
Simulator.
average and maximum estimated task execution times are displayed. Refer to Task Execution Time
Monitor on page 5-107 for the Task Execution Time Monitor.
• Select the relevant hardware revision in the Unit that the hardware revision is displayed.
• The estimated task execution times are not necessarily the same as the actual task execution
times on the physical Controller. Depending on the user program, I/O configuration, and
whether communications are used, the execution times on the physical Controller may ex-
ceed the estimated maximum value. Use them only as guidelines in task design. Always con-
firm the task execution times while connected to the physical Controller to study the designs
and before starting actual system operation.
1 Right-click Programs under Programming − POU in the Multiview Explorer and select Add
for Debugging − Multipart Ladder or Add for Debugging − Structured Text from the menu.
A debug program is created.
2 Enter the test program code into the debugging program that you just created.
You can also change a normal program that is already completed into a debug program in the
same way.
Step 1. Going Online from the Sysmac Studio and Downloading the Project Reference
1. Turn ON the power supply to the Controller. Sysmac Studio Version 1
Operation Manual (Cat.
2. Place the Sysmac Studio online with the Controller. *1
No. W504)
3. Download the project (i.e., the user program, Unit configuration, and other set-
tings) from the Sysmac Studio.
*1. You cannot connect a computer via USB to an NJ701 CPU Unit with hardware revision A or later, NX102
CPU Unit, or NX1P2 CPU Unit because they do not provide a peripheral USB port. Refer to 10-2 Connec-
tion with Sysmac Studio on page 10-8 for the procedure to connect to the Sysmac Studio.
Additional Information
Use the synchronization function to download the project from the Sysmac Studio to the Con-
troller. Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information
on the synchronization function.
1 Go online with the Controller, and then select Synchronization from the Controller Menu.
The data on the computer and the data in the physical Controller are compared automatically.
Connect online to the Controller from the Sysmac Studio and perform the MC Test Run on the MC Test
Run Tab Page.
For details, refer to the NJ/NX-series CPU Unit Motion Control User's Manual (Cat. No. W507).
1 After you complete the necessary wiring, connect the Sysmac Studio online to the Controller.
2 Create axes, assign the axes, and set the following axis parameters.
Axis parameter settings required for an MC Test Run: Unit of Display, Command Pulses Per
Motor Rotation, Travel Distance Per Motor Rotation, Maximum Velocity, Maximum Jog Velocity,
Maximum Acceleration Rate, Maximum Deceleration Rate, Software Limit Function Selection,
Software Limits, and Count Mode
3 Open the MC Test Run Tab Page and perform the following.
Example:
2 Check the operation by changing the status of program inputs and program outputs, and the
values of variables.
• The Clear All Memory operation can be performed only in PROGRAM mode.
• You cannot execute the Clear All Memory operation when write protection of the CPU Unit is
set in the security functions.
• Do not turn OFF the power supply to the CPU Unit during the Clear All Memory operation.
• The client private key, client certificate and secure socket setting for the secure socket com-
munications are out of the target of the Clear All Memory operation.
Use the Secure Socket Configuration commands to initial the client private key, client certifi-
cate and secure socket setting that are used for the secure socket communications.
After you clear the memory, the Controller operates in the same way as immediately after you create
the system configuration with the CPU Unit in the factory default condition.
8-1-2 Clock
CPU Unit
Clock data
• Event logs
• Time and date of files that are
created on SD Memory Card
Battery backup
Battery
CJ1W-BAT01
• The clock data is retained by the Battery when the power is turned OFF. If the battery is not
installed, the clock data is not correct when the power is turned ON. If the battery is not instal-
led, reset the clock data from an NTP server over an EtherNet/IP network after the power is
turned ON.
• The clock data is retained by a built-in capacitor when the battery-free operation is used in
the NX102 and NX1P2 CPU Units. When the power of the device is turned OFF if the reten-
tion time in the built-in capacitor is exceeded, the clock data are initialized. If you use the
clock data in the event log and other functions, specify the clock data when you turn ON the
power supply every time.
Additional Information
When a Battery is not mounted or when the Battery voltage is low, the time zone setting is re-
tained, but the clock data is not retained and will not be correct.
l Application
In a network system, the clock data must be shared by the entire system. NTP is supported to ena-
ble easy time synchronization.
8-1-2 Clock
You can select Controller Clock from the Controller Menu of the Sysmac Studio to display the
clock data.
Logging
When you change the clock data, an event is recorded in the event log.
However, nothing is recorded in the event log if the time is corrected for the NTP.
Introduction
The RUN output on NX-PA9001, NX-PD7001, or NJ-P£3001 Power Supply Unit is ON while the CPU
Unit is operating.
RUN
output
Status Operation
During RUN mode ON
Startup state OFF
(until RUN mode is entered according to the Startup
Mode setting)
During PROGRAM mode
When a major fault level Controller error occurs
The ratings of the RUN output on NX-PA9001, NX-PD7001, or NJ-P£3001 Power Supply Unit are as
follows:
Item Description
Contact form SPST-NO
Switching capacity 2 A at 250 VAC for resistive load
0.5 A at 120 VAC for inductive load
2 A at 24 VDC for resistive load
Application
• Obtain a signal to notify the host that the CPU Unit is functioning normally and is currently operating.
• Synchronize the completion of startup of more than one CPU Unit
• Release interlocks when the CPU Unit starts operation.
It takes up to approximately 10 to 20 seconds to enter RUN mode after the power is turned ON.
The outputs during this time behave according to the slave or Unit specifications.
Use the RUN output on the Power Supply Unit, for example, to implement fail-safe circuits so
that external devices do not operate incorrectly.
For I/O data that are handled by the NX Bus Function Module, there are two kinds of I/O data, the
status of NX Units managed by the NX Bus Function Module as the NX bus master and I/O data for
individual NX Units. The variables are the assignable I/O ports for both of them.
The following describes the status of NX Units managed by the NX Bus Function Module as the NX
bus master, I/O data for individual NX Units, assigning device variables to I/O ports, and programming
sample using device variables.
The status says that message communications are enabled for NX Units
that meet the following conditions.
• The comparison shows no differences (only if the Unit configuration in-
formation is registered).
• The NX Unit does not have a WDT error.
The status is FALSE for NX Units that are set as unmounted Units.
Each bit is updated when the message communications status changes on
the corresponding NX Unit.
NX Unit I/O Data Active Status This status tells whether the NX Units can process I/O data communica-
tions.
Each bit has the following meaning.
TRUE: The I/O data in the NX Unit can be used for control.
FALSE: The I/O data in the NX Unit cannot be used for control.
The status is FALSE for NX Units that are set as unmounted Units.
Each bit is updated when the operating status changes on the correspond-
ing NX Unit.
If both of NX Unit Registration Status and NX Unit I/O Data Active Status
are TRUE, the target NX Units operate normally.
Name Description
NX Unit Error Status This status tells whether an error exists on the NX Units.
Each bit has the following meaning.
TRUE: Error
FALSE: No error
Each bit is set to TRUE when the level of the error is as follows:
• Major fault
• Partial fault
• Minor fault
• Observation
The status is FALSE for NX Units that are set as unmounted Units.
Each bit is updated at the following times.
The status changes to TRUE when an error occurs.
The status changes to FALSE when the error is reset. Even if the cause of
the error has been removed, you must reset the error for the status to
change to FALSE.
Time Stamp of Synchronous This time stamp tells when a synchronous input occurred in the NX Unit
Input that supports synchronous I/O refreshing. The unit is ns.
Refer to A-6-4 NX Bus Function Module, Category Name: _NXB on page A-93 for details on the 8
related system-defined variables.
Refer to the user’s manual for the specific NX Units for details on I/O data for individual NX Units.
I/O port names are determined by the model number of the NX Unit and the functionality for I/O
data for NX Units mounted on the CPU Unit.
Nx_Unit5_IOActive Nx_Unit5_Error
MemCopy1
MemCopy
EN ENO
In1[1] In Out
AryOut1[1] AryOut
AryOut1[1]
UINT#3 Size
Nx_Unit5_MessageActive
NX_WriteObj1
NX_WriteObj 8
Execute Done
UnitProxy1 UnitProxy Busy
Obj1 Obj Error
Nx_Unit5_MessageActive: This is a device variable to indicate the NX Unit Message Enabled Status with NX Unit number 5.
Overview of Function
You can use this function to register NX Units that will be added to at a later time in the Unit configura-
tion information as unmounted Units. With this function, you can create the program in advance for NX
Units that are not mounted to the actual configuration.
You can use this function even if a specific Unit is temporarily unavailable such as when commission-
ing the system.
• I/O memory area is reserved for these unmounted NX Units in the same way that it is reserved for
NX Units that are mounted to the actual configuration.
• Unmounted NX Units are also assigned NX Unit numbers. This prevents the NX Unit numbers of
other NX Units on the CPU Unit from changing when you change the setting of an NX Unit that is
not mounted to the setting of an NX Unit that is mounted to the actual configuration.
♯2 ♯3 ♯7
NX Unit NX Unit NX Unit
NX Units to add later
End Cover
CPU Unit ♯1 ♯4 ♯5 ♯6 ♯8
NX Unit NX Unit NX Unit NX Unit NX Unit
Current Unit
configuration
CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5 ♯6 ♯7 ♯8
NX Unit NX Unit NX Unit NX Unit NX Unit NX Unit NX Unit NX Unit
Unit configuration (Set as an (Set as an (Set as an
information that is unmounted unmounted unmounted
Unit configuration
created Unit.) Unit.) Unit.)
information
The Unit configuration information includes information on unmounted Units so that I/O memory area is
also reserved for them.
Item Operation
Bandwidth reservation for I/O refresh data with the Bandwidth is reserved.
EtherCAT master
I/O refreshing with the EtherCAT master The I/O is not refreshed.
Detection of events Events are not detected.
Assignment of NX Unit numbers to NX Units Unit numbers are not assigned because the Units do
not exist.
Item Operation
Message communications Not possible because the Units do not exist.
Transfers for the synchronization function of the Sys- Not applicable.
mac Studio
Transfer of the Unit operation settings Not applicable.
Sysmac Studio Controller backup function Not applicable.
SD Memory Card backup function Not applicable.
Instructions Parameters cannot be read or written. An instruction
error will occur.
Clearing all memory Not applicable.
Reading/writing setting information through backup/ Not applicable.
restore operations
Reading event logs Not applicable.
Notification of status information Not applicable.
NX Units that are set as unmounted Units are included in the calculations for total power consumption
and total Unit width when the Unit configuration is created on the Sysmac Studio.
Check the user program, data, and parameter settings for proper execution before you use
them for actual operation.
When you mount an NX Unit that was set as an unmounted Unit, a Unit Configuration Verifica-
tion Error will occur.
Types of Restarts
The following table gives the types of restarts for individual NX Units.
Type Function
Restarting NX Bus Function Module All NX Units on the CPU Unit are restarted.
Restarting Individual NX Units The specified NX Unit is restarted.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the RestartN-
XUnit instruction.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the RestartN-
XUnit instruction.
The NX Bus Function Module and all NX Units that were not specified for restarting continue to oper-
ate.
Restarting an NX Unit
Place the Sysmac Studio online. In the CPU and Expansion Racks Tab Page, right-click the CPU Unit
and select Restart for NX Bus/NX Unit – Yes. All NX Units on the CPU Unit are restarted.
In the same way, right-click the NX Unit to restart and select Restart for NX Bus/NX Unit – Yes. The
You can use the Sysmac Studio to check the wiring between NX Units on the CPU Unit and I/O devi-
ces during system commissioning even if the user program is not created.
Preparation 8
Create the NX Unit configuration information and check whether the Unit configuration on the Sysmac
Studio agrees with the actual Unit configuration if the NX Unit configuration information was transfer-
Refer to 8-6-1 Forced Refreshing on page 8-52 for information on forced refreshing.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the operations on the
Sysmac Studio.
Additional Information
• For Position Interface Units and other NX Units that are assigned to axes, use the MC Test
Run of the Sysmac Studio. Refer to the NJ/NX-series CPU Unit Motion Control User's Manual
(Cat. No. W507) for details.
• Use the I/O checking of EtherCAT Slave Terminals to check the wiring of NX Units on the
EtherCAT Coupler Unit. Refer to the NX-series EtherCAT Coupler Units User’s Manual (Cat.
No. W519) for details.
This function allows the NX Bus Function Module to start or continue I/O refreshing only with the NX
Units on the CPU Unit that can operate normally when an error occurs for the NX Bus Function Mod-
ule.
For example, you can use this function in the following cases.
• When it is dangerous to stop all NX Units on the CPU Unit at once.
• To continue the operation of the NX Units on the CPU Unit until the system can be stopped safely
through the user program or user operation.
• To not stop all devices, i.e., to continue operation for only some devices
End Cover
CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5
NX Unit NX Unit NX Unit NX Unit NX Unit
Error occurs.
End Cover
CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5
NX Unit NX Unit NX Unit NX Unit NX Unit
If you change the fail-soft operation setting, the output status when the error occurs may also
change. Confirm safety before you change the setting.
If you use fail-soft operation, write programming to determine whether Unit I/O data is valid.
Without such programming, the user program cannot distinguish between Units for which I/O
refreshing is continued and Units for which I/O refreshing is stopped.
To determine whether Unit I/O data is valid, use the variables to indicate the NX Unit I/O Data
Active Status and NX Unit Error Status from the NX Unit device variables.
A sample programming that determines whether NX Unit (NX Unit number: 5) I/O data on the
CPU Unit is valid is given below.
R_HandSensor_Active R_HandSensor_Error
MemCopy1
MemCopy
EN ENO
In1[1] In Out
R_HandSensor_Active: This is a device variable to indicate the NX Unit I/O Data Active Status with NX Unit number 5.
R_HandSensor_Error: This is a device variable to indicate the NX Unit Error Status with NX Unit number 5.
Operation when an error occurs while Operation when an error occurs dur-
Operating status
starting ing normal operation 8
With fail-soft operation The NX Bus Function Module starts I/O The NX Bus Function Module continues
Except for the I/O refreshing, the operation when an error occurs for the NX Bus Function Module is
the same regardless of whether fail-soft operation is used. Specifically, error notification is provided
and errors are recorded in the event log.
• After you change the setting, always transfer the changed settings to the CPU Unit.
• Refer to 4-2-4 Unit Configuration and Unit Setup for NX102 and NX1P2 CPU Units on page
4-13 for information on the Unit configurations and settings for the NX102 CPU Units and
NX1P2 CPU Units.
Even if you enable Fail-soft operation, the NX Bus Function Module may not start I/O refreshing for
all of the NX Units when the CPU Unit is started, depending on the cause of the error.
Refer to Causes of Unit Configuration Verification Errors and Error Operation on page 8-18 for details
on the operation for different error causes.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the errors to which fail-soft op-
eration applies.
If an error occurs to which fail-soft operation does not apply, the NX Bus Function Module will stop I/O
refreshing for all NX Units even if you enable fail-soft operation.
8-2-6 Monitoring Total Power-ON Time for NX Units on the CPU Unit
This section describes how to monitor the total power-ON time for NX Units on the CPU Unit.
8
Each of the NX Units on the CPU Unit records the total time that the Unit power supply is ON to it. You
8-2-6 Monitoring Total Power-ON Time for NX Units on the CPU Unit
can display these times on the Sysmac Studio.
Item Specification
Display unit • When total power-ON time is less than 1 hour : Minutes
• When total power-ON time is 1 hour or longer : Hours
Update interval • When total power-ON time is less than 24 hours : 10 minutes
• When total power-ON time is 24 hours or longer : 1 hour
Measurement error 1 hour/month max.
Default setting 0 minutes
Or, you can use the following special instruction to check the total power-ON times.
• NX_ReadTotalPowerOnTime instruction
This section describes how to check the total power-ON times with the Sysmac Studio. Refer to the
NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the NX_ReadTotalPower-
OnTime instruction.
1 Go online.
2 Right-click CPU Rack under Configurations and Setup - CPU/Expansion Racks in the Multi-
view Explorer and select Production Information.
The Production Information Dialog Box is displayed.
You can check the total power-ON times of each NX Unit when you change the view to the pro-
duction information details.
l Display for Units That Do Not Support Monitoring the Total Power-ON
Time
If a Unit does not support monitoring the total power-ON time, the total power-ON time for the Unit
is displayed as "---" on the Sysmac Studio.
Introduction
You can increase the input response time to reduce chattering and the effects of external noise. You
can decrease the input response time to enable detection of shorter input pulses. Do not set the ON
Input from a
proximity sensor
or other device
Input bit
ResetUnit
a b The ResetUnit instruction restarts a Special Unit
across multiple task periods when execution condition
Execute Done a changes to TRUE. If the restart ends normally, the
output variable Done (normal end) changes to TRUE
UnitNo Busy and variable b therefore changes to TRUE.
Error
ErrorID
If Special Unit settings are changed in any of the following ways, you must restart the Special Unit or
cycle the power supply to the Controller.
• Editing from the Special Unit Settings Tab Page of the Sysmac Studio
• Editing from the I/O Map or Watch Tab Page
• Setting the user program
Sysmac Studio
SD Memory Card
Creating/reading files
from Sysmac Studio
Function Introduction
SD Memory Card operation in- You can access SD Memory Cards from instructions in the user program.
structions
FTP Client communications in- You can use these instructions to transfer files via FTP from the CPU Unit
structions*1 to computers or Controllers at Ethernet nodes.
You can use FTP commands from an FTP client on the Intranet to read
FTP server
and write large files in the SD Memory Card through EtherNet/IP.
You can perform file operations from the Sysmac Studio for the SD Mem-
File operations from the Sysmac ory Card inserted in the CPU Unit.
Studio You can perform file operations for Controller files in the SD Memory Card
and save standard document files on the computer.
SD Memory Card life expiration Notification of the expiration of the life of the SD Memory Card is provided
detection in a system-defined variable and event log.
You use the SD Memory Card inserted in the CPU Unit to backup, re-
SD Memory Card backup, auto-
store, and verify user programs and data in the Controller. For details, re-
matic transfer from SD Memory
fer to 9-2 SD Memory Card Backups on page 9-14, 9-4 Automatic Trans-
Card, and program transfer from
fers from SD Memory Cards on page 9-36, and 9-5 Program Transfer
SD Memory Card*2
from SD Memory Card on page 9-38 for details.
You can record I/O data for the NX-SL5£££ that is mounted to the NX
bus of the NX102 CPU Unit in a chronological order into an SD Memory
Safety Data Logging*3 card.
Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930-
E1-12 or later) for details.
Function Introduction
You can record parameters, starting, ending, and errors of a TLS session.
Secure socket communications
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's
logging*4
Manual (Cat. No. W506) for details.
*1. A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use the
FTP client communications instructions.
*2. A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use the
function.
*3. An NX102 CPU Unit with unit version 1.31 or later, an NX-SL5£££ Safety CPU Unit with unit version 1.3
or later, and Sysmac Studio version 1.24 or higher are required to use the Safety Data Logging.
*4. An NX102-££00 CPU Unit with unit version 1.46 or later, an NX102-££20 CPU Unit with unit version 1.37
or later, or an NX1P2 CPU Unit with unit version 1.46 or later and Sysmac Studio version 1.46 or later are
required to use the secure secure socket communications logging.
The SD Memory Card you can use depends on the model and version of the Controller.
CPU models other than NX102-££££
NX102-££££
HMC- HMC-
Unit version HMC-SD291 HMC-SD491 HMC-SD292 HMC-SD492
SD1A1 SD1A2
Ver.1.30 to Can be used without restric- *2 *4 *2
Ver.1.31 tions.
Ver.1.32 to Can be used *4
Ver.1.35 without re-
Ver.1.36 to strictions. Can be used without restrictions.
Ver.1.39
Ver.1.40 to *4
Ver.1.42
Ver.1.43 or Can be used without restrictions.
later
*1. You cannot use an HMC-SD291 or HMC-SD292 for the NJ 501-££££ CPU Unit with the hardware
revision "A" and unit version 1.15 or later.
*2. Cannot be used.
*3. You cannot use a SD Memory Card with "MR£" written on the back for the NJ501-££££ CPU Unit
with unit version 1.12 or earlier or the NX701-££££ CPU Unit with unit version 1.13 or earlier.
*4. 8-4-7 SD Memory Card Life Expiration Detection on page 8-29 cannot be used.
Additional Information
l Character Restrictions
Multibyte
Maximum size
Object named by Usable charac- character Case sen-
l Subdirectory Levels
You can create up to 5 levels (example: f1/f2/f3/f4/f5/abc.txt)
Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are re-
quired to use the FTP client communications instructions.
CPU Unit
FTP Client
FTP
commands
File transfers
The life of the SD Memory Card is checked when the power is turned ON and periodically while the
SD Memory Card is inserted.
When the end of the life of the SD Memory Card is detected, save the data on the SD Memory Card
and replace the SD Memory Card.
Version Information
Combination of the CPU Unit version and SD Memory Card determines whether the SD memo-
ry card life expiration detection function can be used or not. Refer to 8-4-2 Specifications of
Supported SD Memory Cards, Folders, and Files on page 8-25.
Note Refer to 9-2 SD Memory Card Backups on page 9-14 for the system-defined variables that are used with
the SD Memory Card backup function.
Additional Information
_Card1Ready
_Card1Err 8
_Card1Access
You can select whether to perform self-diagnosis when the power is turned ON in the Operation
Settings of the Controller Setup under the Configurations and Setup from the Sysmac Studio as
shown below.
• File system check
• Check equivalent to CHKDSK
• Restoration attempt when check fails
Setting
Access point Setting Description Set value
group
Operation Set- SD Memory Memory Card Sets whether to execute self-diagnosis Do not check.
tings, Operation Card Settings Diagnosis at (file system check and restoration) on Check.
Settings Tab, Startup*1 the inserted SD Memory Card when
Basic Settings the power is turned ON.
*1. Self-diagnosis is not executed if write protection is set on the SD Memory Card itself.
l Results of Self-diagnosis
Indicators
Case SD Error type Correction Remarks
RUN SD PWR
BUSY
Self-diagnosis in Flashing Not lit Lit --- --- ---
progress
When self-diagnosis --- Lit Not lit Normal None ---
found no problems
The format of the SD --- Not lit Not lit Observation Use the Sys- ---
Memory Card is not mac Studio to
correct. format the SD
Memory Card.
An error was detect- --- Lit Flashes Observation Use file opera- If a corrupted
ed during the file during tions in the file is detected,
system check and restore Sysmac Studio an attempt is
the file system was opera- or insert the made to re-
automatically re- tion. SD Memory store the file.
stored. Not lit af- Card into the
ter re- computer to
store op- check whether
eration is any files were
complet- deleted by the
ed. restore opera-
tion.
The SD Memory --- Not lit Not lit Observation Replace the ---
Card failed. SD Memory
Card.
If the recovery function is activated at startup, time is required to enter RUN mode. During that
time, outputs will be OFF and external communications are not performed.
Use the RUN output on the Power Supply Unit, for example, to implement fail-safe circuits so
that external devices do not operate incorrectly.
Never interrupt the power supply to the Controller during SD Memory Card access. That in-
cludes when SD Memory Card self-diagnosis at startup is enabled.
An attempt is made by the SD Memory Card restoration function to restore any corrupted files.
If the restoration fails, these files may be deleted automatically at startup.
When the following functions are used, an access to files on the SD Memory Card will occur.
• SD Memory Card operation instructions and FTP client instructions
• Backup, restore and verification operations with the SD Memory Card
• File operations in the SD Memory Card from the Sysmac Studio
• Backup, restore and verification operations from the Sysmac Studio
• FTP server
8-5 Security
This section describes the security functions that are supported by the NJ/NX-series Controller.
To protect your assets, you can use security functions to protect the user program and data in the
Controller. To prevent incorrect operation, you can use security functions to restrict operations on the
Sysmac Studio.
Introduction
You can set a specific ID (called a user program execution ID) in the CPU Unit in advance. If you do,
8-5 Security
you can execute only a user program with the same ID.
Sysmac Studio
8
A user program execution ID
is registered in the CPU Unit.
You can therefore prevent different CPU Units (hardware) from executing a user program.
In contrast to the protection function, you can still display and edit the user program even if a user pro-
gram execution ID is set.
Operating Procedure
1 Always backup the project files before you assign a user program execution ID.
2 Assign the user program execution ID to the user program offline from the Sysmac Studio.
After you assign a user program execution ID to a user program, you cannot change or delete
the ID.
To use a different ID, read the project file without an ID that was backed up in step 1, above,
and assign another user program execution ID. To delete the ID, use the project file without an
ID that was backed up in step 1, above.
3 Connect the Sysmac Studio online and register the user program execution ID that was set in
step 2 in the CPU Unit.
The registration of the user program execution ID in the CPU Unit is recorded in the event log.
At this time, the user program execution ID in the CPU Unit is overwritten even if it is already
registered.
4 Transfer the user program with the same user program execution ID to the CPU Unit.
If the user program execution ID in the user program does not match the user program execu-
tion ID in the CPU Unit or if one of them does not have an ID, an ID Verification Error (major
fault level Controller error) occurs when you attempt to change to RUN mode and the CPU Unit
will not operate.
After you assign a user program execution ID to the CPU Unit, you cannot read or delete the
ID. To delete the ID from the CPU Unit, perform the Clear All Memory operation on the CPU
Unit.
l When the User Program Execution ID in the CPU Unit Is Incorrect or Not
Registered
Connect online to the CPU Unit from the Sysmac Studio and perform the following steps.
1 Overwrite or register the correct user program execution ID in the CPU Unit.
2 Cycle the power supply to the Controller, or reset the CPU Unit from the Sysmac Studio.
l When the User Program Execution ID Is Not Assigned to the User Pro-
gram or Is Incorrect
1 Read the backed up project file from the Sysmac Studio, and assign the correct user program
execution ID.
2 Connect the Sysmac Studio to the CPU Unit online and transfer the user program.
3 Cycle the power supply to the Controller, or reset the Controller from the Sysmac Studio.
Other Situations
To Delete the User Program Execution ID Assigned to the User Program
8-5 Security
Read the backed up project file in the Sysmac Studio.
Specifications
Verification Conditions
The conditions for verifications are given in the following table.
Introduction
Normally, when you transfer the user program from the Sysmac Studio to the CPU Unit, information is
transferred to restore it.
This function does not transfer information for restoration. That makes it impossible to read the user
program.
User program
Normally, both User program Restoration information
Readable (restoration are transferred. (restoration
is not transferred.
information) information)
Not readable
This function is used to prevent theft of user program data when on-site maintenance of the user pro-
gram is not required.
Operating Procedure
When you transfer the user program to the CPU Unit, select the Do not transfer program source
Check Box in the Synchronization Window of the Sysmac Studio and then click the Transfer to
Controller Button.
Operating Procedure
This section describes how to set a password for a project.
When you use Save As to save the project file, select the Enable password protection for the
project file Check Box to enable setting a password.
8-5 Security
8
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Version Information
A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are re-
quired to use data protection.
Introduction
You can place protection on part of the data in a project file to restrict access to that data.
You can select any of three levels of access restrictions when you set protection.
Protection must be temporarily cleared to access the restricted data. The length of time for which pro-
tection is cleared depends on the operation that you use.
Protected Data
Protection can be set for the following data.
• Ladder diagrams (applies to programs, functions, and function blocks)
• ST (applies to programs, functions, and function blocks)
• Cam profiles
Operating Procedure
This function is used when the Sysmac Studio is offline.
The settings are saved in the project file. When you use the synchronization function of the Sysmac
Studio to transfer the project, the data protection settings in the data in the computer or Controller are
transferred to Controller or computer.
Select Security − Set/Release Data Protection from the Controller Menu of the Sysmac Studio to set
protection.
8-5 Security
Select Security − Temporarily Change Prohibition of Data Protection from the Controller Menu of
the Sysmac Studio to temporarily clear protection. 8
Select Security − Finish Temporary Change Prohibition of Data Protection from the Controller
Menu of the Sysmac Studio to end temporary change protection.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Version Information
Secure communication is available in the following CPU Units of the stated versions.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
Version Information
An NX102-££00 CPU Unit with unit version 1.46 or later or an NX102-££20 CPU Unit with
unit version 1.37 or later, and Sysmac Studio version 1.46 or higher are required to use secure
socket services.
An NX1P2-££££££ CPU Unit 1.46 or later and Sysmac Studio version 1.46 or higher are
required.
Version Information
Packet Filer is available in the following CPU Units of the stated versions.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
Introduction
Online operations are restricted by operation rights to prevent damage to equipment or injuries that
may be caused by operating mistakes.
Examples are shown below.
• I/O Monitor: Writing, forced refreshing, etc.
• Controller operations: Changing the operating mode, online editing, MC Test Run, etc.
You can register passwords for operation authority for each CPU Unit in the Sysmac Studio. If a cor-
rect password is entered when an online connection is made to a Controller, the online operations for
the operation authority category for the password that was entered will be allowed.
The Administrator sets a password for each operation authority. Users are notified of the operation au-
thority name and password according to their skills.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific operating proce-
dures for operation authorities.
Operating Procedure
For operation authority verification, select Security − Setting of Operation Authority from the Con-
8-5 Security
troller Menu on the Sysmac Studio.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Specifications 8
l Types of Operation Authorities
Type Password
Administrator Required.
Designer*1 Optional*2 Whether a password is required is determined by the default opera-
Maintainer tion authority that is set in the Setting of Operation Authority Dialog Box.
Operator*1
Observer*1 Not required.
*1. A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required.
*2. Whether a password is required is determined by the default operation authority that is set in the Setting
of Operation Authority Dialog Box. A password must be entered to perform operations that require an
operation authority that is higher than the default operation authority. A password is not required to per-
form operations that require an operation authority that is equal to or lower than the default operation
authority.
Adminis- Maintain-
Status monitor (example) Designer Operator Observer
trator er
Monitoring errors for troubleshooting OK OK OK OK OK
Adminis- Maintain-
I/O monitor operations (examples) Designer Operator Observer
trator er
I/O monitor: Reading OK OK OK OK NP
I/O monitor: Writing OK OK OK VR NP
Controlling BOOL variables OK OK OK VR NP
Forced refreshing OK OK OK NP NP
Adminis- Maintain-
Controller operations (examples) Designer Operator Observer
trator er
RUN mode/PROGRAM mode OK OK VR NP NP
Online editing OK OK VR NP NP
Resetting the Controller OK OK NP NP NP
Resetting errors for troubleshooting OK OK OK VR NP
Starting or restarting an MC Test Run OK OK VR NP NP
User program execution IDs for Controllers OK NP NP × NP
CPU Unit write-protection OK OK NP NP
l Password Specifications
Item Description
Valid number of characters 8 to 32
Applicable characters Single-byte alphanumeric characters (case sensitive)
Outline
The user authentication function assigns individual user names and passwords to users of the CPU
Unit and identifies who operated the CPU Unit online. When an online connection is made to the CPU
Unit, the user will be asked to enter user name and password. Online connections cannot be made
unless the user name and password match the predefined settings.
Furthermore, for each user, operation authority of any of administrator, designer, maintainer, operator
and observer is assigned. This ensures that users can operate the CPU Unit online within the authori-
ties assigned to them. Refer to the 8-5-9 Operation Authority Verification on page 8-43 for more infor-
mation on operation authority verification.
To place the CPU Unit online for the first time or to do so after clearing all memory, you need to be
registered as an administrator. Unless being registered as the administrator, you cannot place the Unit
online.
The user authentication function records user names in several event logs. This is useful to prevent
denial when a security problem occurs. For more information on events for which user names are log-
ged, refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503).
You can transfer and save the user authentication settings, including the user names, passwords, and
operation authority properties of the user in the CPU Unit. Then, you can use the user authentication
function even when another computer is connected to the CPU unit.
However, user authentication settings are not included in the Sysmac Studio project. Therefore, you
must configure the user authentication settings for each CPU Unit that you want to use with user au-
thentication.
Version Information
Operating Procedure
Entering your user name and password when connecting Sysmac Studio online to the CPU Unit will
allow you to operate within the permissions assigned to you. Refer to the Sysmac Studio Version 1
Operation Manual (Cat. No. W504) for specific procedures.
8-5 Security
If user authentication is not enabled on the CPU Unit, then if a third party enables user authenti-
cation settings on the CPU Unit, online operations will be disabled unless you enter the user
name and password. Make an agreement with the user in advance whether to set up user au-
thentication settings.
8
Major cate-
Minor category Description Setting range Default
gory
User Number of users*1 Number of users to register 1 to 64 ---
User name User name 1 to 16 characters*2 ---
Password Password 8 to 32 characters*2 ---
The user authentication settings must be made for each CPU Unit. They are not saved in the Sysmac
Studio project file. These settings can only be executed by users with administrator privileges, except
for initial settings.
For the details on the settings, refer to the Sysmac Studio Version 1 Operation Manual (Cat. No.
W504).
Other Specifications
This section describes other specifications of user authentication function.
8-5 Security
You can clear the user authentication settings in any of the following ways. Perform this to prevent
information leaks when you dispose of the CPU Unit.
• Perform Clear All Memory operation.
• Specify an early project unit version that does not support user authentication function to the
CPU Unit.
8
l What to Do If You Forget Your Password?
• The backup file must be prepared beforehand for the above actions. Note that these backup
files cannot be created after the Administrator forgets the password.
• If you execute the above measures, user program will be overwritten by the backup files.
CPU Unit
Earlier version
not supporting
Unit version supporting user authentication function
user authentica-
tion function
Project unit version Project unit ver- Earlier project unit
not set sion supporting version not support- All project unit
(Factory default or user authentication ing user authentica- versions
memory all cleared) function tion function
Sys- Ver.1.50 Possible.*1 Possible. Not possible. Not possible.
mac or high-
Studio er
Lower Not possible.*1 Not possible.
than
Ver.1.50
*1. When user authentication is enabled when the project unit version is not set (factory default or memory all
cleared), Sysmac Studio Ver.1.50 will be connected after user authentication. However, Sysmac Studio low-
er than Ver.1.50 can connect without user authentication. Set the project unit version of the CPU Unit that
supports user authentication function.
Sysmac Studio
At startup
Write protection Write Protection
Writing is not
possible.
Set whether to automatically enable write protection when the power supply is turned ON in the
Operation Settings under the Configurations and Setup - Controller Setup of the Sysmac Stu-
dio.
Access Setting
Setting Description Set value
point group
Operation Set- Security Set- Write Protec- Sets whether to enable write Do not use.
tings, Opera- tings tion at Startup protection. Use.
tion Settings
Tab, Basic
Settings
8-5 Security
Sysmac Studio
CPU Unit
8
Enabled
Introduction
Register a CPU Unit name in the CPU Unit.
When going online to a CPU Unit from the Sysmac Studio, the CPU Unit name in the project is com-
pared to the name of the CPU Unit being connected to.
This helps prevent incorrect connections to the CPU Unit from the Sysmac Studio. It is particularly ef-
fective for operations performed over an EtherNet/IP network.
Sysmac Studio
CPU Unit
name: A
In addition to the CPU Unit name, it is also possible to use serial ID identification based on the CPU
Unit production information (optional).
Setting Methods
1 Set the CPU Unit name when you create a project on the Sysmac Studio.
The CPU Unit name is displayed as shown below.
To change the name, right-click the Controller icon and select Rename.
2 When you first connect to the CPU Unit online, the Sysmac Studio prompts you to store the
CPU Unit name in the CPU Unit.
3 After that, when you connect to the CPU Unit online, the Sysmac Studio refers to the CPU Unit
name in the project and the CPU Unit name of the CPU Unit you connect to. A warning dialog
box is shown if they do not match, and you are asked whether to continue to connect.
Additional Information
Serial IDs
When the Sysmac Studio first connects online, you can obtain the serial ID from the CPU Unit's pro-
duction information and store it in the project.
After that, when the Sysmac Studio connects online, both the CPU Unit name and the serial ID are
compared. This enables stricter verification of the CPU Unit.
Sysmac Studio
CPU Unit
CPU Unit
8-5 Security
8-5-13 Access log
8
Operations that the user performed to the Controller using the tool are registered as access logs. If the
user authentication function is used, the user name is registered in the access log that is important for
8-6 Debugging
This section describes debugging.
Introduction
Forced refreshing allows the user to refresh external inputs and outputs with user-specified values
from the Sysmac Studio to debug the system.
Forced refreshing is executed not for the specified device variables, but for the I/O ports that are as-
signed to the device variables.
The state that is specified with forced refreshing is retained until forced refreshing is cleared from the
Sysmac Studio. (Refer to Holding/Clearing Forced Refreshing on page 8-55 for information how
forced refreshing is retained or cleared according to changes in CPU Unit status.)
All forced refreshing is cleared when a fatal error occurs, when a Clear All Memory operation is per-
formed, when the operating mode is changed, when power is interrupted, or when the project is down-
loaded.
l Inputs
The I/O port and device variable change to the status that is specified with forced refreshing re-
gardless of the status of the external input.
Sysmac Studio
CPU Unit
I/O port
(1) I/O port changed to Device variable
TRUE with forced
refreshing. FALSE
TRUE TRUE
l Outputs
The I/O port and the output to the external device change to the status that is specified with forced
refreshing.
In the user program, the status of the device variable that is assigned to the I/O port will not neces-
sarily be the status that was specified with forced refreshing. It will change with the results of user
program execution.
Sysmac Studio
CPU Unit
I/O port
(1) Output changed to Device variable
TRUE with forced
refreshing.
TRUE
FALSE TRUE
8-6 Debugging
Applicable Areas
You can execute forced refreshing for the following I/O ports and memory used for CJ-series Units.
• I/O ports for EtherCAT slaves
• I/O ports from data handled by the NX Bus Function Module of the NX102 CPU Unit and NX1P2
CPU Unit 8
• I/O ports for I/O built in the NX1P2 CPU Unit
• I/O ports for Analog I/O Option Boards in the NX1P2 CPU Unit
If you execute forced refreshing from the Ladder Editor or the Watch Tab Page, the status of the I/O
port or memory element for a CJ-series Unit will change via the variable.
Note For I/O ports from data handled by the NX Bus Function Module of the NX102 CPU Unit and NX1P2 CPU
Unit, only the I/O ports for I/O data for individual NX Units are applicable. The I/O ports for status of NX
Units managed by the NX Bus Function Module as the NX bus master are not applicable.
Note You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
The number of external I/O points are given for the above limits. For example, if more than one varia-
ble is assigned the same external I/O point as the AT specifications, it is counted as only one point.
Application
l Inputs
• To apply a simulated input signal to debug the user program
• To create a status that would occur only when a failure occurs (e.g., two exclusive bits turning
ON or OFF at the same time)
l Outputs
• To turn outputs ON and OFF to check wiring
• To intentionally turn OFF an output you do not want to operate regardless of results of user pro-
gram execution
Operating Procedure
Operations can be performed from the following panes.
• Program panes (Ladder diagram language)
• I/O Map
• Watch Tab Page
1 Select Monitor from the Controller Menu. The monitor turns ON.
2 Double-click the ladder program, ladder function, or ladder function block under Programming
in the Multiview Explorer.
The rungs are displayed on the Ladder Editor in monitor status.
3 Right-click the input or output and select Forced Refreshing − TRUE. The input or output is
forced to TRUE. Right-click the input or output and select Forced Refreshing − FALSE. The
input or output is forced to FALSE.
4 The input or output in the Ladder Editor changes to TRUE or FALSE and the execution condi-
tion changes accordingly.
A mark that indicates that the input or output has forced status is displayed as shown below.
Ladder diagram
The TRUE or FALSE mark for forced status indicates the status that was specified for forced
refreshing. It does not indicate the current value of the input or output.
Additional Information
If there are other variables that are assigned the same memory address as one that is specified
as the AT specification of a variable for which forced refreshing is specified, the forced status
mark is displayed for all of the variables with that AT specification.
8-6 Debugging
Holding/Clearing Forced Refreshing
Forced refreshing is retained and cleared according to changes in the status of the CPU Unit as
shown below.
a
x • a is FALSE in the program.
• When the output is refreshed, information from forced
OFF refreshing is reflected and the external output of a is
TRUE.
External output
of a: TRUE
• Confirm that no adverse effect will occur in the system before you use forced refreshing.
• Forced refreshing ignores the results of user program execution and refreshes I/O with the
specified values.
If forced refreshing is used for inputs for which I/O refreshing is not supported, the inputs will
first take the specified values, but they will then be overwritten by the user program.
Depending on the difference in the forced status, the control system may operate unexpectedly.
Introduction
You can change the present values of variables that are used in the user program and settings and
you can change program inputs and outputs to TRUE or FALSE. This allows you to check the opera-
tion of the user program and settings.
Sysmac Studio
CPU Unit
Always confirm the safety of the system before you change the present value of a variable.
Application
8-6 Debugging
l Changing the Values of Other Variables
You can change the present values of user-defined variables, system-defined variables, and device
variables as required. You can do this on a Watch Tab Page.
Operations can be performed from the following panes to change the present values. Refer to the
Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on the operating procedures
on the panes.
• Program panes (ladder diagrams and ST)
• I/O Map
• Watch Tab Page
Note You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
Introduction
The online editing function is used to add to or change part of a program in the CPU Unit directly from
the Sysmac Studio.
Application
You can use online editing to change a user program without stopping the operation of the CPU Unit.
CAUTION
Execute online editing only after confirming that no adverse effects will oc-
cur if the I/O timing is disrupted. If you perform online editing, the task exe-
cution time may exceed the task period, I/O may not be refreshed with ex-
ternal devices, input signals may not be read, and output timing may be
changed.
8-6 Debugging
Precautions for Correct Use
• The differentiation status of differentiated instructions in a program that is edited online is ini-
tialized.
• When online editing changes are applied, the execution times of the tasks are extended. Set
the task period appropriately so that you do not cause a Task Period Exceeded error due to
online editing. 8
• If the power supply to the Controller is interrupted when online edits are being saved,* a ma-
jor fault level Controller error (User Program/Controller Configurations and Setup Transfer Er-
If you use data tracing to sample following variables, correct data may not be sampled.
• Structure members whose data size is 16 bits or more, except for system-defined variables
for motion control
• Array elements whose data size is 16 bits or more
If you sample the data with the above variables, perform either of the followings.
• Copy the above variables to the internal variables with a basic data type other than a data
size of 64 bits, and trace data for the copied variables.
• Use the settings for exclusive control of variables in tasks, and the task for which you use
data tracing to sample is set as a refreshing task.
l Triggered Tracing
Trigger conditions are set to record data before and after an event. Sampling stops automatically
when the maximum number of sampled variables is reached. Even if the Sysmac Studio is not on-
line, you can trace data when trigger conditions are met and then upload the data after placing the
Sysmac Studio online.
• You can check the flow of the program based on the status of changes in the present values of
variables.
• You can use the data to investigate the cause of unexpected changes in the values of variables.
Sysmac Studio
CPU Unit
Data to trace
Sampling
Sampled data
Uploaded once.
l Continuous Tracing
Sampling starts without any trigger and continues on even after 10,000 samples are collected.
Sample data is transferred to a computer as it is collected and saved to a file.
When the display buffer is full, the data is automatically saved to a CSV file.
You can use this to store trace results data for a long tracing period in multiple CSV files.
Sysmac Studio
CPU Unit
Data to trace
Sampling
Sampled data
Continues.
Item Description
Types of data Triggered tracing Set a trigger condition to start sampling. Data from before and after
traces the condition is met is saved.
8-6 Debugging
Continuous tracing Sample data is transferred to a computer as it is collected and
saved to a file.
Setting of tim- Period of specified Specify a task. The period of that task is set as the sampling period.
ing of sam- task *1
pling Specified fixed inter- The time you enter is set as the sampling period. However, the time
val you enter is rounded off to an integer multiple of the primary period- 8
ic task.
Trace sampling in- With this method, sampling is performed whenever the TraceSamp
Item Description
Setting trig- Condition data types Basic data types except for times, durations, dates, and text strings
gers Arrays (specify the element), structures (specify the member), and
unions (specify the member)
Condition expres- Tracing is started when one of the following conditions is met.
sion*3 BOOL: when it changes to TRUE or FALSE
Non- BOOL: Equals (=), Greater than (>), Greater than or equal (≥),
Less than (<), Less than or equal (≤), Not equal (≠)*4
Command from Sys- Tracing starts when the Trigger TRUE Button is clicked.
mac Studio
Data Trace Trigger in- Tracing starts when the TraceTrig instruction is executed.
struction
Evaluation timing • If something other than the TraceSamp instruction is used to set
the timing of sampling, the trigger is evaluated only once in the
specified task period.
• If the TraceSamp instruction is used to set the timing of sampling,
the trigger is evaluated whenever the instruction is executed.
Delay A slider is used to set the percentage of sampling before and after
the trigger condition is met. (Example: 20%/80%)
Starting a Command from Sys- Tracing is started when the Execute Button is clicked on the Sys-
trace mac Studio mac Studio.
Starting tracing at Tracing can be started when operation of the Controller starts (i.e.,
start of operation when the operating mode is changed from PROGRAM mode to
RUN mode).
Stopping a Triggered traces • Tracing stops when the maximum value of 10,000 samples is
trace reached.
• Tracing is stopped when the Stop Button is clicked on the Sys-
mac Studio.
Continuous traces • If stop tracing is set as the operation to perform when the maxi-
mum number of samples is reached, tracing stops when the max-
imum number of samples or maximum amount of time is
reached.
• Tracing is stopped when the Stop Button is clicked on the Sys-
mac Studio.
Setting con- Maximum data stor- You can set the maximum amount of time to save continuous trace
tinuous trac- age period data.
ing Maximum data stor- You can set the maximum total size of all files saved during continu-
age size ous tracing.
Data items per file You can set the number of samples to save in each file during a
continuous trace.
File save location You can specify the location to create files to save data during a
continuous trace.
File name prefix You can specify a prefix to automatically add to the beginning of the
file names.
Setting of operation You can specify the operation to perform when the storage time pe-
when limit is reached riod or size limit is reached.
• Stopping the trace
• Deleting the oldest files and continuing
Item Description
Displaying Graph display You can display a graph where the X axis represents time and the Y
trace results axis represents the value of the variable. You can display both
BOOL variables and other variables on the same graph.
Table display You can display the maximum value, minimum value, average val-
ue, and value at the specified time for each variable in a table.
3D Motion Monitor You can position a virtual composition model in 3D space and dis-
Display Mode play the composition motion based on the command positions and
actual positions of the motion axes.
Exporting Exporting to CSV files You can save the trace results and all settings other than the trace
trace data number to a CSV file.
Number of data traces that can be exe- NX701-££££: 4 traces
cuted simultaneously*5 NX102-££££: 2 traces
NX1P2-££££: 2 traces
NJ501-££££: 4 traces
NJ301-££££: 2 traces
NJ101-££££: 2 traces
Importing trace data You can display CSV format trace results on top of the current
graph.
Saving You can save the trace results in the project along with the trace
settings.
Printing You can print graphs. The Sysmac Studio's printing functionality is
used.
*1. For an NJ-series CPU Unit and NX701 CPU Unit, if you perform an internal variable with a data size of 64
bits or more to the sampled data, specify the task that assigns the program in which the target internal varia-
ble is defined. If the different task is specified, the concurrency of variable values may not be ensured.
8-6 Debugging
*2. You cannot perform data traces for the EN, ENO, P_off, P_on, P_CY, P_First_RunMode, P_First_Run and
P_PRGER system-defined variables, in-out variables that are used in function block instances, and varia-
bles in functions.
*3. Data tracing will not start when data trace is started even if the trigger condition is met.
*4. Combinations of multiple condition expressions are not permitted. Also, the valid range for comparison con-
stants is determined by the valid range of the literal expressions for the variable type on the left side of the 8
condition expression.
*5. Trace numbers 0 to 3 are set for the NX701 and NJ501. Trace numbers 0 and 1 are set for the NX102,
Example: If sampling is specified in the primary periodic task, data tracing is executed in System Com-
mon Processing 1, as shown in the following diagram.
processing 2
processing 1
processing 2
Motion
control
Motion
control
common
common
common
System
System
System
System
Additional Information
I/O refreshing, user program execution, and motion control processing are all executed in the
same task period. For data tracing, user program execution and motion control processing for
the current task period and I/O refreshing for the next task period are displayed at the same
time. The timing charts in the NJ/NX-series Motion Control Instructions Reference Manual (Cat.
No. W508) are based on the task periods, so the display are not the same as those for data
tracing.
Display examples for data trace operations and execution results is given below for sampling in a
specified task period.
Example 1:
In this example, the SysRun variable is changed to TRUE in the user program when the Sensor1 vari-
able (assigned to the sensor input signal) changes to TRUE.
The data trace operations and display of the execution results are given below.
1. In data trace processing in System Common Processing 1, TRUE is obtained for Sensor1.
3. In data trace processing in System Common Processing 1 in the next primary period, TRUE is ob-
tained for SysRun.
Therefore, in the data trace display, SysRun is shown as TRUE one task period after Sensor1.
Data Trace Display
TRUE
Sensor1
Delayed.
TRUE
SysRun
1 task period
Additional Information
If the values of variables change during user program execution, the changes in the values and
changes for output processing for I/O refreshing are changed in the same task period.
Example 2:
When the Button2 variable (assigned to an input signal from a pushbutton) changes to TRUE during
velocity control, the user program in this example decelerates axis 0 (MC_Axis000) to a stop.
The data trace operations and display of the execution results are given below.
1. In data trace processing in System Common Processing 1, TRUE is obtained for Button2.
2. STP_BSY is changed to TRUE in the user program and the Motion Control Function Module per-
forms deceleration processing.
3. In data trace processing in System Common Processing 1 in the next primary period, TRUE is ob-
tained for STP_BSY and the status of the motion variable is obtained.
4. STP_ACT is changed to TRUE in the user program.
5. In data trace processing in System Common Processing 1 in the next primary period, TRUE is ob-
tained for STP_ACT.
The command value in the MC Function Module starts changing (B in the following diagram) when
STP_BSY changes to TRUE in the user program and the Motion Control Function Module starts to
perform deceleration processing. The command value changes stepwise in synchronization with the
primary periodic task.
8-6 Debugging
The data trace, however, interpolates the values to connect the values for the previous and current
periods. Therefore, the display shows that the command value for the Command Velocity motion con-
trol variable (MC_Axis000.Cmd.Vel) changes one period early, i.e., when Button2 changes to TRUE (A
in the following figure). The display also shows that STP_BSY changes to TRUE one period after de-
celeration starts and then STP_ACT changes to TRUE after another period.
8
Button2
STP_BSY
STP_ACT
Dotted lines: Command value in MC Function Module
MC_Axis000.Cmd.Vel
Task period
A B
Additional Information
For function blocks that contain motion control instructions, the values of input parameters are
passed to the input variables when execution of the function block starts, and the values of the
output variables are passed to the output parameters when execution of the function block
ends. (Refer to Variable Designations for Function Blocks on page 6-11.) On the data trace dis-
plays, input parameters and input variables, and output parameters and output variables,
change in the same task period.
Note You cannot use these system-defined variables in the user program. Use the GetTraceStatus instruction to
read the status of data tracing from the user program.
Sysmac Studio
CPU Unit
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are re-
quired to use differential monitoring.
Application
You can use differential monitoring to check or count the number of times an external input signal
turns ON or OFF or an input in the user program changes to TRUE or FALSE. This is useful during
system commissioning and for troubleshooting operation failures during production.
Item Specification
Differential monitor- Number of variables 8 max.
ing condition Specified variables • BOOL
• Element of BOOL array
• BOOL member of structure or union
Condition expres- • Change to TRUE
sion • Change to FALSE
Conditional match Timing Once every primary period
evaluation
8-6 Debugging
Match count The number of times the specified variable matches the condition
is counted.
Starting and stop- Start condition Command from Sysmac Studio
ping Stop condition • Command from Sysmac Studio
• Occurrence of a major fault level Controller error
• User program download
• Clear All Memory operation 8
• Disconnecting online connection to Sysmac Studio
Operation modes • RUN Mode
l Number of Variables
You can specify a maximum of eight variables. This means differential monitoring can detect the
numbers of times conditions are met for eight variables in parallel.
l Specified Variables
The data types of the variables that you can specify for differential monitoring are given below.
• BOOL
• Elements of BOOL arrays
• BOOL members of structures or unions
l Condition Expressions
The condition of the change in the variable to detect is called the condition expression. There are
two types of condition expressions that you can select from. You specify a condition expression for
each variable.
• Change to TRUE
• Change to FALSE
For example, we will assume the condition expression was set to a change to TRUE. Even if
the value of the specified variable is TRUE when differential monitoring is started, the status of
the value of the variable is not detected as a change to TRUE. The value of the variable must
first change to FALSE and then to TRUE to be considered as a change to TRUE.
• Even if the value changes to match the condition expression more than one time within the
same primary period, the count will be incremented only once in each primary period.
• If the values of the variable are the same at the time of the previous and current evaluations,
the condition is not considered to be a match, even if the value changed between evalua-
tions.
Normally, use the Sysmac Studio to stop differential monitoring. Differential monitoring will stop auto-
matically at the following cases.
• When a major fault level Controller error occurs
• When the user program is downloaded
• When the Clear All Memory operation is performed
• When an online connection to the Sysmac Studio is disconnected
Operating Procedure
Use the following procedures to control differential monitoring. Refer to the Sysmac Studio Version 1
Operation Manual (Cat. No. W504) for details.
1 Select Differential Monitor from the View Menu on the Sysmac Studio.
2 Right-click a variable that can be specified for differential monitoring and select Add
Differential Monitor.
3 Set the differential monitoring condition expression for each variable in the Differential Monitor
Window.
8-6 Debugging
8
4
8-6-5 Differential Monitoring
Execute the user program.
The number of times that the condition is met for each variable is displayed in the Differential
Monitor Window.
The GVar1 global variable is read and written by the P1 program that is assigned to the primary
periodic task. Therefore, it will be updated in the primary period as long as the program writes to it
every period. The P2.GVar1 external variable, however, is updated only when the CPU Unit exe-
cutes the P2 program that is assigned to the periodic task. This means the external variable is up-
dated only in the task period of the periodic task. Because the task period of the periodic task is
longer than the primary periodic, the count for P2.GVar1 is updated fewer times than the count for
GVar1.
Number of times
condition for GVar1 is 0 1 2 3 4
met (change to TRUE)
Task period
Periodic task
(accessing task)
P2 P2 P2
P2.GVar1 TRUE
FALSE
(external
variable)
The value of the P2.GVar1 external variable is updated only when
P2 is executed.
Number of times
0 1 2
condition for P2.GVar1 is
met (change to TRUE)
8-6 Debugging
8
8-7-1 Introduction
The event logs contain records of events,* such as errors, status changes, and user-defined events,
that occurred in the NJ/NX-series Controller.
* Here, events are unscheduled events that occur on the Controller, such as errors. “Event” refers to
an error or to information that does not indicate an error but for which the user must be notified by the
Controller or for a user definition.
There are two types and four classifications of events.
• Controller events
Controller errors
Controller information
• User-defined events
User-defined errors
User-defined information
Battery
backup *1
You can check the current EtherCAT slave EtherCAT
Controller events and the event Terminal slave
log of past events.
Event logs
*1. The event logs are saved in battery-backup memory in the NX701 CPU Unit.
The event logs are saved in the non-volatile memory in the NX102 CPU Unit and NX1P2 CPU Unit.
• Only the NX102 CPU Units and NX1P2 CPU Units have the NX Bus Function Module.
• You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
• Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.
Or User program
Create User-defined
Error (SetAlarm)
Event logs instruction
Battery backup
You can check the current
Controller events and the event EtherCAT
slave
log of past events.
To use an NS-series PT to check events, connect the PT to the built-in EtherNet/IP port on the
CPU Unit.
• You can use CJ-series Units only with NJ-series CPU Units.
• Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.
8
Features
8-7-1 Introduction
Event logs have the following features.
• In addition to error records, various records are recorded for events such as the time the power sup-
ply is turned ON or OFF, and the time when operation is started.
• You can check these records based on the time. You can therefore use them to isolate the causes of
errors when problems occur.
Types of Events
Events are classified as shown below.
• Controller information
l User-defined Events
These are events that occur in applications that the user developed. You can execute instructions
to create the following types of events.
• User-defined errors
• User-defined information
You can read the event logs from the Sysmac Studio or from an HMI.
Event Sources
This information identifies where an event occurred in the Controller.
The event sources are given below for Controller events and user-defined events.
Category
This information displays the category of event log.
It is used to access error logs from the Sysmac Studio or an HMI.
Number of Records
Each event log can contain the following number of records.
If the number of events exceeds the number of records permitted, the CPU Unit overwrites the oldest
events.
For the CPU Unit that uses a Battery to retain the event logs, the event logs are not retained
when there is no Battery.
Periodically export event logs as required. 8
Event Levels
Each event has an "event level" that indicates its level.
The event level depends on the type of event. Levels are defined separately for Controller events and
user-defined events.
l Controller Events
Controller events are classified into five levels according to the degree of the effect that the events
have on control, as shown in the following table.
Errors with a higher level have a greater impact on the functions that the Controller provides, and
are more difficult to recover from.
When an event in one of these levels occurs, the Sysmac Studio or an HMI will display the error.
l User-defined Events
User-defined events are classified into the following levels. These levels are defined by the NJ/NX-
series System.
The event levels are defined for user-defined events.
The events in these logs are displayed in tables on the Sysmac Studio. Select an event from the table
to display detailed information.
Additional Information
If an event occurs in the Controller that is not supported by the version of the Sysmac Studio or
an HMI, the source is displayed as Unknown and the event name is displayed as Unknown
• If you need to delete event log in the CPU Unit from the Sysmac Studio or an HMI, make sure
you do not need any of the event information before you delete the event log. You may have
overlooked some important information and observation level Controller events or user-de-
fined events. Always check for these before you delete an event log.
• Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for restrictions on clear-
ing an event log from the PT.
Introduction
Controller errors and information are defined by the NJ/NX-series System.
These events occur when the NJ/NX-series System detects an error or information factor.
l Controller Errors
These are system-defined errors.
“Controller error” is a collective term for major fault level, partial fault level, minor fault level, and
observation level Controller events.
Errors in the function modules of the CPU Unit, NX Units, NX-series Slave Terminals, EtherCAT
slaves, and CJ-series Units are detected. When one of these events occurs, a Controller error is
recorded in the event log.
To check the status of a Controller error on the user program, you execute the Get Error Status
instruction to access the status of the Error Status variable, which is a system-defined variable.
Note You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
Note You can use CJ-series Units only on the NJ-series CPU Units.
Controller errors are not reset when the operating mode changes.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for details on Controller errors.
l Controller Information
Controller information is system-defined notification information. This information does not indicate
errors. It represents information level Controller events.
Examples include events other than errors, such as turning the power ON and OFF, starting and
stopping operation, connecting the Sysmac Studio online, and downloading user programs.
Function Modules
PLC Function
Module
Event logs
Motion Control
Function Module
An error or information occurs.
EtherCAT Controller events
Master Function
Module
EtherNet/IP
Function Module
System-defined variables
Errors in Special
Units Error status
Detected Controller errors
Errors in EtherCAT
slaves
l User-defined Information
User-defined information is user-defined notification information. This information does not indicate
errors.
Use the Create User-defined Information (SetInfo) instruction to create user-defined information.
When this instruction is executed, user-defined information is recorded in the event log.
System-defined Variables
Application Procedures
Use the following procedures.
l User-defined Errors
1. Register a user-defined error in the Event Setting Table.
4. The corresponding system-defined variable _AlarmFlag (User-defined Error Status) changes to TRUE.
Execute any process for that condition.
5. Check the user-defined error in the event log with the Sysmac Studio, an instruction, or an HMI.
l User-defined Information
1. Register user-defined information in the Event Setting Table.
Programming Example
SetAlarm
Normal end
EN ENO
Code OutVal
UINT#102
Var1 Info1
Var2 Info2
Additional Information
You can set up to nine different languages for the same event code for different regions and
users. On the Sysmac Studio, you can import an Event Setting Table from a Microsoft Excel file
via the clipboard.
Additional Information
Displaying User Messages on an HMI When a Major Fault Level Controller Error Occurs:
When a major fault level Controller error occurs, the user program execution stops.
The NJ/NX-series Controllers can display user messages on an HMI when a major fault level
Controller error occurs. You can set the display messages under the list of user-defined events
in the Event Setting Table on the Sysmac Studio.
If you update the Event Setting Table and transfer it to the CPU Unit, the event logs for user-
defined events still contain old information. This can result in inconsistencies with the new
Event Setting Table. Program operations with caution.
Example:
Level
Code
Additional Information
You can use user-defined errors to add a message on possible corrections or other information
when a Controller error occurs.
Use instructions such as the GetPLCError instruction to obtain information about the error sta-
tus or event code when a Controller error occurs. You can then use the information to trigger a
user-defined error.
Example 1
When a Low Battery Voltage error occurs, the event code (16#000B0000) is obtained and the
following message is displayed.
Battery is dead.
Apply power for at least five minutes before changing the Battery.
Install a new Battery within five minutes of turning OFF the power supply.
Example 2
When a partial fault level Controller error occurs, the event error level is obtained (highest level
status: 2) and the following message is displayed.
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are re-
quired to change event levels.
1 Double-click Operation Settings under Configurations and Setup - Controller Setup in the
Sysmac Studio. Or right-click Operation Settings and select Edit from the menu.
The Basic Settings Display is displayed on the Operation Setting Tab Page in the Edit Pane.
3 Change the levels of the required events in the Event Level column.
If you change an event level on the Sysmac Studio and download the event level setting to the
Controller when the event already exists on the Controller, the event will be reset when the
download is started. If the same event occurs again while the download is in progress, the
Controller will operate according to the previous event level. If the same event occurs after the
download is completed, the Controller will operate according to the new level.
Function Description
Backing up data You can back up all of the data in the Controller to an SD Memory Card or to a computer.
A file to save is called a backup file.
Restoring data You can transfer the contents of a backup file on the SD Memory Card or computer to
the Controller. All of the data in the Controller are replaced with the data when it is
backed up.
Verifying data You can compare the contents of a backup file on the SD Memory Card or computer with
the data in the Controller to see if they are the same.
Item Description
Applications of backup Effective usage of the backup functions is described.
functions
Examples of operating The backup functions are executed with simple procedures. Examples are provid-
procedures for the backup ed.
functions
Data that is backed up The data that can be saved with the backup functions from the connected Units
and slaves is described.
Types of backup functions There are different types of backup functions that differ in where the data is saved.
The types of backup functions and the difference between them are described.
• The performance may be different if the hardware revisions are different. Before you transfer
the user program, data, and parameter settings to the CPU Units with the different hardware
9
revisions, check them for proper execution and then use them for actual operation.
• For NX-series CPU Unit, we recommend that you back up the present values of variables
9-1-1 Applications of Backup Functions
• The client certificate and client private key that are related to the secure socket communica-
tions are information that are attached to the individual CPU Unit, therefore, the information
are out of the target of backup and restoration.
Transfer the client certificate and client private key to the CPU Unit when you replace the
hardware of the CPU Unit.
Similarly, the secure socket setting is also out of the target of backup and restoration. Use the
Secure Socket Configuration commands to make the setting to the CPU Unit.
• Network security issues such as the server data be illegally obtained or tampered, or commu-
nications to the server be disabled may occur due to theft, information leaks and tampering of
the client certificate, private key and secure socket setting by third parties.
Take necessary measures for the management of the client certificate, private key and se-
cure socket setting and for the prevention of theft, information leaks and tampering of those.
Especially, use an encrypted safe communications path, etc. when obtaining the private key
to avoid information leaks.
Furthermore, store the private key in a location where possibilities of leaks are eliminated as
much as possible.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506) for
information on the secure socket communications.
Item Application
Program and setting When you change the user program and settings for equipment that is currently in
changes operation.
Hardware replacements When you replace the hardware for the CPU Unit, other Units, or slaves.
Troubleshooting equip- When you want to save data in the Controller to analyze the cause of an error that
ment failures occurs in the equipment.
Equipment backup and When an error occurs in the equipment, and when you want to restore the equip-
recovery ment with data from a normal operating status. When you want to backup the data
in the equipment while it is in operation.
Manufacture of equipment When you want to manufacture the same equipment and need to transfer the data
from the existing equipment to new equipment in its initial state.
For the NX701 CPU Units, eight pins, pins 1 to 8, are provided on the DIP switch. Before you
use the backup functions, set all of pins 5 to 8 to OFF.
Backup Procedure
l Preparations
2 Set pins 1 to 4 on the DIP switch on the CPU Unit as follows: 1: OFF, 2: OFF, 3: ON, and 4:
OFF.
1 Set all of pins 1 to 4 on the DIP switch on the CPU Unit to OFF.
2 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.
Restoration Procedure
1 Turn OFF the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.
2 Insert the SD Memory Card that contains the backup file into the CPU Unit.
3 Set pins 1 to 4 on the DIP switch on the CPU Unit as follows: 1: OFF, 2: OFF, 3: ON, and 4:
ON.
9
l Restoring Data
Functions
9-1-2 Examples of Operating Procedures for the Backup
1 Turn ON the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.
The restoration operation is started. The SD PWR indicator will flash, lighting for 3 seconds
and going out for 0.5 seconds. When the restoration operation is completed, the SD PWR indi-
cator will stop flashing and remain lit.
1 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.
2 Turn OFF the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.
2 Set all of pins 1 to 4 on the DIP switch on the CPU Unit to OFF.
3 Turn ON the power supply to the NJ-series Controller and to the EtherCAT slaves.
Verification Procedure
l Preparations
1 Insert the SD Memory Card that contains the backup file into the CPU Unit.
2 Set all of pins 1 to 4 on the DIP switch on the CPU Unit to OFF.
1 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.
Operation method
CPU
Sys-
Unit
tem-de-
Function name Description front- Sysmac Reference
fined
panel Studio
varia-
DIP
bles
switch
SD Backing The Controller data is saved ¡ ¡ ¡ 9-2-1 Backup (Controller
Memory up data in a backup file on the SD to SD Memory Card) on
Card Memory Card. page 9-15
Backups Restor- The data in a backup file on ¡ ¡ 9-2-2 Restore (SD Memo-
ing data the SD Memory Card is ry Card to Controller) on
transferred to the Controller. page 9-20
Verify- The Controller data and the ¡ ¡ ¡ 9-2-3 Verify (between
ing data data in a backup file on the Controller and SD Memory
SD Memory Card are com- Card) on page 9-28
pared.
Disabling backups You can disable backing up ¡ 9-3 Disabling Backups to
to SD Memory data to SD Memory Cards. SD Memory Cards on
Cards page 9-34
Operation method
CPU
Sys-
Unit
tem-de-
Function name Description front- Sysmac Reference
fined
panel Studio
varia-
DIP
bles
switch
Automatic transfers When the power supply is ¡ 9-4 Automatic Transfers
from SD Memory turned ON, the data in a from SD Memory Cards on
Card backup file on the SD Mem- page 9-36
ory Card is automatically
transferred to the Controller.
After the data transfer, the
operating mode of the CPU
Unit will change to the mode
that is specified in Startup
Mode setting.
Program transfer With a system-defined varia- ¡ 9-5 Program Transfer from
from SD Memory ble, you can transfer a pro- SD Memory Card on page
Card gram that is stored in the SD 9-38
Memory Card to the Control-
ler.
After the transfer, the operat-
ing mode of the CPU Unit
will change to the mode that
is specified in Startup Mode
setting.
Operating method
CPU
Sys-
Unit
tem-de-
Function name Description front- Sysmac Reference
fined
panel Studio
varia-
DIP
bles
switch
Sysmac Backing The Controller data is saved ¡ 9-6-1 Backup (Controller
Studio up data in a backup file on the com- to Computer) on page
Controller puter. 9-46
backups Restor- The data in a backup file on ¡ 9-6-2 Restore (Computer
ing data the computer is transferred to Controller) on page
to the Controller. 9-47
Verify- The Controller data and the ¡ 9-6-3 Verify (between
ing data data in a backup file on the Controller and Computer)
computer are compared. on page 9-48
Importing Export- The data is exported from ¡ 9-7 Importing and Export-
and ex- ing data the project on the Sysmac ing Sysmac Studio Back-
porting Studio to a backup file with- up File Data on page
Sysmac out using a Controller. 9-50
Studio Import- The data in the backup file is ¡
backup ing data imported into the Sysmac
file data Studio project without using
a Controller.
Sysmac Backing You can back up the present ¡ 9-8 Sysmac Studio Varia-
Studio up data values of data that is backed ble and Memory Backup
variable up by a battery to an XML Functions on page 9-52
and mem- file on the computer.
ory back- Restor- You can restore the present ¡
up func- ing data values of data that is backed
tions up by a battery from the
computer to the CPU Unit.
Version Information
• A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are re-
quired to use the following backup functions: SD Memory Card backups, automatic transfers
from SD Memory Cards, Sysmac Studio Controller backups, and importing and exporting
Sysmac Studio backup file data.
• A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are re-
quired to transfer programs from the SD Memory Card.
• A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are re-
quired to use the restore of SD Memory Card backups by the system-defined variable.
Additional Information
The backup functions are executed as a system service. This means that if you perform a back-
up or verification operation in RUN mode with an NJ-series CPU Unit, it may take time for the
operation to be completed. If you perform a backup or verification operation in RUN mode,
make sure that the sufficient execution time is allocated for the system service. You can reduce
the processing time by performing the system service in PROGRAM mode.
Data group
User program and set- Present
tings values of Absolute
Present Units and
Type of backup function memory encoder
IP address of values of slaves set-
used for home off-
built-in Ether- variables tings
CJ-series sets
Net/IP port*2
Units*1
SD Memory Backing up ¡ ¡ ¡*3 ¡*4 ¡ ¡
Card back- data
ups Restoring ¡ ¡ ¡*3 ¡*4 ¡ ¡
data
Verifying ¡*5 ¡ × × ¡ ×
data
Automatic transfers from ¡ ¡ ¡*3 ¡*4 × ×
SD Memory Cards*6
Program transfer from SD ¡ ¡ ¡*3 ¡*4 × ×
Memory Card*7
Sysmac Backing up ¡ ¡ ¡*3 ¡*4 ¡*8 ¡
*6. For all of the data groups except for the user program and setting group, only the items that are specified to
be transferred in the automatic transfer command file are transferred.
*7. For all of the data groups, only the data that is specified as the transfer target by the system-defined varia-
ble is transferred.
*8. If the CJ-series Units are specified for backup, the parameters in the CJ-series Units are backed up. If the
EtherCAT slaves are specified for the backup, parameters for the EtherCAT slaves are backed up.
*9. The following data is not processed: The data that is not processed depends on the version of the Sysmac
Studio.
Using Sysmac Studio Version 1.16 or Higher
The built-in EtherNet/IP port name in the Controller name
Words allocated to CPU Bus Units in the Unit Configuration and Unit Settings
Operation authority verification
Data Trace Settings
Using Sysmac Studio Version 1.15 or Lower
The built-in EtherNet/IP port name in the Controller name
The built-in EtherNet/IP tag data link settings in the Controller Setup
Words allocated to CPU Bus Units in the Unit Configuration and Unit Settings
Operation authority verification
Data Trace Settings
Additional Information
The files that are handled for backing up variables and memory from the Sysmac Studio are not
compatible with other backup files.
Refer to9-8 Sysmac Studio Variable and Memory Backup Functions on page 9-52for details on
the Sysmac Studio variable and memory backup functions.
Units/slaves
NX Units CJ-series Units*4
Type of backup func- NJ/NX- Comput-
EtherCAT on the Units and EtherNet/
tion series er and
slaves*1 CPU Master Slaves IP slaves
CPU Unit HMIs
Unit*2*3 Units
SD Memory Card ¡ ¡*3 ¡ ¡ × × ×
backups
Automatic transfers ¡ × × × × × ×
from SD Memory Card
Program transfer from ¡ × × × × × ×
SD Memory Card
Sysmac Studio Con- ¡ ¡*3 ¡ ¡ × × ×
troller backups
Importing and export- ¡ ¡*5 ¡ × × × ×
ing backup file data on
Sysmac Studio
Units/slaves
NX Units CJ-series Units*4
Type of backup func- NJ/NX- Comput-
EtherCAT on the Units and EtherNet/
tion series er and
slaves*1 CPU Master Slaves IP slaves
CPU Unit HMIs
Unit*2*3 Units
Variable and memory ¡ × × × × × ×
backup functions of
Sysmac Studio
*1. EtherCAT Slave Terminals are included. If EtherCAT Slave Terminals are set for backup, the backup func-
tion applies to both the EtherCAT Coupler Unit and the NX Units.
*2. You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
*3. This does not apply to Safety Control Units. Refer to the NX-series Safety Control Unit User’s Manual (Cat.
No. Z930-E1-12 or later) for information on importing and exporting settings and safety unit restore settings
for a Safety Control Unit.
*4. You can use CJ-series Units only on the NJ-series CPU Units.
*5. Only importing data is possible. Exporting is not possible.
The Units and slaves that are shown in the following figure are covered by the SD Memory Card back-
up functions and Sysmac Studio Controller backup functions.
Computer HMI
Slaves
EtherCAT slaves
9
9-1-6 Applicable Range of the Backup Functions
Note You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
Note You can use CJ-series Units and NJ-series Expansion Racks only with the NJ-series CPU Unit.
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to connect EtherCAT Slave Terminals.
Backing up data
Restoring data Data that is
Verifying data backed up
Backup file
Restore command file
Automatic transfer command file
Verification results files
When you back up data, the Backup file, Restore command file, and Automatic transfer command file
are created in the specified directory on the SD Memory Card. When you verify data, the Verification
results files are created in the specified directory.
All of these files are collectively referred to as Backup-related files.
The functions of the backup-related files are given in the following table.
Function
File Backing up Restoring da- Verifying da-
Description
data ta ta
Backup file This file contains the Controller data Created. Accessed. Accessed.
that is handled by the functions that
are related to data backup.
Restore command This file specifies the data groups to Created. Accessed. Accessed.
file restore when restoring data.You can
edit this file with a text editor on a
computer to specify the data groups to
restore.
Automatic transfer This file specifies the data groups to Created. Nothing is Nothing is
command file transfer when automatically transfer- done. done.
ring data from an SD Memory Card.
You can edit this file with a text editor
on a computer to specify the data
groups to transfer.
Verification results These files contain the verification re- Nothing is Nothing is Created.
files sults after data is verified. done. done.
The execution method for the functions, applicable directory, and applicable operating modes are giv-
en in the following table.
• The SD Memory Card will remain mounted after completion of the backup.
Procedure
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 sec-
onds. Press the SD Memory Card power supply switch so that the indicator will light.
*1. For the NX701 CPU Unit, set all of pins 5 to 8 on the DIP switch to OFF.
*2. If an SD Memory Card is not inserted, the SD PWR indicator will not light.
The backup operation starts when you change the _Card1BkupCmd.ExecBkup (Exe-
cute Backup Flag) system-defined variable to TRUE.
Cancel command You can cancel the backup operation.
The backup operation ends in an error if you change the _Card1BkupCmd.CancelBk-
up (Cancel Backup Flag) system-defined variable to TRUE.
Executing The _Card1BkupSta.Active (Active Flag) system-defined variable changes to TRUE.
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable
will change to TRUE.
Execution results Normal End:
The _Card1BkupSta.Done (Done Flag) system-defined variable changes to TRUE.
Error End:
The _Card1BkupSta.Err (Error Flag) system-defined variable changes to TRUE.
Note Do not use this system-defined variable from the user program.
l Backing Up Data from the SD Memory Card Window on the Sysmac Studio
Processing stage Procedure
Start command Click the SD Memory Card Backup Button on the SD Memory Card Window in the
Sysmac Studio, specify the directory to save the backup file in, and execute the back-
up.
Executing The progress of the backup is displayed in the dialog box.
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable
will change to TRUE.
Execution results A message will appear when the backup is completed. You will then be asked to con-
firm whether to verify the backup data.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Error End:
The value of the Error output variable from the BackupToMemoryCard instruction
changes to TRUE.
The error code is stored in the ErrorID output variable from the BackupToMemoryCard
instruction.
Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are re-
quired to use the BackupToMemoryCard instruction.
Variable name
Meaning Function Data type R/W
Member name
_Card1BkupCmd*1 SD Memory Card _sBKUP_CMD RW
Backup Commands
ExecBkup*1 Execute Backup Change this variable to TRUE to BOOL RW
Flag back up Controller data to an SD
9
Memory Card. 9-2-1 Backup (Controller to SD Memory Card)
CancelBkup*1 Cancel Backup Flag Change this variable to TRUE to can- BOOL RW
cel backing up data to an SD Memory
Card.
DirName*1 Directory Name Use this variable to specify the direc- STRING(64) RW
tory name in the SD Memory Card for
which to back up data.
_Card1BkupSta*1 SD Memory Card _sBKUP_STA R
Backup Status
Done*1 Done Flag TRUE when a backup is completed. BOOL R
Additional Information
• Refer to the NA-series Programmable Terminal Software User’s Manual (Cat. No. V118) for
information on mapping variables when you connect an NA-series PT to the NJ/NX-series
Controller.
• Refer to A-11 Registering a Symbol Table on the CX-Designer on page A-234 for the proce-
dure to register these system-defined variables in the variable table of the CX-Designer when
you connect an NS-series PT to the NJ/NX-series Controller.
Timing Charts
The operation of the system-defined variables when they are used to backup data is shown below.
In the charts, “pre-execution checks” indicates processing to check whether there is an SD Memory
Card in the CPU Unit and other items before the backup starts. The value of _Card1BkupSta.Active
(Active Flag) changes to TRUE only after all of the pre-execution checks are cleared and the actual
backup is started.
l Normal Operation
Backup start Pre-execution
command checks cleared. Normal end
_Card1BkupCmd.ExecBkup TRUE
FALSE
_Card1BkupCmd.CancelBkup TRUE
FALSE
_Card1BkupSta.Done TRUE
FALSE
_Card1BkupSta.Active TRUE
FALSE
_Card1BkupSta.Err TRUE
FALSE
_BackupBusy TRUE
FALSE
l Operation When the Backup Cannot Start Because Another Backup Func-
tion Is in Progress
Backup start Pre-execution
command checks not cleared.
TRUE
_Card1BkupCmd.ExecBkup
FALSE
_Card1BkupCmd.CancelBkup TRUE
FALSE
_Card1BkupSta.Done TRUE
FALSE
TRUE
_Card1BkupSta.Active
FALSE
TRUE
_Card1BkupSta.Err
FALSE
_BackupBusy TRUE
FALSE
_Card1BkupSta.Done TRUE
FALSE
TRUE
_Card1BkupSta.Active
FALSE
TRUE
_Card1BkupSta.Err
FALSE
TRUE
_BackupBusy
FALSE
Backup cancel
command
Backup start Pre-execution Backup stopped
command checks cleared. with an error.
_Card1BkupCmd.ExecBkup TRUE
FALSE
TRUE
_Card1BkupCmd.CancelBkup
FALSE
The transfer starts when the power supply is turned ON with the CPU Unit front-panel DIP switch. You
can specify data to restore by the restore command file. You cannot specify the source directory for
backup-related files. The backup file to restore must be stored in the root directory on the SD Memory
Card.
With system-defined variables, you can specify the data to restore and source directory for backup-
related files, and give a command to start the transfer by a system-defined variable. You can specify
whether to use this function or not and set a password in the Controller Setup. You can use this func-
tion to operate the CPU Unit with the data in a backup file on the SD Memory Card, by operating an
HMI.
Processing Contents
The following describes the processing contents for restoring data with the CPU Unit front-panel DIP
switch and with system-defined variables.
• After the operation is completed, the operating mode will change to PROGRAM mode. You cannot
start operation in this state. To start operation, turn OFF all DIP switch pins and then cycle the power
supply to the Controller or reset the Controller.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
• While the data is being restored, the CPU Unit will be in startup state.
• If an error occurs in the checks that are performed before starting to restore the data, the previous
data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being restored, aUser Program/
Controller Configurations and Setup Transfer Error (a major fault level Controller error)will occur. If
that occurs, the data in the Controller is not dependable. Use one of the following methods to clear
the error.
• Perform the restore operation again.
• Clear all of memory and then download the project from the Sysmac Studio.
• If the configuration for Units and slaves in the backup file does not match the actual configuration
where data is restored, a Restore Execution Error will occur when you restore the data.
• The restore operation is possible even if the Option Board configuration in the backup file do not
match the actual configuration where data is restored. However, the Option Board does not operate.
Refer to theNX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual(Cat. No.
W579) for details.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be restored, the previous present values of those variables will be retained. However, the values of
any variables that do not meet the retain conditions are initialized. These are the retain conditions
• The data to be restored is the group of data specified with the system-defined variable. A
specification of the restore command file (RestoreCommand.ini) is not affected. Refer toRe-
lated System-defined Variables on page 9-25for details on the related system-defined varia-
bles.
• To prevent an unexpected restoration, set to enter the password every time before the restore
operation.
• Executing this function automatically resets the Controller. The outputs during the Controller
reset behave according to the slave and Unit specifications. Also, during the Controller reset,
variables in the Controller cannot be accessed from the outside.
• If a variable on the Controller that was accessed before the transfer is deleted by the restora-
tion, the system-defined variables may not be accessed because the deleted variable cannot
be recovered by an HMI. For example with an NS-series PT, if the tag verification result finds
any inconsistency, the list of tag verification result is displayed and the screen cannot be
changed to others. Confirm, in advance, no variables that are used on the HMI are deleted.
• If the power is interrupted while this function is in progress, a User Program/Controller Con-
figurations and Setup Transfer Error (event code 10200000 hex) or other errors may occur.
• You cannot execute the restore by the system-defined variable after you transfer a backup file
for whichRestore by system-defined variableis set toDo not usein the Controller Setup. If
you intend to continue restoring, transfer a backup file for which the above setting is set
toUse.
• You cannot execute other backup function while a restore operation is in progress.
• With the _Card1RestoreCmd (SD Memory Card Restore Command) system-defined variable, you
can transfer the data saved in the SD Memory Card that is mounted on the CPU Unit to the Control-
ler.
• The backup file to be restored is the file stored in the directory specified with the system-defined var-
iable. The target backup file must be stored in a directory on the SD Memory Card in advance.
• If the password set on thePasswordof theSD Memory Card Restore Settingdiffers from the pass-
word set in the _Card1RestoreCmd.Password system-defined variable, the Restore Operation
Failed to Start error occurs.
• When the restore is started, the password set in the _Card1RestoreCmd.Password system-defined
variable is initialized.
• The Controller is automatically reset during the restore operation.
• After the Controller reset, the CPU Unit will be in startup state. After the restore operation is com-
pleted, the operating mode will change to PROGRAM mode. You cannot start operation in this state.
To start operation, cycle the power supply to the Controller or reset the Controller.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
• If an error occurs in the checks that are performed before starting the restore operation or in the pre-
execution checks, the previous data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being restored, a User Program/
Controller Configurations and Setup Transfer Error (a major fault level Controller error) will occur. If
that occurs, the data in the Controller is not dependable. Use one of the following methods to clear
the error.
• Perform the restore operation again.
• Clear all of memory and then download the project from the Sysmac Studio.
• All data items that are not specified for the restore will retain their present values.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be transferred, the previous present values of those variables will be retained. However, the values
of any variables that do not meet the retain conditions are initialized. These are the retain conditions
for the variable:
• The variable name, data type name, and data type size must be the same before and after trans-
ferring the data.
• If the present values of memory for CJ-series Units are not set to be restored in the NX102 CPU
Unit or NX1P2 CPU Unit, the previous present values in the DM, EM and Holding Areas will be re-
tained. However, when the DM, EM and Holding Areas are newly generated or the area is expand-
ed, the values in those areas will be the initial values.
• The power is continued to supply even if the SD Memory Card power supply switch is pressed when
a restore operation is in progress.
• The SD Memory Card will remain mounted after completion of the restore operation.
• The write protection for the CPU Unit that is set in the Write Protection at Startup setting is used
after completion of the restore operation.
Procedure
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 sec-
onds. The indicator stop flashing and stay lit when the SD Memory Card power supply
switch is pressed. *2
*1. For the NX701 CPU Unit, set all of pins 5 to 8 on the DIP switch to OFF. 9
*2. If an SD Memory Card is not inserted, the SD PWR indicator will not light.
9-2-2 Restore (SD Memory Card to Controller)
l Restoring Data with the _Card1RestoreCmd (SD Memory Card Restore
Command) System-defined Variable
Processing stage Procedure
Pre-start prepara- To use the restore by the system-defined variable, set to use the Restore by system-
tion defined variable in the Controller Setup. *1
*2. The password is initialized when the restore by the system-defined variable is started. Specify a pass-
word every time you start a restore.
If a password is not set on the Password of the SD Memory Card Restore Setting on the Controller Set-
up, the restore is started when the value of the _Card1RestoreCmd.Password system-defined variable is
the initial value. The restore is not started if the value is not the initial value.
*3. The IP address means setting type, IP address, subnet mask, and default gateway.
*4. If an SD Memory Card is not inserted, the SD PWR indicator will not light.
Variable name
Meaning Function Data type R/W
Member name
_Card1RestoreCmd SD Memory Card _sRES- RW
Restore Com- TORE_CMD
mand
Exec Execute Restore Change this variable to TRUE to re- BOOL RW
Flag store the data in a backup file on the
SD Memory Card to the Controller.
DirName Directory Name Use this variable to specify the direc- STRING(64) RW
tory name in the SD Memory Card in
which the backup file to be restored
Additional Information
• Refer to the NA-series Programmable Terminal Software User’s Manual (Cat. No. V118) for
information on mapping variables when you connect an NA-series PT to the NJ/NX-series
Controller.
• Refer to A-11 Registering a Symbol Table on the CX-Designer on page A-234 for the proce-
dure to register these system-defined variables in the variable table of the CX-Designer when
you connect an NS-series PT to the NJ/NX-series Controller.
Timing Charts
The operation of the system-defined variables when they are used for the restart of SD Memory Card
backups is shown below.
In the charts, “checks performed before starting” indicates the processing performed before the re-
store operation to check whether the password matches. The value of _Card1PrgRestoreSta.Active
(Active Flag) changes to TRUE only after the checks performed before starting result in OK.
l Normal Operation
Restore Checks
start before starting
command a restore was Controller
OK. reset Normal end
TRUE
_Card1RestoreCmd.Exec FALSE
Setting Initial
_Card1RestoreCmd.Password Initial Setting value
value
TRUE
_Card1RestoreSta.Done FALSE
TRUE
_Card1RestoreSta.Active FALSE
TRUE
_Card1RestoreSta.Err FALSE
_BackupBusy TRUE
FALSE
_BackupBusy TRUE
FALSE
TRUE
_Card1RestoreSta.Active FALSE
TRUE
_Card1RestoreSta.Err FALSE
_BackupBusy TRUE
FALSE
Processing Time
The time that is required to restore the data depends on factors such as the CPU Unit, Unit configura-
tion, and user program. Guidelines for the restoration time are given in the following table.
Connected Number of
Connected Connected User program
NX Units or user-de- Restoration
CPU Unit EtherCAT Option memory size
CJ-series fined time (s)
slaves Boards (MB)
Units POUs
NX701-££££ *1 *3 --- 113 7.13 Approx. 50
NX102-££££ *2 *3 --- 15 0.37 Approx. 70
NX1P2-££££ *2 *3 *4 15 0.35 Approx. 60
NJ501-££££ *1 *5 --- 53 2.36 Approx. 100
NJ301-££££ *6 --- 20 0.53 Approx. 70
NJ101-££££ *2 --- 15 0.38 Approx. 70
*1. Thirty-two each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1611 Digital I/O Terminals, and GX-OD1611
Digital I/O Terminals.
*2. Two each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1600 Digital I/O Terminals, and GX-OD1611 Digital
I/O Terminals.
*3. One NX-PF0630 Additional I/O Power Supply Unit, three NX-ID5342 Digital Input Units, two NX-OD3153 Digital Output
Units, one NX-AD4608 Analog Input Unit, and one NX-DA3605 Analog Output Unit.
*4. Two NX1W-CIF01 Serial Communications Option Boards.
*5. Four CJ1W-SCU22 Serial Communications Units and one CJ1W-EIP21 EtherNet/IP Unit.
*6. Eight each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1611 Digital I/O Terminals, and GX-OD1611 Digi-
tal I/O Terminals.
Processing Contents
• The Controller data and the data in a backup file that is saved in the specified directory of the SD
Memory Card are compared.
• The data groups that are processed by the restoration operation are specified in the RestoreCom-
mand.ini file (restore command file).
• The present values of variables, the present values in memory used for the CJ-series Units, and the
absolute encoder home offsets are not compared because these values may change while the veri-
fication is in process.
• When you verify the data, the verification results file (VerifyResult.log) is created in the specified di-
rectory. The verification results are stored in this file. If a verification results file already exists in the
specified directory, it will be overwritten. However, if the SD Memory Card is write-protected, the ver-
ification results files will not be created.
• If there is not a restore command file in the specified directory of the SD Memory Card, all of the
data from the backup files in the specified directory that can be compared will be compared.
• If the Unit and slave configuration in the backup file is not the same as the actual configuration of
the Controller, a Verification Error will occur.
• The SD Memory Card will remain mounted after completion of the verification operation.
Procedure
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 sec-
l Verifying Data with the _Card1BkupCmd (SD Memory Card Backup Com-
mand) System-defined Variable
Processing stage Procedure
Start command The name of the directory where the files are saved is stored in the
_Card1BkupCmd.DirName (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory. 9
The verification operation starts when you change the _Card1BkupCmd.ExecVefy 9-2-3 Verify (between Controller and SD Memory Card)
(Execute Verify Flag) system-defined variable to TRUE.
Cancel command You can cancel the verification operation.
The verification operation ends in an error if you change the _Card1BkupCmd.Cancel-
Vefy (Cancel Verify Flag) system-defined variable to TRUE.
Executing The _Card1VefySta.Active (Active Flag) system-defined variable changes to TRUE.
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable
will change to TRUE.
Error End:
The _Card1BkupSta.Err (Error Flag) system-defined variable changes to TRUE.
Note Do not use this system-defined variable from the user program.
l Verifying Data from the SD Memory Card Window on the Sysmac Studio
Processing stage Procedure
Start command Click the Compare SD Memory Card Backup Button on the SD Memory Card Win-
dow in Sysmac Studio, specify the directory that contains the file to compare, and ex-
ecute the verification.
Executing The progress of the verification is displayed in the dialog box. The value of the _Back-
upBusy (Backup Function Busy Flag) system-defined variable will change to TRUE.
The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
Execution results The results of the verification are displayed in the dialog box.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Variable name
Meaning Function Data type R/W
Member name
_Card1BkupCmd*1 SD Memory Card _sBKUP_CMD RW
Backup Com-
mands
ExecVefy*1 Execute Verify Change this variable to TRUE to BOOL RW
Flag compare the Controller data to a
backup file in the SD Memory Card.
CancelVefy*1 Cancel Verify Change this variable to TRUE to can- BOOL RW
Flag cel comparing the Controller data to a
backup file in the SD Memory Card.
DirName*1 Directory Name Use this variable to specify the direc- STRING(64) RW
tory name in the SD Memory Card for
which to back up data.
_Card1VefySta*1 SD Memory Card _sVEFY_STA R
Verify Status
Variable name
Meaning Function Data type R/W
Member name
Done*1 Done Flag TRUE when a verification is complet- BOOL R
ed.
Active*1 Active Flag TRUE when a verification is in prog- BOOL R
ress.
VefyRslt*1 Verify Result Flag TRUE if the data was the same. BOOL R
FALSE if differences were found.
Err*1 Error Flag TRUE when processing a verification BOOL R
ended in an error.
_BackupBusy Backup Function TRUE when a backup, restoration, or BOOL R
Busy Flag verification is in progress.
*1. Do not use this system-defined variable from the user program.
Additional Information
• Refer to the NA-series Programmable Terminal Software User’s Manual (Cat. No. V118) for
information on mapping variables when you connect an NA-series PT to the NJ/NX-series
Controller.
• Refer to A-11 Registering a Symbol Table on the CX-Designer on page A-234 for the proce-
dure to register these system-defined variables in the variable table of the CX-Designer when
you connect an NS-series PT to the NJ/NX-series Controller.
Timing Charts
TRUE
_Card1VefySta.Done
FALSE
TRUE
_Card1VefySta.Active
FALSE
_Card1VefySta.Rslt TRUE
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE
_Card1VefySta.Err TRUE
FALSE
_BackupBusy TRUE
FALSE
_Card1VefySta.Done TRUE
FALSE
_Card1VefySta.Active TRUE
FALSE
TRUE
_Card1VefySta.Rslt
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE
_Card1VefySta.Done TRUE
FALSE
_Card1VefySta.Active TRUE
FALSE
_Card1VefySta.Rslt TRUE
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE
Verification
canceled.
Verification Pre-execution Verification stopped
start command checks cleared. with an error.
_Card1BkupCmd.ExecVefy TRUE
FALSE
TRUE
_Card1BkupCmd.CancelVefy
FALSE
_Card1VefySta.Done TRUE
FALSE
TRUE
_Card1VefySta.Active
FALSE
_Card1VefySta.Rslt TRUE
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE
The following three functions are applicable for disabling backup to SD Memory Card.
• Backups using the CPU Unit front-panel DIP switch
• Backups using system-defined variables
• Backups from the SD Memory Card Window on the Sysmac Studio
Backup function using the BackupToMemoryCard instruction is not applicable. This means that you
can backup data using the BackupToMemoryCard instruction even if the Prohibit data backup to the
SD Memory Card setting is set to be used.
Use the following procedure to set the Prohibit data backup to the SD Memory Card setting.
Select the Use Option for the Prohibit data backup to the SD Memory Card setting in the Basic Set-
tings Display of the Operation Settings Tab Page under Configurations and Setup − Controller
Setup on the Sysmac Studio.
Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are re-
quired to use the BackupToMemoryCard instruction.
The automatic transfer uses a backup file that is created with the backup function and an automatic
transfer command file. Save both files in the /autoload directory in advance.
File Function
Backup file This file contains the Controller data that is handled by the functions that are relat-
ed to data backup.
Automatic transfer com- This file specifies the data groups to transfer when transferring data from an SD
mand file Memory Card. You can edit this file with a text editor on a computer to specify the
data groups to transfer.
The following tables gives the procedure, the applicable directory, and the timing at which the transfer
is executed.
Processing Contents
• When the power is turned ON, the data in the backup file in the /autoload directory on the SD Mem-
ory Card is automatically transferred to the Controller.
• The automatic transfer function transfers the data in the data groups that are specified in the Aut-
loadCommand.ini file in the /autoload directory. Refer to 9-13-4 Specifications of an Automatic
Transfer Command File on page 9-72 for details on the automatic transfer command file.
• If an AutoloadCommand.ini file is not in the /autoload directory on the SD Memory Card, all of the
data from the backup file in the /autoload directory that can be transferred will be transferred.
• The operating mode that is set in the Startup Mode setting in the Controller Setup is used after com-
pletion of the automatic transfer.
• While the data is being automatically transferred, the CPU Unit will be in startup state.
• If an error occurs in the checks that are performed before starting the automatic transfer, the previ-
ous data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being automatically transferred, a
User Program/Controller Configurations and Setup Transfer Error (a major fault level Controller er-
ror) will occur. If that occurs, the data in the Controller is not dependable. Use one of the following
methods to clear the error.
• Perform the automatic transfer again.
• Clear all of memory and then download the project from the Sysmac Studio.
• All data items that are not specified for the automatic transfer will retain their present values.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be transferred, the previous present values of those variables will be retained. However, the values
of any variables that do not meet the retain conditions are initialized. These are the retain conditions
for the variable:
• The variable name, data type name, and data type size must be the same before and after trans-
ferring the data.
• For the NX102 CPU Unit and NX1P2 CPU Unit, memory for CJ-series Units is generated by the set-
tings in the Memory Settings for CJ-series CPU Units in the backup file.
• If the present values of memory for CJ-series Units are not set to be restored in the NX102 CPU
Procedure
Error End:
The RUN indicator goes out, the ERR indicator lights, and a major fault level Control-
ler error occurs.
The SD PWR indicator will light. *2
*1. For the NX701 CPU Unit, set all of pins 5 to 8 on the DIP switch to OFF.
*2. If an SD Memory Card is not inserted, the SD PWR indicator will not light.
Backup file
The transfer uses a backup file that is created with the backup function. Save the backup file in a di-
rectory on the SD Memory Card in advance.
Use the system-defined variable to specify the directory that contains the backup file.
File Function
Backup file This file contains the Controller data that is handled by the functions that are related to
data backup.
The execution method for the functions, applicable directory, and applicable operating modes are giv-
en in the following table.
• When you use this function to transfer a program whose Startup Mode setting is set to RUN
mode, the operating mode changes to RUN after the transfer is completed regardless of the
status and setting before the transfer. Use this function after you confirm that system startup
does not cause any problem.
• To prevent an unexpected transfer of a program, set to enter the password every time before
a transfer.
• Executing this function automatically resets the Controller. The outputs during the Controller
reset behave according to the slave and Unit specifications. Also, during the Controller reset,
variables in the Controller cannot be accessed from the outside.
• When an EtherCAT slave is used or a motion control is executed, an error may occur in the
EtherCAT Master Function Module or Motion Control Function Module after the program
transfer is completed. If an error occurs, reset the error after the program transfer is complet-
ed. Refer to sample programming for the ResetMCError instruction in the NJ/NX-series
Instructions Reference Manual (Cat. No. W502) for details on resetting errors in the user
program.
• If a variable on the Controller that was accessed before the transfer is deleted by the program
transfer, the system-defined variables may not be accessed because the deleted variable
cannot be recovered by an HMI. For example with an NS-series PT, if the tag verification re-
sult finds any inconsistency, the list of tag verification result is displayed and the screen can-
not be changed to others. Confirm, in advance, no variables that are used on the HMI are
deleted.
Processing Contents
• With the _Card1PrgTransferCmd (SD Memory Card Program Transfer Command) system-defined
variable, you can transfer a program saved in the SD Memory Card that is mounted on the CPU Unit
to the Controller.
• The backup file of the programs to be transferred is the file stored in the directory specified with the
system-defined variable. The target backup file must be stored in a directory on the SD Memory 9
Card in advance.
• The data of the programs to be transferred is the group of data specified with the system-defined
variable. Refer to Related System-defined Variables on page 9-42 for details on the related sys-
tem-defined variables.
• If the password set on the Password of the SD Memory Card Program Transfer Setting differs
from the password set in the _Card1PrgTransferCmd.Password system-defined variable, the SD
Memory Card Program Transfer Failed to Start error occurs.
• When the program transfer is started, the password set in _Card1PrgTransferCmd.Password sys-
tem-defined variable is initialized.
• The Controller is automatically reset during the program transfer. The outputs during the Controller
reset behave according to the slave and Unit specifications.
• After the Controller reset, the CPU Unit will be in startup state. Then when the program transfer is
completed, the CPU Unit will be in normal operation state and operate in the operating mode set in
the Startup Mode setting in the Controller Setup, which was transferred by the program transfer
function.
However, the CPU Unit will operate in PROGRAM mode when the CPU Unit front-panel DIP switch
is set to the Safe Mode.
• If an error occurs in the checks that are performed before starting the program transfer or in the pre-
execution checks, the previous data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the user program transfer is in progress, a
User Program/Controller Configurations and Setup Transfer Error (a major fault level Controller
error) will occur. If that occurs, the data in the Controller is not dependable. Use one of the following
methods to clear the error.
• Transfer the programs from the SD Memory Card again.
• Use the automatic transfer from SD Memory Card function, or restore with SD Memory Card
backup function.
• Clear all of memory and then download the project from the Sysmac Studio.
• All data items that are not specified for the program transfer will retain their present values.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be transferred, the previous present values of those variables will be retained. However, the values
of any variables that do not meet the retain conditions are initialized. These are the retain conditions
for the variable:
• The variable name, data type name, and data type size must be the same before and after trans-
ferring the data.
• For the NX102 CPU Unit and NX1P2 CPU Unit, memory for CJ-series Units is generated by the set-
tings in the Memory Settings for CJ-series CPU Units in the backup file.
• If the present values of memory for CJ-series Units are not set to be restored in the NX102 CPU
Unit or NX1P2 CPU Unit, the previous present values in the DM, EM and Holding Areas will be re-
tained. However, when the DM, EM and Holding Areas are newly generated or the area is expand-
ed, the values in those areas will be the initial values.
• The power is continued to supply even if the SD Memory Card power supply switch is pressed while
the program transfer is in progress.
• The SD Memory Card will remain mounted after completion of the program transfer operation.
• The write protection for the CPU Unit that is set in the Write Protection at Startup setting is used
after completion of the program transfer operation.
Procedure
Processing
Procedure
stage
Start command Specify the name of the directory where the backup files are saved in the
_Card1PrgTransferCmd.DirName (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory.
Specify a password in the _Card1PrgTransferCmd.Password (Password) system-de-
fined variable. *2
Change the _Card1PrgTransferCmd.TargetIPAdr (IP Address Transfer Flag) system-de-
fined variable to TRUE to specify the built-in EtherNet/IP port settings as the transfer
target. *3
Change the _Card1PrgTransferCmd.TargetVariable (Present Values of Variables with
the Retain Attribute Transfer Flag) system-defined variable to TRUE to specify the
present values of variables with the Retain attribute as the transfer target.
Change the _Card1PrgTransferCmd.TargetMemory (Present Values of Memory Used
for CJ-series Units with the Retain Attribute Transfer Flag) system-defined variable to
TRUE to specify the present values of the memory used for CJ-series Units with the Re-
tain attribute as the transfer target.
Change the _Card1PrgTransferCmd.Exec (Execute Program Transfer Flag) system-de-
fined variable to TRUE to start the transfer operation.
Executing The _BackupBusy (Backup Function Busy Flag) system-defined variable changes to
TRUE.
*4. If an SD Memory Card is not inserted, the SD PWR indicator will not light.
Variable name
Meaning Function Data type R/W
Member name
_Card1PrgTrans- SD Memory Card _sPRGTRANS- RW
ferCmd Program Transfer FER_CMD
Command
Exec Execute Program Change this variable to TRUE to BOOL RW
Transfer Flag transfer the data in a backup file on
the SD Memory Card to the Control-
ler by using the function to transfer
programs from the SD Memory Card.
DirName Directory Name Use this variable to specify the direc- STRING(64) RW
tory name in the SD Memory Card for
which to back up data.
Password Password Use this variable to specify the pass- STRING(33) RW
word that is used for verification
when you start transferring the pro-
grams.
The password is initialized every time
you start transferring programs from
the SD Memory Card.
TargetUserPro- User Program Change this variable to TRUE to set BOOL RW
gram and Settings a user program or setting as the
Transfer Flag*1 transfer target.
Always set this variable to TRUE for
transferring programs from SD Mem-
ory Card.
TargetIPAdr IP Address Change this variable to TRUE to in- BOOL RW
Transfer Flag clude the IP address of the built-in
EtherNet/IP port as the transfer tar-
get.
The IP address means setting type,
IP address, subnet mask, and default
gateway.
TargetVariable Present Values of Change this variable to TRUE to set BOOL RW
Variables with the the present values of variables with
Retain Attribute the Retain attribute as the transfer
Transfer Flag target.
TargetMemory Present Values of Change this variable to TRUE to set BOOL RW
Memory Used for the present values of the memory
CJ-series Units used for CJ-series Units with the Re-
with the Retain tain attribute as the transfer target.
Attribute Transfer
Flag
_Card1PrgTransfer- SD Memory Card _sPRGTRANS- R
Sta Program Transfer FER_STA
Status
Variable name
Meaning Function Data type R/W
Member name
Done Done Flag TRUE when a program transfer is BOOL R
completed.
Active Active Flag TRUE when a program transfer is in BOOL R
progress.
Err Error Flag TRUE when a program transfer BOOL R
ended in an error.
*1. The data in the user program and setting data groups is the target of settings. However, the IP address for
the built-in EtherNet/IP port is set with the IP Address Transfer Flag.
Additional Information
• Refer to the NA-series Programmable Terminal Software User’s Manual (Cat. No. V118) for
information on mapping variables when you connect an NA-series PT to the NJ/NX-series
Controller.
• Refer to A-11 Registering a Symbol Table on the CX-Designer on page A-234 for the proce-
dure to register these system-defined variables in the variable table of the CX-Designer when
you connect an NS-series PT to the NJ/NX-series Controller.
l Normal Operation
Program Checks
transfer before starting
start a transfer was Controller
command OK. reset Normal end
TRUE
_Card1PrgTransferCmd.Exec FALSE
Setting Initial 9
_Card1PrgTransferCmd.Password Initial Setting value
value
TRUE
_Card1PrgTransferSta.Done FALSE
TRUE
_Card1PrgTransferSta.Active FALSE
TRUE
_Card1PrgTransferSta.Err FALSE
_BackupBusy TRUE
FALSE
TRUE
_Card1PrgTransferSta.Active FALSE
TRUE
_Card1PrgTransferSta.Err FALSE
_BackupBusy TRUE
FALSE
l Operation When the Program Transfer Fails After a Normal Start of Pro-
gram Transfer
Program Checks before
transfer starting a
start transfer was Controller Error occurred before
command OK. reset or during execution.
TRUE
_Card1PrgTransferCmd.Exec FALSE
Setting Initial
_Card1PrgTransferCmd.Password Initial Setting value
value
TRUE
_Card1PrgTransferSta.Done FALSE
TRUE
_Card1PrgTransferSta.Active FALSE
TRUE
_Card1PrgTransferSta.Err FALSE
_BackupBusy TRUE
FALSE
Backing up data
Restoring data Data that is
Verifying data backed up
Backup file
Restore command file
Automatic transfer command file
Verification results files
When you back up data, the backup file, restore command file, and automatic transfer command file
are created in the specified directory in the computer. The functions of the backup-related files are giv-
en in the following table.
Additional Information
You can change the operating mode of the CPU Unit while a backup or verification operation is
in progress.
However, an error will occur if the backup or verification cannot be processed normally due to
faulty memory in the CPU Unit, or some other failure.
Processing Contents
• For the Units and slaves settings in the backup data, you must select all the NX Units connected to
the CPU Unit, all the EtherCAT slaves that are connected, and all of the CJ-series Units that are
connected.
• The backing up conditions for data groups are given in the following table.
IP address of the built-in EtherNet/IP port*1 The CPU Unit must be selected.
Present values of variables The CPU Unit must be selected.
Present values of memory used for CJ-series Units The CPU Unit must be selected.
Event logs The CPU Unit must be selected.
Units and slaves settings The NX Units on the CPU Unit*2, CJ-series Units*3,
and EtherCAT slaves must be selected.
Absolute encoder home offsets The CPU Unit must be selected.
*1. A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are required.
*2. You can select NX Units on the CPU Unit only for the NX102 CPU Units and NX1P2 CPU Units.
*3. You can select CJ-series Units only for NJ-series CPU Units.
• When you back up data, the backup file, restore command file, and automatic transfer command file
are created in the specified directory in the computer.
• If the backup-related files are already in the specified directory, they are overwritten.
• If an error occurs while writing the backup-related files to specified directory, the previous backup-
related files will be deleted. Also, the new backup-related files will not be created.
• If an error occurs before the new backup-related files are created, the previous files are retained and
the new files are not created.
• The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will be TRUE
during the backup operation.
Procedure
1 Select Backup − Backup Controller from the Tools Menu on the Sysmac Studio.
2 Specify the folder in which to save the backup file, restore command file, and automatic trans-
fer command file.
For CPU Units with unit version 1.40 or later, the Controller reset is required in any of the follow-
ing cases. Transfer the project according to the message on the Sysmac Studio.
• When an attempt is made to transfer a project with project unit version 1.40 or later to a CPU
Unit where a project with project unit version earlier than 1.40 is stored.
• When an attempt is made to transfer a project with project unit version earlier than 1.40 to a
CPU Unit where a project with project unit version 1.40 or later is stored.
• After the Clear All Memory operation is performed on a CPU Unit where a project with project
unit version 1.40 or later is stored, without executing the Controller reset, an attempt is made
to transfer a project with project unit version earlier than 1.40.
Processing Contents
• The data in a backup file in the specified directory on the computer is restored to the Controller.
• You can select the data groups to restore from the Sysmac Studio. The conditions for restoring the
data are given in the following table.
only for the NJ-series CPU Units, NX102 CPU Units, and NX1P2 CPU Units.
*3. You can select NX Units on the CPU Unit only for the NX102 CPU Units and NX1P2 CPU Units.
• If an error occurs in the checks that are performed before starting to restore the data, the previous
data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being restored, a User Program/
Controller Configurations and Setup Transfer Error (a major fault level Controller error) will occur. If
that occurs, the data in the Controller is not dependable. Use one of the following methods to clear
the error.
• Perform the restore operation again.
• Clear all of memory and then download the project from the Sysmac Studio.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be restored, the previous present values of those variables will be retained. However, the values of
any variables that do not meet the retain conditions are initialized. These are the retain conditions
for the variable:
• The variable name, data type name, and data type size must be the same before and after restor-
ing the data.
• The restore operation is possible even if the Option Board configuration in the backup file do not
match the actual configuration where data is restored. However, the Option Board does not operate.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No.
W579) for details.
• For the NX102 CPU Unit and NX1P2 CPU Unit, memory for CJ-series Units is generated by the set-
tings in the Memory Settings for CJ-series CPU Units in the backup file.
• If the present values of memory for CJ-series Units are not set to be restored in the NX102 CPU
Unit or NX1P2 CPU Unit, the previous present values in the DM, EM and Holding Areas will be re-
tained. However, when the DM, EM and Holding Areas are newly generated or the area is expand-
ed, the values in those areas will be the initial values.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
• If Sysmac Studio Ver.1.50 or later is used and user authentication function is enabled in the backup
file to be used for restoration, the Controller will be automatically reset when restoration is complet-
ed.
Procedure
1 Select Backup − Restore Controller from the Tools Menu on the Sysmac Studio.
2 Specify the folder that contains the backup file and restore command file.
Processing Contents
• The Controller data and the data in a backup file in the specified directory on the computer are com-
pared. You can select the data groups to verify from the Sysmac Studio. The conditions for verifying
the data are given in the following table. If you select them all at once, all of these data will be refer-
enced.
IP address of built-in EtherNet/IP port*1 The IP address of built-in EtherNet/IP port must be selected.
Units and slaves settings The NX Units on the CPU Unit*2, CJ-series Units*3, and Ether-
CAT slaves must be selected.
*1. A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are required.
*2. You can select NX Units on the CPU Unit only for the NX102 CPU Units and NX1P2 CPU Units.
*3. You can select CJ-series Units only for NJ-series CPU Units.
• The results of the verification are displayed in the dialog box on the Sysmac Studio.
• The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will be TRUE
during the backup operation.
Procedure
1 Select Backup − Compare with Backup File from the Tools Menu on the Sysmac Studio.
Data group
User program and set- Present
tings values of Absolute
Present Units and
Function IP address memory encoder
values of slaves
of built-in used for home off-
variables settings
EtherNet/IP CJ-series sets
port*2 Units*1
Importing and ex- Exporting ¡*3 ¡ × × × ×
porting Sysmac backup file
Studio backup file data
data Importing ¡*4*5 ¡ × × ¡ ×
backup file
data
*1. You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
*2. With a combination of the CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher,
IP address of the Built-in EtherNet/IP Port Settings can be used as a data group.
IP address is included in the user program and settings other than the above combination.
*3. The following data is not processed.
• The built-in EtherNet/IP port name in the Controller name
• The built-in EtherNet/IP tag data link settings in the Controller Setup
• Words allocated to CPU Bus Units in the Unit Configuration and Unit Settings
• Operation authority verification
• User authentication
• Data trace settings
*4. The following data is not processed.
• The built-in EtherNet/IP port name in the Controller name
• Words allocated to CPU Bus Units in the Unit Configuration and Unit Settings
• Operation authority verification
• User authentication
• Data trace settings
*5. The following data is not processed:
Using Sysmac Studio Version 1.15 or Lower
• The built-in EtherNet/IP tag data link settings in the Controller Setup
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for more information on
these functions.
The data related to OPC UA server function is included in the user program and setting data
groups. However, the data related to OPC UA server function is stored in the CPU Unit, so the
data is not subject to the importing and exporting Sysmac Studio backup file data.
Sysmac Studio
CPU Unit
Restoring
Present values of
battery-backup memory
Backup
9-8-1 Applicable Data for Sysmac Studio Variable and Memory Backup
Functions
The Sysmac Studio variable and memory backup functions cover the following data.
• Present values of variables with a Retain attribute
• Present values in the DM, EM, and Holding Areas of memory used for CJ-series Units
• Absolute encoder home offsets
Note You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102 CPU Units,
and NX1P2 CPU Units.
Version Information
With a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, you
can select specific variables to back up or restore the present values of variables with a Retain
attribute.
Additional Information
Database Connection CPU Units, SECS/GEM CPU Units, NJ Robotics CPU Units, Robot Inte-
grated CPU Units, and NC Integrated Controller are not compatible.
Refer to the relevant manuals for specific Units for details on the compatibility of these CPU
Units.
Version Information
The models of the CPU Units for backing up and restoring data can be different only when us-
ing a CPU Unit with version 1.04 or later and Sysmac Studio version 1.05 or higher. The com-
patibility for all other cases is given in the following table.
(¡: Compatible, ×: Not compatible.)
The following precautions are required for the data that is being backed up and restored.
Present Values in the DM, EM, and Holding Areas of Memory Used 9
for CJ-series Units 9-8-3 Compatibility between CPU Unit Models
For memory used for CJ-series Units, if the area data saved in the backup file and area data in the
actual CPU Unit to restore to are different, only the duplicated area data is restored.
The following precautions are necessary for the present values in the DM, EM, and Holding Areas of
memory used for CJ-series Units if the models of the backup and restore CPU Units are different. An
example of the NJ-series CPU Unit is given in the following table.
The following provides examples when the area data saved in the backup file and area data in the
actual CPU Unit to restore to are different.
l If Area Data in the Backup File Is Larger Than Area Data in the Restore
CPU Unit
Size of DM Area data in the restore CPU Unit = 4
Size of DM Area data when backed up = 8 words
words
Address Value Address Value
DM0 0x0001 DM0 0x0001
DM1 0x0002 DM1 0x0002
DM2 0x0003 DM2 0x0003
DM3 0x0004 DM3 0x0004
DM4 0x0005 --- ---
DM5 0x0006 --- ---
DM6 0x0007 --- ---
DM7 0x0008 --- ---
l If Area Data in the Backup File Is Less Than Area Data in the Restore CPU
Unit
Size of DM Area data in the restore CPU Unit = 4
Size of DM Area data when backed up = 8 words
words
Address Value Address Value
DM0 0x0001 DM0 0x0001
DM1 0x0002 DM1 0x0002
DM2 0x0003 DM2 0x0003
DM3 0x0004 DM3 0x0004
--- --- DM4 No change
--- --- DM5 No change
--- --- DM6 No change
--- --- DM7 No change
Additional Information
To use the backup functions for EtherCAT Slave Terminals, refer to 9-10 Backup Functions
When EtherCAT Slave Terminals Are Connected on page 9-61.
Execution
Controller status
Backing up data Restoring data Verifying data
Link OFF Not possible.*1 Not possible.*2 Possible.*3
Illegal master status*4 Not possible. *1*5 Not possible.*2 Possible.*3
Network configuration mismatch with configu- Not possible.*1 Not possible.*2 Possible.*3
ration information*6
Network configuration mismatch with configu- Possible. Not possible.*2 Possible.*3
ration at time of backup
Disabled slave in Disabled slaves in ac- Possible.*7 Possible.*7 Possible.*7
network configura- tual configuration
tion No disabled slaves in Possible. Possible. Possible.
actual configuration
Execution
Controller status
Backing up data Restoring data Verifying data
Slave disconnected Disconnected slaves in Not possible.*1 Possible. Possible.
for “Disconnect” des- actual configuration Data for discon- Data for discon-
ignation in network nected slaves is nected slaves is
configuration also restored. also restored.
No disconnected Not possible.*1 Not possible.*2 Possible.*3
slaves in actual config-
uration
Slave State Transition Failed*8 Not possible.*1 Not possible.*2 Possible.*3
*1. EtherCAT Slave Backup Failed events are recorded in the event log.
*2. EtherCAT Slave Restore Operation Failed events are recorded in the event log.
*3. The verification results will show differences.
*4. For project unit version earlier than 1.40, this refers to the following errors: Duplicate Slave Node Address,
Network Configuration Information Error, Network Configuration Error, Slave Initialization Error, Network
Configuration Verification Error for Fail-soft Operation Setting of “Stop”, Link OFF Error, and EtherCAT
The following conditions must be met before you restore the backup data to the EtherCAT slaves.
• The backup files must contain the EtherCAT slave data.
• The Network Configuration Information must match the actual network configuration where data is
being restored.
• The revision values that are preset in the EtherCAT slaves must match. The conditions used to eval-
uate the match are based on the Revision Check Method in the backup file. Even if you set the Re-
vision Check Method to not check revisions, the restoration operation cannot be performed if the set
revision is greater than the actual revision of the slave. You cannot change the revision values.
• The serial numbers must match if the Serial Number Verification setting in the backup file is set to
verify the serial numbers.
• The node addresses must match if the hardware switches are used to set the node address.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
• All slaves are disconnected after the data is restored. You must connect the target slaves
again to reset the disconnected slaves.
• If you set the Serial Number Verification setting in the backup file to verify the serial numbers,
the data cannot be restored if you replace any of the hardware for the EtherCAT slaves. In
this case, change the network configuration in Sysmac Studio and download the configura-
tion data to the new slaves. Then, transfer the slave parameters to restore the slaves to their
original condition. If the node address is set on the hardware switches, use the same setting
as when the data was backed up.
*1. Cycle the power supply to a slave after you restore data. Cycle the power supply to a slave before you verify
the data after you restore it. The verification will fail if you do not cycle the power supply before you perform
the verification.
*2. If any of the following conditions applies, do not turn the Servo ON while the data is being backed up or
restored before you verify the data. If you turn the Servo ON while the data is being backed up or restored
before you verify the data, the parameters are updated before the verification operation and may cause dif-
ferences in the verification results.
• When the Realtime Autotuning Mode Selection (3002 hex) is set to 1 to 4, or 6 (enabled).
• When the Adaptive Filter Selection (3200 hex) is set to 1 or 2 (enabled).
1 Import the Inverter parameters from the backup file with the backup file import function of the
Sysmac Studio.
Display the Inverter parameters on the Inverter Parameters Tab Page for the Controller Config-
urations and Setup of the Sysmac Studio.
2 Confirm that the model number of the Inverter in the parameters that you imported agrees with
the model number of the Inverter that is actually connected.
3 Download the parameters to the Inverter using the “To Drive” menu on the Inverter Parameters
Tab Page for the Controller Configurations and Setup of the Sysmac Studio.
If you use the Inverter Mode Selection parameter (parameter number b171) in a 3G3AX-MX2-
ECT Inverter, change the Inverter to the mode that was used when the backup data was creat-
ed before you write the parameters. After you change the mode setting, you must initialize the
Inverter to enable the change.
Additional Information
When the unit version of the CPU Unit is 1.10 or earlier, even if the restore operation for the
Inverter fails, all other data are restored including settings of Units and slaves, user program
settings, and present values of variables.
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are re-
quired to use EtherCAT Slave Terminals.
To restore backup data to an EtherCAT Slave Terminal that has an identical Unit configuration
to the EtherCAT Slave Terminal from which data was backed up, make sure that all hardware
switches are set to the same settings as when the backup was made. Backup data cannot be
restored if the hardware switches are set differently from those in the backup data. This will
cause a Restore Operation Failed to Start (EtherCAT Slave) observation event to occur.
Execution
EtherCAT Slave Terminal status Backing up Restoring Verifying da-
data data ta
Automatic creation of the Unit configuration information Possible.*1 Possible.*2 Possible.
Waiting for NX Unit participation Not possi- Not possi- Possible.*5
ble.*3 ble.*4
Watchdog time error in EtherCAT Coupler Unit or NX Unit Not possi- Not possi- Possible.*5
ble.*3 ble.*4
During Bus Controller Error Not possi- Not possi- Possible.*5
ble.*3 ble.*4
During Unit Configuration Information Error Not possi- Possible. Possible.*5
ble.*3
During Unit Configuration Verification Error Not possi- Possible. Possible.*5
ble.*3
The Unit configuration information does not agree with the Unit --- Not possi- Possible.*5
configuration information in the backup data. ble.*4
*1. The backup contains information saying that the Unit configuration information does not exist.
*2. After the data is restored, automatic Unit configuration status continues.
*3. A Backup Failed event is recorded in the event log.
*4. A Restore Operation Failed event is recorded in the event log.
*5. The verification results will show differences.
• The unit version settings of the NX Unit from which the data was backed up and the unit versions of
the actual NX Units to which the data is restored must be the same.
You can mount an NX-SL££££ Safety Control Unit on the NX102 CPU Unit. However, you
cannot back up, restore, or compare data for the Safety Control Unit. Refer to the NX-series
Safety Control Unit User’s Manual (Cat. No. Z930-E1-12 or later) for information on importing
and exporting settings and safety unit restore settings for a Safety Control Unit.
Execution
Controller status Backing up da-
Restoring data Verifying data
ta
Automatic creation of the Unit configuration informa- Possible*1 Possible*2 Possible
tion
Watchdog time error in NX Unit Not possible*3 Not possible*4 Possible*5
During NX Bus Controller Error Not possible*3 Not possible*4 Possible*5
During Unit Configuration Verification Error Not possible*3 Possible Possible*5
The Unit configuration information does not agree with --- Not possible*4 Possible*5
the Unit configuration information in the backup data.
*1. The backup contains information saying that the Unit configuration information does not exist.
*2. After the data is restored, automatic Unit configuration status continues.
*3. An NX Unit Backup Failed event is recorded in the event log.
*4. An NX Unit Restore Operation Failed event is recorded in the event log.
*5. The verification results will show differences.
You can connect CJ-series Units only with NJ-series CPU Units.
Execution
Controller status
Backing up data Restoring data Verifying data
I/O Bus Check Error Not possible.*1 Not possible.*2 Possible.*3
End Cover Missing
Incorrect Unit/Expansion Rack Connection
Duplicate Unit Number Error
Too Many I/O Points
I/O Setting Check Error
Restarting the CJ-series Unit Not possible.*1 Possible. Possible.*3
*1. CJ-series Unit Backup Failed events are recorded in the event log.
*2. CJ-series Unit Restore Operation Failed events are recorded in the event log.
*3. The verification results will show differences.
If you restore data using the SD Memory Card backup functions or the Sysmac Studio Control-
ler backup functions while CJ-series Units are connected, a CPU Unit Service Monitor Error will
occur. This means that servicing the CJ-series Units from the CPU Unit was not completed
within a specific amount of time. However, this is the result of the time that is required to restore
the data and it does not indicate an error. The following will occur at this time.
• For communications-related CJ-series Units, the MS indicator flashes red.
• For CJ-series Units with seven-segment indicator, the indicator displays “HE”.
• For CJ-series Units that have an ERH indicator, the ERH indicator lights.
• An event code of 00000002 hex is recorded in the Controller event logs to indicate a CPU
Unit Service Monitor Error or Refresh Timeout event.
• If a CJ-series CJ1W-CT021 High-speed Counter Unit is connected, an event code of
68010000 hex is recorded in the Controller event logs to indicate a Unit Error. The attached
information will be 0002 hex.
l Backup File
This file contains the Controller data that is handled by the backup-related functions. These files
are created when data is backed up.
Verification results
Description
files
Controller verification re- This file contains the verification results for all backup data specified by the re-
sults file store command file.
EtherCAT slave verifica- This file contains the verification results for each EtherCAT slave. It is created
tion results file when the Unit and slave settings are set to be restored in the restore command
file and the EtherCAT slave settings are contained in the backup file.
EtherCAT Slave Termi- This file contains the verification results for each EtherCAT Coupler Unit and NX
nal verification results Unit. This file is created when all of the following conditions are met.
file • The Unit and slave settings are specified for restoration in the restore com-
mand file.
• The EtherCAT slave settings are included in the backup file.
• One or more EtherCAT Slave Terminals is connected.
Verification results
Description
files
NX Unit verification re- This file contains the verification results for each NX Unit on the CPU Unit. It is
sults file*1 generated when the Unit and slave settings are set to be restored in the restore
command file and the backup file contains settings of the NX Unit on the CPU
Unit.
CJ-series Unit verifica- This file contains the verification results for each CJ-series Unit. It is created
tion results file*2 when the Unit and slave settings are set to be restored in the restore command
file and the CJ-series Unit settings are contained in the backup file.
*1. You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
*2. You can use CJ-series Units only on the NJ-series CPU Units.
File Name
A different backup file name is given depending on the CPU Unit series.
File Name
File File name
Restore command file RestoreCommand.ini
; --- IP Address of Built-in EtherNet/IP Port Settings. --- IP address of built-in EtherNet/IP port
; "yes":will be restored, "no":will not be restored yes/no: Restore/Do not restore.
IPAdr=yes
; --- Present values of variables (Retained variables only). --- Present values of variables (only vari-
; "yes":will be restored, "no":will not be restored ables that are set to be retained with
Variable=yes the Retain attribute)
yes/no: Restore/Do not restore.
; --- Absolute encoder home offset. --- Absolute encoder home offsets
; "yes":will be restored, "no":will not be restored yes/no: Restore/Do not restore.
AbsEncoder=yes
Note 1. The default file contents when the restore command file is created are given above. All of the data
groups that are listed in the file are set to be restored.
Note 2. The restore command file lists the restorable data groups that were in the backup file when the backup
file was created.
Note 3. Only single-byte alphanumeric characters are used. The text is not case sensitive.
Note 4. An entry of IP Address of Built-in EtherNet/IP Port Settings is not created if the backup is performed in
the CPU Unit with unit version 1.13 or earlier.
In the CPU Unit with unit version 1.14 or later, if an entry of IP Address of Built-in EtherNet/IP Port Set-
tings for which the restore command file is not created is used, the operation is performed as
“IPAdr=yes”.
Refer to Compatibility between Restore Command Files on page 9-71 for compatibility between the re-
store command file with unit version 1.13 or earlier and the restore command file with unit version 1.14
or later.
When you edit the restore command file, do not change anything in the file except for the “yes”
and “no” specifications for the selectable data groups. If you change anything else in the file,
the Controller may perform unexpected operation when you restore the data.
Unit version of CPU Unit that cre- Unit version of CPU Unit where data is being restored
ates the restore command file
Version 1.13 or earlier Version 1.14 or later
and backup file
Version 1.13 or earlier Restorable. Restorable.
IP Address of Built-in EtherNET/IP IP Address of Built-in EtherNET/IP
Port Settings is restored. Port Settings is restored.
Unit version of CPU Unit that cre- Unit version of CPU Unit where data is being restored
ates the restore command file
Version 1.13 or earlier Version 1.14 or later
and backup file
Version 1.14 or later Not restorable. Restorable.
In the CPU Unit with unit version IP Address of Built-in EtherNET/IP
1.13 or earlier, because the entry of Port Settings corresponds to
IP Address of Built-in EtherNET/IP “yes/no” of “IPAdr”.
Port Settings cannot be interpreted,
a Restore Operation Failed to Start
error in an observation level occurs.
The error details will be “0104 hex:
The contents of the restore com-
mand file are not correct”.
File Name
File File name
Automatic transfer command file AutoloadCommand.ini
; --- IP Address of Built-in EtherNet/IP Port Settings. --- IP address of built-in EtherNet/IP
; "yes":will be transferred, "no":will not be transferred port
IPAdr=yes yes/no: Transfer/Do not transfer.
; --- Present values of variables (Retained variables only). --- Present values of variables (only
; "yes":will be transferred, "no":will not be transferred variables that are set to be retained
Variable=yes with the Retain attribute)
yes/no: Transfer/Do not transfer.
; --- Present values of memory used for CJ-series Units (Holding, EM, and Present values of memory used for
DM Area data). --- CJ-series Units (only addresses
; "yes":will be transferred, "no":will not be transferred that are set to be retained with the
Retain attribute)
yes/no: Transfer/Do not transfer.
Note 1. The default file contents when the automatic transfer command file is created are given above. All of the
data groups that are listed in the file are set to be automatically transferred.
Note 2. The automatic transfer command file lists the transferable data groups that were in the backup file when
the backup file was created.
Note 3. Only single-byte alphanumeric characters are used. The text is not case sensitive.
Note 4. An entry of IP Address of Built-in EtherNet/IP Port Settings is not created if the backup is performed in
the CPU Unit with unit version 1.13 or earlier.
In the CPU Unit with unit version 1.14 or later, if an entry of IP Address of Built-in EtherNet/IP Port Set-
tings for which the automatic transfer file is not created is used, the operation is performed as
When you edit the automatic transfer command file, do not change anything in the file except
for the “yes” and “no” specifications for the selectable data groups. If you change anything else
in the file, the Controller may perform unexpected operation when you automatically transfer the 9
data. File
9-13-4 Specifications of an Automatic Transfer Command
Unit version of CPU Unit that cre- Unit version of CPU Unit where data is being automatically transfer-
ates the automatic transfer file red
and backup file Version 1.13 or earlier Version 1.14 or later
Version 1.13 or earlier Automatic transfer is possible. Automatic transfer is possible.
IP Address of Built-in EtherNET/IP IP Address of Built-in EtherNET/IP
Port Settings is automatically trans- Port Settings is automatically trans-
ferred. ferred.
Unit version of CPU Unit that cre- Unit version of CPU Unit where data is being automatically transfer-
ates the automatic transfer file red
and backup file Version 1.13 or earlier Version 1.14 or later
Version 1.14 or later Automatic transfer is not possible. Automatic transfer is possible.
In the CPU Unit with unit version IP Address of Built-in EtherNET/IP
1.13 or earlier, because the entry of Port Settings corresponds to
IP Address of Built-in EtherNET/IP “yes/no” of “IPAdr”.
Port Settings cannot be interpreted,
an Error in Starting Automatic
Transfer in a major fault level oc-
curs. The error details will be “0104
hex: The contents of the automatic
transfer command file are not cor-
rect”.
File Name
File File name
Controller verification results file VerifyResult.log
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
Note 1. The verification results are given only for the data groups that were compared.
Note 2. The verification results of IP Address of Built-in EtherNet/IP Port Settings are included in an entry of user
program and settings even for the CPU Unit with unit version 1.14 or later.
File Name
File File name
EtherCAT verification results file VerifyResult_ECAT.log
[E002:NX]
Result=Matched
*1. If EtherCAT Slave Terminals are set for verification, the EtherCAT Slave Terminal verification results file is
created. The detailed verification results for the EtherCAT Slave Terminals are given in the EtherCAT Slave
Terminal verification results file.
Note The verification results are given only for the EtherCAT slaves that were compared.
File Name
File File name
EtherCAT Slave Terminal verification results file VerifyResult_ECAT_NX.log
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
“Result=Matched” indicates a data group for which no differences were found. “Result=Not matched”
indicates a data group for which differences were found.
The following table gives an example of the verification results for the following file contents.
• Matched: EtherCAT Coupler Unit E002, NX Unit N1, and NX Unit N2
• Not matched: EtherCAT Coupler Unit E005 and NX Unit N3
You can use NX Units only on the NX102 CPU Units and NX1P2 CPU Units.
9
9-13-8 Specifications of an NX Unit Verification Results File
File Name
File File name
NX Unit verification results file VerifyResult_NXUnit.log
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
You can use CJ-series Units only with NJ-series CPU Units.
File Name
File File name
CJ-series Unit verification results file VerifyResult_CJUnit.log
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
Result=Not matched The Unit model is obtained from the cyclic initialization
data. Consecutive spaces at the end of the model
number are deleted.
Unit No.:
Text string of decimal numbers. Leading zeros are
suppressed. Range for a CPU Bus Unit: 0 to 15. Spe-
cial I/O Units: 0 to 95.
Note The verification results are given only for the EtherCAT slaves that were compared.
In this context, the term restore is used collectively for these backup functions: restore, automatic
transfer, program transfer, and read (back up).
Additional Information
The files that are handled for backing up variables and memory from the Sysmac Studio are not
compatible with other backup files.
Refer to 9-8 Sysmac Studio Variable and Memory Backup Functions on page 9-52 for details on
these functions.
NX1P2-9024DT1
NX1P2-9B40DT ×*1 ×*1 ×*1 ×*1 ×*1 ¡ ×*1 ×*1 ×*1 ×*1 ×*1
NX1P2-9B40DT1
NX1P2-9B24DT ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ¡ ×*1 ×*1 ×*1 ×*1
NX1P2-9B24DT1
NJ501-1500 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ¡ ×*1 ×*1 ×*1
NJ501-1400
NJ501-1300
NJ301-1200 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ¡ ×*1 ×*1
NJ301-1100
NJ101-1000 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ¡ ×*1
NJ101-9000 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ×*1 ¡
*1. The Sysmac Studio variable and memory backup functions are compatible. However, a CPU Unit with unit version 1.04 or later and
Sysmac Studio version 1.05 or higher are required. Refer to 9-8-3 Compatibility between CPU Unit Models on page 9-53 for the com-
patibility between CPU Unit models for the Sysmac Studio variable and memory backup functions.
Additional Information
Database Connection CPU Units, SECS/GEM CPU Units, NJ Robotics CPU Units, Robot Inte-
grated CPU Units, and NC Integrated Controller are not compatible.
Refer to the relevant manuals for specific Units for details on the compatibility of these CPU
Units.
Even if the CPU Unit models are compatible, there may be restrictions between various CPU Unit
models.
The following table shows which restoration function can be used based on whether the CPU Unit
models are compatible.
Communications Setup
This section describes how to go online with the CPU Unit and how to connect to other
devices.
The shaded steps in the overall procedure that is shown below are related to the communications sys-
tems.
Step 4. Wiring
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series on page 1-19 for details.
l NX701 System
Overview
You can use the NX701 System to build the communications system shown below.
Sysmac Studio
10
NTP server
BOOTP server
DNS server
EtherNet/IP
10-1-1 Introduction
NX-series Controller EtherNet/IP
General-purpose slaves
l NX102 System
You can use the NX102 System to build the communications system shown below.
NTP server
BOOTP server
DNS server
EtherNet/IP
CJ2 Series
NX102 CPU Unit
NX-series Communications
Interface Unit
EtherCAT
General-purpose slaves
EtherNet/IP slave
EtherNet/IP
Overview
NTP server
BOOTP server
DNS server
EtherNet/IP
NX1P2
CJ2 series 10
CPU Unit
10-1-1 Introduction
Built-in EtherNet/IP port
NX-series
Communications Interface Unit
EtherCAT
General-purpose slaves
l NJ-series System
You can use the NJ-series System to build the communications system shown below.
Sysmac Studio
NTP server
BOOTP server
DNS server
EtherNet/IP EtherNet/IP
CJ2 Series
Example: Serial Communications Unit
Sysmac Studio
Example: EtherNet/IP Unit
USB
CompoNet
Built-in EtherNet/IP port
MS NS WORD NODE ADR 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 MS NS WORD NODE ADR 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
OUT OUT
Serial General-purpose
device with serial
Example: DeviceNet Unit communications
DeviceNet
EtherCAT
General-purpose slaves
Overview
10
10-1-1 Introduction
For the following CPU Unit versions, use Sysmac Studio on Windows 10 or higher OS on the
computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to the Controller.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
For CPU Units with unit version 1.40 or later, the Controller reset is required in any of the follow-
ing cases. Connect online according to the message on the Sysmac Studio.
• When an attempt is made to connect the Sysmac Studio where a project with project unit ver-
sion 1.40 or later is opened online to a CPU Unit in the factory default condition. However, the
Controller reset is not necessary for the NX1P2-9B££££ CPU Units only with unit version
1.40 or later.
USB
A direct connection is made from the computer that runs Sysmac Studio. You do not need to specify the
connection device.
Note Connect a computer and the CPU Unit with a USB 2.0 certified cable. Do not use a USB hub to connect
them.
Note You cannot connect a computer to an NJ701 CPU Unit with hardware revision A or later, NX102 CPU
Unit or NX1P2 CPU Unit via USB because they do not provide a peripheral USB port.
Studio
EtherNet/IP EtherNet/IP
10
• A direct connection is made from the computer • Specify the IP address of the remote node
that runs Sysmac Studio. You do not need to from the Sysmac Studio.
Sysmac Studio
USB
EtherNet/IP
• Specify the IP address of the remote node from the Sysmac Studio.
• You can use either a cross cable or a straight cable.
Note Connect a computer and the CPU Unit with a USB 2.0 certified cable. Do not use a USB hub to connect
them.
Note The NX701 CPU Unit of hardware revision A or later and CPU Units of NX102 and NX1P2 do not pro-
vide the peripheral USB port.
Sysmac Studio
EtherNet/IP
CJ1W-EIP21
EtherNet/IP Unit
Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.
EtherNet/IP
Sysmac Studio
USB
DeviceNet network
DeviceNet Unit
Note You cannot connect a DeviceNet Unit with NX-series CPU Units.
Studio
Additional Information
10
To improve security, we recommend installing the Sysmac Studio on an operating system that is
within the Microsoft Windows support period.
Secure communication is available in the following CPU Units of the stated versions.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
The secure communication function may affect the communication response performance and
the execution processing performance of some instructions.
When you use a CPU Unit that supports the secure communication, check the operation suffi-
ciently in advance.
If there is a problem with the performance, consider changing settings to allow connection to
Sysmac Studio or an NA-series Programmable Terminal that do not support secure
communication.
Ver.1. 48 *2 or earlier, factory de- Follow the DIP switch settings of the CPU Unit.
fault, or when all memory is *3
cleared
Ver.1. 48 *2 or earlier Can be connected without using secure com-
munication
*1. This is the unit version for the NJ-series, NX102, or NX1P2 CPU Units. If you use the NX701 CPU Unit,
read it as version 1.29.
*2. This is the unit version for the NJ-series, NX102, or NX1P2 CPU Units. If you use the NX701 CPU Unit,
read it as version 1.28.
*3. For details on the DIP switch settings of the CPU Unit, refer to How to Allow Connection to Sysmac Stu-
dio or NA-series Programmable Terminal that Do Not Support Secure Communication on page 10-12.
Unit version of CPU Unit versions of NA-series Programmable Terminal and Soft-NA
Unit Ver.1.16 or later Ver.1.15 or earlier
Ver.1.49*1 or later Secure communication available Follow the DIP switch settings of the
CPU Unit. *3
Ver.1. 48 *2 or earlier Can be connected without using se- Can be connected without using secure
cure communication communication
*1. This is the unit version for the NJ-series, NX102, or NX1P2 CPU Units. If you use the NX701 CPU Unit,
read it as version 1.29.
*2. This is the unit version for the NJ-series, NX102, or NX1P2 CPU Units. If you use the NX701 CPU Unit,
read it as version 1.28.
*3. For details on the DIP switch settings of the CPU Unit, refer to How to Allow Connection to Sysmac Stu-
dio or NA-series Programmable Terminal that Do Not Support Secure Communication on page 10-12.
The following unit versions of the CPU Unit support secure communication.
• NJ-series, NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
When combining these for communication, it is necessary to set the DIP switches of the CPU Unit. Set
the DIP switches are as follows. However, in these cases, normal communication is used and secure
communication cannot be performed.
Studio
ON OFF ON ON Enables connections to the Sysmac Studio or NA-series Programmable Termi-
nal that do not support secure communication, and starts the CPU Unit in Safe
Mode.
OFF ON ON ON Enables connections to the Sysmac Studio or NA-series Programmable Termi- 10
nal that do not support secure communication and automatic transfer from SD
Memory Card
When you use a CPU Unit that supports secure communication and an NA-series Programma-
ble Terminal or a Soft-NA that do not support secure communication, please note that there are
following restrictions if the DIP switch is not set as shown above.
• The NA-series Programmable Terminal cannot be connected.
• The troubleshooter of the NS-series Programmable Terminal cannot be used.
EtherNet/IP
You can use the built-in EtherNet/IP ports or ports on CJ1W-EIP21 EtherNet/IP Units.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506) for de-
tails on the built-in EtherNet/IP port and CJ-series EtherNet/IP Unit Operation Manual for NJ-series
CPU Unit (Cat. No. W495) for details on the CJ1W-EIP21 EtherNet/IP Unit.
Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.
EtherNet/IP
l Message Communications
You can send CIP messages from the user program.
EtherNet/IP
CIP communications
instruction
trollers or Slaves
Sending and Receiving Files
EtherNet/IP
FTP server
SD Memory Card 10
Communications
EtherNet/IP
Socket service
instruction
NTP server
Clock information
EtherNet/IP
NTP client
DNS server
IP address EtherNet/IP
Host name
DNS client
BOOTP server
IP address
EtherNet/IP
BOOTP commands
BOOTP client
SNMP manager
Administration
information
EtherNet/IP
SNMP messages
SNMP agent
EtherCAT
High-speed, high-precision communications are possible with Servo Drives and general-purpose
slaves.
Refer to the NJ/NX-series CPU Unit Built-in EtherCAT Port User's Manual (Cat. No. W505) for details.
10
Slave Terminal General-purpose slave
l EtherNet/IP
You can use a built-in EtherNet/IP port or a CJ1W-EIP21 EtherNet/IP Unit to connect to an HMI.
HMI
EtherNet/IP
Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP Port User's Manual (Cat. No. W506) for
details on the built-in EtherNet/IP port and CJ-series EtherNet/IP Unit Operation Manual for NJ-
series CPU Unit (Cat. No. W495) for details on the CJ1W-EIP21 EtherNet/IP Unit.
l Serial Communications
You can use a Serial Communications Unit to connect to an NS-series PT.
NS-series PT
RS-232C or
RS-422A/485
Note You cannot use a Serial Communications Unit for NX-series CPU Units.
Refer to the CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit (Cat.
No. W494) for details on the Serial Communications Unit.
EtherCAT
NX-series EtherCAT Coupler Unit
Serial communications device
RS-232C or
RS-422A/485
The NX bus connector of the CPU Unit is provided for future expansion, so it cannot be used to
connect any NX-series Communications Interface Unit.
You cannot use a CJ-series Serial Communications Unit or a Serial Communications Option
Board to connect to an NX701 CPU Unit, either.
RS-232C or
RS-422A/485
RS-232C or
RS-422A/485
RS-232C or
RS-422A/485
Sysmac Studio
NJ-series Controller Analog Input Unit
USB
Displacement Sensor
Built-in EtherCAT port
EtherCAT
G5 EtherCAT
11-1-2 Operation
Interrupt feeding starts when the sensor signal changes to ON during velocity control.
The vertical position changes based on the analog input from the Displacement Sensor.
Variable Design
Consider the following:
• The separation of variables into those that you use in more than one POU (global variables) and
variables that you use in only specific POUs (local variables)
• Defining the variables names for the device variables that you use to access slaves and Units
• Defining the attributes of variables, such as the Name and Retain attributes
• Designing the data types of variables
11
Additional Information
At this point, you can use forced refreshing from the I/O Map to check the wiring.
2 In the I/O Map, assign the variables to the I/O ports. (The I/O ports are created automatically
from the Unit and slave configurations.)
You can automatically create device variable names with the Sysmac Studio. To do so, right-
click an I/O port and select Create Device Variable from the menu.
By default, device variables are registered in the global variable table. If necessary, you can
change the variable type from a global variable to a local variable (internal variable) for a POU.
1 Right-click Axis Settings under Configurations and Setups - Motion Control Setup and se-
lect Add - Axis Settings from the menu.
2 Assign Servo Drives to the axes (axis variables) that you created in the EtherCAT configura-
tion.
1 Right-click Programs under Programming - POU and select Add - Ladder or Add - ST from
the menu.
5 As required, right-click Functions or Function Blocks under Programming - POU and select
Add - Ladder or Add - ST from the menu.
Double-click the Function£ or FunctionBlock£ that you registered. Register local variables
for each function and function block. Create the algorithms.
Note For a ladder diagram, press the R Key and create the following rungs.
Going Online
2 Connect the computer and the CPU Unit with a USB cable.
3 Select Communications Setup from the Controller Menu. Select the connection method for
the connection configuration in the Connection Type Field.
Checking Wiring
Check the wiring by using forced refreshing of real I/O from the I/O Map or Ladder Editor.
MC Test Run
Manual Operation
Change the CPU Unit to RUN mode.
• Turning the Servo ON and OFF: Execute the MC_Power motion control instruction.
• Jogging: Execute the MC_MoveJog motion control instruction.
Homing
Homing: Execute the MC_Home instruction.
Actual Operation
Select Operation Mode - RUN Mode from the Controller Menu.
If an error occurs, investigate the cause and edit the user program.
Host computer
HMI
Checking Network
Status
EtherNet/IP
Troubleshooter
Network Configurator
Built-in
NJ/NX-series EtherNet/IP port CJ-series Units
CPU Unit and NX Units
Troubleshooting
Sysmac Studio
EtherCAT
EtherCAT
slave
You can use the troubleshooting functions of the Sysmac Studio or the Troubleshooter on an HMI to
quickly check for errors that have occurred and find corrections for them.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for types of errors, meanings, spe-
cific corrections when errors occur and for troubleshooting information on the entire NJ/NX-series Con-
troller.
A-1 Specifications
This section gives the specifications of the NJ/NX-series Controllers.
A-1 Specifications
• NX-series NX1P2 CPU Unit Hardware User’s Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User's Manual (Cat. No. W500)
A-1 Specifications
Maximum data size 1,444 byte 600 bytes
per connection
Maximum number of 256 per port 32 per port 32 (1 connection = 1 tag set)
registrable tag sets 512 total 40 total*17
(1 connection = (1 connec-
1 tag set) tion = 1 tag
set)
Maximum tag set size 1,444 bytes 600 bytes (Two bytes are used if Controller status is included in the A
(Two bytes are tag set.)
used if Control-
A-1 Specifications
branching
Transmission media Twisted-pair cable of category 5 or higher (double-shielded straight cable with alumi-
num tape and braiding)
Maximum transmission distance 100 m
between nodes
Maximum number of slaves 512 64 16*27 192 64
Range of node addresses that can 1 to 512 1 to 192
be set A
Maximum process data size Inputs: 11,472 Inputs: Inputs: Inputs: 5,736 bytes
bytes 5,736 1,434 Outputs: 5,736 bytes
A-1 Specifications
nutes to +4.5 mi- 25°C: minutes
nutes Monthly difference -2.0 At ambient temperature of 0°C:
Ambient temper- minutes to +2.0 minutes Monthly difference -4.5 minutes to +4.5
ature of 25°C: At ambient temperature minutes
Monthly differ- of 0°C:
ence -3.5 mi- Monthly difference -3.0
nutes to +3.5 mi- minutes to +2.0 minutes
nutes
A
At ambient tem-
perature of 0°C:
Monthly differ-
*24. The following variables cannot be published. For details on the following maximum values, refer to the NJ/NX-series CPU Unit OPC
UA User’s Manual (Cat. No. W588).
• Variable whose size exceeds the maximum value
• Two-dimensional or higher structure arrays
• Structures that include two-dimensional and higher arrays
• Structures where nesting exceeds the maximum value
• Unions
• Arrays whose index number suffix does no start from 0
• Array whose number of elements exceeds the maximum value
•
Structure with more than the maximum number of members
*25. The followings can be selected.
• None
• Sign - Basic128Rsa15
• Sign - Basic256
• Sign - Basic256Sha256
• SignAndEncrypt - Basic128Rsa15
• SignAndEncrypt - Basic256
• SignAndEncrypt - Basic256Sha256
*26. A ring topology can be used for project unit version 1.40 or later.
*27. The maximum number of slaves is 8 for an NX1P2-9B£££££ CPU Unit.
*28. However, the data must be within eight frames.
*29. However, for project unit version earlier than 1.40, the data must be within four frames.
*30. However, for project unit version earlier than 1.40, the data must be within one frame.
*31. The communications cycle is 4,000 μs to 8,000 μs (in 250-µs increments) for an NX1P2-9B£££££ CPU Unit.
*32. NX1P2-££40£££: 2, NX1P2-££24£££: 1
*33. NX1P2-££40£££: 24, NX1P2-££24£££: 14
*34. NX1P2-££40£££: 16, NX1P2-££24£££: 10
*35. NX1P2-£££££: None (NPN), NX1P2-££££££1: Provided (PNP)
*36. These are values in continuous operation state.
Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to
A-16 Version Information for NX-series Controllers on page A-258 and A-17 Version Information for NJ-series Control-
lers on page A-262 for information on version upgrades.
A-1 Specifications
Used motion control servo 256 axes 128 axes
axes
Used single-axis position ---
control servo axes
Maximum number of axes for linear interpolation axis 4 axes per axes group
control
Number of axes for circular interpolation axis control 2 axes per axes group
Maximum number of axes groups 64 axes groups
A
Motion control period The same control period as that is
used for the process data communica-
NX102-
Item
12££ 11££ 10££ 90££
Number of con- Maximum number of controlled axes 15 axes 4 axes
trolled axes*1 Motion control axes 11 axes ---
Single-axis position 4 axes
control axes
Maximum number of used real axes 12 axes 8 axes 6 axes 4 axes
Used motion control 8 axes 4 axes 2 axes ---
servo axes
Used single-axis po- 4 axes
sition control servo
axes
Maximum number of axes for linear in- 4 axes per axes group ---
terpolation axis control
Number of axes for circular interpola- 2 axes per axes group ---
tion axis control
Maximum number of axes groups 8 axes groups ---
Motion control period The same control period as that is used for the process data
communications cycle for EtherCAT.
Cams Number of cam Maximum points per 65,535 points ---
data points cam table
Maximum points for 262,140 points ---
all cam tables
Maximum number of cam tables 160 tables ---
Position units Pulse, mm, μm, nm, degree, and inch
Override factors 0.00%, or 0.01% to 500.00%
*1. Refer to the NJ/NX-series CPU Unit Motion Control User's Manual (Cat. No. W507) for descriptions of axes.
NX1P2-
Item 90££££ 9B£££
11£££££ 10£££££
£ ££
Number of con- Maximum number of controlled axes 12 axes 10 axes 4 axes 2 axes
trolled axes*1 Motion control axes 8 axes 6 axes ---
Single-axis position 4 axes 2 axes
control axes
Maximum number of used real axes 8 axes 6 axes 4 axes 2 axes
Used motion control 4 axes 2 axes ---
servo axes
Used single-axis posi- 4 axes 2 axes
tion control servo axes
Maximum number of axes for linear interpo- 4 axes per axes group ---
lation axis control
Number of axes for circular interpolation 2 axes per axes group ---
axis control
Maximum number of axes groups 8 axes groups ---
Motion control period Same as the period for primary periodic task
Cams Number of cam Maximum points per 65,535 points ---
data points cam table
Maximum points for all 262,140 points ---
cam tables
Maximum number of cam tables 80 tables ---
Position units Pulse, mm, μm, nm, degree, and inch
Override factors 0.00%, or 0.01% to 500.00%
*1. Refer to the NJ/NX-series CPU Unit Motion Control User's Manual (Cat. No. W507) for descriptions of axes.
NJ501-
Item
£5££ £4££ £3££
Number of con- Maximum number of controlled axes 64 axes 32 axes 16 axes
trolled axes*1 Motion control axes 64 axes 32 axes 16 axes
Single-axis position ---
control axes
Maximum number of used real axes 64 axes 32 axes 16 axes
Used motion control 64 axes 32 axes 16 axes
servo axes
Used single-axis posi- ---
tion control servo axes
A-1 Specifications
Maximum number of axes for linear interpo- 4 axes per axes group
lation axis control
Number of axes for circular interpolation ax- 2 axes per axes group
is control
Maximum number of axes groups 32 axes groups
Motion control period The same control period as that is used for the proc-
ess data communications cycle for EtherCAT.
Cams Number of cam Maximum points per 65,535 points A
data points cam table
Maximum points for all 1,048,560 points
NJ301-
Item
12££ 11££
Number of controlled Maximum number of controlled axes 15 axes (*)
axes*1 Motion control axes 15 axes (*)
Single-axis position control ---
axes
Maximum number of used real axes 8 axes 4 axes
Used motion control servo 8 axes 4 axes
axes
Used single-axis position ---
control servo axes
Maximum number of axes for linear interpolation ax- 4 axes per axes group
is control
Number of axes for circular interpolation axis control 2 axes per axes group
Maximum number of axes groups 32 axes groups
Motion control period The same control period as that is used
for the process data communications
cycle for EtherCAT.
Cams Number of cam data Maximum points per cam ta- 65,535 points
points ble
Maximum points for all cam 262,140 points
tables
Maximum number of cam tables 160 tables
Position units Pulse, mm, μm, nm, degree, and inch
Override factors 0.00%, or 0.01% to 500.00%
*1. Refer to the NJ/NX-series CPU Unit Motion Control User's Manual (Cat. No. W507) for descriptions of axes.
Note Items that are marked with asterisks in the table are improvements that were made during version up-
grades. Refer to A-16 Version Information for NX-series Controllers on page A-258 and A-17 Version Infor-
mation for NJ-series Controllers on page A-262 for information on version upgrades.
NJ101-
Item
10££ 90££
Number of controlled Maximum number of controlled axes 6 axes ---
axes*1 Motion control axes 6 axes ---
Single-axis position control ax- ---
es
Maximum number of used real axes 2 axes ---
Used motion control servo ax- 2 axes ---
es
Used single-axis position con- ---
trol servo axes
Maximum number of axes for linear interpolation axis 4 axes per axes group ---
control
Number of axes for circular interpolation axis control 2 axes per axes group ---
Maximum number of axes groups 32 axes groups ---
Motion control period The same control peri- ---
od as that is used for
the process data com-
munications cycle for
EtherCAT.
Cams Number of cam data Maximum points per cam table 65,535 points ---
points Maximum points for all cam ta- 262,140 points ---
bles
Maximum number of cam tables 160 tables ---
Position units Pulse, mm, μm, nm, de- ---
gree, and inch
Override factors 0.00%, or 0.01% to ---
500.00%
*1. Refer to the NJ/NX-series CPU Unit Motion Control User's Manual (Cat. No. W507) for descriptions of axes.
A-1 Specifications
periodic
tasks
Condi- Maximum 32
tionally number of
execut- event tasks
ed Execution When Activate Event Task instruction is executed or when condition expression for
tasks (*) conditions variable is met
Setup System Service Moni- --- The execution interval and the percent- A
toring Settings age of the total user program execution
time are monitored for the system serv-
ices (processes that are executed by
A-1 Specifications
Single- Starting cam A cam motion is performed using the specified cam table.
axis operation
synchro
nized
control
Ending cam The cam motion for the axis that is specified with the input parameter is ended.
operation
Starting A gear motion with the specified gear ratio is performed between a master axis and
gear opera- slave axis.
A
tion
Positioning A gear motion with the specified gear ratio and sync position is performed between a
A-1 Specifications
sitions (*)
Changing The Composition Axes parameter in the axes group parameters can be overwritten
the axes in temporarily.
an axes
group (*)
Common Cams Setting cam The end point index of the cam table that is specified in the input parameter is
items table proper- changed.
ties
A
Saving cam The cam table that is specified with the input parameter is saved in non-volatile memo-
tables ry in the CPU Unit.
A-1 Specifications
FTP server Files can be read from or written to the SD Memory Card in the CPU Unit from com-
puters at other Ethernet nodes.
Automatic Clock information is read from the NTP server at the specified time or at a specified
clock adjust- interval after the power supply to the CPU Unit is turned ON. The internal clock time in
ment the CPU Unit is updated with the read time.
SNMP agent Built-in EtherNet/IP port internal status information is provided to network manage-
ment software that uses an SNMP manager.
OPC Server Func- Functions to respond to re- --- Functions ---
A
UA*5*6 tion quests from clients on the to respond
OPC UA network to requests
from cli-
A-1 Specifications
Maximum 9 (Sysmac Studio)
number of 2 (NS-series PT)
message
languages
User- Function User-defined errors are registered in advance and then records are created by execut-
defined ing instructions.
errors Levels 8
Maximum 9 A
number of
message
Note Items that are marked with asterisks in the table were added for version upgrades. Refer to A-16 Version Information
for NX-series Controllers on page A-258 and A-17 Version Information for NJ-series Controllers on page A-262 for in-
formation on version upgrades.
The task execution times in the physical Controller depend on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on A
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.
• Calculation of the average real processing times of tasks for the priority-5 periodic task will
require the value of the PDO Communications Cycle 2: Transmission Delay Time, which
is displayed in the EtherCAT Tab Page after the EtherCAT configuration is created with the
Sysmac Studio.
• Processing performance of I/O refresh, user program, and motion control has been improved
in the hardware revision B or later, so the actual processing time may be shorter.
Additional Information
Periodic tasks may be interrupted for the execution of tasks with higher execution priorities. The
real processing time of a task does not include the time for which the task is interrupted. It is the
task execution time that gives the actual time from when the task is started until it is finished,
including the interrupted time. For a detailed description of the differences between the real
processing times of tasks and the task execution times, refer to Meaning of the Task Execution
Time and the Real Processing Time of the Task on page 5-110.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
Priori-
Priori- ty-17 and
Primary Priority-5
ty-16 pe- priori-
Processing Processing contents periodic periodic
riodic ty-18 pe-
task task
task riodic
tasks
I/O refresh processing I/O is refreshed for EtherCAT ¡ ¡ --- ---
slaves.
User program execution Programs assigned to tasks are ¡ ¡ ¡ ¡
executed in the order that they are
assigned.
Motion control process- • Motion control commands from ¡ ¡ --- ---
ing the user program are executed.
• Motion output processing
Common System • Variable refresh processing (if ¡ ¡ ¡ ¡
process- common there are accessing tasks) is
ing time processing performed.
1 • Motion input processing
• Data trace processing
System • Variable refresh processing (if ¡ ¡ ¡ ¡
common there are refreshing tasks) is
processing performed.
2 • Variable access processing ex-
ternal to the Controller to en-
sure concurrency with task exe-
cution
System Other system common processing ¡ ¡ ¡ ¡
overhead
time
Guidelines are provided below for calculating the various processing times.
The formula for calculating the EtherCAT slave processing time is different between the primary peri-
odic task and the priority-5 periodic task.
• When calculating for the priority-5 periodic task, you need to determine the task period of the
primary periodic task in advance.
• Performance of I/O refresh execution has been improved in the hardware revision B or later,
so the actual processing time may be shorter.
Additional Information
EtherCAT slave processing time [μs] = 0.0006 × pDout + 0.0001 × pDin + 0.082 × pDinout
+ (1.24 × Snum + 0.01 × Clen) + 25.58
A
pDout : Total output processing data size [byte] of EtherCAT slaves assigned to the primary periodic
EtherCAT slave processing time [μs] = 0.0006 × pDout + (Larger of the following A and B)
+ sTsend + 0.0001 × sDin + 16
pDout : Total output processing data size [byte] of EtherCAT slaves assigned to the primary periodic
task
sTsend*1 : Transmission delay time for PDO communications cycle 2 [μs] displayed on the Sysmac
Studio
sDin : Total input processing data size [byte] of EtherCAT slaves assigned to the priority-5 periodic
task
sDout : Total output processing data size [byte] of EtherCAT slaves assigned to the priority-5 period-
ic task
pTcycle : Task period of the primary periodic task [μs]
pDinout : Total of the larger of the input and output processing data size of each EtherCAT slave as-
signed to the primary periodic task [byte]
*1. The value of sTsend (transmission delay time) cannot be calculated on paper. Assign the value of the PDO
Communications Cycle 2: Transmission Delay Time, which is displayed in the EtherCAT Tab Page
after the EtherCAT configuration is created with the Sysmac Studio, to sTsend (transmission delay time).
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for how to display the PDO
Communications Cycle 2: Transmission Delay Time on the Sysmac Studio.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-29 and Instruction Configuration for Standard ST
Instructions on page A-31 for information on the instruction configuration.
l Simple Estimate
For the number of instructions in each group, read the execution time for each instruction group A
from the following graphs and calculate the total.
1000
900
800
Execution time (µs)
700
600
500
400
300
200
NX701-££££
100
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
Total number of instructions
Percent of exe-
Percent of in- cution time in in-
Types of instructions Instructions
structions [%] struction group
[%]
Ladder diagram instruc- LD, AND, OUT, SET, and RESET 81.0 40.2
tions
Comparison instructions EQ and LT 4.1 8.3
Percent of exe-
Percent of in- cution time in in-
Types of instructions Instructions
structions [%] struction group
[%]
Timer and counter instruc- Timer, TON/TOF, and CTU/CTD 1.6 7.3
tions
Math instructions +, -, *, /, ADD, SUB, MUL, and DIV 2.4 6.5
BCD conversion instruc- INT_TO_DINT and 0.2 1.2
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 6.2 13.0
structions
Data movement instruc- MOVE 4.6 23.5
tions
Total 100.0 100.0
Execution Times for Ladder Diagram Arithmetic and Trigonometric Instructions for LREAL
Data
300
270
240
Execution time (µs)
210
NX701-££££
180
150
120
90
60
NX701-££££
30
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
1000
900
800
700
600
500
400
300
NX701-££££
200
100
0 A
0 10000 20000 30000 40000 50000 60000 70000
Total number of instructions
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
ST constructs IF ELSIF END_IF 75.4 41.6
Comparison instructions EQ and LT 5.2 8.7
Timer and counter instruc- Timer, TON/TOF, and 2.1 18.8
tions CTU/CTD
Math instructions +, -, *, and / 3.1 10.2
BCD conversion instruc- INT_TO_DINT and 0.2 1.6
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 8.0 11.7
structions
Data movement instruc- := 5.9 7.3
tions
Total 100.0 100.0
Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL Data
300
270
240
Execution time (µs)
210
NX701-££££
180
150
120
90
60
NX701-££££
30
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
Performance of user program execution has been improved in the hardware revision B or later,
so the actual execution time may be shorter.
250
Processing time (µs)
200
150
100
50
Processing performance of motion control has been improved in the hardware revision B or lat- A
er, so the actual processing time may be shorter.
Item Conditions
Input slave GX-ID1611 (Ver. 1.1): 1
Output slave GX-OD1611 (Ver. 1.1): 1
Servo Drives R88D-1SN£££-ECT: 4
EtherCAT Slave Terminal: 1
EtherCAT Coupler Unit NX-ECC203: 1
Slaves/Units that
EtherCAT slaves DC Input Unit NX-ID5342: 1
are used
Transistor Output Unit NX-OD5121: 1
Analog Input Unit NX-AD3608: 1
Analog Output Unit NX-DA2605: 1
Communications Interface NX-CIF101: 1
Units NX-CIF105: 1
Language Ladder diagrams
Standard instruc- Number of instructions: 5,000
tion configuration
Arithmetic instruc- Number of instructions: 200
User program tions for LREAL
data
Trigonometric in- Number of instructions: 100
structions for
LREAL data
Motion control 4
Number of axes
processing
Note Total length of cables connected to the built-in EtherCAT port is 10 [m].
Total number of bytes are given below for pDout, pDin and pDinout.
pDout = 2 + 23 × 4 + 62 = 156 [byte]
pDin = 3 + 1 + 26 × 4 + 88 = 196 [byte]
pDinout = 3 + 2 + 26 × 4 + 88 = 197 [byte]
A
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh processing time
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
= EtherCAT slave processing time
= 0.0006 × pDout + 0.0001 × pDin + 0.082 × pDinout + (1.24 × Snum + 0.01 × Clen) + 25.58
= 0.0006 × 156 + 0.0001 × 196 + 0.082 × 197 + (1.24 × 7 + 0.01 × 10) + 25.58
= 0.0936 + 0.0196 + 16.154 + (8.68 + 0.1) + 25.58
≈ 51 [μs]
Therefore, the user program execution time is the total of the above values, which is given by the
following formula.
User program execution time = 12+ 4 + 9
= 25 [μs]
Therefore, the average real processing time of the task is given by the following formula.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
=51 + 25 + 10 + 15
= 101 [μs]
Because the average real processing time of the task that is calculated above is 101 μs, the task peri-
od is set to 125 μs, which is larger than 1.1 times the average time.
The task execution times in the physical Controller depend on the logic operations that are performed
in the user program, the presence of communications commands and data links, on whether data trac-
ing is performed, and on other factors. The task execution time for a periodic task depends on whether
it is interrupted for the execution of tasks with higher execution priorities.
Use the physical Controller and verify the task execution time with the Task Execution Time Monitor.
The task execution times in the physical Controller depend on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on A
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.
Additional Information
Periodic tasks will be interrupted for the execution of tasks with higher execution priorities. The
real processing time of a task does not include the time for which the task is interrupted. It is the
task execution time that gives the actual time from when the task is started until it is finished,
including the interrupted time. For a detailed description of the differences between the real
processing times of tasks and the task execution times, refer to Meaning of the Task Execution
Time and the Real Processing Time of the Task on page 5-110.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
Priority-17
Primary pe- and priori-
Processing Processing contents
riodic task ty-18 peri-
odic tasks
I/O refresh processing I/O is refreshed for NX Units on the CPU Unit and ¡ ----
EtherCAT slaves.
User program execution Programs assigned to tasks are executed in the order ¡ ¡
that they are assigned.
Motion control process- • Motion control commands from the user program ¡ ---
ing are executed.
• Motion output processing
Common System • Variable refresh processing (if there are accessing ¡ ¡
processing common tasks) is performed.
time processing • Motion input processing
1 • Data trace processing
System • Variable refresh processing (if there are refreshing ¡ ¡
common tasks) is performed.
processing • Variable access processing external to the Control-
2 ler to ensure concurrency with task execution
System Other system common processing ¡ ¡
overhead
time
Guidelines are provided below for calculating the various processing times.
I/O refresh processing time = EtherCAT slave processing time + NX Unit processing time
The following describes how to determine the EtherCAT slave processing time and NX Unit processing
time used in the above formula.
EtherCAT slave processing time [μs] = 0.017 × pDout + 0.010 × pDin + 0.082 × pDinout
+ (1.24(*1) × Snum + 0.01 × Clen) + 151.11
The EtherCAT slave processing time is 0 if EtherCAT slaves are not connected.
*1. If the data size of an NX Unit is less than 2 bytes, calculate as 2 bytes.
Additional Information
The NX Unit processing time is 0 if NX Units are not connected to the CPU Unit.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
• Trigonometric instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-40 and Instruction Configuration for Standard ST
Instructions on page A-42 for information on the instruction configuration.
l Simple Estimate
For the number of instructions in each group, read the execution time for each instruction group
from the following graphs and calculate the total.
• Execution time for standard instructions
• Execution time for arithmetic instructions for LREAL data
• Execution time for trigonometric instructions for LREAL data
This will allow you to estimate the execution time of the user program.
500
450
400
Execution time (µs)
350
300
250
200
150
100
NX102-££££
50
0 1500 3000 4500 6000 7500 9000 10500 12000 13500 15000
Total number of instructions
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
Ladder diagram instruc- LD, AND, OUT, SET, and RE- 81.0 40.2
tions SET
Comparison instructions EQ and LT 4.1 8.3
Execution Times for Ladder Diagram Arithmetic and Trigonometric Instructions for LREAL
Data A
1000
800
NX102-££££
Execution time (µs)
700
600
500
400
NX102-££££
300
200
100
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
1000
900
800
Execution time (µs)
700
600
500
400
300
NX102-££££
200
100
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
ST constructs IF ELSIF END_IF 75.4 41.6
Comparison instructions EQ and LT 5.2 8.7
Timer and counter instruc- Timer, TON/TOF, and 2.1 18.8
tions CTU/CTD
Math instructions +, -, *, and / 3.1 10.2
BCD conversion instruc- INT_TO_DINT and 0.2 1.6
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 8.0 11.7
structions
Data movement instruc- := 5.9 7.3
tions
Total 100.0 100.0
Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL Data
900
700
NX102-££££
600
500
400
NX102-££££
300
200
100
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
NX102-££££
300
250
Processing time (µs)
200
150
100
50
0
0 1 2 3 4 5 6 7 8
Number of axes
Item Conditions
• GX-ID1611 (Ver. 1.1) Input Slave: 1
EtherCAT slaves • GX-OD1611 (Ver. 1.1) Output Slave: 1
• R88D-1SN£££-ECT Servo Drives: 4
• NX-PF0630 Additional I/O Power Supply Unit: 1
Slaves/Units that are used
• NX-ID5342 Digital Input Units: 3
NX Units
• NX-OD3153 Digital Output Units: 2
A
(on CPU Rack)
• NX-AD4608 Analog Input Unit: 1
• NX-DA3605 Analog Output Unit: 1
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
Language Ladder diagrams
Standard instruction Number of instructions: 5,000
configuration
Arithmetic instruc- Number of instructions: 200
User program
tions for LREAL data
Trigonometric in- Number of instructions: 100
structions for LREAL
data
Motion control processing Number of axes 4
Note Total length of cables connected to the built-in EtherCAT port is 10 [m].
Total number of bytes are given below for pDout, pDin and pDinout.
pDout = 2 + 23 × 4 = 94 [byte]
pDin = 3 + 1 + 26 × 4 = 108 [byte]
pDinout = 3 + 2 + 26 × 4 = 109 [byte]
The following table gives the Dnxout (output data size), Dnxin (input data size) values of the NX-
PF0630 Additional I/O Power Supply Unit, NX-ID5342 Digital Input Unit, NX-OD3153 Digital Output
Unit, NX-AD4608 Analog Input Unit, and NX-DA3605 Analog Output Unit.
Total number of bytes are given below for Dnxout and Dnxin.
Dnxout = 2 × 2 + 8 = 12 [byte]
Dnxin = 2 × 3 + 16 = 22 [byte]
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh processing time
= EtherCAT slave processing time + NX Unit processing time
= 0.017 × pDout + 0.010 × pDin + 0.082 × pDinout + (1.24 × Snum + 0.01 × Clen)
+ 151.11 + 0.149 × Dnxout + 0.064 × Dnxin + 0.549 × Dnxnum + 97.48
= 0.017 × 94 + 0.010 × 108 + 0.082 × 109 + (1.24 × 6 + 0.01 × 10) + 151.11
+ 0.149 × 12 + 0.064 × 22 + 0.549 × 8 + 97.48
= 1.598 + 1.080 + 8.938 + (7.24 + 0.1) + 151.11
+ 1.788 + 1.408 + 4.392 + 97.48
≈ 275 [μs]
Therefore, the user program execution time is the total of the above values, which is given by the
following formula.
User program execution time = 189 + 41 + 51
= 281 [μs]
Therefore, the average real processing time of the task is given by the following formula.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
= 275 + 281 + 148 + 133
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
Task period ≥ Average real processing time of task x 1.1
Because the average real processing time of the task that is calculated above is 837 μs, the task peri-
od is set to 1000 μs, which is larger than 1.1 times the average time.
The task execution times in the physical Controller depend on the logic operations that are performed
in the user program, the presence of communications commands and data links, on whether data trac-
ing is performed, and on other factors. The task execution time for a periodic task depends on whether
it is interrupted for the execution of tasks with higher execution priorities.
Use the physical Controller and verify the task execution time with the Task Execution Time Monitor.
You must use the physical Controller to check the real processing times of tasks and task execution
times. Refer to 5-11 Task Design Methods and I/O Response Times on page 5-112 for details.
The task execution times in the physical Controller depend on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.
Additional Information
Periodic tasks will be interrupted for the execution of tasks with higher execution priorities. The
real processing time of a task does not include the time for which the task is interrupted. It is the
task execution time that gives the actual time from when the task is started until it is finished,
including the interrupted time. For a detailed description of the differences between the real
processing times of tasks and the task execution times, refer to Meaning of the Task Execution
Time and the Real Processing Time of the Task on page 5-110.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
Guidelines are provided below for calculating the various processing times.
I/O refresh processing time = EtherCAT slave processing time + NX Unit processing time
The following describes how to determine the EtherCAT slave processing time and NX Unit processing
time used in the above formula.
EtherCAT slave processing time [μs] = 0.017 × pDout + 0.010 × pDin + 0.082 × pDinout
+ (1.24(*1) × Snum + 0.01 × Clen) + 151.11
pDout : Total output processing data size [byte] of EtherCAT slaves assigned to the primary periodic
task
pDin : Total input processing data size [byte] of EtherCAT slaves assigned to the primary periodic
task
pDinout : Total of the larger of the input and output processing data size of each EtherCAT slave as-
signed to the primary periodic task [byte]
Snum : Total number of EtherCAT slaves connected to the built-in EtherCAT port
Clen : Total length of cables connected to the built-in EtherCAT port [m]
Additional Information
The EtherCAT slave processing time is 0 if EtherCAT slaves are not connected.
NX Unit processing time [μs]= 0.248 × Dnxout + 0.241 × Dnxin + 0.549 × Dnxnum + 125.36
*1. If the data size of an NX Unit is less than 2 bytes, calculate as 2 bytes.
Additional Information
The NX Unit processing time is 0 if NX Units are not connected to the CPU Unit.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions page A-51 and Instruction Configuration for Standard ST
Instructions page A-53 for information on the instruction configuration.
l Simple Estimate
For the number of instructions in each group, read the execution time for each instruction group A
from the following graphs and calculate the total.
500
450
400
Execution time (µs)
350
300
250
200
150
100
NX1P2-££££
50
0 1500 3000 4500 6000 7500 9000 10500 12000 13500 15000
Total number of instructions
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
Ladder diagram instruc- LD, AND, OUT, SET, and RE- 81.0 40.2
tions SET
Comparison instructions EQ and LT 4.1 8.3
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
Timer and counter instruc- Timer, TON/TOF, and 1.6 7.3
tions CTU/CTD
Math instructions +, -, *, /, ADD, SUB, MUL, and 2.4 6.5
DIV
BCD conversion instruc- INT_TO_DINT and 0.2 1.2
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 6.2 13.0
structions
Data movement instruc- MOVE 4.6 23.5
tions
Total 100.0 100.0
Execution Times for Ladder Diagram Arithmetic and Trigonometric Instructions for LREAL
Data
1000
900
800
NX1P2-££££
Execution time (µs)
700
600
500
400
NX1P2-££££
300
200
100
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
1000
800
Execution time (µs)
700
600
500
400
300
NX1P2-££££
200
100
A
0
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
ST constructs IF ELSIF END_IF 75.4 41.6
Comparison instructions EQ and LT 5.2 8.7
Timer and counter instruc- Timer, TON/TOF, and 2.1 18.8
tions CTU/CTD
Math instructions +, -, *, and / 3.1 10.2
BCD conversion instruc- INT_TO_DINT and 0.2 1.6
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 8.0 11.7
structions
Data movement instruc- := 5.9 7.3
tions
Total 100.0 100.0
Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL Data
1000
900
800
Execution time (µs)
700
NX1P2-££££
600
500
400
NX1P2-££££
300
200
100
0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
250
Processing time (µs)
200
150
100
50
Item Conditions
• GX-ID1611 (Ver. 1.1) Input Slave: 1
EtherCAT slaves • GX-OD1611 (Ver. 1.1) Output Slave: 1
• R88D-1SN£££-ECT Servo Drives: 4
• NX-PF0630 Additional I/O Power Supply Unit: 1
Slaves/Units that are used
• NX-ID5342 Digital Input Units: 3
NX Units
• NX-OD3153 Digital Output Units: 2
(on CPU Rack)
• NX-AD4608 Analog Input Unit: 1
• NX-DA3605 Analog Output Unit: 1
Language Ladder diagrams
Standard instruction Number of instructions: 5,000
configuration
Arithmetic instruc- Number of instructions: 200
User program
tions for LREAL data
Trigonometric in- Number of instructions: 100
structions for LREAL
data
Motion control processing Number of axes 4
Note Total length of cables connected to the built-in EtherCAT port is 10 [m].
Total number of bytes are given below for pDout, pDin and pDinout.
pDout = 2 + 23 × 4 = 94 [byte]
pDin = 3 + 1 + 26 × 4 = 108 [byte]
pDinout = 3 + 2 + 26 × 4 = 109 [byte]
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh processing time
= EtherCAT slave processing time + NX Unit processing time A
= 0.017 × pDout + 0.010 × pDin + 0.082 × pDinout + (1.24 × Snum + 0.01 × Clen)
+ 151.11 + 0.248 × Dnxout + 0.241 × Dnxin + 0.549 × Dnxnum + 125.36
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
= 0.017 × 94 + 0.010 × 108 + 0.082 × 109 + (1.24 × 6 + 0.01 × 10) + 151.11
+ 0.248 × 12 + 0.241 × 22 + 0.549 × 8 + 125.36
= 1.598 + 1.080 + 8.938 + (7.24 + 0.1) + 151.11
+ 2.976 + 5.302 + 4.392 + 125.36
≈ 308 [μs]
Therefore, the user program execution time is the total of the above values, which is given by the
following formula.
User program execution time = 189 + 41 + 51
= 281 [μs]
Therefore, the average real processing time of the task is given by the following formula.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
= 308 + 281 + 148 + 133
= 870 [μs]
Because the average real processing time of the task that is calculated above is 870 μs, the task peri-
od is set to 2000 μs, which is larger than 1.1 times the average time.
The task execution times in the physical Controller depend on the logic operations that are performed
in the user program, the presence of communications commands and data links, on whether data trac-
ing is performed, and on other factors. The task execution time for a periodic task depends on whether
it is interrupted for the execution of tasks with higher execution priorities.
Use the physical Controller and verify the task execution time with the Task Execution Time Monitor.
• The task execution times in the physical Controller depend on the logic operations that are
performed in the user program, the presence of communications commands and data links,
on whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions A
on the actual system and make sure that the task periods are not exceeded and that suitable
communications performance is achieved.
• The performance may be different if the hardware revisions are different. Before you transfer
the user program, data, and parameter settings to the CPU Units with the different hardware
revisions, check them for proper execution and then use them for actual operation.
• When the hardware revisions are different, the actual execution timing of the event tasks, tag
data link service and system services may be different even if the user program, data, and
parameter settings are same.
• Processing performance of I/O refresh, user program, and motion control has been improved
in the hardware revision E or later, so the actual processing time may be shorter.
Additional Information
Periodic tasks will be interrupted for the execution of tasks with higher execution priorities. The
real processing time of a task does not include the time for which the task is interrupted. It is the
task execution time that gives the actual time from when the task is started until it is finished,
including the interrupted time. For a detailed description of the differences between the real
processing times of tasks and the task execution times, refer to Meaning of the Task Execution
Time and the Real Processing Time of the Task on page 5-110.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
Priority-17
Priority-16
Primary pe- and priori-
Processing Processing contents periodic
riodic task ty-18 peri-
task
odic tasks
I/O refresh processing I/O is refreshed for CJ-series Units (Ba- ¡ ¡ ---
sic I/O Units, Special I/O Units, and
CPU Bus Units) and EtherCAT slaves.
User program execu- Programs assigned to tasks are execut- ¡ ¡ ¡
tion ed in the order that they are assigned.
Motion control proc- • Motion control commands from the ¡ --- ---
essing user program are executed.
• Motion output processing
Common System • Variable refresh processing (if there ¡ ¡ ¡
process- common are accessing tasks) is performed.
ing time process- • Motion input processing
ing 1 • Data trace processing
System • Variable refresh processing (if there ¡ ¡ ¡
common are refreshing tasks) is performed.
process- • Variable access processing external
ing 2 to the Controller to ensure concurren-
cy with task execution
System Other system common processing ¡ ¡ ¡
overhead
time
Guidelines are provided below for calculating the various processing times.
The following describes how to determine the I/O refresh overhead time, EtherCAT slave processing
Performance of I/O refresh execution has been improved in the hardware revision E or later, so
the actual processing time may be shorter.
EtherCAT slave processing time [μs] = Tout × Dout + Tin × Din + Tref × Dinout
+ (1.24(*1) × Snum + 0.01 × Clen - Tec)
The values of the output processing time, input processing time, refresh processing time, and
EtherCAT communications adjustment time in the above formula are fixed. They are determined by
the model of the CPU Unit as given in the following table.
If the result that is calculated from the part (1.24 × Snum + 0.01 × Clen - Tec) of the above formula
is a negative number, the result is regarded as 0.
Σ (I/O refresh time for each CJ-series Unit × Number of Units) − Tcj [μs]
In the above formula, Σ represents the total processing time for all CJ-series Units.
If the result that is calculated from the above formula is a negative number, the CJ-series Unit proc-
essing time is regarded as 0 μs.
The method for calculating the I/O refresh time for each CJ-series Unit is provided later.
The value of Tcj depends on the model and the unit version of the CPU Unit.
If any of the following CJ-series Units is used, add Tcj [μs] to the result that is calculated from the
above formula, regardless of the number of Units.
• CJ1W-PH41U Isolated-type Units with Universal Inputs
• CJ1W-AD04U Isolated-type Units with Universal Inputs
• CJ1W-PDC15 Isolated-type DC Input Unit
• CJ1W-V680C11 ID Sensor Unit
• CJ1W-V680C12 ID Sensor Unit
• CJ1W-CRM21 CompoNet Master Unit
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-65 and Instruction Configuration for Standard ST
Instructions on page A-68 for information on the instruction configuration.
l Simple Estimate
For the number of instructions in each group, read the execution time for each instruction group A
from the following graphs and calculate the total.
2000
NJ501-££££
1800
1600
NJ301-££££
1400
Execution time (ms)
1200
NJ101-££££ NJ101-££££ *1
1000
800
600
NJ301-££££ *1
400
NJ501-££££ *1
200
0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
*1. It is the case when the hardware revision for the Unit is A or later. The other cases are for the Units that
the hardware revisions are in blank.
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
Ladder diagram instruc- LD, AND, OUT, SET, and RE- 81.0 40.2
tions SET
Percent of execu-
Percent of instruc-
Types of instructions Instructions tion time in instruc-
tions [%]
tion group [%]
Comparison instructions EQ and LT 4.1 8.3
Timer and counter instruc- Timer, TON/TOF, and CTU/CTD 1.6 7.3
tions
Math instructions +, -, *, /, ADD, SUB, MUL, and 2.4 6.5
DIV
BCD conversion instruc- INT_TO_DINT and 0.2 1.2
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 6.2 13.0
structions
Data movement instruc- MOVE 4.6 23.5
tions
Total 100.0 100.0
Execution Times for Ladder Diagram Arithmetic and Trigonometric Instructions for LREAL
Data
• When hardware revisions for the Units are in blank
200
NJ101-££££ NJ501-££££
180
NJ301-££££
160
NJ101-££££
140
Execution time (µs)
120
100
80
60
NJ301-££££
40
NJ501-££££
20
0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
180
NJ301-££££
160
NJ101-££££
140
Execution time (µs)
120
NJ501-££££
100
80
60
NJ101-££££
40
0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
2000
NJ501-££££
1800
1600
NJ301-££££
Execution time (ms)
1400
1200
NJ101-££££
1000
NJ101-££££ *1
800
NJ301-££££ *1
600
400
NJ501-££££ *1
200
*1. It is the case when the hardware revision for the Unit is A or later. The other cases are for the Units that
the hardware revisions are in blank.
Percent of execu-
Percent of instruc- tion time in in-
Types of instructions Instructions
tions [%] struction group
[%]
ST constructs IF ELSIF END_IF 75.4 41.6
Comparison instructions EQ and LT 5.2 8.7
Timer and counter instruc- Timer, TON/TOF, and 2.1 18.8
tions CTU/CTD
Math instructions +, -, *, and / 3.1 10.2
BCD conversion instruc- INT_TO_DINT and 0.2 1.6
tions and data conversion WORD_BCD_TO_UINT
instructions
Bit string processing in- AND and OR 8.0 11.7
structions
Data movement instruc- := 5.9 7.3
tions
Total 100.0 100.0
Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL Data
• When hardware revisions for the Units are in blank
120
100
80
60
NJ301-££££
40
0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
200
180
A
NJ301-££££
160
NJ101-££££
120
NJ501-££££
100
80
60
NJ101-££££
40
NJ501-££££
20
NJ301-££££
0
0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data
Performance of user program execution has been improved in the hardware revision E or later,
so the actual execution time may be shorter.
NJ501-££££ NJ301-££££
600 120
500 100
Unit version 1.01 Unit version 1.01
or earlier
Processing time (µs)
or earlier
400 80
Unit version 1.02
or later Unit version 1.02
or later
300 60
*1
200 40
*1
100 20
0 0
0 8 16 24 32 40 48 56 64 0 1 2 3 4 5 6 7 8
Number of axes Number of axes
NJ101-10££
120
100
Processing time (µs)
80
60
*1
40
20
0
0 1 2
Number of axes
*1. It is the case when the hardware revision for the Unit is A or later. The other cases are for the Units that the
hardware revisions are in blank.
Note You cannot use the motion control functions with an NJ101-90££ CPU Unit.
Processing performance of motion control has been improved in the hardware revision E or lat-
er, so the actual processing time may be shorter.
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
If you are using an NJ501-££££ CPU Unit with a unit version of 1.02 and the hardware revision for
the Unit is in blank, first find the average real processing time of the task for the following conditions.
The task is the primary periodic task.
Item Conditions
• GX-ID1611 (Ver. 1.1) Input Slave: 1
EtherCAT slaves • GX-OD1611 (Ver. 1.1) Output Slave: 1
• R88D-1SN£££-ECT Servo Drives: 4
• CJ1W-ID211 DC Input Unit: 1
Slaves/Units that are
• CJ1W-OD211 Transistor Output Unit: 1
used
CJ-series Units • CJ1W-AD042 Analog Input Unit: 1
(on CPU Rack) • CJ1W-DA021 Analog Output Unit: 1
• CJ1W-SCU42 Serial Communications Unit: 1
(Protocol macros are not used.)
Language Ladder diagrams
Standard instruc- Number of instructions: 5,000
tion configuration
Arithmetic instruc- Number of instructions: 200
User program tions for LREAL da-
ta
Trigonometric in- Number of instructions: 100
structions for
LREAL data
Motion control process- 4
Number of axes
ing
Note Total length of cables connected to the built-in EtherCAT port is 10 [m].
The I/O refresh overhead time is 65 μs because the EtherCAT slaves and CJ-series Units are con-
nected.
The following table gives the Dout (output processing data size), Din (input processing data size),
and Dinout (larger of the input and output data size) values of the GX-ID1611 (Ver. 1.1) Input Slave,
GX-OD1611 (Ver. 1.1) Output Slave, R88D-1SN£££-ECT Servo Drives.
Total number of bytes are given below for Dout, Din and Dinout.
Dout = 2 + 23 × 4 = 94 [byte]
Din = 3 + 1 + 26 × 4 = 108 [byte]
Dinout = 3 + 2 + 26 × 4 = 109 [byte]
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh processing time
= EtherCAT slave processing time
= Tout × Dout + Tin × Din + Tref × Dinout + (1.24 × Snum + 0.01 × Clen - Tec)
= 0.004×94 + 0.011×108 + 0.082×109 + (1.24×6 + 0.01×10 - 55)
= 0.376 + 1.188 + 8.938 + (7.44 + 0.1 - 55)
= 10.502 + 0*1
≈ 11[μs]
Because the result that is calculated inside the parenthesis is a negative number, it is regarded as
"0" μs.
Because the number of Units is all one, use the following formula for the CJ-series Unit processing
time.
CJ-series Unit processing time = Σ (I/O refresh time for each CJ-series Unit x Number of Units) -
110
Because the result that is calculated from the above formula is a negative number, the CJ-series
Unit processing time is regarded as 0 μs.
The following values of the I/O refresh overhead time, EtherCAT slave processing time, and CJ-
series Unit processing time are found by the above calculations. A
Item Value [μs]
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
I/O refresh overhead time 65
EtherCAT slave processing time 11
CJ-series Unit processing time 0
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh time = I/O refresh overhead time +
(Larger of the EtherCAT slave processing time and the CJ-series Unit processing time)
=65 + 11
=76 [μs]
Therefore, the user program execution time is the total of the above values, which is given by the
following formula.
User program execution time = 100 + 20 + 27
= 147 [μs]
Therefore, the average real processing time of the task is given by the following formula.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
=76 + 147 + 46 + 150
=419[μs]
Because the average real processing time of the task that is calculated above is 419 μs, the task peri-
od is set to 500 μs, which is larger than 1.1 times the average time.
The task execution times in the physical Controller depend on the logic operations that are performed
in the user program, the presence of communications commands and data links, on whether data trac-
ing is performed, and on other factors. The task execution time for a periodic task depends on whether
it is interrupted for the execution of tasks with higher execution priorities.
Use the physical Controller and verify the task execution time with the Task Execution Time Monitor.
You read and write the variables with the user program, with communications from external devices,
with the Sysmac Studio, or with an NS/NA-series PT.
Basically, system-defined variables are classified according to the function modules.
The variables start with the following category names.
The variables are described in the tables of this appendix as shown below.
Range of
Variable name Meaning Function Data type Reference
values
This is the system- This is the mean- The function of the variable is descri- The data The range The page of
defined variable ing of the variable. bed. type of the of values the individ-
name. The prefix variable is that the var- ual system-
gives the category given. iable can defined var-
name. take is giv- iable speci-
en. fications ta-
ble is given.
A version in parentheses of the Variable name column is the unit version of the CPU Unit when the
system-defined variable was added.
There are system-defined variables that are not supported or differ in specifications such as the
number of arrays. Refer to A-7 Specifications for Individual System-defined Variables on page
A-139 for details on the specifications for individual system-defined variables.
Range of
Variable name Meaning Function Data type Reference
values
_TaskName Task Execution Contains the number of executions of the UDINT Depends on page A-141
_ExecCount Count task. data type.
If 4294967295 is exceeded, the value re-
turns to 0 and counting is continued.
Note You cannot use this system-
defined variable in the user
program. It is used only to ac-
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
value returns to 0 and the count is contin-
ued.
If 4294967295 is exceeded, the value re-
turns to 0 and counting is continued.
Note You cannot use this system-
defined variable in the user
program. It is used only to ac-
cess task status for data trac-
ing from the Sysmac Studio.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
program. Use it in CIP mes-
sage communications when
sending a command from an
HMI or host computer.
CancelVefy Cancel Verify Flag Change this variable to TRUE to cancel BOOL TRUE or page A-145
comparing the Controller data to a back- FALSE
up file in the SD Memory Card.
Note You cannot use this system-
defined variable in the user
program. Use it in CIP mes-
sage communications when
sending a command from an
HMI or host computer.
DirName Directory Name Use this variable to specify the directory STRING(64) Depends on page A-145
name in the SD Memory Card for which data type.
to back up data.
Note You cannot use this system-
defined variable in the user
program. Use it in CIP mes-
sage communications when
sending a command from an
HMI or host computer.
_Card1BkupSta SD Memory Card _sBKUP_ST page A-146
(Ver.1.03) Backup Status A
Done Done Flag TRUE when a backup is completed. BOOL TRUE or page A-146
Note You cannot use this system- FALSE
defined variable in the user
program. Use it in CIP mes-
sage communications when
sending a command from an
HMI or host computer.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
TargetVariable Present Values of Change this variable to TRUE to set the BOOL TRUE or page A-149
Variables with the present values of variables with the Re- FALSE
Retain Attribute tain attribute as the transfer target.
Transfer Flag
TargetMemory Present Values of Change this variable to TRUE to set the BOOL TRUE or page A-149
Memory Used for CJ- present values of the memory used for FALSE
series Units with the CJ-series Units with the Retain attribute
Retain Attribute as the transfer target.
Transfer Flag
_Card1PrgTransfer- SD Memory Card _sPRGTRAN page A-149
Sta (Ver.1.11) Program Transfer SFER_STA
Status
Done Done Flag TRUE when a program transfer is com- BOOL TRUE or page A-149
pleted. FALSE
Active Active Flag TRUE when a program transfer is in BOOL TRUE or page A-149
progress. FALSE
Err Error Flag TRUE when a program transfer ended in BOOL TRUE or page A-150
an error. FALSE
_Card1RestoreCmd SD Memory Card _sRES- page A-150
(Ver.1.14) Restore Command TORE_CMD
Exec Execute Restore Change this variable to TRUE to restore BOOL TRUE or page A-150
Flag the data in a backup file on the SD Mem- FALSE
ory Card to the Controller.
DirName Directory Name Use this variable to specify the directory STRING(64) Depends on page A-150
name in the SD Memory Card in which data type.
the backup file to be restored by the sys-
tem-defined variable is stored.
Password Password Use this variable to specify the password STRING(33) Depends on page A-150
that is used for verification when you start data type.
the restore by the system-defined varia-
ble.
The password is initialized every time
when the restore by the system-defined
variable is started.
Range of
Variable name Meaning Function Data type Reference
values
_Card1RestoreCmd- User Program and Change this variable to TRUE to set a BOOL TRUE or page A-151
TargetUserProgram Settings Transfer user program or setting for the restore by FALSE
(Ver.1.14) Flag the system-defined variable as the trans-
fer target.
Always set this variable to TRUE for the
restore by the system-defined variable.
_Card1RestoreCmd- IP Address Transfer Change this variable to TRUE to include BOOL TRUE or page A-152
TargetIPAdr Flag the IP address of the built-in EtherNet/IP FALSE
(Ver.1.14) port for the restore by the system-defined
variable as the transfer target.
The IP address means setting type, IP
address, subnet mask, and default gate-
way.
_Card1RestoreCmd- Present Values of Change this variable to TRUE to set the BOOL TRUE or page A-152
TargetVariable Variables with the present values of variables with the Re- FALSE
(Ver.1.14) Retain Attribute tain attribute for the restore by the sys-
Transfer Flag tem-defined variable as the transfer tar-
get.
_Card1RestoreCmd- Present Values of Change this variable to TRUE to set the BOOL TRUE or page A-152
TargetMemory Memory Used for CJ- present values of the memory used for FALSE
(Ver.1.14) series Units with the CJ-series Units with the Retain attribute
Retain Attribute for the restore by the system-defined var-
Transfer Flag iable as the transfer target.
_Card1RestoreCmd- Unit and Slave Pa- Change this variable to TRUE to set the BOOL TRUE or page A-152
TargetUnitConfig rameters Transfer Unit and slave settings for the restore by FALSE
(Ver.1.14) Flag the system-defined variable as the trans-
fer target.
_Card1RestoreCmd- Absolute Encoder Change this variable to TRUE to set the BOOL TRUE or page A-153
TargetAbsEncoder Home Offset Transfer absolute encoder home offset for the re- FALSE
(Ver.1.14) Flag store by the system-defined variable as
the transfer target.
_Card1RestoreCmd- OPCUA Security Change this variable to TRUE to set the BOOL TRUE or page A-153
TargetOpcuaSPF Profile Transfer Flag OPC UA security profile for the restore by FALSE
(Ver.1.17) the system-defined variable as the trans-
fer target.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
_RetainFail Retention Failure TRUE at the following time (failure of re- BOOL TRUE or page A-154
Flag tention during power interruptions). FALSE
• When an error is detected in the bat-
tery-backup memory check at startup.
FALSE at the following times (no failure
of retention during power interruptions).
• When no error is detected in the bat-
tery-backup memory check at startup.
• When the user program is download-
ed.
• When the Clear All Memory operation
is performed.
Note When the absolute encoder
home offset data is not re-
tained, the status is given in
the error status of the axis vari-
able, and not in this flag.
Range of
Variable name Meaning Function Data type Reference
values
P_First_RunMode First RUN Period This flag is TRUE for only one task peri- BOOL TRUE or page A-155
Flag od after the operating mode of the Con- FALSE
troller is changed from PROGRAM mode
to RUN mode if execution of the program
is in progress.
This flag remains FALSE if execution of
the program is not in progress.
Use this flag to perform initialization
when the Controller begins operation.
Note You cannot use this system-
defined variable inside func-
tions.
P_First_Run First Program Period This flag is TRUE for one task period af- BOOL TRUE or page A-155
(Ver.1.08) Flag ter execution of the program starts. FALSE
Use this flag to perform initial processing
when execution of a program starts.
Note You cannot use this system-
defined variable inside func-
tions.
P_PRGER Instruction Error Flag This flag changes to and remains TRUE BOOL TRUE or page A-155
when an instruction error occurs in the FALSE
program or in a function/function block
called from the program. After this flag
changes to TRUE, it stays TRUE until the
user program changes it back to FALSE.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
sion is stored in element number 0.
The fractional part of the project unit ver-
sion is stored in element number 1.
Example 1) If the project unit version is
1.09, “1” is stored in element number 0
and “9” is stored in element number 1.
Example 2) If the project unit version is
1.40, “1” is stored in element number 0
and “40” is stored in element number 1.
Range of
Variable name Meaning Function Data type Reference
values
_CJB_UnitErrSta I/O Bus Unit Error Gives the error status of the I/O Bus Unit. ARRAY [0..3, 16#0000 to page A-165
Status Note Do not use this variable in the 0..9] OF 16#80F0
user program. There may be a WORD
delay in updating it. Use this
variable only to access status
through communications from
an external device.
Refer to information on the
meanings of the error status
bits at the end of this appendix
for details.
Note You can use this system-de-
fined variable only for NJ-ser-
ies CPU Units.
_CJB_InRespTm Basic Input Unit Input Contains the response times of the Basic ARRAY [0..3, 0 to 320 page A-166
Response Times Input Units. 0..9] OF
Note You can use this system-de- UINT
fined variable only for NJ-ser-
ies CPU Units.
Range of
Variable name Meaning Function Data type Reference
values
_CJB_CBU00Restart CPU Bus Unit Re- The CPU Bus Unit is restarted when the BOOL TRUE or page A-167
to start Bits corresponding variable changes to FALSE
_CJB_CBU15Restart TRUE. (It is changed to FALSE by the
system after the CPU Bus Unit is restart-
ed.)
The numbers in the variables indicate the
unit numbers of the applicable Units.
Range of
Variable name Meaning Function Data type Reference
values
_NXB_UnitRegTbl NX Unit Registration Indicates whether the NX Units on the ARRAY TRUE or page A-169
(Ver.1.13) Status CPU Unit are registered in the Unit con- [0..32] OF FALSE
figuration. This status is given as an ar- BOOL*2
ray of BOOL data. The subscript of the
array corresponds to the NX Unit num-
ber. A subscript of 0 indicates the NX Bus
Function Module.
Range of
Variable name Meaning Function Data type Reference
values
_NXB_MstrErrSta NX Bus Function Gives the status of errors that are detect- WORD 16#0000 to page A-170
(Ver.1.13) Module Master Error ed in the NX Bus Function Module of the 16#40F2
Status CPU Unit.
Note We do not recommend the use
of this variable in the user pro-
gram. There may be a delay in
updating it. Use this variable
only to access status through
communications from an exter-
nal device such as an HMI.
Refer to A-6-8 Meanings of Er-
ror Status Bits on page A-137
for the meanings of the error
status bits.
Note You can use this system-de-
fined variable only for the
NX102 CPU Units and NX1P2
CPU Units.
_NXB_UnitErrStaTbl NX Bus Function Gives the status of errors that are detect- ARRAY 16#0000 to page A-171
(Ver.1.13) Module Unit Error ed in the NX Bus Function Module of the [1..32] OF 16#40F2
Status CPU Unit. This status is given as an ar- WORD*1
ray of WORD data. The subscript of the
array corresponds to the NX Unit num-
ber.
Note We do not recommend the use
of this variable in the user pro-
gram. There may be a delay in
updating it. Use this variable
only to access status through
communications from an exter-
nal device such as an HMI.
Refer to A-6-8 Meanings of Er-
ror Status Bits on page A-137
for the meanings of the error
status bits.
Note You can use this system-de-
fined variable only for the
NX102 CPU Units and NX1P2
CPU Units.
_NXB_UnitErr- NX Unit Error Status Indicates whether errors occurred in the ARRAY TRUE or page A-171
FlagTbl NX Unit on the CPU Unit. This status is [0..32] OF FALSE
(Ver.1.13) given as an array of BOOL data. The BOOL*2
subscript of the array corresponds to the
NX Unit number. A subscript of "0" indi-
cates the NX Bus Function Module and
whether an event occurred that is detect-
ed by the NX Bus Function Module.
TRUE: Error.
FALSE: No error.
The status is "FALSE" for NX Units that
are set as unmounted Units.
Note You can use this system-de-
fined variable only for the
NX102 CPU Units and NX1P2
CPU Units.
*1. For the NX1P2 CPU Units, the data type is ARRAY [1..8] OF WORD.
*2. For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF BOOL.
Range of
Variable name Meaning Function Data type Reference
values
_MC1_GRP Axes Group Varia- Used to specify axes groups and shows AR- --- page A-173
bles multi-axes coordinated control status, RAY[0..63]
and multi-axes coordinated control set- OF
tings for motion control instructions used _sGROUP_R
for motion control 1. EF
When you create an axes group on the
System Studio, a user-defined axes
group variable with a different name is
created.
Normally, you use an Axes Group Varia-
ble with a different name.
Refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No.
W508) for details on structure members.
Note You can use this system-de-
fined variable only for NX701
CPU Units.
You can access the same val-
ues of _MC1_GRP and
_MC_GRP if the array element
numbers of them are the
same.
_MC2_GRP Axes Group Varia- Used to specify axes groups and shows AR- --- page A-174
bles multi-axes coordinated control status, RAY[0..63]
and multi-axes coordinated control set- OF
tings for motion control instructions used _sGROUP_R
for motion control 2. EF
When you create an axes group on the
System Studio, a user-defined axes
group variable with a different name is
created.
Normally, you use an Axes Group Varia-
ble with a different name.
Refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No.
W508) for details on structure members.
Note You can use this system-de-
fined variable only for NX701
CPU Units.
_MC_AX Axis Variables NX701 CPU Units: Used to specify axes AR- --- page A-174
and shows single-axis control status, and RAY[0..255]
single-axis control settings for motion OF _sAX-
control instructions used for motion con- IS_REF*4
trol 1.
NX102 CPU Units, NX1P2 CPU Units,
and NJ-series CPU Units: Used to speci-
fy axes and shows single-axis control
status, and single-axis control settings for
motion control instructions.
When you create an axis on the System
Studio, a user-defined axis variable with
a different name is created.
Normally, you use an Axis Variable with a
different name.
Refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No.
W508) for details on structure members.
Range of
Variable name Meaning Function Data type Reference
values
_MC1_AX Axis Variables Used to specify axes and shows single- AR- --- page A-174
axis control status, and single-axis con- RAY[0..255]
trol settings for motion control instruc- OF _sAX-
tions used for motion control 1. IS_REF
When you create an axis on the System
Studio, a user-defined axis variable with
a different name is created.
Range of
Variable name Meaning Function Data type Reference
values
_EC_NetCfgCmpErr Network Configura- TRUE if one of the following events oc- BOOL TRUE or page A-177
tion Verification Error curred. FALSE
• Network Configuration Verification Er-
ror (84220000 hex)
• Network Configuration Verification Er-
ror (Slave Unconnected) (84380000
hex)
Range of
Variable name Meaning Function Data type Reference
values
_EC_IndataInvalidErr Input Process Data TRUE if the Input Process Data Invalid BOOL TRUE or page A-179
(Ver.1.13) Invalid Error Error (842F0000 hex) event occurred. FALSE
_EC_CommErrTbl Communications Er- Slaves are given in the table in the order Array [1..512] TRUE or page A-179
ror Slave Table of slave node addresses. The corre- OF BOOL*1 FALSE
sponding slave element is TRUE if the
master detected an error for the slave.
_EC_CycleExceeded EtherCAT Communi- TRUE if the EtherCAT Communications BOOL TRUE or page A-179
cations Cycle Ex- Cycle Exceeded (34410000 hex) event FALSE
ceeded occurred.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
*1. For the NX102 CPU Units, NX1P2 CPU Units, and NJ-series CPU Units, the node address is 1 to 192 and the data type is ARRAY
[1..192] OF WORD.
Additional Information
Note The values of all system-defined variables that are related to errors in EtherCAT communications do not
change until the cause of the error is removed and then the error in the Controller is reset with the trou-
bleshooting functions of the Sysmac Studio or the ResetECError instruction.
Range of
Variable name Meaning Function Data type Reference
values
_EC_PktSaving Saving Packet Data Shows whether a packet data file is being BOOL TRUE or page A-182
File saved. FALSE
TRUE: Packet data file being saved.
FALSE: Packet data file not being saved.
_EC_InDataInvalid Input Data Invalid TRUE when process data communica- BOOL TRUE or page A-182
tions established in the primary periodic FALSE
task are not normal and the input data is
Note All system-defined variables that are related to the status of EtherCAT communications give the current status.
Range of
Variable name Meaning Function Data type Reference
values
_EC_StatisticsLog- Diagnosis/Statistics Specifies the interval to write the diag- UINT 0, or 30 to page A-183
CycleSec Log Cycle nostic and statistical information of the di- 1800
(Ver.1.11) agnosis/statistics log in units of seconds.
When 0 is specified, the diagnostic and
statistical information is written only once
when the diagnosis/statistics log is
ended.
Note The write interval does not
change even if you change the
value of this system-defined
variable while the diagnosis/
statistics log operation is in
progress.
_EC_Statistic- Diagnosis/Statistics TRUE while the diagnosis/statistics log BOOL TRUE or page A-184
sLogBusy Log Busy operation is in progress. FALSE
(Ver.1.11)
_EC_StatisticsLogErr Diagnosis/Statistics TRUE when the diagnosis/statistics log BOOL TRUE or page A-184
(Ver.1.11) Log Error failed to start or it is impossible to write FALSE
into the log.
The value of this flag is determined when
_EC_StatisticsLogBusy (Diagnosis/
Statistics Log Busy) changes to FALSE
after the diagnosis/statistics log operation
is started.
The error end is caused by the following.
• Another records cannot be added in
the log file because the capacity of the
SD Memory Card is fully used.
• The SD Memory Card is write-protect-
ed.
• There is no SD Memory Card.
• The function cannot be started be-
cause the value specified for
_EC_StatisticsLogCycleSec (Diagno-
sis/Statistics Log Cycle) is invalid.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_PortErr Communications Port This is the error status variable for the WORD 16#0000 to page A-185
Error communications port. 16#00F0
NX-series CPU Units: Represents the
collective status of the following error
flags.
• _EIP1_MacAdrErr (Port1 MAC Ad-
dress Error)
• _EIP1_LanHwErr (Port1 Communica-
tions Controller Error)
• _EIP1_EtnCfgErr (Port1 Basic Ether-
net Setting Error)
• _EIP1_IPAdrCfgErr (Port1 IP Address
Setting Error)
• _EIP1_IPAdrDupErr (Port1 IP Address
Duplication Error)
• _EIP1_BootpErr (Port1 BOOTP Serv-
er Error)
• _EIP_DNSCfgErr (DNS Setting Error)
• _EIP_DNSSrvErr (DNS Server Con-
nection Error)
• _EIP_IPRTblErr (IP Route Table Error)
NJ-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP_MacAdrErr (MAC Address Error)
• _EIP_LanHwErr (Communications
Controller Error)
• _EIP_EtnCfgErr (Basic Ethernet Set-
ting Error)
• _EIP_IPAdrCfgErr (IP Address Setting
Error)
• _EIP_IPAdrDupErr (IP Address Dupli-
cation Error)
• _EIP_BootpErr (BOOTP Server Error)
• _EIP_IPRTblErr (IP Route Table Error)
Note If a Link OFF Detected or Built-
in EtherNet/IP Error occurs, it
is recorded in the event log
and then the corresponding bit
turns ON.
Refer to Meanings of Error
Status Bits for the meanings of
the error status bits.
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_PortErr Communications This is the error status variable for the WORD 16#0000 to page A-185
Port1 Error communications port 1. 16#00F0
Represents the collective status of the
following error flags.
• _EIP1_MacAdrErr (Port1 MAC Ad-
dress Error)
• _EIP1_LanHwErr (Port1 Communica-
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_PortErr Communications This is the error status variable for the WORD 16#0000 to page A-186
Port2 Error communications port 2. 16#00F0
Represents the collective status of the
following error flags.
• _EIP2_MacAdrErr (Port2 MAC Ad-
dress Error)
• _EIP2_LanHwErr (Port2 Communica-
tions Controller Error)
• _EIP2_EtnCfgErr (Port2 Basic Ether-
net Setting Error)
• _EIP2_IPAdrCfgErr (Port2 IP Address
Setting Error)
• _EIP2_IPAdrDupErr (Port2 IP Address
Duplication Error)
• _EIP2_BootpErr (Port2 BOOTP Serv-
er Error)
• _EIP_DNSCfgErr (DNS Setting Error)
• _EIP_DNSSrvErr (DNS Server Con-
nection Error)
• _EIP_IPRTblErr (IP Route Table Error)
Note If a Link OFF Detected or Built-
in EtherNet/IP Error occurs, it
is recorded in the event log
and then the corresponding bit
turns ON.
Refer to Meanings of Error
Status Bits for the meanings of
the error status bits.
Note You can use this system-de-
fined variable only for the
NX701, and NX102 CPU Units.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_CipErr CIP Communications This is the error status variable for CIP WORD 16#0000 to page A-186
Error communications. 16#00F0
NX-series CPU Units: Represents the
collective status of the following error
flags.
• _EIP1_IdentityErr (CIP Communica-
tions1 Identity Error)
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_CipErr CIP Communica- This is the error status variable for CIP WORD 16#0000 to page A-187
tions1 Error communications 1. 16#00F0
Represents the collective status of the
following error flags.
• _EIP1_IdentityErr (CIP Communica-
tions1 Identity Error)
• _EIP1_TDLinkCfgErr (CIP Communi-
cations1 Tag Data Link Setting Error)
• _EIP1_TDLinkOpnErr (CIP Communi-
cations1 Tag Data Link Connection
Failed)
• _EIP1_TDLinkErr (CIP Communica-
tions1 Tag Data Link Communications
Error)
• _EIP1_TagAdrErr (CIP Communica-
tions1 Tag Name Resolution Error)
• _EIP1_MultiSwONErr (CIP Communi-
cations1 Multiple Switches ON Error)
Note If a Tag Name Resolution Error
occurs, it is recorded in the
event log and this variable
changes to TRUE. Refer to
Meanings of Error Status Bits
for the meanings of the error
status bits.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
_EIP2_CipErr CIP Communica- This is the error status variable for CIP WORD 16#0000 to page A-187
tions2 Error communications 2. 16#00F0
Represents the collective status of the
following error flags.
• _EIP2_IdentityErr (CIP Communica-
tions2 Identity Error)
• _EIP2_TDLinkCfgErr (CIP Communi-
cations2 Tag Data Link Setting Error)
• _EIP2_TDLinkOpnErr (CIP Communi-
cations2 Tag Data Link Connection
Failed)
• _EIP2_TDLinkErr (CIP Communica-
tions2 Tag Data Link Communications
Error)
• _EIP2_TagAdrErr (CIP Communica-
tions2 Tag Name Resolution Error)
• _EIP2_MultiSwONErr (CIP Communi-
cations2 Multiple Switches ON Error)
Note If a Tag Name Resolution Error
occurs, it is recorded in the
event log and this variable
changes to TRUE. Refer to
Meanings of Error Status Bits
for the meanings of the error
status bits.
Note You can use this system-de-
fined variable only for the
NX701, and NX102 CPU Units.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TcpAppErr TCP Application This is the error status variable for TCP WORD 16#0000 to page A-187
Communications Er- application communications. 16#00F0
ror Represents the collective status of the
following error flags.
• _EIP_TcpAppCfgErr (TCP Application
Setting Error)
• _EIP_NTPSrvErr (NTP Server Con-
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_LanHwErr Port2 Communica- Indicates that a communications control- BOOL TRUE or page A-189
tions Controller Error ler failure occurred on the communica- FALSE
tions port 2.
TRUE: Failure
FALSE: Normal
Note You can use this system-de-
fined variable only for the
NX701 and NX102 CPU Units.
_EIP_EtnCfgErr Basic Ethernet Set- NX-series CPU Units: Indicates that the BOOL TRUE or page A-189
ting Error Ethernet communications speed setting FALSE
(Speed/Duplex) for the communications
port 1 is incorrect. Or, a read operation
failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
NJ-series CPU Units: Indicates that the
Ethernet communications speed setting
(Speed/Duplex) is incorrect. Or, a read
operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
_EIP1_EtnCfgErr Port1 Basic Ethernet Indicates that the Ethernet communica- BOOL TRUE or page A-189
Setting Error tions speed setting (Speed/Duplex) for FALSE
the communications port 1 is incorrect.
Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
_EIP2_EtnCfgErr Port2 Basic Ethernet Indicates that the Ethernet communica- BOOL TRUE or page A-190
Setting Error tions speed setting (Speed/Duplex) for FALSE
the communications port 2 is incorrect.
Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
Note You can use this system-de-
fined variable only for the
NX701 and NX102 CPU Units.
_EIP_IPAdrCfgErr IP Address Setting NX-series CPU Units: Indicates the IP BOOL TRUE or page A-190
Error address setting errors for the communi- FALSE
cations port 1.
TRUE:
• There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the
BOOTP server is inconsistent.
FALSE: Normal
NJ-series CPU Units: Indicates the IP ad-
dress setting errors.
TRUE:
• There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the
BOOTP server is inconsistent.
• The default gateway settings are not
correct.
FALSE: Normal
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_IPAdrCfgErr Port1 IP Address Indicates the IP address setting errors for BOOL TRUE or page A-190
Setting Error the communications port 1. FALSE
TRUE:
• There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the
BOOTP server is inconsistent.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_BootpErr BOOTP Server Error NX-series CPU Units: Indicates that a BOOL TRUE or page A-192
BOOTP server connection failure occur- FALSE
red on the communications port 1.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP address
was normally obtained from the BOOTP
server.
NJ-series CPU Units: Indicates that a
BOOTP server connection failure occur-
red.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP address
was normally obtained from the BOOTP
server.
_EIP1_BootpErr Port1 BOOTP Server Indicates that a BOOTP server connec- BOOL TRUE or page A-192
Error tion failure occurred on the communica- FALSE
tions port 1.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP address
was normally obtained from the BOOTP
server.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
_EIP2_BootpErr Port2 BOOTP Server Indicates that a BOOTP server connec- BOOL TRUE or page A-192
Error tion failure occurred on the communica- FALSE
tions port 2.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP address
was normally obtained from the BOOTP
server.
Note You can use this system-de-
fined variable only for the
NX701 and NX102 CPU Units.
_EIP_IPRTblErr IP Route Table Error NX-series CPU Units: Indicates that the BOOL TRUE or page A-193
default gateway settings or IP router ta- FALSE
ble settings are incorrect.
Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
NJ-series CPU Units: Indicates that the
IP router table or hosts settings are incor-
rect. Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
Range of
Variable name Meaning Function Data type Reference
values
_EIP_IdentityErr Identity Error NX-series CPU Units: Indicates that the BOOL TRUE or page A-193
identity information for CIP communica- FALSE
tions 1 (which you cannot overwrite) is in-
correct. Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
NJ-series CPU Units: Indicates that the
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TDLinkOpnErr Tag Data Link Con- NX-series CPU Units: Indicates that es- BOOL TRUE or page A-195
nection Failed tablishing a tag data link connection for FALSE
CIP communications 1 failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the following
causes.
• The information registered for a target
node in the tag data link parameters is
different from the actual node informa-
tion.
• There was no response from the re-
mote node.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that es-
tablishing a tag data link connection
failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the following
causes.
• The information registered for a target
node in the tag data link parameters is
different from the actual node informa-
tion.
• There was no response from the re-
mote node.
FALSE: Other than the above.
_EIP1_TDLinkOp- CIP Communica- Indicates that establishing a tag data link BOOL TRUE or page A-195
nErr tions1 Tag Data Link connection for CIP communications 1 FALSE
Connection Failed failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the following
causes.
• The information registered for a target
node in the tag data link parameters is
different from the actual node informa-
tion.
• There was no response from the re-
mote node.
FALSE: Other than the above.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
_EIP2_TDLinkOp- CIP Communica- Indicates that establishing a tag data link BOOL TRUE or page A-195
nErr tions2 Tag Data Link connection for CIP communications 2 FALSE
Connection Failed failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the following
causes.
• The information registered for a target
node in the tag data link parameters is
different from the actual node informa-
tion.
• There was no response from the re-
mote node.
FALSE: Other than the above.
Note You can use this system-de-
fined variable only for the
NX701 and NX102 CPU Units.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TDLinkErr Tag Data Link Com- NX-series CPU Units: Indicates that a BOOL TRUE or page A-196
munications Error timeout occurred in a tag data link con- FALSE
nection for CIP communications 1.
TRUE: A timeout occurred.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that a
timeout occurred in a tag data link con-
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TagAdrErr Tag Name Resolution NX-series CPU Units: Indicates that the BOOL TRUE or page A-197
Error tag resolution for CIP communications 1 FALSE
failed (i.e., the address could not be iden-
tified from the tag name).
TRUE: Tag resolution failed (i.e., the ad-
dress could not be identified from the tag
name). The following causes are possi-
ble.
• The size of the network variable is dif-
ferent from the tag settings.
• The I/O direction that is set in the tag
data link settings does not agree with
the I/O direction of the variable in the
CPU Unit.
• There is no network variable in the
CPU Unit that corresponds to the tag
setting.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that tag
name resolution failed (i.e., the address
could not be identified from the tag
name).
TRUE: Tag resolution failed (i.e., the ad-
dress could not be identified from the tag
name). The following causes are possi-
ble.
• The size of the network variable is dif-
ferent from the tag settings.
• The I/O direction that is set in the tag
data link settings does not agree with
the I/O direction of the variable in the
CPU Unit.
• There is no network variable in the
CPU Unit that corresponds to the tag
setting.
FALSE: Other than the above.
_EIP1_TagAdrErr CIP Communica- Indicates that the tag resolution for CIP BOOL TRUE or page A-197
tions1 Tag Name communications 1 failed (i.e., the ad- FALSE
Resolution Error dress could not be identified from the tag
name).
TRUE: Tag resolution failed (i.e., the ad-
dress could not be identified from the tag
name). The following causes are possi-
ble.
• The size of the network variable is dif-
ferent from the tag settings.
• The I/O direction that is set in the tag
data link settings does not agree with
the I/O direction of the variable in the
CPU Unit.
• There is no network variable in the
CPU Unit that corresponds to the tag
setting.
FALSE: Other than the above.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TagAdrErr CIP Communica- Indicates that the tag resolution for CIP BOOL TRUE or page A-198
tions2 Tag Name communications 2 failed (i.e., the ad- FALSE
Resolution Error dress could not be identified from the tag
name).
TRUE: Tag resolution failed (i.e., the ad-
dress could not be identified from the tag
name). The following causes are possi-
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TcpAppCfgErr TCP Application Set- TRUE: At least one of the set values for a BOOL TRUE or page A-199
ting Error TCP application (FTP, NTP, SNMP) is in- FALSE
correct. Or, a read operation failed.
FALSE: Normal
_EIP_NTPSrvErr NTP Server Connec- TRUE: The NTP client failed to connect BOOL TRUE or page A-199
tion Error to the server (timeout). FALSE
FALSE: NTP is not set. Or, NTP is set
and the connection was successful.
_EIP_DNSSrvErr DNS Server Connec- TRUE: The DNS client failed to connect BOOL TRUE or page A-199
tion Error to the server (timeout). FALSE
FALSE: DNS is not enabled. Or, DNS is
enabled and the connection was suc-
cessful.
*1. With the NJ-series CPU Unit, this variable can be used with the unit version 1.11 or later.
_EIP2_CipErr, and _EIP_TcpAppErr variables in the second level is TRUE, then the _EIP_ErrSta
variable in the first level also changes to TRUE. Therefore, you can check the values of system-
defined variables in a higher level to see if an error has occurred for a variable in a lower level.
Note 1. You can access the same values of the system-defined variables whose variable names with _EIP1
and the system-defined variables whose variable names with _EIP. For example, you can access the
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_EtnOnlineSta Port2 Online Indicates that the built-in EtherNet/IP BOOL TRUE or page A-200
port's communications can be used via FALSE
the communications port 2 (that is, the
link is ON, IP address is defined, and
there are no errors.)
TRUE: The built-in EtherNet/IP port’s
communications can be used.
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TDLinkAll- CIP Communica- Indicates that all tag data links are com- BOOL TRUE or page A-201
RunSta tions1 All Tag Data municating in CIP communications 1. FALSE
Link Communications TRUE: Tag data links are communicating
Status in all connections as the originator.
FALSE: An error occurred in at least one
connection.
Note You can use this system-de-
fined variable only for NX-ser-
ies CPU Units.
_EIP2_TDLinkAll- CIP Communica- Indicates that all tag data links are com- BOOL TRUE or page A-201
RunSta tions2 All Tag Data municating in CIP communications 2. FALSE
Link Communications TRUE: Tag data links are communicating
Status in all connections as the originator.
FALSE: An error occurred in at least one
connection.
Note You can use this system-de-
fined variable only for the
NX701 CPU Units and NX102
CPU Units.
_EIP_RegTarget- Registered Target NX-series CPU Units: Gives a list of no- ARRAY TRUE or page A-202
Sta[255] Node Information des for which built-in EtherNet/IP connec- [0..255] OF FALSE
tions are registered for CIP communica- BOOL
tions 1.
This variable is valid only when the built-
in EtherNet/IP port is the originator.
Array[x] is TRUE:
The connection to the node with a target
node ID of x is registered.
Array[x] is FALSE:
The connection to the node with a target
node ID of x is not registered.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_RegTarget- CIP Communica- Gives a list of nodes for which built-in ARRAY TRUE or page A-202
Sta[255] tions2 Registered EtherNet/IP connections are registered [0..255] OF FALSE
Target Node Informa- for CIP communications 2. BOOL
tion This variable is valid only when the built-
in EtherNet/IP port is the originator.
Array[x] is TRUE:
The connection to the node with a target
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_EstbTarget- CIP Communica- Gives a list of nodes that have normally ARRAY TRUE or page A-203
Sta[255] tions2 Normal Target established built-in EtherNet/IP connec- [0..255] OF FALSE
Node Information tions for CIP communications 2. BOOL
Gives a list of nodes that have normally
established EtherNet/IP connections for
CIP communications 2.
Array[x] is TRUE:
The connection to the node with a target
node ID of x was established normally.
Array[x] is FALSE:
The connection to the node with a target
node ID of x was not established, or an
error occurred.
Note You can use this system-de-
fined variable only for the
NX701 CPU Units and NX102
CPU Units.
_EIP_TargetPLCMo- Target PLC Operat- NX-series CPU Units: Shows the operat- ARRAY TRUE or page A-204
deSta[255] ing Mode ing status of the target node Controllers [0..255] OF FALSE
that are connected for CIP communica- BOOL
tions 1, with the built-in EtherNet/IP port
as the originator.
The array elements are valid only when
the corresponding Normal Target Node
Information is TRUE. If the corresponding
Normal Target Node Information is
FALSE, it indicates the previous operat-
ing status.
Array[x] is TRUE:
This is the operating state of the target
Controller with a node address of x.
Array[x] is FALSE:
Other than the above.
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TargetPLC- CIP Communica- Shows the operating status of the target ARRAY TRUE or page A-204
ModeSta[255] tions1 Target PLC node Controllers that are connected for [0..255] OF FALSE
Operating Mode CIP communications 1, with the built-in BOOL
EtherNet/IP port as the originator.
The array elements are valid only when
the corresponding Normal Target Node
Information is TRUE. If the corresponding
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TargetPL- Target PLC Error In- NX-series CPU Units: Shows the error ARRAY TRUE or page A-205
CErr[255] formation status (logical OR of fatal and non-fatal [0..255] OF FALSE
errors) of the target node Controllers that BOOL
are connected for CIP communications 1,
with the built-in EtherNet/IP ports as the
originator. The array elements are valid
only when the corresponding Normal Tar-
get Node Information is TRUE. The im-
mediately preceding value is retained if
this variable is FALSE.
Array[x] is TRUE:
A fatal or non-fatal error occurred in the
target Controller with a target node ID of
x.
Array[x] is FALSE:
Other than the above.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TargetPL- CIP Communica- Shows the error status (logical OR of fa- ARRAY TRUE or page A-205
CErr[255] tions2 Target PLC Er- tal and non-fatal errors) of the target [0..255] OF FALSE
ror Information node Controllers that are connected for BOOL
CIP communications 2, with the built-in
EtherNet/IP ports as the originator. The
array elements are valid only when the
corresponding Normal Target Node Infor-
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TargetNo- Target Node Error In- NX-series CPU Units: Indicates that the ARRAY TRUE or page A-206
deErr[255] formation connection for the Registered Target [0..255] OF FALSE
Node Information for CIP communica- BOOL
tions 1 was not established or that an er-
ror occurred in the target Controller.
The array elements are valid only when
the Registered Target Node Information
is TRUE.
Array[x] is TRUE:
A connection was not normally establish-
ed with the target node for a target node
ID of x (the Registered Target Node Infor-
mation is TRUE and the Normal Target
Node Information is FALSE), or a con-
nection was established with the target
node but an error occurred in the target
Controller.
Array[x] is FALSE:
The target node is not registered for a
target node ID of x (the Registered Target
Node Information is FALSE), or a con-
nection was normally established with the
target node (the Registered Target Node
Information is TRUE and the Normal Tar-
get Node Information is TRUE). An error
occurred in the target Controller (the Tar-
get PLC Error Information is TRUE).
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TargetNo- CIP Communica- Indicates that the connection for the Reg- ARRAY TRUE or page A-206
deErr[255] tions1 Target Node istered Target Node Information for CIP [0..255] OF FALSE
Error Information communications 1 was not established or BOOL
that an error occurred in the target Con-
troller.
The array elements are valid only when
the Registered Target Node Information
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TargetNo- CIP Communica- Indicates that the connection for the Reg- ARRAY TRUE or page A-207
deErr[255] tions2 Target Node istered Target Node Information for CIP [0..255] OF FALSE
Error Information communications 2 was not established or BOOL
that an error occurred in the target Con-
troller.
The array elements are valid only when
the Registered Target Node Information
is TRUE.
Array[x] is TRUE:
A connection was not normally establish-
ed with the target node for a target node
ID of x (the Registered Target Node Infor-
mation is TRUE and the Normal Target
Node Information is FALSE), or a con-
nection was established with the target
node but an error occurred in the target
Controller.
Array[x] is FALSE:
The target node is not registered for a
target node ID of x (the Registered Target
Node Information is FALSE), or a con-
nection was normally established with the
target node (the Registered Target Node
Information is TRUE and the Normal Tar-
get Node Information is TRUE). An error
occurred in the target Controller (the Tar-
get PLC Error Information is TRUE).
Note You can use this system-de-
fined variable only for the
NX701 CPU Units and NX102
CPU Units.
_EIP_NTPResult NTP Operation Infor- Use the GetNTPStatus instruction to read _sNTP_RE- page A-207
mation the NTP operation information from the SULT
user program.
Direct access is not possible.
.ExecTime NTP Last Operation Gives the last time that NTP processing DATE_AND_ Depends on page A-207
Time ended normally. TIME data type.
The time that was obtained from the NTP
server is stored when the time is ob-
tained normally.
The time is not stored if it is not obtained
from the NTP server normally.
Note Do not use this variable in the
user program. There may be a
delay in updating it. Use this
variable only to access status
through communications from
an external device.
.ExecNormal NTP Operation Re- TRUE: Indicates an NTP normal end. BOOL TRUE or page A-207
sult FALSE: Indicates that NTP operation FALSE
ended in an error or has not been execut-
ed even once.
Note Do not use this variable in the
user program. There may be a
delay in updating it. Use this
variable only to access status
through communications from
an external device.
For the NX-series Controller, the communications status of CIP communications 1 and CIP
communications 2 is shown by the combination of the values of four system-defined variables in
the same way as shown in the above table.
• CIP Communications 1
• _EIP1_RegTargetSta (CIP Communications1 Registered Target Node Information)
• _EIP1_EstbTargetSta (CIP Communications1 Normal Target Node Information)
• _EIP1_TargetPLCErr (CIP Communications1 Target PLC Error Information)
• _EIP1_TargetNodeErr (CIP Communications1 Target Node Error Information)
• CIP Communications 2
• _EIP2_RegTargetSta (CIP Communications2 Registered Target Node Information)
• _EIP2_EstbTargetSta (CIP Communications2 Normal Target Node Information)
• _EIP2_TargetPLCErr (CIP Communications2 Target PLC Error Information)
• _EIP2_TargetNodeErr (CIP Communications2 Target Node Error Information)
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TDLink- CIP Communica- Change this variable to TRUE to stop tag BOOL TRUE or page A-209
StopCmd tions1 Tag Data Link data links for CIP communications 1. FALSE
Communications It automatically changes back to FALSE
Stop Switch after tag data link operation stops.
Note Do not force this switch to
change to FALSE from the
user program or from the Sys-
The meanings of the bits are shown in the following table. However, do not use the following variables
in the user program: _ErrSta (Controller Error Status), _CJB_ErrSta (I/O Bus Error Status),
_CJB_MstrErrSta (I/O Bus Master Error Status), _CJB_UnitErrSta (I/O Bus Unit Error Status),
_NXB_ErrSta (NX Bus Function Module Error Status), _NXB_MstrErrSta (NX Bus Function Module
Master Error Status), and _NXB_UnitErrStaTbl (NX Bus Function Module Unit Error Status). There
may be a delay in updating them and concurrency problems in relation to the error status of the func-
tion module. Use these variables only to access status through communications from an external de-
vice.
Bit: 1 5 1 4 1 3 1 2 11 1 0 9 8 7 6 5 4 3 2 1 0
WORD - - - - - - - - - -
Bit Description
15 Master-detected error: This bit indicates whether the master detected a Controller error in the Unit/slave for the
error status of the Controller error.
TRUE: The master detected a Controller error.
FALSE: The master has not detected a Controller error. (Valid for _CJB_UnitErrSta.)
14 Collective slave error status: This bit indicates if a Controller error is detected for levels (e.g., a Unit, slave, axis,
or axes group) that are lower than the event source (i.e., a function module).
TRUE: A Controller error has occurred at a lower level.
FALSE: A Controller error has not occurred at a lower level. (Valid for _CJB_ErrSta, _MC_ErrSta, and _EC_Err-
Sta.)
13 to 8 Reserved.
7 This bit indicates whether a major fault level Controller error has occurred.
TRUE: A major fault level Controller error has occurred.
FALSE: A major fault level Controller error has not occurred.
6 This bit indicates whether a partial fault level Controller error has occurred.
TRUE: A partial fault level Controller error has occurred.
FALSE: A partial fault level Controller error has not occurred.
5 This bit indicates whether a minor fault level Controller error has occurred.
TRUE: A minor fault level Controller error has occurred.
FALSE: A minor fault level Controller error has not occurred.
4 This bit indicates whether an observation level Controller error has occurred.
TRUE: An observation level Controller error has occurred.
FALSE: An observation level Controller error has not occurred.
3 to 0 Reserved.
Note Bits 14 and 15 are never TRUE for the built-in EtherNet/IP port.
Variable name This is the system-defined variable name. The Members (for struc- The member names are given for
prefix gives the category name. tures) structure variables only.
Meaning This is the meaning of the variable. Global/local Global: Global variable, Local: Local
variable
Function The function of the variable is described.
Data type The data type of the variable is given. Range of values The range of values that the variable
can take is given.
R/W access R: Read only, Retained The Retain at- Network Publish The Network Publish attribute of the
RW: Read/ tribute of the variable is given.
write variable is
given.
Usage in user pro- Whether you Related in- The instructions that are related to the variable are given.
gram can use the structions If you cannot use the variable directly in the user program, the instructions that
A
variable di- access the variable are given.
rectly in the
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
user program
is specified.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
gram structions struction.
• GetMyTaskStatus
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name _Card1Access
Meaning SD Memory Card Access Flag Global/local Global
Function TRUE during SD Memory Card access.
TRUE: Card is being accessed.
FALSE: Card is not being accessed.
The system updates the flag every 100 ms. Because of this, access to the SD Memory Card is shown by this flag
with a delay of up to 100 ms. We therefore do not recommend the use of this variable in the user program.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
*1. This system-defined variable was added for unit version 1.03 of the CPU Unit.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
*1. This system-defined variable was added for unit version 1.03 of the CPU Unit.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Data type Structure: _sPRGTRANSFER_CMD, Member: Range of values TRUE or FALSE
BOOL
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
*1. This system-defined variable was added for unit version 1.11 of the CPU Unit.
*2. This system-defined variable is not applicable for the data backup function even with a Retain attribute.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name _Card1RestoreSta*1 Member name .Err
Meaning Error Flag Global/local Global
Function TRUE when a restore operation ended in an error.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sRESTORE_STA, Member: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
*1. This system-defined variable was added for unit version 1.14 of the CPU Unit.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
gram structions
*1. This system-defined variable was added for unit version 1.17 of the CPU Unit.
*2. This system-defined variable is not applicable for the data backup function even with a Retain attribute.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name P_First_Run*1
Meaning First Program Period Flag Global/local Local
Function This flag is TRUE for one task period after execution of the program starts.
Use this flag to perform initial processing when execution of a program starts.
Note You cannot use this system-defined variable inside functions.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user pro- Possible. Related in- ---
gram structions
*1. This system-defined variable was added for unit version 1.08 of the CPU Unit.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
*1. This system-defined variable was added for unit version 1.10 of the CPU Unit.
Note The values of all system-defined variables that are related to errors in EtherCAT communications do not change until
the cause of the error is removed and then the error in the Controller is reset with the troubleshooting functions of the
Sysmac Studio or the ResetECError instruction.
Note 1. All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note 2. The variable temporarily changes to TRUE if the EC_DisconnectSlave (Disconnect EtherCAT Slave) instruction,
EC_ConnectSlave (Connect EtherCAT Slave) instruction, or EC_ChangeEnableSetting (Enable/Disable EtherCAT
Slave) instruction is executed.
Note 1. All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note 2. The variable temporarily changes to TRUE if the EC_DisconnectSlave (Disconnect EtherCAT Slave) instruction,
EC_ConnectSlave (Connect EtherCAT Slave) instruction, or EC_ChangeEnableSetting (Enable/Disable EtherCAT
Slave) instruction is executed.
Note 1. All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note 2. The variable temporarily changes to TRUE if the EC_DisconnectSlave (Disconnect EtherCAT Slave) instruction,
EC_ConnectSlave (Connect EtherCAT Slave) instruction, or EC_ChangeEnableSetting (Enable/Disable EtherCAT
Slave) instruction is executed.
NJ-series CPU Units: Indicates that the same IP address is assigned to more than one node.
NJ-series CPU Units: Indicates that a BOOTP server connection failure occurred.
TRUE: There was a failure to connect to the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or BOOTP is enabled and an IP address was normally obtained from the
BOOTP server.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that the IP router table or hosts settings are incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that the tag data link settings are incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed.
FALSE: Normal
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that establishing a tag data link connection failed.
TRUE: Establishing a tag data link connection failed due to one of the following causes.
• The information registered for a target node in the tag data link parameters is different from the actual node
information.
• There was no response from the remote node.
FALSE: Other than the above.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
A
Variable name _EIP1_TDLinkOpnErr
Meaning CIP Communications1 Tag Data Link Connec- Global/local Global
NJ-series CPU Units: Indicates that a timeout occurred in a tag data link connection.
TRUE: A timeout occurred.
FALSE: Other than the above.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that tag name resolution failed (i.e., the address could not be identified from the
tag name).
TRUE: Tag resolution failed (i.e., the address could not be identified from the tag name). The following causes are
possible.
• The size of the network variable is different from the tag settings.
• The I/O direction that is set in the tag data link settings does not agree with the I/O direction of the variable in
the CPU Unit.
• There is no network variable in the CPU Unit that corresponds to the tag setting.
FALSE: Other than the above.
A
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
NJ-series CPU Units: Indicates that more than one switch turned ON at the same time
TRUE: More than one data link start/stop switch changed to TRUE at the same time.
FALSE: Other than the above.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that the built-in EtherNet/IP port's communications can be used via the communi-
cations port (that is, the link is ON and IP address is defined, and there are no errors.)
TRUE: The built-in EtherNet/IP port’s communications can be used.
FALSE: The built-in EtherNet/IP port’s communications is disabled due to an error in initial processing, restart
processing, or link OFF status.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that at least one connection is in normal operation.
TRUE: Normal operation
FALSE: Other than the above.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Indicates that all tag data links are communicating.
TRUE: Tag data links are communicating in all connections as the originator. A
FALSE: An error occurred in at least one connection.
Data type BOOL Range of values TRUE or FALSE
NJ-series CPU Units: Gives a list of nodes that have normally established built-in EtherNet/IP connections.
Array[x] is TRUE: The connection to the node with a target node ID of x was established normally.
Array[x] is FALSE: The connection to the node with a target node ID of x was not established, or an error occur-
red.
Data type ARRAY [0..255] OF BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Shows the operating status of the target node Controllers that are connected with the built-
in EtherNet/IP port as the originator.
The array elements are valid only when the corresponding Normal Target Node Information is TRUE. If the corre-
sponding Normal Target Node Information is FALSE, it indicates the previous operating status.
Array[x] is TRUE: This is the operating state of the target Controller with a node address of x.
Array[x] is FALSE: Other than the above.
Data type ARRAY [0..255] OF BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Shows the error status (logical OR of fatal and non-fatal errors) of the target node Control-
lers that are connected with the built-in EtherNet/IP ports as the originator. The array elements are valid only
when the corresponding Normal Target Node Information is TRUE. The immediately preceding value is retained if
this variable is FALSE.
Array[x] is TRUE: A fatal or non-fatal error occurred in the target Controller with a target node ID of x.
Array[x] is FALSE: Other than the above.
Data type ARRAY [0..255] OF BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
A
Variable name _EIP1_TargetPLCErr[255]
Meaning CIP Communications1 Target PLC Error Infor- Global/local Global
NJ-series CPU Units: Indicates that the connection for the Registered Target Node Information was not establish-
ed or that an error occurred in the target Controller.
The array elements are valid only when the Registered Target Node Information is TRUE.
Array[x] is TRUE: A connection was not normally established with the target node for a target node ID of x (the
Registered Target Node Information is TRUE and the Normal Target Node Information is FALSE), or a connection
was established with the target node but an error occurred in the target Controller.
Array[x] is FALSE: The target node is not registered for a target node ID of x (the Registered Target Node Infor-
mation is FALSE), or a connection was normally established with the target node (the Registered Target Node
Information is TRUE and the Normal Target Node Information is TRUE). An error occurred in the target Controller
(the Target PLC Error Information is TRUE).
Data type ARRAY [0..255] OF BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Change this variable to TRUE to start tag data links.
It automatically changes back to FALSE after tag data link operation starts.
Note Do not force this switch to change to FALSE from the user program or from the Sysmac Studio.
It changes to FALSE automatically.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
NJ-series CPU Units: Change this variable to TRUE to stop tag data links.
It automatically changes back to FALSE after tag data link operation stops.
Note Do not force this switch to change to FALSE from the user program or from the Sysmac Studio.
It changes to FALSE automatically.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related in- ---
gram structions
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
PRO- el Con- enabled ×: Not
×: Not-re- cable.
GRAM troller er- allowed.
tained. ×: Not
and RUN ror oc-
applica-
Mode curs
ble.
User POUs and ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM/ ¡
pro- user program execution (with non- before ported. RUN mode Online
gram ID in user program volatile power in- (online edit- editing
memory) terruption. ing)
Task Task Settings ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
Set- (with non- before ported. mode
tings volatile power in-
memory) terruption.
Varia- Varia- Device variable ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM x
bles ble ta- (with non- before ported. mode
bles volatile power in-
(not memory) terruption.
varia- User-defined ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM/ ¡
ble variables (with non- before ported. RUN mode Online
val- volatile power in- (online edit- editing
ues) memory) terruption. ing)
Data type User-defined ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM/ ¡
data types (with non- before ported. RUN mode Online
volatile power in- (online edit- editing
memory) terruption. ing)
Controller CPU Unit name ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM/ ¡
name (with non- before ported. RUN mode
volatile power in-
memory) terruption.
Built-in Ether- ¡ Same as Retained. Retained. Support- × PROGRAM/ ¡
Net/IP port (with non- before ed. RUN mode
name volatile power in-
memory) terruption.
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
PRO- el Con- enabled ×: Not
×: Not-re- cable.
GRAM troller er- allowed.
tained. ×: Not
and RUN ror oc-
applica-
Mode curs
ble.
Built-in I/O Settings ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
(with non- before ported. mode
volatile power in-
memory) terruption.
Option Board Settings ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
(with non- before ported. mode
volatile power in-
memory) terruption.
Memory Settings for CJ- ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
series Units (with non- before ported. mode
volatile power in-
memory) terruption.
OPC OPC Server Settings ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
UA UA Network Set- (with non- before ported. mode
Set- Serv- tings volatile power in-
tings er End Point Set- memory) terruption.
Set- tings
tings Execution Log
Settings
Client Certification ¡ Same as Retained. Retained. Support- × PROGRAM/ ¡
Certif- Trust List (with non- before ed. RUN mode
ica- Certification volatile power in-
tion Trust List (Ex- memory) terruption.
Set- pired)
tings Certification
Reject List
Root Certifica-
tion/Intermedi-
ate Certification
List
Root Certifica-
tion/Intermedi-
ate Certification
List (Expired)
User User Authenti- ¡ Same as Retained. Retained. Support- × PROGRAM/ ¡
Set- cation Defini- (with non- before ed. RUN mode
tings tion File volatile power in-
memory) terruption.
Motion Axis assignments, ¡ Same as Retained. Retained. Not sup- ¡ PROGRAM ×
Con- axis parameter settings, (with non- before ported. mode
trol axes group parameter volatile power in-
Setup settings, memory) terruption.
MC common parameter
settings
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
PRO- el Con- enabled ×: Not
×: Not-re- cable.
GRAM troller er- allowed.
tained. ×: Not
and RUN ror oc-
applica-
Mode curs
ble.
Ether- Ether- Master ¡ Same as Retained. Retained Not sup- ¡ PROGRAM ×
CAT CAT (with non- before ported. mode
Set- Set- volatile power in-
tings tings memory) terruption.
Settings in ¡ --- Retained. Retained. Support- ¡ RUN/ ¡
Slaves (by ed. PROGRAM
slaves) mode
Operation Authority Verification ¡ Same as Retained. Retained. Not sup- × RUN/ ¡
(with non- before ported. PROGRAM
volatile power in- mode
memory) terruption.
User Authentication*1 ¡ Same as Retained. Retained. Not sup- × RUN/ ¡
(with non- before ported. PROGRAM
volatile power in- mode
memory) terruption.
User program execution ID ¡ Same as Retained. Retained. Not sup- × PROGRAM ×
in CPU Unit (with non- before ported. mode
volatile power in-
memory) terruption.
Values Val- User-defined × Initial val- Initial val- Initial val- Support- × RUN/ ¡
of Var- ues of variables and ues ues ues ed. PROGRAM
iables non- device varia- mode
re- bles
tained
varia-
bles
Val- User-defined ¡ Same as Retained. Retained. Support- × RUN/ ¡
ues of variables and (with Bat- before ed. PROGRAM
re- device varia- tery*2) power in- mode
tained bles terruption.
varia-
bles
Con- CIO/WR × 16#0000 16#0000 16#0000 Support- × RUN/ ¡
tents ed. PROGRAM
of mode
memo- HR/DM/EM ¡ Same as Retained. Retained. Support- × RUN/ ¡
ry (with Bat- before ed. PROGRAM
used power in- mode
tery*2)
for CJ- terruption.
series *3
Units
Event Logs System log ¡ Same as Retained. Retained. Support- × ¡
logs User event log (with Bat- before ed.
tery*2) power in-
terruption.
Transfer-
ring data
Data re- Status changes with the
Over-
tention at Sysmac
Writing writing
power in- Studio
When when Operating in RUN
terrup- Synchro
power is Chang- When a write modes per- mode
CPU Unit data tions nized da-
turned ing be- major protec- mitting ¡: Al-
¡: Re- ta
ON tween fault lev- tion is writing lowed.
tained. ¡: Appli-
• You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102
CPU Units, and NX1P2 CPU Units.
• Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat.
No. W579) for how to use memory for CJ-series Units on the NX1P2 CPU Units.
I/O Bits
l Description
The bits in this area are allocated to input and output terminals on CJ-series Basic I/O Units.
The number of words (16 bits each) that is required for each CJ-series Basic I/O Unit are allocated
in order based on the position where the Units are connected (from left to right starting from the
Unit that is closest to the CPU Unit).
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range CIO 0 to CIO 159 CIO 0.00 or CIO 159.15
Additional Information
You can access this area on NJ-series CPU Units through device variables allocated to I/O
ports. We therefore recommend that you do not use AT specifications to access this area.
You should use AT specifications for the CIO Area only when you specify addresses for some of
the Special Units.
l Description
The bits in this area are allocated to control and status information for CJ-series CPU Bus Units.
Each Unit is allocated 25 words based on its unit number.
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses Words per Unit
The words that are allocated are listed in the following table.
For details on how to use the allocated words, refer to the operation manual for the CJ-series CPU
Bus Unit.
Additional Information
You can access the CPU Bus Unit Area in NJ-series CPU Units through the device variables A
that are allocated to I/O ports. We therefore recommend that you do not use AT specifications
to access this area.
l Description
The bits in this area are allocated to control and status information for CJ-series Special I/O Units.
Each Unit is allocated 10 words based on the unit number for up to a total of 96 Units (unit num-
bers 0 to 95).
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses Words per Unit
Range CIO 2000 to CIO 2959 CIO 2000.00 to CIO 10 words
(10 words × 96 unit num- 2959.15
bers)
The words that are allocated are listed in the following table.
For details on how to use the allocated words, refer to the operation manual for the CJ-series Spe-
cial I/O Unit.
Additional Information
You can access the Special I/O Unit Area in NJ-series CPU Units through the device variables
that are allocated to I/O ports. We therefore recommend that you do not use AT specifications
to access this area.
DeviceNet Area
l Description
The bits in this area are allocated to the slaves when the remote I/O master function of a DeviceNet
Unit is used (fixed allocations only).
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range CIO 3200 to CIO 3799 CIO 3200.00 to CIO 3799.15
Words in this area are allocated to slaves for fixed allocations according to fixed allocation setting
1, 2, or 3 in the software switches in the CIO Area. Select one of these fixed areas.
You can allocate memory in the DeviceNet Area even if you use fixed allocations to use the remote
I/O slave function of a DeviceNet Unit.
Refer to the CJ-series DeviceNet Units Operation Manual for NJ-series CPU Unit (Cat. No. W497)
for details.
l Description
You use the bits in these areas only in programming. You cannot use them to input or output data
through external I/O terminals. If you need work bits, you should normally use bits in this area.
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
l Description
You use the bits in these areas only in programming. You cannot use them to input or output data
through external I/O terminals. If you need work bits, you should normally use bits in this area.
Data in this area is cleared when power is cycled or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range W000 to W511 W000.00 to W511.15 A
l Description
You use the words and bits in this area only in programming. The status of the words and bits in
this area are retained during power interruptions or when the operating mode is changed between
PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range H0 to H511 H0.00 to H511.15
A-9-4 DM Area
l Description
This is a general-purpose data area used to read and write 16-bit words.
You can also add a bit number to address specify bits.
Data in this area is retained during power interruption or when the operating mode is changed be-
tween PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range D0 to D32767 D0.00 to D32767.15
l Description
The following words in the DM Area are allocated to initial settings for Special Units.
l Addresses
Type of CJ-series
Addresses Word addresses Words per Unit
Special Unit
Range CJ-series Special I/O D20000 to D29599 100 words
Units (100 words × 96 unit num-
bers)
CJ-series CPU Bus D30000 to D31599 100 words
Units (100 words × 16 unit num-
bers)
The words that are allocated are listed in the following table.
CJ-series Special I/O Units
For details on how to use the allocated words, refer to the operation manual for the Special Unit.
Additional Information
You can access the DM Area words that are allocated to Special Units in NJ-series CPU Units
through the device variables that are allocated to I/O ports. We therefore recommend that you
do not use AT specifications to access this area.
A-9-5 EM Area
l Description
This is a general-purpose data area used to read and write 16-bit words.
You can also add a bit number to address specify bits.
Data in this area is retained during power interruption or when the operating mode is changed be-
tween PROGRAM and RUN mode.
l Addresses
Addresses Word addresses Bit addresses
Range NJ501-££££: E0_0 to E18_32767 NJ501-££££: E0_0.00 to E18_32767.15
NJ301-££££: E0_0 to E3_32767 NJ301-££££: E0_0.00 to E3_32767.15
NJ101-££££: E0_0 to E3_32767 NJ101-££££: E0_0.00 to E3_32767.15
This information for determining the location of a variable in memory is called the alignment. The align-
ment is determined for each data type. The amount of memory and the memory locations for the varia-
bles are given below.
Item Specification
Amount of memory that is allo- An integral multiple of the alignment. However, the minimum amount
cated of memory is the data size.
Item Specification
Locations in memory At an integral multiple of the alignment starting from the start of the
variable in memory.
The alignments and the amounts of memory that are allocated for the basic data types and enumera-
tions are given below.
The elements of arrays and the members of structures and unions are located in memory for the most
efficient access. The alignments and the amounts of memory that are allocated for arrays, structures,
and unions are determined by the variable declarations, as described below.
A
Therefore, the following formula gives the amount of memory that is allocated for a BOOL array.
For 1 to 16 elements, 2 bytes are allocated. For 17 to 32 elements, 4 bytes are allocated.
Specific examples of the rules for memory allocation for variables of each data type are given below.
Arrays
A continuous section of memory is allocated for the elements of the array based on the data size of
the data type of the array variable. The alignment of an array is the same as alignment of the data
type of the elements.
Example: Continuous variables in the following order: two BOOL variable, one BOOL array with five
elements, one BOOL array with 19 elements, and one BOOL array with four elements
Example: BYTE array with four elements for each dimension with two-dimensional array
Example: WORD array with three elements for each dimension with two-dimensional array
Structures
For a structure variable, the members are located in memory in the order that they are declared. Each
member is located at an integer multiple of the alignment of the data type of the member. Therefore,
Example: The alignments and the amounts of memory that are allocated for the four variable declara-
tions given in the following figure are given in the following table.
Example: The alignments and the amounts of memory that are allocated for the four variable declara-
tions given in the following figure are given in the following table.
Unions
For a union variable, the members overlap in the same memory locations.
The alignment of a union is largest alignment of all of the members. The amount of memory that is
allocated is the largest amount of memory that is allocated for any of the members.
Example: The alignments and the amounts of memory that are allocated for the four variable declara-
tions given in the following figure are given in the following table.
Additional Information
This is not necessary when you exchange data between NJ/NX-series CPU Units.
Name Data type NJ/NX-series Structure Variable NJ_X Name Data type CJ-series Structure Variable CJ_X
Structure Y STRUCT Bytes Structure Y STRUCT Bytes
a DINT First byte a a DINT First byte a
b INT b INT
Version Information
The following table gives the unit version of the CPU Units and the Sysmac Studio version that
are required to specify member offsets.
If you change the memory configuration of a structure variable by setting offsets, you must make
the same changes for the same structure variable in other NJ/NX-series CPU Units on the network.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the procedure to
change the memory configuration of a structure variable.
Example: The following example shows how the memory configuration of the structure variable in
the NJ/NX-series CPU Unit is changed to match the memory configuration of the structure variable
in the CJ-series CPU Unit.
To align the memory configurations in the NJ-series and CJ-series CPU Units, offsets are set in the Sysmac Studio.
Here, the following offsets are set for member c of data type Y of the structure variable NJ_X.
Example: The following example shows how the memory configuration of the structure variable in
the CJ-series CPU Unit is changed to match the memory configuration of the structure variable in
the NJ/NX-series CPU Unit.
(2) Add the dummy variable b2 that you created in the (1) Add a dummy member variable b2 that matches the
CJ-series CPU Unit to the NJ/NX-series CPU Unit as well. unused memory location on the NJ/NX-series CPU Unit.
1 Use the following format to create a table of variables in a Microsoft Excel spreadsheet.
You must use the same number and arrangement of columns as in the following format. Do not
omit any columns even if they are empty, like the Address Type/Number and I/O Comment
columns that are shown below.
2 Start the CX-Designer and open the Symbol Table Dialog Box.
A
3 Copy the shaded portion of the Microsoft Excel spreadsheet.
Always copy all of the columns that are shown below.
4 Right-click in the Symbol Table Dialog Box in the CX-Designer and select Paste from the
menu.
5 In the Host Selection Dialog Box on the CX-Designer, select the NJ/NX-series Controller host
and then click the OK Button.
The variables are registered in the Symbol Table Dialog Box of the CX-Designer.
Version Information
A CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher are re-
quired to use the instructions to enable and disable EtherCAT slaves and axes. A
Additional Information
• You can also enable and disable EtherCAT slaves in the following Sysmac Studio settings:
Configurations and Setup - EtherCAT - Network Configuration - Enable/Disable
Settings. If you use the Sysmac Studio settings, however, you would have to use the Sys-
mac Studio to change the settings every time or you would have to change the project file
depending on the machine to handle the application that is described later in Application 1:
Centralized Management of Machines with Different EtherCAT Slave Configuration and Axis
Composition on page A-241.
• You can disable an EtherCAT slave to enable removing it or installing it on the EtherCAT net-
work.
Version Information
A CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher are re-
quired to use the EC_ChangeEnableSetting and MC_ChangeAxisUse instructions.
EC_ChangeEnableSetting Instruction
The EC_ChangeEnableSetting (Enable/Disable EtherCAT Slave) instruction is used to enable and dis-
able EtherCAT slaves. You can use the EC_ChangeEnableSetting instruction to enable or disable the
EtherCAT slave with the specified node address. If you cycle the power supply to the Controller after
this instruction is executed, the settings will return to the settings from before instruction execution.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for the detailed specifica-
tions of the EC_ChangeEnableSetting instruction.
MC_ChangeAxisUse Instruction
The MC_ChangeAxisUse (Change Axis Use) instruction is used to enable and disable axes. The
MC_ChangeAxisUse instruction changes the setting of the Axis Use axis parameter of the specified
axis between Used Axis and Unused Axis. If you cycle the power supply to the Controller after this
instruction is executed, the settings will return to the settings from before instruction execution.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for the de-
tailed specifications of the MC_ChangeAxisUse instruction.
Value Meaning
TRUE The EtherCAT slave with the specified node address is disabled.
FALSE The EtherCAT slave with the specified node address is enabled.
Value Meaning
0:_mcNoneAxis The specified axis is an undefined axis.
1: _mcUnusedAxis The specified axis is an unused axis.
2: _mcUsedAxis The specified axis is a used axis.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for the detailed specifica-
tions of the PrgStart instruction and PrgStop instruction.
When you want to disable the program, first disable the EtherCAT slave and axis which the pro-
gram is associated with, and then disable the program.
Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are re-
quired to use the PrgStart and PrgStop instructions.
Version Information
A CPU Unit with unit version 1.08 or later and the Sysmac Studio version 1.09 or higher are
required to use the PrgStatus instruction.
1 Right-click EtherCAT under Configurations and Setup and select Edit from the menu.
The EtherCAT Tab Page is displayed.
2 In the Toolbox, right-click the EtherCAT slave you want to connect and select Insert from the
menu.
The selected EtherCAT slave is displayed under the EtherCAT master on the EtherCAT Tab
Page. Also, the Parameter Settings Area for the EtherCAT slave is displayed on the right side
of the EtherCAT Tab Page.
3 Set the value of Enable/Disable Settings to Enabled on the Parameter Settings Area for the
EtherCAT slave.
1 Right-click Axis Settings under Configurations and Setup - Motion Control Setup and se-
lect Add - Axis Settings from the menu.
The axis MC_Axis000(0) is added under Axis Settings.
1 Right-click Task Settings under Configurations and Setup and select Edit from the menu.
The Task Settings Tab Page is displayed.
3 Set Initial Status of the program to Run on the Program Assignment Settings Display.
CPU CPU
EtherCAT EtherCAT
A B C A B C D
In the Sysmac Studio project, an EtherCAT Slave Configuration is created for all four EtherCAT slaves
and axes in A, B, C, and D in the figure. Then, on the Sysmac Studio, you set the EtherCAT slave
enable/disable settings, Axis Use parameter settings, and the associated program run/stop status at
the start of operation according to machine 1, as shown in the following table.
To make changes for machine 2, you use instructions to change the EtherCAT slave enable/disable
settings, Axis Use parameter settings, and the associated program enable/disable settings as shown
in the following table.
The user program algorithm is shown in the following figure. A signal is input to the Controller from an
external device to specify whether machine 1 or machine 2 is operated.
Yes
Machine 1?
No
Operation started.
CPU CPU
Unit Unit
Production line 1 is left
running while the EtherCAT
EtherCAT EtherCAT
slave configuration and axis
composition on production
line 2 are changed.
A B Production line 1 A B Production line 1
In the Sysmac Studio project, an EtherCAT slave configuration is created for all seven EtherCAT
slaves and axes in A to G in the figure.
On the Sysmac Studio, set the EtherCAT slave enable/disable settings, Axis Use parameter settings,
and the associated program run/stop status at the start of operation for nodes A to G as shown in the
following table. These are the settings for the configuration before change.
The following procedure is used to change the EtherCAT slaves and axes that are used from C, D, E
to F and G.
2 Use the MC_ChangeAxisUse instruction to set the Axis Use parameters for C, D, and E to Un-
used Axis.
3 Use the EC_ChangeEnableSetting instruction to disable the settings for EtherCAT slaves C, D,
A
and E.
7 Use the EC_ChangeEnableSetting instruction to enable the settings for EtherCAT slaves F and
G.
8 Use the MC_ChangeAxisUse instruction to set the Axis Use parameters for F and G to Used
Axis.
9 Use the PrgStart instruction to enable the programs associated with F and G.
When you want to disable the program, first disable the EtherCAT slave and axis which the pro-
gram is associated with, and then disable the program.
Errors can occur during online editing even if the user program size restrictions are not exceed-
ed. This is because even if you change the user program with online editing, other data that is
allocated in the memory of the CPU Unit may remain. If errors occur, change the Controller to
PROGRAM mode and transfer the user program to the Controller again to reset the errors.
POU Restrictions
There are restrictions both on POU definitions and POU instances.
Refer to Number of POU Instances on page A-248 for information on counting POU instances.
Restrictions to Variables
There are restrictions to both variable usage and variable definitions.
guidelines. The methods for counting objects sometimes varies with the unit version of the CPU Unit.
Always use the Sysmac Studio to confirm that user program object sizes are suitable.
Work Description
Upload the data from the CPU Unit. Upload the following three types of data from the old CPU Unit.
Each of these must be uploaded separately.
• Project
• Present values of variables and memory
• Tag data link tables
Connect the new CPU Unit. Remove the old CPU Unit from the Controller and connect the
new CPU Unit.
Download the data to the CPU Unit. Download the three types of data that you stored in the comput-
er to the new CPU Unit.
The following data in the CPU Unit is not included in the project, present values of variables and
memory, or tag data link tables. Therefore, you must set them again after you replace the CPU
Unit.
• Data Trace Settings
• Controller name
• Operation authority verification
• User authentication
• Time zone setting for the built-in clock
1 Start the Sysmac Studio on the computer that is connected to the NJ-series Controller.
6 Clear the Do not transfer the EtherNet/IP connection settings (built-in port and Unit)
Check Box and click the Transfer From Controller Button.
1 Select Backup - Backup Variables and Memory from the Tools Menu on the Sysmac Studio.
2 Select the Present value of Retain attribute variables, DM, EM and Holding Memory used for
CJ -series Units, and Absolute encoder home offset value Check Boxes and click the Execute
Button.
The variable and memory data is uploaded to the computer.
1 Start the Network Configurator on the computer that is connected to the NJ-series Controller.
5 Select only the IP address of the connected CPU Unit as the device and click the OK Button.
Check the operation of the downloaded project for proper execution before you use it for actual
operation.
1 Start the Sysmac Studio on the computer that is connected to the NJ-series Controller.
3 From the project list, select the project that you uploaded from the old CPU Unit.
In the following example, the name of the project that you uploaded from the previous CPU
Unit is BackupData.
6 Clear the Do not transfer the EtherNet/IP connection settings (built-in port and Unit)
Check Box and click the Transfer To Controller Button.
The project in the computer is downloaded to the Controller.
1 Select Backup - Restore Variables and Memory from the Tools Menu on the Sysmac Studio.
2 Select the data file that you uploaded from the old CPU Unit and click the Execute Button.
The variable and memory data is downloaded to the Controller.
1 Start the Network Configurator on the computer that is connected to the NJ-series Controller.
3 Select File - Open and open the tag data link table file that you uploaded from the old CPU
Unit.
4 To download tag data link tables to a CPU Unit with unit version 1.03 or later when the tag data
link tables were uploaded from a CPU Unit with unit version 1.02 or earlier, select Device–
Change Device and select NJ£££-1£££ Rev2 as the New Device.
If NJ£££-1£££ Rev2 is not displayed as a new device selection in step 4, above, use the
newest version of the Network Configurator.
sions
Event Log Utility Included with SYSMAC Gateway.
The Windows versions on which support software can be used for each CPU Unit version are shown
below. Use a computer with the required version of Windows according to the unit version of the CPU A
Unit.
For the following CPU Unit versions, use Sysmac Studio on Windows 10 or higher OS on the
computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to the Controller.
• NX102, NX1P2 CPU Unit: Version 1.49 or later
• NX701 CPU Unit: Version 1.29 or later
Ver.1.49*1 Ver.1.50
Ver.1.29*2
Ver.1.48*3 Ver.1.49
Ver.1.28*2
Ver.1.47*4 Ver.1.47
Ver.1.38*5
Ver.1.27*6
Ver.1.46*4 Ver.1.46
Ver.1.37*5
Ver.1.26*6
Ver.1.43*7 Ver.1.44
Ver.1.36*5
Ver.1.24*6
Ver.1.42*4 Ver.1.43
Ver.1.35*5 Ver.1.41
Ver.1.23*6
Ver.1.41*8 Ver.1.40
Ver.1.34*5
Ver.1.21*12
Ver.1.31*13 Ver.1.24
Ver.1.30*14 Ver.1.23
Ver.1.18*15 Ver.1.22
Ver.1.16*16 Ver.1.20
Ver.1.14 Ver.1.18
Ver.1.13*17 Ver.1.17*18
Ver.1.12 Ver.1.16
Ver.1.11 Ver.1.15
A
Ver.1.10 Ver.1.13
*1. This is the unit version of NX102-££££ CPU Units and NX1P2-£££££££ CPU Units.
A-16-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions
*2. This is the unit version of NX701-££££ CPU Units.
*3. This is the unit version of NX102-££££ CPU Units.
*4. This is the unit version of NX102-££00 CPU Units and NX1P2-£££££££ CPU Units.
*5. This is the unit version of NX102-££20 CPU Units.
*6. This is the unit version of NX701-££££ CPU Units.
*7. This is the unit version of NX102-££00 CPU Units.
*8. This is the unit version of NX102-££00 CPU Units and NX1P2-£££££££ CPU Units.
*9. This is the unit version of NX102-££00 CPU Units and NX1P2-£££££££ CPU Units.
There is no NX1P2-9B£££££ CPU Unit with unit version earlier than 1.40.
*10. Use an NX1P2-9B£££££ CPU Unit with Sysmac Studio version 1.30 or higher.
You cannot use an NX1P2-9B£££££ CPU Unit with Sysmac Studio version 1.29 or lower.
*11. This is the unit version of NX701-££££ CPU Units.
*12. This is the unit version of NX1P2-£££££££ CPU Units.
*13. This is the unit version of NX102-££££ CPU Units. There is no NX701-££££ CPU Unit and NX1P2-£
££££££ CPU Unit with unit version 1.31.
*14. This is the unit version of NX102-££££ CPU Units. There is no NX102-££££ CPU Unit with unit ver-
sion 1.29 or earlier. There are no NX701-££££ CPU Unit and NX1P2-£££££££ CPU Unit with unit
version 1.30.
*15. There are no NX701-££££ CPU Unit and NX1P2-£££££££ CPU Unit with unit version 1.17.
*16. There are no NX701-££££ and NX1P2-£££££££ CPU Units with unit version 1.15.
*17. There is no NX1P2-£££££££ CPU Unit with unit version 1.12 or earlier.
*18. Use an NX1P2-£££££££ CPU Unit with Sysmac Studio version 1.17 or higher. You cannot use an
NX1P2-£££££££ CPU Unit with Sysmac Studio version 1.16 or lower.
Additional Information
A-16-2 Functions That Were Added or Changed for Each Unit Version
This section describes the functions that were added or changed for each unit version of NX-series
CPU Unit.
Unit Sysmac
Addition/
Function ver- Studio Reference
change
Security Asset pro- User au- Number of Addition *2 Ver.1.50 8-5-10 User Authentication
tection and thentication groups on page 8-44
preventing
incorrect op-
A
eration
SD Mem- Application Program transfer from SD Addition Ver.1.1 Ver.1.15 9-5 Program Transfer from
A-16-2 Functions That Were Added or Changed for Each Unit Version
ory Cards Memory Card 1 SD Memory Card on page
9-38
Backing Safety unit restore*1 Addition Ver.1.3 Ver.1.24 9-1-4 Types of Backup
up Data 1 Functions on page 9-8
*1. This addition applies only to an NX102-££££.
*2. For information on the CPU Unit models and unit versions supporting the function, refer to the listed references.
*3. This addition applies to an NX102-££££ CPU Unit and an NX1P2 CPU Unit.
*4. Packet monitoring can be used with project unit version earlier than 1.40. It cannot be used with project unit version
1.40 or later.
Note Refer to the manuals for the function modules for additions and changes to function module functions for each unit
version of the CPU Units.
For the following CPU Unit versions, use Sysmac Studio on Windows 10 or higher OS on the
computer. Sysmac Studio on Windows 8.1 or lower cannot connect online to the Controller.
• NJ-series CPU Unit: Ver. 1.49 or later
Ver.1.47*2
Ver.1.47*3 Ver.1.47
Ver.1.27*4
Ver.1.46*3 Ver.1.46
Ver.1.26*4
Ver.1.43*5 Ver.1.44
Ver.1.42*6 Ver.1.43
Ver.1.41*7 Ver.1.42
Ver.1.23*8 Ver.1.41
Ver.1.41*9 Ver.1.40
Ver.1.40*10 Ver.1.29
Ver.1.21*11
Ver.1.21*12 Ver.1.28
Ver.1.20 Ver.1.26
Ver.1.19 Ver.1.24
Ver.1.18 Ver.1.22
Ver.1.17 Ver.1.21
A-17-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions
Ver.1.00
*1. This is the unit version of NJ501-1£00 CPU Units.
*2. This is the unit version of NJ501-££20, NJ501-1340, NJ501-5300, NJ501-4£££, and NJ101-££20 CPU
Units.
*3. This is the unit version of NJ501-1£00, NJ501-R£££, NJ301-££££, and NJ101-££00 CPU Units.
*4. This is the unit version of NJ501-££20, NJ501-4£££, NJ501-1340, NJ501-5300, and NJ101-1£20 CPU
Units.
*5. This is the unit version of NJ501-1£00 CPU Units.
*6. This is the unit version of NJ501-1£00, NJ301-1£00, and NJ101-££00 CPU Units.
*7. This is the unit version of NJ501-R£00 CPU Units.
*8. This is the unit version of NJ501-1£20, NJ501-4320, and NJ101-££20 CPU Units.
*9. This is the unit version of NJ501-1£00, NJ301-1£00, and NJ101-££00 CPU Units.
*10. This is the unit version of NJ501-1£00, NJ301-1£££, and NJ101-££00 CPU Units.
*11. This is the unit version of NJ501-4£00, NJ501-4£10, NJ501-1340, and NJ501-5300 CPU Units.
*12. This is the unit version of NJ501-1£00, NJ301-1£00, and NJ101-££00 CPU Units.
*13. There is no NJ101-££££ CPU Unit with unit version 1.09 or earlier.
*14. Use an NJ101-££££ CPU Unit with Sysmac Studio version 1.13 or higher. You cannot use an NJ101-££
££ CPU Unit with Sysmac Studio version 1.12 or lower.
*15. There is no NJ301-££££ CPU Unit with unit version 1.00. Therefore, you cannot use an NJ301-££££
CPU Unit with Sysmac Studio version 1.01 or lower.
An error will occur if you perform the following type of operation. Use it with caution.
• Create a project on Sysmac Studio version 1.02 or higher with unit version 1.01 or later se-
lected as the version in the Select Device Area of the Project Properties Dialog Box.
• Upload the project to Sysmac Studio version 1.01.
Additional Information
A-17-3 Functions That Were Added or Changed for Each Unit Version
This section gives the functions that were added or changed for each unit version of NJ-series CPU
Unit. A
l Additions and Changes to Functional Specifications
A-17-3 Functions That Were Added or Changed for Each Unit Version
The following table gives the unit version of the CPU Units and the Sysmac Studio version for each
addition or change to the functional specifications.
Unit Sysmac
Addition/
Function ver- Studio ver- Reference
Change
sion sion
Tasks Function Conditionally executed tasks Addition 1.03 1.04 5-2 Overview of Tasks
on page 5-6
Program- Namespaces Addition 1.01 1.02 6-7 Namespaces on
ming page 6-141
Data types Structure da- Specifying Addition 1.01 1.02 Specifying Structure
ta types member offsets Change 1.03 Member Offsets on
page 6-44
Variables Arrays Variable-length Addition 1.18 1.22 6-3-7 Array Specifica-
array tions and Range Speci-
fications for Data Types
on page 6-51
Libraries Addition 1.01 1.02 6-8 Libraries on page
6-146
Unit Sysmac
Addition/
Function ver- Studio ver- Reference
Change
sion sion
Motion Single axis Single-axis Cyclic synchro- Addition 1.03 1.04 NJ/NX-series CPU Unit
control position con- nous absolute Motion Control User's
trol positioning Manual (Cat. No. W507)
Auxiliary Homing with Addition 1.03 1.04
functions for specified pa-
single-axis rameters
control Enabling digital Addition 1.06 1.07
cam switches
Slave axis po- Addition 1.10 1.12
sition compen-
sation
Cam monitor Addition 1.21 1.28/1.29
Start velocity Addition 1.05 1.06
Axes Multi-axes Axes group cy- Addition 1.01 1.02
groups coordinated clic synchro-
control nous absolute
positioning
Auxiliary Reading axes Addition 1.01 1.02
functions for group positions
multi-axes Changing the Addition 1.01 1.02
coordinated axes in a group
control
Common Cams Generating Addition 1.08 1.09
items cam tables
Parameters Changing axis Addition 1.08 1.09
parameters
Auxiliary Input signal logic inversion Addition 1.05 1.06
functions
Unit (I/O) NX Units Addition 1.05 1.06 NX-series EtherCAT
manage- Coupler Unit User’s
ment Manual (Cat. No. W519)
Commu- Built-in TCP/IP func- Packet Filter Addition *1 1.50 NJ/NX-series CPU Unit
nications EtherNet/IP tion Built-in EtherNet/IP Port
port TCP/IP ap- FTP client Addition 1.08 1.09 User's Manual (Cat. No.
plications W506)
OPC UA Server Func- Addition Refer to the NJ/NX-series CPU Unit OPC UA
tion User’s Manual (Cat. No. W588) for models and
unit versions of the CPU Units which support
OPC UA function and corresponding Sysmac
Studio versions.
Built-in Packet monitoring*2 Addition 1.10 1.12 NJ/NX-series CPU Unit
EtherCAT (NJ301-££££) Change*3 1.40 1.29 Built-in EtherCAT Port
port User's Manual (Cat. No.
W505)
Communications instructions Change 1.08 1.09 NJ/NX-series
1.11 1.15 Instructions Reference
Manual (Cat. No. W502)
Debug- Differential monitoring Addition 1.03 1.04 8-6-5 Differential Moni-
ging func- toring on page 8-66
tion
Unit Sysmac
Addition/
Function ver- Studio ver- Reference
Change
A-17-3 Functions That Were Added or Changed for Each Unit Version
bles
SD Memory Addition 1.03 1.04
Card Window
in Sysmac Stu-
dio
Special instruc- Addition 1.08 1.09
tion
Protection Disabling back- Addition 1.03 1.04 9-3 Disabling Backups
ups to SD to SD Memory Cards on
Memory Cards page 9-34
Sysmac Studio Controller backups Addition 1.03 1.04 9-6 Sysmac Studio Con-
troller Backups on page
9-45
*1. For information on the CPU Unit models and unit versions supporting the function, refer to the listed references.
*2. This addition applies only to an NJ301-££££ CPU Unit. The NJ501-££££ and NJ101-££££ CPU Units support
packet monitoring with all versions.
*3. Packet monitoring can be used with project unit version earlier than 1.40. It cannot be used with project unit version
1.40 or later.
Note Refer to the manuals for the function modules for additions and changes to function module functions for each unit
version of the CPU Units.
For details, refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) and NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).
Sysmac Stu-
Function Performance value Unit version
dio version
Program- Program Quanti- Number of POU 9,000 --- 1.06 or higher
ming capacity ties instances 6,000 --- 1.05 or lower
(NJ501-£££
£)
Number of POU 3,000 1.04 or later 1.05 or higher
instances 1,500 1.04 or lower
(NJ301-£££ 2,400 1.03 or earlier 1.05 or higher
£)
1,500 1.04 or lower
Memory Variables Number of vari- 5,000 1.04 or later 1.05 or higher
capacity with a ables*1 2,500 1.04 or lower
for varia- Retain (NJ301-£££ 2,500 1.03 or earlier ---
bles attribute £)
Variables Number of vari- 180,000 Ver.1.20 or lat- Ver.1.26 or
without a ables er higher
Retain (NJ501-£££ 90,000 Other than the above combina-
attribute £) tion
Number of vari- 90,000 Ver.1.20 or lat- Ver.1.26 or
ables er higher
(NJ301-£££ 22,500 Other than the above combina-
£) tion
Motion Number of Maximum number of con- 15 axes 1.06 or later 1.07 or higher
control controlled trolled axes*2*3*4 8 axes Other than the above combina-
axes (NJ301-££££) (NJ301-1200) tion
4 axes
(NJ301-1100)
Maximum number of axes 15 single axes 1.06 or later 1.07 or higher
for single-axis control*4*5 8 single axes Other than the above combina-
(NJ301-££££) (NJ301-1200) tion
4 single axes
(NJ301-1100)
Sysmac Stu-
Function Performance value Unit version
dio version
Index
Numerics _EC_SlavAdrDupErr (Slave Node Address Duplicated Error)
....................................................................... A-101, A-178
_<TaskName>_Exceeded (Task Period Exceeded Flag)....... _EC_SlavAppErr (Slave Application Error)....... A-101, A-178
................................................................................... 5-104 _EC_SlavEmergErr (Emergency Message Detected)............
_Card1RestoreCmdTargetOpcuaSPF (OPCUA Security ....................................................................... A-101, A-179
Profile Transfer Flag)....................................... A-82, A-153 _EC_SlavErr (Slave Error)................................ A-100, A-176
_EC_CommErrTbl (Communications Error Slave Table)........ _EC_SlavErrTbl (Slave Error Table)..................A-100, A-176
....................................................................... A-102, A-179 _EC_SlavInitErr (Slave Initialization Error)........A-101, A-178
_EC_CycleExceeded (EtherCAT Communications Cycle Ex- _EIP_BootpErr (BOOTP Server Error).............. A-116, A-192
ceeded).......................................................... A-102, A-179 _EIP_CipErr (CIP Communications Error)......... A-111, A-186
_EC_DisableSlavTbl (Disabled Slave Table).....A-104, A-181 _EIP_DNSCfgErr (DNS Setting Error)............... A-115, A-192
_EC_DisconnSlavTbl (Disconnected Slave Table)................. _EIP_DNSSrvErr (DNS Server Connection Error).................
....................................................................... A-104, A-181 ....................................................................... A-122, A-199
_EC_EntrySlavTbl (Network Connected Slave Table)............ _EIP_ErrSta (Built-in EtherNet/IP Error)............A-107, A-184
....................................................................... A-104, A-180 _EIP_EtnCfgErr (Basic Ethernet Setting Error). A-114, A-189
_EC_ErrSta (Built-in EtherCAT Error)................A-100, A-175 _EIP_IdentityErr (Identity Error).........................A-117, A-193
_EC_InData1Invalid (Input Data1 Invalid)......... A-105, A-182 _EIP_IPAdrCfgErr (IP Address Setting Error)....A-114, A-190
_EC_InData2Invalid (Input Data2 Invalid)......... A-105, A-182 _EIP_IPAdrDupErr (IP Address Duplication Error).................
_EC_InDataInvalid (Input Data Invalid)............. A-105, A-182 ....................................................................... A-115, A-191
_EC_IndataInvalidErr (Input Process Data Invalid Error)....... _EIP_IPRTblErr (IP Route Table Error)............. A-116, A-193
....................................................................... A-102, A-179 _EIP_LanHwErr (Communications Controller Error)..............
_EC_LanHwErr (Communications Controller Error)............... ....................................................................... A-113, A-188
....................................................................... A-100, A-176 _EIP_MacAdrErr (MAC Address Error)............. A-113, A-188
_EC_LinkOffErr (Link OFF Error)...................... A-100, A-176 _EIP_MultiSwONErr (Multiple Switches ON Error).................
_EC_LinkStatus (Link Status)............................A-104, A-181 ....................................................................... A-121, A-198
_EC_MacAdrErr (MAC Address Error)..............A-100, A-176 _EIP_NTPSrvErr (NTP Server Connection Error)..................
_EC_MBXSlavTbl (Message Communications Enabled ....................................................................... A-122, A-199
Slave Table)................................................... A-104, A-180 _EIP_PortErr (Communications Port Error).......A-108, A-185
_EC_MsgErr (EtherCAT Message Error)...........A-101, A-178 _EIP_TagAdrErr (Tag Name Resolution Error)..A-120, A-197
_EC_MstrErr (Master Error).............................. A-100, A-175 _EIP_TcpAppCfgErr (TCP Application Setting Error).............
_EC_NetCfgCmpErr (Network Configuration Verification Er- ....................................................................... A-122, A-199
ror)................................................................. A-101, A-177 _EIP_TcpAppErr (TCP Application Communications Error)...
_EC_NetCfgErr (Network Configuration Information Error).... ....................................................................... A-113, A-187
....................................................................... A-100, A-177 _EIP_TDLinkCfgErr (Tag Data Link Setting Error)..................
_EC_NetTopologyErr (Network Configuration Error).............. ....................................................................... A-117, A-194
....................................................................... A-101, A-177 _EIP_TDLinkErr (Tag Data Link Communications Error)........
_EC_PDActive (Process Data Communications Status)........ ....................................................................... A-119, A-196
....................................................................... A-104, A-181 _EIP_TDLinkOpnErr (Tag Data Link Connection Failed)........
_EC_PDCommErr (Process Data Communications Error)..... ....................................................................... A-118, A-195
....................................................................... A-101, A-177 _EIP1_BootpErr (Port1 BOOTP Server Error)...A-116, A-192
_EC_PDSendErr (Process Data Transmission Error)............ _EIP1_CipErr (CIP Communications1 Error).....A-112, A-187
....................................................................... A-101, A-178 _EIP1_EtnCfgErr (Port1 Basic Ethernet Setting Error)...........
_EC_PDSlavTbl (Process Data Communicating Slave Ta- ....................................................................... A-114, A-189
ble)................................................................. A-104, A-180 _EIP1_IdentityErr (CIP Communications1 Identity Error).......
_EC_PDTimeoutErr (Process Data Reception Timeout Er- ....................................................................... A-117, A-193
ror)................................................................. A-101, A-177 _EIP1_IPAdrCfgErr (Port1 IP Address Setting Error).............
_EC_PktMonStop (Packet Monitoring Stopped)..................... ....................................................................... A-115, A-190
....................................................................... A-104, A-181 _EIP1_IPAdrDupErr (Port1 IP Address Duplication Error)......
_EC_PktSaving (Saving Packet Data File)........A-105, A-182 ....................................................................... A-115, A-191
_EC_PortErr (Communications Port Error)....... A-100, A-175 _EIP1_LanHwErr (Port1 Communications Controller Error)...
_EC_RegSlavTbl (Registered Slave Table).......A-104, A-179 ....................................................................... A-113, A-189
_EC_Ring Breaking (Ring Disconnection).................... A-105 _EIP1_MacAdrErr (Port1 MAC Address Error)..A-113, A-188
_EC_RingBreaking (Ring Disconnection)..................... A-183 _EIP1_MultiSwONErr (CIP Communications1 Multiple
_EC_RingBreakNodeAdr (Slave Node Address Before Ring Switches ON Error)........................................ A-121, A-198
Disconnection)............................................... A-105, A-183 _EIP1_PortErr (Communications Port1 Error)...A-109, A-185
CIP Communications Error................................ A-111, A-186 CIP Communications2 Target PLC Operating Mode..............
CIP Communications1 All Tag Data Link Communications ....................................................................... A-129, A-204
Status.............................................................A-126, A-201 CIP Safety communications.............................................. 2-9
CIP Communications1 Error.............................. A-112, A-187 CJ-series Unit configuration............................................ 1-12
CIP Communications1 Identity Error..................A-117, A-193 _CJB_CBU££InitSta (CPU Bus Unit Initializing Flags).........
CIP Communications1 Multiple Switches ON Error................ ................................................................8-23, A-92, A-166
....................................................................... A-121, A-198 _CJB_CBU££Restart (CPU Bus Unit Restart Bits)..............
CIP Communications1 Normal Target Node Information........ ................................................................8-23, A-93, A-167
....................................................................... A-127, A-203 _CJB_ErrSta (I/O Bus Error Status).................... A-91, A-165
CIP Communications1 Registered Target Node Information.. _CJB_InRespTm (Basic Input Unit Input Response Times)...
....................................................................... A-126, A-202 ................................................................8-22, A-92, A-166
CIP Communications1 Tag Data Link Communications Error _CJB_IOUnitInfo (Basic I/O Unit Information)..... A-92, A-166
....................................................................... A-119, A-196 _CJB_MaxRackNo (Largest Rack Number)........A-91, A-164
CIP Communications1 Tag Data Link Communications Start _CJB_MaxSlotNo (Largest Slot Number)............A-91, A-164
Switch............................................................ A-136, A-208 _CJB_MstrErrSta (I/O Bus Master Error Status). A-91, A-165
CIP Communications1 Tag Data Link Communications Sta- _CJB_SCU00P£ChgSta (Serial Communications Unit 0,
tus.................................................................. A-125, A-200 Port 1/2 Settings Changing Flags)................... A-93, A-168
CIP Communications1 Tag Data Link Communications Stop _CJB_SCU15P£ChgSta (Serial Communications Units 1 to
Switch............................................................ A-137, A-209 15, Port 1/2 Settings Changing Flags)............. A-93, A-168
CIP Communications1 Tag Data Link Connection Failed....... _CJB_SIO££InitSta (Special I/O Unit Initializing Flags).......
....................................................................... A-118, A-195 ................................................................8-23, A-92, A-167
CIP Communications1 Tag Data Link Setting Error................ _CJB_SIO££Restart (Special I/O Unit Restart Bits).............
....................................................................... A-117, A-194 ................................................................8-23, A-93, A-167
CIP Communications1 Tag Name Resolution Error................ _CJB_UnitErrSta (I/O Bus Unit Error Status)...... A-92, A-165
....................................................................... A-120, A-197 Common Error Status..........................................A-97, A-172
CIP Communications1 Target Node Error Information........... Common Variable................................................ A-97, A-173
....................................................................... A-133, A-206 Communications Controller Error...........................................
CIP Communications1 Target PLC Error Information............. ................................................ A-100, A-113, A-176, A-188
....................................................................... A-130, A-205 Communications Error Slave Table................... A-102, A-179
CIP Communications1 Target PLC Operating Mode.............. Communications Port Error........ A-100, A-108, A-175, A-185
....................................................................... A-129, A-204 Communications Port1 Error............................. A-109, A-185
CIP Communications2 All Tag Data Link Communications Communications Port2 Error..............................A-110, A-186
Status.............................................................A-126, A-201 Controller Error Status.........................................A-77, A-142
CIP Communications2 Error.............................. A-112, A-187 CPU Bus Unit Initializing Flags...................8-23, A-92, A-166
CIP Communications2 Identity Error..................A-117, A-193 CPU Bus Unit Restart Bits..........................8-23, A-93, A-167
CIP Communications2 Multiple Switches ON Error................ CPU Unit High Temperature Flag........................ A-85, A-157
....................................................................... A-121, A-198 _CurrentTime (System Time)....................... 8-5, A-76, A-139
CIP Communications2 Normal Target Node Information........
....................................................................... A-128, A-203 D
CIP Communications2 Registered Target Node Information..
....................................................................... A-127, A-202 Date........................................................................6-34, 6-46
CIP Communications2 Tag Data Link Communications Error DATE...................................................................... 6-34, 6-46
....................................................................... A-119, A-196 Date and time......................................................... 6-34, 6-46
CIP Communications2 Tag Data Link Communications Start DATE_ AND_ TIME................................................ 6-34, 6-46
Switch............................................................ A-136, A-208 Derivative data types....................................................... 6-36
CIP Communications2 Tag Data Link Communications Sta- Device Output Hold Configuration....................... A-86, A-158
tus.................................................................. A-125, A-201 Device Output Hold Status.................................. A-86, A-158
CIP Communications2 Tag Data Link Communications Stop _DeviceOutHoldCfg (Device Output Hold Configuration).......
Switch............................................................ A-137, A-209 ......................................................................... A-86, A-158
CIP Communications2 Tag Data Link Connection Failed....... _DeviceOutHoldStatus (Device Output Hold Status)..............
....................................................................... A-118, A-195 ......................................................................... A-86, A-158
CIP Communications2 Tag Data Link Setting Error................ Diagnosis/Statistics Log Busy........................... A-106, A-184
....................................................................... A-117, A-194 Diagnosis/Statistics Log Cycle.......................... A-106, A-183
CIP Communications2 Tag Name Resolution Error................ Diagnosis/Statistics Log Enable........................ A-105, A-183
....................................................................... A-121, A-198 Diagnosis/Statistics Log Error........................... A-106, A-184
CIP Communications2 Target Node Error Information........... DINT................................................................................ 6-33
....................................................................... A-134, A-207 Disabled Slave Table......................................... A-104, A-181
CIP Communications2 Target PLC Error Information............. Disconnected Slave Table................................. A-104, A-181
....................................................................... A-131, A-205 DNS Server Connection Error........................... A-122, A-199
DNS Setting Error.............................................. A-115, A-192 _EIP_TDLinkAllRunSta (All Tag Data Link Communications
Durations................................................................ 6-34, 6-46 Status)............................................................A-125, A-201
DWORD...........................................................................6-33 _EIP_TDLinkCfgErr (Tag Data Link Setting Error)..................
....................................................................... A-117, A-194
E _EIP_TDLinkErr (Tag Data Link Communications Error)........
....................................................................... A-119, A-196
_EC_EntrySlavTbl (Network Connected Slave Table)............ _EIP_TDLinkOpnErr (Tag Data Link Connection Failed)........
....................................................................... A-104, A-180 ....................................................................... A-118, A-195
_EC_LinkOffErr (Link OFF Error)...................... A-100, A-176 _EIP_TDLinkRunSta (Tag Data Link Communications Sta-
_EC_StatisticsLogBusy (Diagnosis/Statistics Log Busy)........ tus)................................................................. A-125, A-200
....................................................................... A-106, A-184 _EIP_TDLinkStartCmd (Tag Data Link Communications
_EC_StatisticsLogCycleSec (Diagnosis/Statistics Log Cycle) Start Switch)...................................................A-136, A-208
....................................................................... A-106, A-183 _EIP_TDLinkStopCmd (Tag Data Link Communications
_EC_StatisticsLogEnable (Diagnosis/Statistics Log Enable). Stop Switch)...................................................A-136, A-208
....................................................................... A-105, A-183 _EIP1_BootpErr (Port1 BOOTP Server Error)...A-116, A-192
_EC_StatisticsLogErr (Diagnosis/Statistics Log Error)........... _EIP1_CipErr (CIP Communications1 Error).....A-112, A-187
....................................................................... A-106, A-184 _EIP1_EstbTargetSta (CIP Communications1 Normal Target
_EIP_BootpErr (BOOTP Server Error).............. A-116, A-192 Node Information).......................................... A-127, A-203
_EIP_CipErr (CIP Communications Error)......... A-111, A-186 _EIP1_EtnCfgErr (Port1 Basic Ethernet Setting Error)...........
_EIP_DNSCfgErr (DNS Setting Error)............... A-115, A-192 ....................................................................... A-114, A-189
_EIP_DNSSrvErr (DNS Server Connection Error)................. _EIP1_EtnOnlineSta (Port1 Online).................. A-124, A-200
....................................................................... A-122, A-199 _EIP1_IdentityErr (CIP Communications1 Identity Error).......
_EIP_ErrSta (Built-in EtherNet/IP Error)............A-107, A-184 ....................................................................... A-117, A-193
_EIP_EstbTargetSta (Normal Target Node Information)......... _EIP1_IPAdrCfgErr (Port1 IP Address Setting Error).............
....................................................................... A-127, A-203 ....................................................................... A-115, A-190 I
_EIP_EtnCfgErr (Basic Ethernet Setting Error). A-114, A-189 _EIP1_IPAdrDupErr (Port1 IP Address Duplication Error)......
_EIP_EtnOnlineSta (Online)..............................A-124, A-199 ....................................................................... A-115, A-191
_EIP_IdentityErr (Identity Error).........................A-117, A-193 _EIP1_LanHwErr (Port1 Communications Controller Error)...
_EIP_IPAdrCfgErr (IP Address Setting Error)....A-114, A-190 ....................................................................... A-113, A-189
_EIP_IPAdrDupErr (IP Address Duplication Error)................. _EIP1_MacAdrErr (Port1 MAC Address Error)..A-113, A-188
....................................................................... A-115, A-191 _EIP1_MultiSwONErr (CIP Communications1 Multiple
_EIP_IPRTblErr (IP Route Table Error)............. A-116, A-193 Switches ON Error)........................................ A-121, A-198
_EIP_LanHwErr (Communications Controller Error).............. _EIP1_PortErr (Communications Port1 Error)...A-109, A-185
....................................................................... A-113, A-188 _EIP1_RegTargetSta (CIP Communications1 Registered
_EIP_MacAdrErr (MAC Address Error)............. A-113, A-188 Target Node Information)............................... A-126, A-202
_EIP_MultiSwONErr (Multiple Switches ON Error)................. _EIP1_TagAdrErr (CIP Communications1 Tag Name Reso-
....................................................................... A-121, A-198 lution Error).................................................... A-120, A-197
_EIP_NTPResult (NTP Operation Information).............A-134 _EIP1_TargetNodeErr (CIP Communications1 Target Node
_EIP_NTPResult.ExecNormal (NTP Operation Result)......... Error Information)...........................................A-133, A-206
....................................................................... A-134, A-207 _EIP1_TargetPLCErr (CIP Communications1 Target PLC
_EIP_NTPResult.ExecTime (NTP Last Operation Time)........ Error Information)...........................................A-130, A-205
....................................................................... A-134, A-207 _EIP1_TargetPLCModeSta (CIP Communications1 Target
_EIP_NTPSrvErr (NTP Server Connection Error).................. PLC Operating Mode).................................... A-129, A-204
....................................................................... A-122, A-199 _EIP1_TDLinkAllRunSta (CIP Communications1 All Tag Da-
_EIP_PortErr (Communications Port Error).......A-108, A-185 ta Link Communications Status).................... A-126, A-201
_EIP_RegTargetSta (Registered Target Node Information).... _EIP1_TDLinkCfgErr (CIP Communications1 Tag Data Link
....................................................................... A-126, A-202 Setting Error).................................................. A-117, A-194
_EIP_TagAdrErr (Tag Name Resolution Error)..A-120, A-197 _EIP1_TDLinkErr (CIP Communications1 Tag Data Link
_EIP_TargetNodeErr (Target Node Error Information)............ Communications Error).................................. A-119, A-196
....................................................................... A-132, A-206 _EIP1_TDLinkOpnErr (CIP Communications1 Tag Data Link
_EIP_TargetPLCErr (Target PLC Error Information)............... Connection Failed)......................................... A-118, A-195
....................................................................... A-130, A-205 _EIP1_TDLinkRunSta (CIP Communications1 Tag Data Link
_EIP_TargetPLCModeSta (Target PLC Operating Mode)...... Communications Status)................................A-125, A-200
....................................................................... A-128, A-204 _EIP1_TDLinkStartCmd (CIP Communications1 Tag Data
_EIP_TcpAppCfgErr (TCP Application Setting Error)............. Link Communications Start Switch)............... A-136, A-208
....................................................................... A-122, A-199 _EIP1_TDLinkStopCmd (CIP Communications1 Tag Data
_EIP_TcpAppErr (TCP Application Communications Error)... Link Communications Stop Switch)............... A-137, A-209
....................................................................... A-113, A-187 _EIP2_BootpErr (Port2 BOOTP Server Error)...A-116, A-192
_EIP2_CipErr (CIP Communications2 Error).....A-112, A-187
S T
Safety Data Logging Busy Flag........................... A-90, A-163 Tag Data Link Communications Error................ A-119, A-196
Safety Data Logging Completed Flag..................A-90, A-164 Tag Data Link Communications Start Switch.....A-136, A-208
Safety Data Logging Status.................................A-90, A-163 Tag Data Link Communications Status..............A-125, A-200
Saving Packet Data File.................................... A-105, A-182 Tag Data Link Communications Stop Switch.....A-136, A-208
SD Memory Card Access Flag................... 8-30, A-78, A-143 Tag Data Link Connection Failed....................... A-118, A-195
SD Memory Card Backup Commands................ A-78, A-144 Tag Data Link Setting Error................................A-117, A-194
SD Memory Card Backup Status.........................A-79, A-146 Tag Name Resolution Error............................... A-120, A-197
SD Memory Card Error Flag............. 8-25, 8-30, A-78, A-143 Target Node Error Information........................... A-132, A-206
SD Memory Card Life Warning Flag. 8-29, 8-30, A-78, A-143 Target PLC Error Information.............................A-130, A-205
SD Memory Card Power Interruption Flag. 8-30, A-78, A-144 Target PLC Operating Mode..............................A-128, A-204
SD Memory Card Program Transfer Command.. A-80, A-147 Task Active Flag........................................... 5-8, A-76, A-140
SD Memory Card Program Transfer Setting......................4-5 Task Execution Count....................... 5-9, 5-109, A-77, A-141
SD Memory Card Program Transfer Status.........A-81, A-149 task execution time........................................................ 5-110
SD Memory Card Ready Flag.................... 8-30, A-78, A-142 Task Name............................................................... 4-8, 4-10
SD Memory Card Restore Command..................A-81, A-150 Task Period Exceeded Count............5-9, 5-104, A-77, A-141
SD Memory Card Restore Setting..................................... 4-6 Task Period Exceeded Detection.......................................4-9
SD Memory Card Restore Status....................................A-82 Task Period Exceeded Flag... 5-9, 5-104, 5-109, A-77, A-141
SD Memory Card Settings.................................................4-5 Task Timeout Detection Time............................................ 4-9
SD Memory Card Storage Capacity........... 8-30, A-78, A-144 Task Type.......................................................................... 4-8
SD Memory Card Storage Usage...............8-31, A-78, A-144 _TaskName_Active (Task Active Flag)......... 5-8, A-76, A-140
SD Memory Card Verify Status............................A-80, A-146 _TaskName_ExceedCount (Task Period Exceeded Count)...
SD Memory Card Write Protected Flag...... 8-30, A-78, A-143 ..................................................................5-9, A-77, A-141
Secure Communication................................................. 10-10
Security Settings................................................................4-6
U
I
UDINT..............................................................................6-33
UINT................................................................................ 6-33
ULINT.............................................................................. 6-33
Unions............................................................................. 6-36
Unit and Slave Parameters Transfer Flag........... A-82, A-152
Unit Version......................................................... A-85, A-156
_UnitVersion (Unit Version)................................. A-85, A-156
User Program and Settings Transfer Flag........... A-82, A-151
User-defined Error Status...........................8-84, A-77, A-142
User-defined variables.....................................................2-12
USINT..............................................................................6-33
V
Variable Access Time...................................................... 4-10
Verifying data.....................................................................9-3
version................................................................................ 24
W
WORD............................................................................. 6-33
Write Protection Key........................................................ 8-27
OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. ©OMRON Corporation 2011-2022 All Rights Reserved.
438B Alexandra Road, #08-01/02 Alexandra Room 2211, Bank of China Tower, In the interest of product improvement,
Technopark, Singapore 119968 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Tel: (65) 6835-3011 Fax: (65) 6835-2711 PuDong New Area, Shanghai, 200120, China
Tel: (86) 21-5037-2222 Fax: (86) 21-5037-2200 Cat. No. W501-E1-40 1022