w501 NX Nj-Series Cpu Unit Software Users Manual en
w501 NX Nj-Series Cpu Unit Software Users Manual en
NJ/NX-series
CPU Unit
Software
User’s Manual
NX701-1
NX102-1
NX102-90
NX1P2-1
NX1P2-90
NJ501-
NJ301-1
NJ101-10
NJ101-90
CPU Unit
W501-E1-26
NOTE
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe-
less, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other
countries for OMRON factory automation products.
• Microsoft, Windows, Windows Vista, Excel, and Visual Basic are either registered trademarks or trademarks of
Microsoft Corporation in the United States and other countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
• 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 trademarks of their
respective companies.
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
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.
• NX-series CPU Units
• NX701-17
• NX701-16
• NX102-12
• NX102-11
• NX102-10
• NX102-90
• NX1P2-11
• NX1P2-111
• NX1P2-10
• NX1P2-101
• NX1P2-90
• NX1P2-901
Part of the specifications and restrictions for the CPU Units are given in other manuals. Refer to Rele-
vant Manuals on page 2 and Related Manuals on page 28.
Relevant Manuals
The following table provides the relevant manuals for the NJ/NX-series CPU Units.
Read all of the manuals that are relevant to your system configuration and application before you use
the NJ/NX-series CPU Unit.
Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac Stu-
dio Version 1 Operation Manual (Cat. No. W504) for information on the Sysmac Studio.
Manual
Basic information
Hardware User’s Manual
NX-series CPU Unit
Hardware User’s Manual
NX-series NX102 CPU Unit
Hardware User's Manual
NX-series NX1P2 CPU Unit
Hardware User’s Manual
NJ-series CPU Unit
Software User’s Manual
NJ/NX-series CPU Unit
Purpose of use
Manual
Basic information
*1 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-
cated with triangles.
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.
Hook
Indicates a procedure. Connector
Hook holes
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 Controller
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
Versions ................................................................................................................... 24
Terminology ............................................................................................................. 32
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-6
6-2-3 Differences between Programs, Functions, and Function Blocks .............................................. 6-7
6-2-4 Details on Programs ................................................................................................................... 6-7
6-2-5 Details on Function Blocks ......................................................................................................... 6-8
6-2-6 Details on Functions ................................................................................................................. 6-17
6-2-7 Operation That Applies to Both Functions and Function Blocks............................................... 6-22
6-2-8 POU Restrictions ...................................................................................................................... 6-24
6-3 Variables................................................................................................................................. 6-27
6-3-1 Variables ................................................................................................................................... 6-27
6-3-2 Types of Variables .................................................................................................................... 6-27
6-3-3 Types of User-defined Variables in Respect to POUs .............................................................. 6-28
6-3-4 Attributes of Variables............................................................................................................... 6-29
6-3-5 Data Types................................................................................................................................ 6-30
6-3-6 Derivative Data Types............................................................................................................... 6-40
6-3-7 Array Specifications and Range Specifications for Data Types................................................ 6-50
6-3-8 Variable Attributes..................................................................................................................... 6-59
6-3-9 Changes to Variables for Status Changes................................................................................ 6-67
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-96
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-136
6-7 Namespaces......................................................................................................................... 6-142
6-7-1 Namespaces........................................................................................................................... 6-142
6-7-2 Namespace Specifications ..................................................................................................... 6-143
6-7-3 Procedure for Using Namespaces.......................................................................................... 6-146
6-8 Libraries ............................................................................................................................... 6-147
6-8-1 Introduction to Libraries .......................................................................................................... 6-147
6-8-2 Specifications of Libraries....................................................................................................... 6-148
6-8-3 Library Object Specifications .................................................................................................. 6-149
6-8-4 Procedure to Use Libraries ..................................................................................................... 6-150
6-9 Programming Precautions.................................................................................................. 6-151
6-9-1 Array Specifications for Input Variables, Output Variables, In-Out Variables.......................... 6-151
6-9-2 Structure Variables for Input Variables, Output Variables, In-Out Variables ........................... 6-151
6-9-3 Master Control ........................................................................................................................ 6-152
7-3 Checking Operation on the Actual System and Actual Operation...................................... 7-8
7-3-1 Procedures.................................................................................................................................. 7-8
7-3-2 Downloading the Project ............................................................................................................. 7-9
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-10
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-12
A-2 Calculating Guidelines for the Real Processing Times of Tasks for the NX701 System A-21
A-2-1 Calculating the Average Real Processing Times of Tasks ........................................................A-22
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-29
A-3 Calculating Guidelines for the Real Processing Times of Tasks for the NX102 System A-32
A-3-1 Calculating the Average Real Processing Times of Tasks ........................................................A-32
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-38
A-4 Calculating Guidelines for the Real Processing Times of Tasks for the NX1P2 SystemA-42
A-4-1 Calculating the Average Real Processing Times of Tasks ........................................................A-43
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-49
A-5 Calculating Guidelines for the Real Processing Times of Tasks for the NJ-series System
.................................................................................................................................................A-52
A-5-1 Calculating the Average Real Processing Times of Tasks ........................................................ A-53
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
.................................................................................................................................................. A-63
A-6 System-defined Variables .....................................................................................................A-67
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category) ................... A-68
A-6-2 PLC Function Module, Category Name: _PLC ......................................................................... A-78
A-6-3 PLC Function Module, Category Name: _CJB ......................................................................... A-83
A-6-4 NX Bus Function Module, Category Name: _NXB ................................................................... A-85
A-6-5 Motion Control Function Module, Category Name: _MC .......................................................... A-88
A-6-6 EtherCAT Master Function Module, Category Name: _EC ...................................................... A-91
A-6-7 EtherNet/IP Function Module, Category Name: _EIP............................................................... A-96
A-6-8 Meanings of Error Status Bits ................................................................................................. A-123
A-7 Specifications for Individual System-defined Variables ..................................................A-125
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category) ................. A-126
A-7-2 PLC Function Module, Category Name: _PLC ....................................................................... A-143
A-7-3 PLC Function Module, Category Name: _CJB ....................................................................... A-149
A-7-4 NX Bus Function Module, Category Name: _NXB ................................................................. A-154
A-7-5 Motion Control Function Module, Category Name: _MC ........................................................ A-157
A-7-6 EtherCAT Master Function Module, Category Name: _EC .................................................... A-161
A-7-7 EtherNet/IP Function Module, Category Name: _EIP............................................................. A-170
A-8 Attributes of CPU Unit Data ................................................................................................A-195
A-9 Contents of Memory Used for CJ-series Units .................................................................A-200
A-9-1 CIO Area ................................................................................................................................. A-200
A-9-2 Internal I/O Area...................................................................................................................... A-202
A-9-3 Holding Area ........................................................................................................................... A-203
A-9-4 DM Area.................................................................................................................................. A-203
A-9-5 EM Area .................................................................................................................................. A-204
A-10 Variable Memory Allocation Methods ................................................................................A-205
A-10-1 Variable Memory Allocation Rules .......................................................................................... A-205
A-10-2 Important Case Examples ...................................................................................................... A-214
A-11 Registering a Symbol Table on the CX-Designer .............................................................A-218
A-12 Enable/Disable EtherCAT Slaves and Axes ......................................................................A-221
A-12-1 Project Settings When Using EtherCAT Slaves and Axes ...................................................... A-221
A-12-2 Using Instructions to Enable/Disable EtherCAT Slaves and Axes .......................................... A-221
A-12-3 System-defined Variables That Indicate EtherCAT Slave or Axis Status................................ A-222
A-12-4 Enabling/Disabling Execution of Program .............................................................................. A-223
A-12-5 Checking Enabled/Disabled Program..................................................................................... A-223
A-12-6 Settings with the Sysmac Studio ............................................................................................ A-223
A-12-7 Examples of Applications of Enabling/Disabling EtherCAT Slaves and Axes ......................... A-224
A-13 Size Restrictions for the User Program.............................................................................A-227
A-13-1 User Program Object Restrictions .......................................................................................... A-227
A-13-2 Counting User Program Objects............................................................................................. A-231
A-14 Replacing CPU Units with Unit Version 1.02 or Earlier....................................................A-233
A-14-1 Uploading the Data from the CPU Unit................................................................................... A-233
A-14-2 Connecting the New CPU Unit ............................................................................................... A-236
A-14-3 Downloading the Data to the CPU Unit .................................................................................. A-237
A-15 Version Information for NX-series Controllers .................................................................A-241
A-15-1 Relationship Between Unit Versions of CPU Units and Sysmac Studio Versions .................. A-241
A-15-2 Functions That Were Added or Changed for Each Unit Version............................................. A-243
A-16 Version Information for NJ-series Controllers..................................................................A-245
A-16-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions................... A-245
A-16-2 Relationship between Hardware Revisions of CPU Units and Sysmac Studio Versions........ A-247
A-16-3 Functions That Were Added or Changed for Each Unit Version............................................. A-248
A-16-4 Performance Improvements for Unit Version Upgrades ......................................................... A-251
Index
Warranties
Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and workman-
ship for a period of twelve months from the date of sale by Omron (or such other period expressed in
writing by Omron). Omron disclaims all other warranties, express or implied.
Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, ABOUT
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OF
THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses based
on infringement by the Products or otherwise of any intellectual property right.
Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form originally
shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-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
responsible for warranty, repair, indemnity or any other claims or expenses regarding the Products
unless Omron’s analysis confirms that the Products were properly handled, stored, installed and
maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return of
any Products by Buyer must be approved in writing by Omron before shipment. Omron Companies
shall not be liable for the suitability or unsuitability or the results from the use of Products in combi-
nation with any electrical or electronic components, circuits, system assemblies or any other materi-
als 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.
Application Considerations
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations
which apply to the combination of the Product in the Buyer’s application or use of the Product. At
Buyer’s request, Omron will provide applicable third party certification documents identifying ratings
and limitations of use which apply to the Product. This information by itself is not sufficient for a com-
plete determination of the suitability of the Product in combination with the end product, machine, sys-
tem, or other application or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system. Buyer shall take applica-
tion responsibility 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 perfor-
mance is subject to the Omron’s Warranty and Limitations of Liability.
Change in Specifications
Product specifications and accessories may be changed at any time based on improvements and other
reasons. It is our practice to change part numbers when published ratings or features are changed, or
when significant construction changes are made. However, some specifications of the Product may be
changed without any notice. When in doubt, special part numbers may be assigned to fix or establish
key specifications for your application. Please consult with your Omron’s representative at any time to
confirm actual specifications of purchased Product.
Safety Precautions
Conformance to EU Directives
Applicable Directives
• EMC Directives
• Low Voltage Directive
Concepts
EMC Directive
OMRON devices that comply with EU Directives also conform to the related EMC standards so that
they can be more easily built into other devices or the overall machine. The actual products have
been checked for conformity to EMC standards.*
Whether the products conform to the standards in the system used by the customer, however, must
be checked by the customer. EMC-related performance of the OMRON devices that comply with EU
Directives will vary depending on the configuration, wiring, and other conditions of the equipment or
control panel on which the OMRON devices are installed. The customer must, therefore, perform
the final check to confirm that devices and the overall machine conform to EMC standards.
* Applicable EMC (Electromagnetic Compatibility) standards are as follows:
EMS (Electromagnetic Susceptibility): EN 61131-2
EMI (Electromagnetic Interference): EN 61131-2 (Radiated emission: 10-m regulations)
Conformance to EU Directives
The NJ/NX-series Controllers comply with EU Directives. To ensure that the machine or device in
which the NJ/NX-series Controller is used complies with EU Directives, the Controller must be
installed as follows:
• The NJ/NX-series Controller must be installed within a control panel.
• You must use the power supply in SELV specifications for the DC power supplies connected to
DC Power Supply Units and I/O Units.
• NJ/NX-series Controllers that comply with EU Directives also conform to the Common Emission
Standard (EN 61000-6-4). Radiated emission characteristics (10-m regulations) may vary
depending on the configuration of the control panel used, other devices connected to the control
panel, wiring, and other conditions.
You must therefore confirm that the overall machine or equipment complies with EU Directives.
Conformance to KC Certification
Observe the following precaution if you use NX-series Units in Korea.
Noise Filter
Manufacturer Model
Cosel Co., Ltd. TAH-06-683
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.
Checking Versions
You can check versions on the ID information indications or with the Sysmac Studio.
ID information indication
Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.
Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.
MAC address
PORT1 :
PORT2 :
Hardware
Unit version Ver.1. HW Rev. revision
LOT No. DDMYY xxxx
ID information indication
Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.
ID information indication
1 Right-click CPU Rack under Configurations and Setup - CPU/Expansion Racks in the Multiv-
iew Explorer and select Production Information.
The Production Information Dialog Box is displayed.
2 Right-click any open space in the Unit Editor and select Production Information.
The Production Information Dialog Box is displayed.
1 Click the Show Detail or Show Outline Button at the lower right of the Production Information
Dialog Box.
The view will change between the production information details and outline.
The information that is displayed is different for the Outline View and Detail View. The Detail
View displays the unit version, hardware version, and software versions. The Outline View dis-
plays only the unit version.
Note The hardware revision is separated by "/" and displayed on the right of the hardware version. The hardware
revision is not displayed for the Unit that the hardware revision is in blank.
1 Double-click EtherCAT under Configurations and Setup in the Multiview Explorer. Or, right-
click EtherCAT under Configurations and Setup and select Edit from the menu.
The EtherCAT Tab Page is displayed.
2 Right-click the master on the EtherCAT Tab Page and select Display Production Information.
The Production Information Dialog Box is displayed.
The unit version is displayed after “Rev.”
1 Click the Show Detail or Show Outline Button at the lower right of the Production Information
Dialog Box.
The view will change between the production information details and outline.
Related Manuals
The followings are the manuals related to this manual. Use these manuals for reference.
Terminology
Term Description
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 position
after homing and the absolute data that is read from the absolute encoder.
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.
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.
axes group A functional unit that groups together axes within the Motion Control Function Mod-
ule.
Axes Group Variable A system-defined variable that is defined as a structure and provides status infor-
mation 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 instruc-
tions and to monitor the command interpolation velocity, error information, and
other information for the axes group.
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.
Axis Variable A system-defined variable that is defined as a structure and provides status infor-
mation 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.
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.
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.
CJ-series Unit Any of the CJ-series Units that can be used with an NJ-series Controller.
Communications Coupler Unit The generic name of an interface unit for remote I/O communications on a network
between NX Units and a host network master. For example, an EtherCAT Coupler
Unit is a Communications Coupler Unit for an EtherCAT network.
Constant One of the attributes of a variable.
If you specify the Constant attribute for a variable, the value of the variable cannot
be written by any instructions, ST operators, or CIP message communications.
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).
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.
CPU Unit The Unit that serves as the center of control for a Machine Automation Controller.
The CPU Unit executes tasks, refreshes I/O for other Units and slaves, etc. The
NJ/NX-series CPU Units include the NX701-, NX1P2-, NJ501-
and NJ301-.
Term Description
derivative data type A data type that is defined by the user. Structures, unions, and enumerations are
derivative data types.
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.
download To transfer data from the Sysmac Studio to the Controller with the synchronization
operation of the Sysmac Studio.
edge One of the attributes of a variable.
This attribute makes a BOOL variable pass TRUE to a function block when the vari-
able changes from FALSE to TRUE or when it changes from TRUE to FALSE.
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.
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.
event log A function that recognizes and records errors and other events.
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 conditions
are met.
FB An acronym for "function block."
forced refreshing Forcing the refreshing of an input from an external device or an output to an exter-
nal device, e.g., when the user debugs a program.
Addresses that are subject to forced refreshing can still be overwritten from the
user program.
FUN An abbreviation for "function."
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.
function module One of the functional units of the software configuration of the CPU Unit.
general-purpose slave Any of the EtherCAT slaves that cannot be assigned to an axis.
global variable A variable that can be read or written from all POUs (programs, functions, and func-
tion blocks).
I/O map settings Settings that assign variables to I/O ports. Assignment information between I/O
ports and variables.
I/O port A logical interface that is used by the CPU Unit to exchange data with an external
device (slave or Unit).
I/O refreshing Cyclic data exchange with external devices that is performed with predetermined
memory addresses.
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.
Initial Value One of the attributes of a variable. The variable is set to the initial value in the fol-
lowing 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
inline ST ST programming that is included within a ladder diagram program.
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 out-
puts), function instructions, function block instructions, and ST statements.
Term Description
literal A constant expression that is used in a user program.
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.
main memory The memory inside the CPU Unit that is used by the CPU Unit to execute the OS
and user program.
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).
MC Test Run A function to check motor operation and wiring from the Sysmac Studio.
memory used for CJ-series Units A type of I/O memory specified as the assignment destination of variables when
accessing a CJ-series Unit and CJ-series network. It can be accessed only with
variables with an AT attribute.
minor fault level Controller error An error for which part 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 Con-
troller error occurs.
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 func-
tion blocks for PLCopen® motion control as well as instructions developed specifi-
cally for the Motion Control Function Module.
namespace A system that is used to group and nest the names of functions, function block defi-
nitions, 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.
NX bus The NX-series internal bus. An NX1P2 CPU Unit has the NX bus.
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.
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.
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 Con-
troller error.
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.)
periodic task A task for which user program execution and I/O refreshing are performed each
period.
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 interface
to the USB and SD Memory Card.
POU An acronym for "program organization unit." A POU is a unit in a program execution
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.
primary periodic task The task with the highest priority.
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 communica-
tions are also called PDO communications.
Term Description
program Along with functions and function blocks, one of the three types of POUs.
Programs are assigned to tasks to execute them.
Range Specification One of the variable specifications. You can specify a range for a variable in
advance. The variable can take only values that are in the specified range.
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 transferred
SDO communications One type of EtherCAT communications in which service data objects (SDOs) are
used to transmit information whenever required.
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.
slave A device that performs remote I/O for a master.
slave and Unit configurations A generic term for the EtherCAT configuration and Unit configuration.
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.
Special Unit Setup A generic term for the settings for a Special Unit, including the settings in allocated
DM Area words.
structure One of the derivative data types. It consists of multiple data types placed together
into a layered structure.
synchronization A function that automatically compares the information in the NJ/NX-series Control-
ler with the information in the Sysmac Studio, displays any differences and loca-
tions in a hierarchical form, and can be used to synchronize the information.
Sysmac Studio A computer software application for setting, programming, debugging, and trouble-
shooting NJ/NX-series Controllers. It also provides operations for motion control
and a Simulator.
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 between
tasks, data trace processing, and other processing is performed.
system service Processing that is performed by the CPU Unit in unused time between task pro-
cessing. 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.
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.
union One of the derivative data types. It allows you to handle the same data as different
data types.
Unit A device that mounts to the CPU Rack or an Expansion Rack. In NJ/NX-series
manuals, it refers to CJ-series Units.
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.
upload To transfer data from the Controller to the Sysmac Studio with the synchronization
operation of the Sysmac Studio.
user program All of the programs in one project.
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.
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. “Variable” is
used as opposed to “constant,” for which the value does not change.
Term Description
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.
Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.
Introduction to NJ/NX-series
Controllers
This section describes the features, basic system configuration, specifications, and
overall operating procedure of an NJ/NX-series Controller.
Sysmac Studio
Automation Software
IEC programming
1-1-1 Features
Hardware Features
Standard-feature EtherCAT Control Network Support
All CPU Units provide an EtherCAT master port for EtherCAT communications. EtherCAT is an
advanced industrial network system that achieves faster, more-efficient communications. It is based
on Ethernet. Each node achieves a short fixed communications cycle time by transmitting Ethernet
frames at high speed. The standard-feature EtherCAT control network allows you to connect all of
the devices required for machine control (e.g., I/O systems, Servo Drives, Inverters, and machine
vision) to the same network.
Version Information
A CPU Unit with unit version 1.06 or later and Sysmac Studio version 1.07 or higher are required
to use the NX-series Safety Control Units. 1
1-1-1 Features
The NX102 CPU Units and NX1P2 CPU Units allow you to mount NX-series Digital I/O Units, Ana-
log I/O Units and other Units to the CPU Unit, in addition to EtherCAT network slaves.
The NX102- CPU Unit and NX1P2- CPU Unit have a multi-core processor that
can execute the tasks, tag data link service, and system services in parallel. This secures communi-
cations performance with the Sysmac Studio, an HMI, or other devices.
Software Features
Integrated Sequence Control and Motion Control
An NJ/NX-series CPU Unit can perform both sequence control and motion control. You can simulta-
neously achieve both sequence control and multi-axes synchronized control. Sequence control,
motion control, and I/O refreshing are all executed in the same control period. The same control
period is also used for the process data communications cycle for EtherCAT. This enables precise
sequence and motion control in a fixed period with very little deviation.
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
Peripheral USB port
Sysmac Studio
NX-series Controller
Power
Supply Unit CPU Unit
LAN USB
Or
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.
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 EtherNet/IP ports.
EtherNet/IP
HMI
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 Stan-
dard Edition.
Support Software
NX Unit Configuration
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.
Network Configurations
• Host computers, HMIs, and other NJ/NX-series Controllers are connected to the built-in Ether-
Net/IP port.
• An NX102 CPU Unit has two built-in EtherNet/IP ports.
Host computer HMI
EtherNet/IP
HMI
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 Software
The following Support Software is also included in the Sysmac Studio Software Package Stan-
dard Edition.
*1 If the NJ/NX-series Controller is a target device, you may also use Sysmac Studio version 1.10 or high-
er. Use the Network Configurator if a CS/CJ-series PLC operates as the originator device.
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.
Network Configurations
• Host computers, HMIs, and other NJ/NX-series Controllers are connected to the built-in Ether-
Net/IP port.
EtherNet/IP
NX-series
NX1P2
CPU Unit
Serial-communications devices
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 Stan-
dard Edition.
Support Software
The Support Software is connected to the peripheral USB port on the CPU Unit with a commercially
available USB cable. You can also connect it through an Ethernet cable that is connected to the
built-in EtherNet/IP port.
Refer to 10-2 Connection with Sysmac Studio for details on the connection configuration of the Sup-
port Software.
LAN USB
Or
CPU Rack
EtherNet/IP
EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT
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.
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 CompoNet network is connected to a
CompNet Unit. A serial communications network is connected to a Serial Communications Unit.
Host computer HMI NJ-series Controller
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 OD16
CRT1-OD16
CRT1
REMOTE TERMINAL REMOTE TERMINAL
Serial General-purpose
device with serial
DeviceNet Unit communications
DeviceNet
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 debug
and simulate operation.
• Other Support Software
The following Support Software is also included in the Sysmac Studio Software Package Stan-
dard Edition.
Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to A-
15 Version Information for NX-series Controllers and A-16 Version Information for NJ-series Controllers for information
on version upgrades.
Step 4. Wiring
Connect the network cables and wire the I/O.
Step 1-1 • External I/O devices and Unit configuration NX-series CPU Unit Hard-
Designing I/O and • Refresh periods for external devices ware User’s Manual (Cat. 1
Processing • Program contents No. W535)
NX-series NX102 CPU Unit
Hardware User’s Manual
Step 1-3
Designing Pro-
grams
Variable Design • Defining variables that you can use in more than one POU and 6-3 Variables
variables that you use in only specific POUs
• 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
Project Creation 1. Create a project in the Sysmac Studio. New Project Button Sysmac Studio Version 1
2. Insert a Controller. Insert − Controller Operation Manual (Cat. No.
W504)
The following Controller Configurations and Setup and the Programming and Task Settings can be performed in either
order.
Step 2-1
Slave and Unit
Configurations
1) Creating the Slave 1. Creating the slave configuration and EtherCAT Slave Set- 3-2-1 Creating the EtherCAT
and Unit Configura- Unit configuration either offline or ting Editor Slave Configuration
tions online. (For online configuration, make Unit Editor 3-2-2 Creating the Unit Con-
the online connection that is described
figuration
in step 5.)
2. Setting up any Slave Terminals that are NX-series EtherCAT Cou-
used. pler Unit User’s Manual
(Cat. No. W519)
2) Assigning Device Registering device variables in variable I/O Map 3-3 I/O Ports and Device
Variables to I/O Ports tables (Variable names are user defined or Variables
automatically created.)
3) Creating the Axes Creating the axes and setting them as real Configurations and 3-5 Creating the Axes and
and Assigning Them axes or virtual axes. Creating axes groups Setup − Motion Con- Assigning Them to the
to the Servo to perform interpolated axes control. trol Setup Servo Drives/Encoder Input
Drive/Encoder Input Slaves/NX Units
Slaves
Setting the initial values for the PLC Configurations and 4-2 Initial Settings for the
Function Module Setup − Controller PLC Function Module
Setup − Operation
Settings
(For NJ-series CPU Units) Configurations and 4-4 Initial Settings for Spe-
Initial settings for Special Units Setup − CPU/Expan- cial Units
sion Racks
(To use motion control) Configurations and 4-5 Initial Settings for the
Setting the initial settings for the Setup − Motion Con- Motion Control Function
Motion Control Function Module trol Setup Module
Setting the initial values for the Ether- Configurations and 4-6 Initial Settings for the
CAT Function Module Setup − EtherCAT EtherCAT Master Function
Module
Setting the initial values for the Ether- Configurations and 4-7 Initial Settings for the
Net/IP Function Module Setup − Controller EtherNet/IP Function Mod-
Setup − Built-in Ether- ule
Net/IP Port Settings
Step 2-3
Programming
1) Registering Vari- • Registering the variables used by more Global Variable Table Sysmac Studio Version 1
ables than one POU in the global variable Editor Operation Manual (Cat. No.
table with Sysmac Studio W504)
Local Variable Table
• Registering the local variable table for Editor 6-3 Variables
each program
• Registering the local variable table for
each function block and function
2) Writing Algorithms Writing the algorithms for the POUs (pro- Programming Editor Section 6 Programming
for POUs grams, function blocks, and functions) in NJ/NX-series Instructions
the required languages Reference Manual (Cat. No.
W502) and NJ/NX-series
Motion Control Instructions
Reference Manual (Cat. No.
W508)
3) Setting the Tasks Making task settings Configurations and 4-2-3 Task Settings
Setup − Task Settings
Step 2-4 Checking the algorithms and task execu- Section 7 Checking Opera-
Offline Debugging tion times on the Simulator (virtual control- tion and Actual Operation
ler)
2. Setting Hard- • Setting the node addresses of the EtherCAT slaves Operation manuals for the
ware • Setting unit numbers on the rotary switches on the front of the Spe- EtherCAT slaves and Spe-
cial Units cial Units
1. Connecting • Connecting the built-in EtherCAT port NX-series CPU Unit Hard-
• Connecting the built-in EtherNet/IP port ware User’s Manual (Cat.
Ethernet Cable
No. W535)
NX-series NX102 CPU Unit
Hardware User’s Manual
(Cat. No. W593) 1
NX-series NX1P2 CPU Unit
Hardware User's Manual
2. Wiring I/O • Wiring I/O to EtherCAT slaves Operation manuals for the
• Wiring Basic I/O Units and Special Units EtherCAT slaves
NX-series CPU Unit Hard-
ware 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 Hard-
ware User’s Manual (Cat.
No. W500)
1. Online Connec- Turn ON the power supply to the Control- Controller − Commu- Section 7 Checking Opera-
ler and place the Sysmac Studio online. nications Setup tion and Actual Operation
tion to Sysmac Stu-
Then, download the project.*
dio and Project Controller − Synchro-
(Perform this step before you create the
Download slave configuration or Unit configuration
nization
from the mounted Units in step 2-1.)
2. Operation Check 1. Check the wiring by using forced Section 7 Checking Opera-
refreshing of real I/O from the I/O Map tion and Actual Operation
on Controller
or Watch Tab Page.
2. For motion control, use the MC Test
Run operations in PROGRAM mode to
check the wiring. Then check the motor
rotation directions for jogging, travel
distances for relative positioning (e.g.,
for electronic gear settings), and hom-
ing operation.
3. Change the Controller to RUN mode
and check the operation of the user
program.
* Use the Synchronize Menu of the Sysmac Studio to download the project.
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 access enable the CPU Unit to execute both
sequence control and motion control.
NJ/NX-series CPU Unit
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 with 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.
Item Reference
Software P.2-4
Accessing I/O P.2-13
Sequence control and motion control P.2-29
Overview of CPU Unit data P.2-36
Operation for CPU Unit status P.2-37
Refer to the following manuals for details on the use of variables for external communications.
Communications 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 communica- CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit
tions (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
processing Unit
Initialization Startup state Initialization is performed only when Self diagnosis at startup
the power supply is turned ON.
Processing executed Normal operation The processing is executed within the User program execution
with tasks and error states assigned task. These tasks are exe- and I/O refreshing
cuted either periodically or only once
when the specified condition is met. 2
Tag data link service These services are performed only Tag data links
upon requests from the hardware or I/O refreshing for Analog
Option board service*1
Refer to 2-7-1 CPU Unit Status 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 vari-
ables 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 Power The Power Turned ON and Power Interrupted events are
Interrupted events recorded.
*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 on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
*4 You can use CJ-series Units only with NJ-series CPU Units.
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
Type of peri- Main processing con-
(smaller values indicate higher pri- Execution condition
odic task tent
ority)
Primary periodic 4 The primary periodic I/O refreshing, user
task This task has the highest execution task is periodically exe- program execution,
priority. cuted. and motion control
Periodic tasks 5*1 The periodic task is I/O refreshing, user
periodically executed. program execution,
This task has the next highest execu-
The task period is an and motion control
tion priority after the primary periodic
task. integer multiple of the
task period of the pri-
mary periodic task.
16*2, 17, or 18 The periodic task is The processing that
periodically executed. can be performed
The task period is an depends on the task
integer multiple of the execution priority.
task period of the pri- Execution priority 16:
mary periodic task. I/O refreshing and user
program execution
Execution priority 17 or
18: User program exe-
cution
Event tasks 8 or 48 An event task is exe- User program execu-
cuted only once when tion
the specified condition
is 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
example is for the primary periodic task and a periodic task. If the primary periodic task is ready for
execution while a periodic task is in execution, execution of the primary periodic task is prioritized.
2-2 Software
Primary Task Task Task
periodic task
Task period of periodic task Task period of periodic task
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 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 peri-
odic task is called motion control 2.
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.
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 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 informa-
tion 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 for details on the communications bridge service.
System Services
System Services
System services include the following processing.
Processing Contents
2-2 Software
USB port service*1 • Processing of service requests from the Sysmac Studio or host computers
Built-in EtherNet/IP port ser- • Processing of message service requests, such as CIP commands, from
vice the Sysmac Studio, an HMI, host computers, or other Controllers
• Execution of communications instructions for CIP and socket communica-
tions
Built-in EtherCAT port service • Execution of EtherCAT message communications 2
Communications processing • Execution of communications processing for a Serial Communications
for a Serial Communications Option Board
*1 The NX102 CPU Units and NX1P2 CPU Units do not provide 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 allocated to
them during I/O refreshing. You can use CJ-series Special Units only with NJ-series CPU Units.
For NJ-series CPU Units, if a request comes from the hardware or from outside of the CPU Unit,
system services are executed during the unused time between the execution of all tasks.
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
In an NJ/NX-series CPU Unit, you use variables in the user program to access I/O and memory in the
Attribute set-
Variables Accessed data
tings
User-defined variables All attributes can CPU Unit
be set.
Semi-user-defined Device variables Device variables Some attributes EtherCAT slaves*2*3
variables 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 Servo Drives, encoder input
variables for Variable slaves, and CPU Unit
motion control Axis Variables
Axes Group Vari-
ables
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-12 for the attributes that can be set.
*2 “EtherCAT slaves” includes any NX Units on EtherCAT Slave Terminals.
*3 With the Sysmac Studio version 1.08 or lower, the EtherCAT slaves to which axes are assigned cannot be
accessed via EtherCAT slave device variables.
*4 You can use system-defined variables for NX Units only with the NX102 CPU Units and NX1P2 CPU Units.
*5 You can use device variables for built-in I/Os and Option Boards only with the NX1P2 CPU Units.
*6 You can use CJ-series Units only with NJ-series CPU Units.
*7 You can use system-defined variables for NX bus only with the NX102 CPU Units and NX1P2 CPU Units.
User-defined Variables
The user defines all of the attributes of a user-defined variable. Refer to 6-3 Variables for details on
user-defined variables.
Semi-user-defined Variables
Semi-user-defined variables have some attributes that you can set. These variables are used to access
specific data. A semi-user-defined variable can either be a device variable or a cam data variable,
depending on what it can access.
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 Eth-
erCAT slaves, NX Units on the CPU Unit, built-in I/O, Analog I/O Option Boards, and CJ-series
Units.
The device and the data to access in that device determine the type of device variable, as shown
below.
Device variables for built-in I/O*4 Built-in I/O I/O data for built-in I/O
Device variables for Option Boards*4 Analog I/O Option Boards I/O data for Analog I/O Option Boards
Device variables for CJ-series CJ-series Basic I/O Units Real I/O data in Basic I/O Units
Units*5 CJ-series Special Units Operating data*6 and setup data for
Special Units*7
*1 With the Sysmac Studio version 1.08 or lower, the EtherCAT slaves to which axes are assigned cannot be
accessed via EtherCAT slave device variables.
*2 This refers to I/O data that is exchanged during the process data communications cycle between the mas-
ter and slaves.
*3 You can use system-defined variables for NX Units only with the NX102 CPU Units and NX1P2 CPU Units.
*4 You can use device variables for built-in I/Os and Option Boards only with the NX1P2 CPU Units.
*5 You can use CJ-series Units only with NJ-series CPU Units.
*6 This data is used in the operation of CJ-series Units. The CIO Area portion of the memory used for CJ-
series Units is used.
*7 This data is used to set up the CJ-series Units. The DM Area portion of the memory used for CJ-series
Units is used.
Device variables are used to access data for EtherCAT slaves, NX Units on the CPU Unit, built-in
I/O, Analog I/O 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
Instruction
Device variable
EtherCAT slave, NX
I/O port Unit, or CJ-series Unit
System-defined Variables
System-defined variables are defined 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.
*1 Only the NX102 CPU Units and NX1P2 CPU Units have the NX Bus Function Module.
The system-defined variables for motion control are classified according to what the Motion Control
Function Module does, as listed in the following table.
*1 An axes group consists of multiple axes. An axes group is used for interpolation.
Analog I/O Option Boards*4 --- Device variables for Option Boards
CJ-series Units*5 Basic I/O Units --- Device variables for CJ-series Units
Special Units • Operating data Device variables for CJ-series Units
• Setup data
Assigned memory User-defined variables
area data*6
*1 With the Sysmac Studio version 1.08 or lower, the EtherCAT slaves to which axes are assigned cannot be
accessed via EtherCAT slave device variables.
*2 You can use NX Units on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
*3 You can use the built-in I/O only with the NX1P2 CPU Units.
*4 You can use Analog I/O Option Boards only with the NX1P2 CPU Units.
*5 You can use CJ-series Units only with NJ-series CPU Units.
*6 This data is for extended functions and slave I/O that you assign by specifying addresses in memory. You can-
not access assigned memory area data with device 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
Servo Drive and encoder input slaves that are These slaves are accessed directly with Axis variables.*2
assigned to axes
*1 With the Sysmac Studio version 1.08 or lower, the EtherCAT slaves to which axes are assigned cannot be
accessed via EtherCAT slave device variables. 2
*2 For a Servo Drive, one Servomotor is assigned as one axis to one Axis variable. For an encoder input slave,
one counter is assigned as one axis to one Axis variable.
Accessing Servo Drive, Encoder Input, and General-purpose Slaves That Are
Not Assigned to Axes
These slaves are accessed through I/O ports for device variables for EtherCAT slaves. PDO com-
munications are used to access data from I/O ports.
CPU Unit
Example: General-purpose slave
Device variables
for EtherCAT slaves I/O ports
PDO communications
Variable 00
InBit00
to
to
PDO communications
15
Variable
InBit15
Accessing Servo Drive and Encoder Input Slaves That Are Assigned to Axes
Servo Drive and encode input slaves that are assigned to axes are accessed directly through the
Axis variable. PDO communications are used to access data from Axis variables.
For example, if a Servomotor is controlled with a Servo Drive, the control commands for the Servo-
motor that is assigned to an Axis variable are sent to the Servo Drive. The feedback from the Servo-
motor is sent from the Servo Drive to the CPU Unit by using the Axis variable.
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 for details on Axis variables.
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 to which axes are assigned.
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.
Additional Information
There are two types of EtherCAT communications, PDO communications and SDO communica-
tions. PDO communications are used for commands to refresh I/O data, such as data for Servo-
motor position control, on a fixed control period. SDO communications are used for commands
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
Device variables Example: Digital Input Unit
for NX Units I/O ports
Variable 00
Input Bit 00
to
to
Variable 01
Input Bit 01
Refer to 3-5-2 Axis Variables and Axes Group Variables for details on Axis variables.
Variable 00
Output Bit 00
…
… mm
2
Variable
Output Bit mm
…
…
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
Ch1_In00
…
…
Variable 15
Ch1_In15
Variable 00
Ch2_In00
…
…
Variable 15
Ch2_In15
Accessing Special Units through I/O ports by Using Device Variables for CJ-
2
series Units
The operating data and setup data are accessed through the I/O ports for the device variables for
%3201.00
Variable 3201.00 Slave
Refer to A-9 Contents of Memory Used for CJ-series Units for information on the memory used for
CJ-series Units. Refer to 6-3-8 Variable Attributes for information on AT specifications.
The NX Bus Function Module of the NX102 CPU Unit and NX1P2 CPU Unit performs the data
Module
exchange 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.
2
Precautions for Correct Use
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.
Refer to the manuals for the specific Units for the I/O refreshing methods that are supported by individ-
ual NX Units.
Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task Refreshing Refreshing
processing processing processing 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
Module
NX1P2 CPU Unit record the DC times when inputs change (called input changed times). Then, the
input changed times are read at the time that is synchronized with the I/O refreshing in the primary
periodic task. The most recent values are always read as the input values.
2
Additional Information
Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task processing Refreshing processing processing Refreshing processing
Primary Output data Refreshing Input data UPG MC Output data Refreshing Input data UPG MC
periodic task processing 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)
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 with 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.
Additional Information
For details on motion control instructions, refer to the NJ/NX-series Motion Control Instructions
Reference Manual (Cat. No. W508). For details on other instructions, refer to the NJ/NX-series
Instructions Reference Manual (Cat. No. W502).
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 to which axes are assigned.
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.
*1 With the Sysmac Studio version 1.09 or higher, a Servo Drive and encoder input slave to which an axis is
assigned can also be a part of sequence controls if you assign the device variable to the I/O port of the slave.
*2 The data refresh period in the slave depends on settings in the slave.
*3 You can use NX Units on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units. An NX Unit on
the CPU Unit to which an axis is assigned can also be a part of sequence controls if you assign the device vari-
able to the I/O port of the NX Unit.
*4 The I/O refresh cycles of the NX Units that operate with Free-Run refreshing and the control period of the CPU
Unit are asynchronous.
*5 You can use the built-in I/O only with the NX1P2 CPU Units.
*6 You can use Option Boards only with the NX1P2 CPU Units.
*7 The primary periodic task and the data exchange period of Option Boards are asynchronous.
*8 You can use CJ-series Units only with NJ-series CPU Units.
*9 The data exchange period with a CJ-series Unit is the task period to which I/O refreshing for the CJ-series Unit
is assigned.
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
refreshing 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.
For details, refer to 5-11-3 System Input and Output Response Times.
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
Sequence control period (task I/O refreshing in the process data communi-
period of the primary periodic task cations cycle (i.e., task period of the primary Data refresh
or the periodic task) periodic task or the priority-5 periodic task) period in slave
Additional Information
• You can use the priority-5 periodic task only with the NX701 CPU Units.
• 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 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 on the CPU Unit only with the NX102 CPU Units 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 with NJ-series CPU Units.
control processing
instruction Command
Axis variable
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 Mod-
ule 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. For details, refer to 5-11-3 System
Input and Output Response Times.
Additional Information
• Relationship among motion controls, tasks, and process data communications cycles for the
NX701 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 interac-
tion. This status 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 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 12-1 Overview of Troubleshooting for troubleshooting proce-
dures using the status indicators.
• Refer to A-8 Attributes of CPU Unit Data for information on data operations when the CPU Unit
status changes.
• Refer to 6-3-9 Changes to Variables for Status Changes for the values that variables take
when the status of the CPU Unit changes.
*1 Refer to the manual for each slave for information on the slave settings that apply until EtherCAT communi-
cations starts after the power supply is turned ON.
*2 When the download is completed, initialization of the EtherCAT slaves starts. When initialization is in prog-
ress, the outputs reflect the settings for the slave.
*3 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 Con-
figuration) system-defined variables. Refer to 6-3-9 Changes to Variables for Status Changes for details. A
CPU Unit with unit version 1.13 or later and Sysmac Studio version 1.17 or higher are required to use the
_DeviceOutHoldCfg (Device Output Hold Configuration) system-defined variable.
*4 When the download is completed and when the operating mode is changed: the values in the device vari-
ables for CJ-series Units are initialized to the values of the Initial Value attributes.
Refer to 6-3-8 Variable Attributes for information on the Initial Value attribute for variables.
Refer to Device Output Hold Configurations on page 6-70 for details on the device output hold con-
figurations.
Additional Information
*1 For the default setting, the CPU Unit will enter RUN mode when the CPU Unit changes from startup state to
normal operation.
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).
*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.
*1 The system-defined initial values of variables depend on the data types of the variables. Refer to When the Ini-
tial Value Specification Is Left Blank on page 6-64.
Refer to 6-3-9 Changes to Variables for Status Changes for the values that variables take when the sta-
tus of the CPU Unit changes.
RUN indicator
Operating mode
status
Not lit PROGRAM mode
Lit RUN 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.
Step 4. Wiring
Step 1
Configurations
uration
EtherCAT
CPU
Unit
Step 3 Create the axes and assigning them to the slaves or Units (if motion con- Reference
trol is used).
1. Create the axes. 3-5 Creating
2. Assign the axes to the slaves or Units in the EtherCAT configuration or Unit configuration. the Axes and
Axis Setup EtherCAT slave configuration/Unit configuraton Assigning
Servo Drives
Them to the
Axes Assigned.
CPU
Servo
A
Sysmac Studio Axis variable a Unit Drives/Encoder
EtherCAT
Input
Axis variable b B Slaves/NX
A B C D Units
Axis variable c C
Configurations
3-2-1 Creating the EtherCAT Slave Configuration
In the EtherCAT Tab Page of the Sysmac Studio, create the EtherCAT slave configuration that is
detected as “correct” by the CPU Unit.
CPU Unit 3
EtherCAT master
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 Unit User’s Manual (Cat. No. W519) for information on the Slave Terminal configura-
tion and operation settings.
• If you use the built-in I/O or Option Boards with an NX1P2 CPU Unit, make the configuration
settings 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 required
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 3-5 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.
Configurations
same. You can compare the Unit configuration on the Sysmac Studio with the physical Unit configura-
tion to see if they are the same before the first time you download the Unit configuration to the CPU Unit
from the Sysmac Studio.
Compared.
3
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
I/O ports are automatically registered in the I/O Map when you create the EtherCAT slave configuration,
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
Ch_In Ch_Out
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
You can specify device variables in the user program or in external communications to access the
devices (slaves or Units).
CPU Unit
Device variables
I/O ports
Refer to 2-3-1 Types of Variables for the relationship of device variables to other variables. 3
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on registering
device variables with the Sysmac Studio.
Note You can use CJ-series Units only with 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 the built-in I/Os and Option Boards only with the NX1P2 CPU Units.
Note You can use system-defined variables for NX Units only with the NX102 CPU Units and 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.
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
Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required
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 configuration 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 will be added on the I/O Map.
4 Right-click the Node location information and select Create Device Variable.
The variable name will be written automatically 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 _sNX-
UNIT_ID structure data type are given in the following table.
Additional Information
The data type of variables assigned to EtherCAT slaves other than Slave Terminals is _sECAT_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
order 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 Drive,
encoder input slaves, or NX Units. At a result, Axis Variables are automatically created as system- 3
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.
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.
Classification Parameter name Setting
Axis Basic Axis Number Axis numbers are automatically set in the order that the axes
Settings are created.
Motion Control*1 Select Primary periodic task.
Axis Use Select Used axis.
Axis Type Select a servo axis or encoder axis.
Input Device/ Specify the node address of the EtherCAT slave that is
Output Device assigned to the axis.
*1 You can select this parameter for NX701 CPU Units.
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.
Enable Status
ServoOn Busy MyAxis1OnBusy
Error MyAxis1OnError
ErrorID MyAxis1OnErrorID
Refer to 3-5-2 Axis Variables and Axes Group Variables for information on Axis Variables.
Step 4. Wiring
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for details.
Initial Settings Related to the PLC Function Module: 4-2 Initial Set-
tings for the
Controller Setup: Startup Mode, Write Protection, System Service Moni-
PLC Function
toring Settings, and other settings Module
Initial Settings for the Motion Control Function Module: 4-5 Initial Set-
tings for the
• Axis Parameters: Motion control parameters for single-axis operation
Motion Control
• Axes Group Parameters: Motion control parameters for multi-axes coor- Function Mod-
dinated operation ule
• Cam data: Phase and displacement setting tables for cam motions 4
Initial Settings for the EtherCAT Master Function Module: 4-6 Initial Set-
tings for the
EtherCAT Master Parameters in the EtherCAT Configuration:
EtherCAT Mas-
Parameter settings for the EtherCAT master process data communications ter Function
cycle, and other settings Module
Initial Settings for the EtherNet/IP Function Module: 4-7 Initial Set-
tings for the
Ethernet Port Setup: EtherNet/IP Port TCP/IP Settings, Ethernet Settings,
EtherNet/IP
and other settings Function Mod-
ule
4-2-1 Introduction
The initial settings for the PLC Function Module are listed below.
• Controller Setup
• Task Settings
Select Configurations and Setup − Controller Setup and Configurations and Setup − Task Set-
tings on the Sysmac Studio to make these settings
*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 NS start wait
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 opera-
tion state. The time to complete the tag verifications can be reduced by performing a part of processing of the tag verifica-
tions 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 These settings are only provided for the NX102 CPU Units and NX1P2 CPU Units.
*4 For NX-series CPU Units, the System Service Monitoring Settings are not provided.
*5 A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use the SD Memory
Card Program Transfer Setting.
*6 A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are required to use the SD Memory
Card Restore Setting.
*7 A CPU Unit with unit version 1.02 or later and Sysmac Studio version 1.03 or higher are required to use the Event Log
Settings.
*8 A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are required to disable backups.
*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.
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required.
4-2-4 Unit Configuration and Unit Setup for NX102 CPU Units and
NX1P2 CPU Units
This section describes the Unit configurations and settings for the NX102 CPU Units and NX1P2 CPU
Units. These settings are not provided for the NX701 CPU Units and NJ-series CPU Units.
Create the NX Unit configuration on the CPU Unit, and set up each Unit.
Make 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. 4
NX Unit Number 1 2 3
4-2-4 Unit Configuration and Unit Setup for NX102 CPU Units and NX1P2 CPU Units
NX Unit Registration Status _NXB_UnitRegTbl[1] _NXB_UnitRegTbl[2] _NXB_UnitRegTbl[3]
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 cor-
rected 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 s the array sub-
script 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
Unit Information
4-2-5 Unit Configuration and Unit Setup for NJ-series CPU Units
We recommend that you change the name to one that is suitable to the device.
Additional Information
The device names that are set here are placed before the I/O port name when device variables
are automatically created.
Special Units
Set the unit numbers of the Special Units.
The settable items for the selected NX Unit are listed below.
Item Description Set values Default
Device name The name of the NX Unit. Any value*1 *2
NX Unit Mounting Set- This setting enables or disables the mounting of an NX Enabled or Enabled
ting Unit. Refer to 8-2-2 Mounting Settings of NX Units on the Disabled
CPU Unit for details on this setting.
I/O allocation settings These are the settings for which I/O data in the NX Unit to --- Refer to the
exchange.*3 manual for
the specific
Click the Edit I/O Allocation Settings Button to edit these
NX Unit.
settings. You cannot change this setting for System Units.
Refer to 4-3-2 I/O Allocation Settings 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 NX Unit.*4 --- Refer to the
Click the Edit Unit Operation Settings Button to edit manual for
these settings. You cannot change this setting for System the specific
Units. Refer to 4-3-3 Unit Operation Settings for the Unit NX Unit.
operation settings.
Unit application data This data controls the functionality that is specific to each --- Refer to the
NX Unit. Not all NX Units have Unit application data. manual for
the 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.
*2 “N” followed by serial numbers that start from 1.
*3 The NX Units contain default values for the I/O settings. You do not need to edit the default values for a stan-
dard exchange. Change the settings as necessary.
*4 The settings are available depend on the type of the NX Unit. For example, Digital Input Units have a setting
for the input filter value, and Digital Output Units have a setting for the output value at load rejection. Refer to
the manual for the specific NX Unit for the settings and their meanings.
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 This is a mapping list of the I/O entries in the corresponding Unit.
Mapping 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 information, 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 selected 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.
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 entry mapping.
Allocation • OK Button: This button confirms the settings in the Edit I/O Allocation Settings Pane, and returns the
Settings Pane 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.
• Apply Button: This button confirms the settings in the Edit I/O Allocation Settings Pane, and allows you
to edit other I/O entries.
Method 1: Setting from the Unit Setting Pane of the Sysmac Studio
1 Select the Unit in the Unit Configuration and Setup.
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.
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.
Method 3: Using the Sysmac Studio to Specify Initial Settings for the
Device 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.
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:
P_First_RunMode MOVE
4
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
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
4
Select Configurations and Setup − Controller Setup − Built-in EtherNet/IP Port Settings on the
Sysmac Studio to make these settings.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP User’s Manual (Cat. No. W506) for details.
The initial settings for the built-in I/O 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.
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.
4
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
For the NX102 CPU Units, the settings are as follows.
*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.
4-10-3 Settings
Size (Num- Specify the size of memory of 1 to 512 When Not allowed.
ber of Words) area type HR. 1,536 down-
loaded to
CPU Unit
DM*2 Enable Enable or disable the genera- Enable Disable When Not allowed.
tion of DM area type memory Disable down-
used for CJ-series Units. loaded to
CPU Unit
Size (Num- Specify the size of memory of 1 to 4,096 When Not allowed.
ber of Words) area type DM. 16,000 down-
loaded to
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.
Setting Changes in
Item Setting Set value Default Update timing
group RUN mode
Memory Set- CIO*1 Enable Enable Disable When down- Not allowed.
tings for CJ- Disable loaded to CPU
series Units Unit
Size 1 to 6,144 6,144 When down- Not allowed.
(Number of loaded to CPU
Words) Unit
WR*1 Enable Enable Disable When down- Not allowed.
Disable loaded to CPU
Unit
Size 1 to 512 512 When down- Not allowed.
(Number of loaded to CPU
Words) Unit
HR*2 Enable Enable Disable When down- Not allowed.
Disable loaded to CPU
Unit
Size 1 to 1,536 512 When down- Not allowed.
(Number of loaded to CPU
Words) Unit
DM*2 Enable Enable Disable When down- Not allowed.
Disable loaded to CPU
Unit
Size 1 to 32,768 32,768 When down- Not allowed.
(Number of loaded to CPU
Words) Unit
EM0- Enable Enable Disable When down- Not allowed.
EM18*2 Disable loaded to CPU
Unit
Size 1 to 32,768 32,768 When down- Not allowed.
(Number of loaded to CPU
Words) 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.
Step 4. Wiring
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 con-
ditions and execution priorities.
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are required
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 peri-
odic 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.
Exchanging data with CJ-series Units or EtherCAT slaves is called I/O refreshing. 5
You can assign I/O refreshing for each slave and Unit to the primary periodic task or the priority-5 or pri-
ority-16 periodic task. By default, I/O refreshing for all slaves and Units is assigned to the primary peri-
5-2-1 Tasks
odic task.
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.
Additional Information
Tasks operate differently between the NX701 CPU Units, NX102 CPU Units, NX1P2 CPU Units,
and NJ-series CPU Units. Refer to 5-3 Specifications and Basic Operation of Tasks for NX701
CPU Units, 5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
CPU Units, and 5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers for
details.
Data
Variable name Meaning Description R/W
type
_TaskName_Active Task Active Flag TRUE during task execution. BOOL R
FALSE from the completion of task execu-
tion until the end of the task period.
_TaskName_LastExecTime Last Task Execu- Gives the last execution time of the task. TIME R
tion Time
_TaskName_MaxExecTime Maximum Task Gives the maximum value of the task exe- TIME R
Execution Time cution time.
_TaskName_MinExecTime Minimum Task Gives the minimum value of the task exe- TIME R
Execution Time cution time.
Data
Variable name Meaning Description R/W
type
_TaskName_ExecCount Task Execution Contains the number of executions of the UDINT R
Count task.
If the present value exceeds the maximum
value of the data type, the present value
returns to 0 and the count is continued.
_TaskName_Exceeded Task Period TRUE when task execution is completed if BOOL R
Exceeded Flag the task period is exceeded.
FALSE if task execution was completed
within the task period.
_TaskName_ExceedCount Task Period Contains the number of times that the task UDINT R
Exceeded Count period was exceeded.
If the present value exceeds the maximum
Note Example: The Task Period Exceeded Flag for the task named MainTask is _MainTask_Exceeded.
Flag Operation
Task Active Flag (_TaskName_Active)
Task period
5
Primary
periodic task:
IO UPG MC IO UPG MC IO UPG MC
_TaskA_Active
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
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
of Tasks for NX701 CPU Units
This section describes the specifications and basic operation of tasks for the NX701 CPU Units with a
multi-core processor.
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 task 125 µs
250 µs to 8 ms (in 250-µs increments) 5
Task periods of periodic tasks • Priority 5
125 µs
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.
Additional Information
With an NX701 CPU Unit, you can execute multiple tasks, the tag data link service, and system
services in parallel.
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
Task Execution Priority
The type of the task determines its execution priority. The CPU Unit executes the task with the highest
execution priority first.
If the execution condition is met for another task, Tb, that has a higher execution priority while task Ta
execution is in progress, the NX-series CPU Unit will assign Tb to the available core for processing on
a priority basis.
The execution priority for each task type is given in the following table. The smaller the value of the exe-
cution priority, the higher the priority.
Execution pri-
Task Tasks with the same execution priority
ority
Primary periodic task 4 ---
Periodic task 5, 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-3-5 Event Task Execution Timing for NX701 CPU
Units for the order of execution.
5
Primary
4 1
periodic task
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 primary peri-
odic 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 execution
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.
Project with the Primary Periodic Task, Priority-5 Periodic Task, Priority-16
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
Periodic Task, and Priority-17 Periodic Task
• The tasks are classified into the following two groups and executed.
• Each task in the same group is preferentially executed in descending order of execution priority.
• The primary periodic task has the highest execution priority, so it is always executed in the pri-
mary period.
• The priority-5 periodic task is executed in parallel with the primary periodic task.
• The priority-16 periodic task is executed after completion of the primary periodic task.
• The priority-17 periodic task has a lower execution priority than the priority-5 periodic task, so it is
executed when the priority-5 periodic task is not being executed.
• In this example, the task period for the priority-5 periodic task is set to twice the primary period.
Also, the task period for the priority-16 periodic task is set to four times the primary period. This
means that the timing at which execution of a task starts coincides with that of the primary periodic
task once every two primary periods for the priority-5 periodic task and once every four primary
periods for the priority-16 periodic task. 5
• The system services are executed at the required time without being affected by the tasks.
High Primary
periodic task IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
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 Task period
Priority-5
IO UPG MC IO UPG MC IO UPG MC
periodic task
Priority-16
UPG UPG
periodic task
Priority-17
UPG
periodic 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.
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
The Processing Performed in Each Task
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.
*1 The Axis Current Values (Position, Velocity, and Torque) and Drive Status in the system-defined variables for
motion control are updated.
*2 When there are motion control instructions in user program execution in the primary periodic task, the CPU Unit
executes the results from those instructions immediately afterward in motion control processing as shown below.
The CPU Unit outputs the results to the Servo Drives during I/O refreshing in the next primary periodic task.
Note The processes in each cell in the above table are executed in the order of description.
System common
processing 1
Output data
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 priority-16 periodic task,
the CPU Unit 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 for details.
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
Processing Processing contents
System common processing 2 • Processing for exclusive control of variables in tasks is performed (when
refreshing tasks are set).
• Processing for variables accessed from outside of the Controller is per-
formed 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), vari-
able access processing is performed.
*1 The Axis Current Values (Position, Velocity, and Torque) and Drive Status in the system-defined variables for
motion control is updated.
*2 When there are motion control instructions in user program execution in the priority-5 periodic task, the CPU
Unit executes the results from those instructions immediately afterward in motion control processing as
shown below. The CPU Unit outputs the results to the Servo Drives during I/O refreshing in the next priority-
5 periodic task.
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_
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.
Event Tasks
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
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
of tasks in the NX-series CPU Unit
processing 1
processing 2
User program
execution will not refer to the pausing task
scenario.
Task execution
condition is met.
* Refer to Execution Timing When the Execution Condition Is a Condition Expression for a Variable on page 5-28
for the timing of when the value of the specified variable is checked to see if the specified condition expression is
met.
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.
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
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 5
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
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
*1 The following variables cannot be used. EN, ENO, P_Off, P_CY, P_First_RunMode, P_First_Run and
P_PRGER
*2 In-out variables cannot be used.
Classification of data
Data type Specification
type
Boolean, bit string, integer, and real Possible.
Basic data types Duration, date, time of day, date and time, or Not possible.
text string data
Data type specifica- Arrays Not possible.
Array specification
tions Elements Possible.*1
Structures Not possible.
Structures
Members Possible.*2
Derivative data type Unions Not possible.
Unions
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-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
The condition expressions that you can specify depend on the data type of the variable that you
specify for the condition expression. If the variable that you specify for a condition expression is bit
string data, integer data, or real data, you must set a comparison constant to compare to the value of
the variable.
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
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
5-3-5 Event Task Execution Timing for NX701 CPU Units
The execution priority of event tasks is 8 or 48. With a multi-core processor, the NX701 CPU Units exe-
cute event tasks for which the execution condition is met according to the task execution priority.
Depending on the user program, however, the CPU Unit may execute an event task in parallel with the
primary periodic task, periodic tasks, or other event tasks with different execution priorities.
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 for details.
5
The execution of an event task also depends on its execution conditions. You can also set the same
execution priority for more than one event task. You must be careful when the execution conditions are
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 Executes
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
Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task
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
task
Priority-16
periodic task Event task is executed
only once.
Low
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
Precautions for Correct Use
• 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 refresh-
ing 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 following table.
Timing at which the execution condi-
Trigger for condition expression to match
tion for an event task is met
I/O refreshing in the primary periodic task Evaluation in the next primary periodic
task
Execution of the programs in the primary periodic Evaluation in the next primary periodic
task task
• In order for an event task to be executed, the condition expression must be met in the evalua-
tion after the previous evaluation where the condition expression was not met. This means
that even if the status of the condition expression changes from not met to met, if the condition
returns to not met before the next evaluation, the event task will not be executed.
• For an NX701 CPU Unit, specify an internal variable defined in the program that is assigned to
the primary periodic task if you specify an internal variable with a data size of 64 bits or more
to the condition expression. If an internal variable that is not defined in the primary periodic
task is specified, the concurrency of variable values may not be ensured. As the result, the
match evaluation may not be correctly performed.
5
Execution Timing for Event Tasks with the Same Execution Priority
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
• T2: Condition expression for the VarB variable
• 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
expression 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.
(4) The ActEventTask instruction is executed in the user program, so T3 is executed.
(5) When I/O refreshing is executed in the primary periodic task, the match is detected that the
condition 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 execu-
tion period, 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
Primary periodic
IO UPG MC IO UPG MC
task
T2 event task
(execution priority of 8)
T3 event task
(execution priority of 8)
Low
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
5-3-6 Operation When Execution Condition Is Met Again before
Execution of the Event Task Is Completed
If the execution condition for an event task is met again before the execution of that event task is com-
pleted, the second match of the execution condition is ignored. “Before an event task is completed”
includes the duration of execution of the event task and the time waiting for execution. After the execu-
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
5
priority
High Primary period
T1 event task
(execution priority of 8)
Low
5-4-1 Specifications of Tasks for NX102 CPU Units and NX1P2 CPU
Units
The specifications of tasks are given in the following table.
Item Specification
Type of task • Primary periodic task
• Periodic task (priority 17 or 18)
• Event task (priority 8 or 48)
Numbers of tasks • Primary periodic task: 1
• Periodic tasks: 0 to 2 tasks*1
• Event tasks: 0 to 32 tasks*2
Number of programs per task 128 max.
Task period of the primary periodic task NX102 CPU Units: 1 ms to 32 ms (in 250-μs increments)
NX1P2 CPU Units: 2 ms to 8 ms (in 250-μs increments)
Task periods of periodic tasks • Priority 17 or 18
NX102 CPU Units: 1 ms to 100 ms (in 250-μs increments)
NX1P2 CPU Units: 2 ms to 100 ms (in 250-μs increments)
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: 17and 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 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
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.
CPU Units
Event task • Programs that are executed only when specified conditions are met.
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU
5
Units
The NX102 CPU Units and NX1P2 CPU Units cannot execute more than one task at the same time.
5-4-2 Guidelines for Separating Tasks for NX102 CPU Units and NX1P2 CPU Units
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 pri-
Task Tasks with the same execution priority
ority
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 for the order of execution.
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
Event tasks 0 to 32
48
Low
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
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 primary peri-
odic 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 execution
condition is met and on its execution priority.
CPU Units
Examples of Execution Order for Tasks
This section gives a few examples of the execution order for the primary periodic task and periodic
tasks. Refer to 5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2 CPU Units for the
order of execution of event tasks. 5
Projects with Only the Primary Periodic Task
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU Units
The primary periodic task is executed every primary period. The system service shown in this figure
refers to non-task related processing, such as communications processing, that is performed by the
CPU Unit. Refer to Processing Performed in System Services on page 5-82 for details on the sys-
tem services.
Low
IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
SS: Indicates system services.
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
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.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
The Processing Performed in Each Task
processing
processing 2
processing
processing 1
Input data
Motion
control
common
common
System
System
CPU Units
*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.
5-4-3 Basic Operation of Tasks for NX102 CPU Units and NX1P2 CPU Units
refresh data.
Refreshing • This process exchanges data with I/O.
Input data • Whether the condition expression for event task execution is met or not is determined.
processing • Input refresh data is loaded from Input Units that refresh I/O.
• If forced refreshing is set, the forced refreshing values are reflected in the input
refresh data that was read.
System common process- • Processing for exclusive control of variables in tasks is performed (when access-
ing 1 ing tasks are set).
• Motion input processing is performed.*1
• Data trace processing (sampling and trigger checking) is performed.
User program execution • Programs assigned to tasks are executed in the order that they are assigned.
Motion control*2 • The motion control commands from the motion control instructions in the user
program assigned to the primary periodic task are executed.
• Processing the motion outputs for I/O refreshing in the next primary periodic task.
System common process- • Processing for exclusive control of variables in tasks is performed (when refresh-
ing 2 ing 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 access pro-
cessing is performed.
*1 The Axis Current Values (Position, Velocity, and Torque) and Drive Status in the system-defined variables for
motion control are updated.
*2 When there are motion control instructions in user program execution in the primary periodic task, the CPU Unit
executes the results from those instructions immediately afterward in motion control processing as shown below.
The CPU Unit outputs the results to the Servo Drives during I/O refreshing in the next primary periodic task.
Note The processes in each cell in the above table are executed in the order of description.
System common
processing 1
Output data
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
Note The processes in each cell in the above table are executed in the order of description.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
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.
Task execution time (varies)
* The CPU Unit will temporarily interrupt the execution of a
task in order to execute a task with a higher execution
priority.
* *
Control processing
processing 1
processing 2
common
common
System
System
User program execution
Task execution
condition is met.
CPU Units
User program execution • Programs assigned to tasks are executed in the order that they are assigned.
System common pro- • Processing for exclusive control of variables in tasks is performed (when
cessing 2 refreshing tasks are set).*1
*1 Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks for details on exclusive control.
5
5-4-4 Event Task Execution Conditions for NX102 CPU Units and
NX1P2 CPU Units
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.
* Refer to Execution Timing When the Execution Condition Is a Condition Expression for a Variable on page 5-28
for the timing of when the value of the specified variable is checked to see if the specified condition expression is
met.
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.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
Executing Event Tasks for the ActEventTask Instruction
When the ActEventTask (Execute Event Task) instruction is executed in the user program, the specified
event task is executed once. Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502)
for the detailed specifications of the ActEventTask instruction.
Using the ActEventTask instruction to execute event tasks makes it easy to see which event tasks are
executed. Also, this method is also effective when the execution condition for the event task may
change before meeting the condition expression for the variable is determined.
BoolVar @ActEventTask
CPU Units
EN ENO
'Task1' TaskName
Execution
priority
High Primary period
5
Primary
5-4-4 Event Task Execution Conditions for NX102 CPU Units and NX1P2 CPU Units
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 execu-
tion. 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
*1 The following variables cannot be used. EN, ENO, P_Off, P_CY, P_First_RunMode, P_First_Run and
P_PRGER
*2 In-out variables cannot be used.
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
Data Types of Variables for Condition Expressions
The following table lists the data types of variables that you can specify for condition expressions.
Classification of data
Data type Specification
type
Boolean, bit string, integer, and real Possible.
Basic data types Duration, date, time of day, date and time, or Not possible.
text string data
Data type specifica- Arrays Not possible.
Array specification
tions Elements Possible.*1
Structures Not possible.
Structures
Members Possible.*2
Derivative data type Unions Not possible.
Unions
Members Possible.*2
Enumerations Possible.
CPU Units
*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-4 Event Task Execution Conditions for NX102 CPU Units and NX1P2 CPU Units
Data type Possible condition expressions
Boolean, Boolean array elements, Boolean structure members, Change to TRUE
and Boolean union members Change to FALSE
Bit string, real number, integer, as well as array element, struc- Variable = {Comparison constant}
ture 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}
Execution
priority
High Primary period
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
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
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.
CPU Units
• Unlock (Unlock Tasks) instruction
Checking the execution status of other tasks Task_IsActive (Determine Task Status) instruction
Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks for details.
5
The execution of an event task also depends on its execution conditions. You can also set the same
5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2 CPU Units
execution priority for more than one event task. You must be careful when the execution conditions are
met for more than one event task that has the same execution priority.
Task period
Priority-17 Interrupted.
periodic task
ActEventTask
Low instruction is executed.
Example 2: Executing an Event Task with an Execution Priority Lower Than the Task That Executes
an Instruction
Execution
Primary period
priority
High
Primary
periodic task
ActEventTask instruction
is executed.
Event task
(execution priority of 8)
Low
Task period
Priority-17 Interrupted.
periodic task
Low
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
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
periodic task. The event task is therefore executed after the priority-17 periodic task is exe-
cuted.
Execution
priority
Primary period
High
CPU Units
Low
5-4-5 Event Task Execution Timing for NX102 CPU Units and NX1P2 CPU Units
Timing at which the execution condi-
Trigger for condition expression to match
tion for an event task is met
I/O refreshing in the primary periodic task Evaluation in the next primary periodic
task
Execution of the programs in the primary periodic Evaluation in the next primary periodic
task task
• In order for an event task to be executed, the condition expression must be met in the evalua-
tion after the previous evaluation where the condition expression was not met. This means
that even if the status of the condition expression changes from not met to met, if the condition
returns to not met before the next evaluation, the event task will not be executed.
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 instruc-
tion, the event tasks will be executed in the order that the instruction is executed.
Example 1: When Two ActEventTask Instructions Are Executed
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 triggered 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
• T2: Condition expression for the VarB variable
• 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
expression 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.
(4) The ActEventTask instruction is executed in the user program, so T3 is executed.
(5) When I/O refreshing is executed in the primary periodic task, the match is detected that the
condition 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 execu-
tion period, 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
5-4 Specifications and Basic Operation of Tasks for NX102 CPU Units and NX1P2
5-4-6 Operation When Execution Condition Is Met Again before
Execution of the Event Task Is Completed
If the execution condition for an event task is met again before the execution of that event task is com-
pleted, the second match of the execution condition is ignored. “Before an event task is completed”
includes the duration of execution of the event task and the time waiting for execution. After the execu-
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 Execution of the event task has not completed yet,
executed for T1. executed for T1. so the second ActEventTask instruction is ignored.
CPU Units
T1 event task
Interrupted.
(execution priority of 8)
Low
Execution
5
priority
Primary period
High
T1 priority-17
periodic task Interrupted. Interrupted.
Low
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 128 max.
task
Task period of the primary 500 µs*3, 1 ms, 2 ms, or 4 ms
periodic task
Task periods of periodic Set the task period of each periodic task to an integer multiple of the task period of
tasks the primary periodic task. Refer to the table of valid task periods for periodic tasks
that is given below.
*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-.
Task period of the primary periodic task Task periods that you can set for periodic tasks
500 µs*1 1 ms, 2 ms, 3 ms, 4 ms, 5 ms, 8 ms, 10 ms, 15 ms, 20 ms, 25 ms,
30 ms, 40 ms, 50 ms, 60 ms, 75 ms, or 100 ms
1 ms 1 ms, 2 ms, 3 ms, 4 ms, 5 ms, 8 ms, 10 ms, 15 ms, 20 ms, 25 ms,
30 ms, 40 ms, 50 ms, 60 ms, 75 ms, or 100 ms
2 ms 2 ms, 4 ms, 8 ms, 10 ms, 20 ms, 30 ms, 40 ms, 50 ms, 60 ms, or
100 ms
4 ms 4 ms, 8 ms, 20 ms, 40 ms, 60 ms, or 100 ms
*1 With the NJ301-, you can use this setting with unit version 1.03 or later.
You cannot use this setting with the NJ101-.
5
5-5-3 Basic Operation of Tasks for NJ-series Controllers
Execution pri-
Task Tasks with the same execution priority
ority
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
Controllers 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 primary peri-
odic 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 execution
condition is met and on its execution priority.
Low
5
IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
Project with the Primary Periodic Task, Priority-16 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-16 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.
• The priority-17 periodic task has an even lower execution priority, so it is executed when the
above two tasks are not under execution.
• In this example, the task period for the priority-16 periodic task is set to four times the primary
period. This means that once every four primary periods, execution of the primary periodic task
and the priority-16 periodic task will start at the same time.
• System services are executed in the unused time between execution of the tasks.
Execution priority Primary period Primary period Primary period Primary period Primary period
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
Task period
Priority-17 Interrupted.
UPG UPG
periodic 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.
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.
*1 The Axis Current Values (Position, Velocity, and Torque) and Drive Status in the system-defined variables for
motion control are updated.
*2 When there are motion control instructions in user program execution in the primary periodic task, the CPU
Unit executes the results from those instructions immediately afterward in motion control processing. The CPU
Unit outputs the results to the Servo Drives during I/O refreshing in the next primary periodic task.
Note The processes in each cell in the above table are executed in the order of description.
System common
processing 1
Output data
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 for details.
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. 5
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
Note The processes in each cell in the above table are executed in the order of description.
processing 2
System common
User program
execution
Task execution
condition is met.
* Refer to Execution Timing When the Execution Condition Is a Condition Expression for a Variable on page 5-28
for the timing of when the value of the specified variable is checked to see if the specified condition expression is
met.
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.
Execution
priority
Primary period
High
Primary
periodic task
Task1 Interrupted.
event task
Low
5
TRUE
BoolVar
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 execu-
tion. 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
*1 The following variables cannot be used. EN, ENO, P_Off, P_CY, P_First_RunMode, P_First_Run and
P_PRGER
*2 In-out variables cannot be used.
Classification of data
Data type Specification
type
Boolean, bit string, integer, and real Possible.
Basic data types Duration, date, time of day, date and time, or Not possible.
text string data
Data type specifica- Arrays Not possible.
Array specification
tions Elements Possible.*1
Structures Not possible.
Structures
Members Possible.*2
Derivative data type Unions Not possible.
Unions
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
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 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. The execution of an event task also depends on its execution conditions.
You can also set the same execution priority for more than one event task. You must be careful when
the execution conditions are met for more than one event task that has the same execution priority.
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
Execution
priority
High Primary period
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.
Execution
priority
Primary period
High
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
• In order for an event task to be executed, the condition expression must be met in the evalua-
tion after the previous evaluation where the condition expression was not met. This means
that even if the status of the condition expression changes from not met to met, if the condition
returns to not met before the next evaluation, the event task will not be executed.
• For an NJ-series CPU Unit, specify an internal variable defined in the program that is assigned
to the primary periodic task if you specify an internal variable with a data size of 64 bits or
more to the condition expression. If an internal variable that is not defined in the primary peri-
odic task is specified, the concurrency of variable values may not be ensured. As the result,
the match evaluation may not be correctly performed.
5
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
• T2: Condition expression for the VarB variable
• 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
expression 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.
(4) The ActEventTask instruction is executed in the user program, so T3 is executed.
(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
Execution
priority
High Primary period
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
Priority-16
Interrupted. Interrupted.
periodic task: T1
Low
Item Communications bridge service*1 Tag data link service System service
Execution priority The communications bridge ser- The tag data link service is System services are
vice is executed in parallel with executed in parallel with the executed in parallel with
the task execution and system task execution. However, the task execution. How-
services. It is prioritized than the during execution of the com- ever, during execution of
tag data link service and system munications bridge service, the communications
services. the tag data link service is not bridge service and tag
executed. data link service, system
It is prioritized than system services are not exe-
services. cuted.
Processing The processing to relay CIP Data is exchanged by using System services include
Safety communications between tags with other controllers and services with low execu-
CIP Safety on EtherNet/IP devices on an EtherNet/IP tion priority, such as the
devices and the Safety CPU Unit network. You can use the USB port service and SD
that is mounted to the CPU Unit, built-in EtherNet/IP port in the Memory Card service.
is executed in the communica- CPU Unit.*2
tions bridge service.
Execution timing Executed when the frames of the The execution interval and the Executed according to
CIP Safety communications are time that is required for each the execution priority if a
sent and received by the built-in execution depend on the request comes from the
EtherNet/IP port. model of the CPU Unit and on hardware or from outside
the tag data link settings.*3 of the CPU Unit.
*1 The service is executed by an NX102 CPU Unit with unit version 1.31 or later.
*2 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).
*3 Refer to 5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service for details on the
execution interval and the time that is required for execution of tag data links.
Item Tag data link service Option board service System services
Execution prior- The tag data link service is The option board service is System services are executed
ity executed in parallel with the executed in parallel with the in parallel with the task execu-
*3 If sufficient time cannot be obtained to execute the system services with an NJ-series CPU Unit, 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.
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.
periodic task
System
services
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
Task period
Priority-17
UPG Interrupted.
periodic task
5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks
tasks and tag data link service.
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 Timing of the
Tag Data Link Service for details.
Additional Information
Differences in the Timing of Processing Tag Data Links Depending on Whether a Refresh-
ing 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
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
5
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
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-2 Processing Performed in and Execution Timing of the Tag Data Link Service
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.
Option Board
Option board
service
Primary
MC
MC
MC
MC
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 the 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 5
periodic task
Service
5-6-4 Processing Performed in and Execution Timing of the Communications Bridge
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.
*1 The NX102 CPU Units and NX1P2 CPU Units do not provide a USB port.
*2 The communications processing for a Serial Communications Option Board is executed only by an NX1P2
CPU Unit.
*3 You can use CJ-series Units only with NJ-series CPU Units.The CPU Unit exchanges data between CJ-
series Special Units and the memory words that are allocated to them during I/O refreshing.
You can use CJ-series Special Units only with NJ-series CPU Units.
For the NX102 CPU Units, the system services are executed without being affected by the tasks.
However, 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.
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 priority
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 execution
Execution
Task 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
periodic task
5
Task period
Priority-17
System
services
If the time that is specified in the System Service Monitoring Execution of the primary periodic task and
Settings cannot be allocated, execution of the priority-17 periodic priority-16 periodic task is not interrupted.
task is interrupted.
Changes
Access Setting Setting Set val- Update
Description Default in RUN
point group [unit] ues timing
mode
Operation System System Ser- Sets the interval of sys- 10 ms to 10 ms When Not
Settings, Service vice Execu- tem service execution. 1s down- allowed.
Operation Monitoring tion Interval loaded to
Settings Settings [ms] CPU Unit
Tab, Basic System Ser- Sets the ratio for moni- 5% to 10% When Not
Settings vice Execu- toring system service 50% down- allowed.
tion Time execution. loaded to
Ratio [%] CPU Unit
Additional Information
NX-series CPU Units are designed to always secure sufficient time for system service execution,
so the System Service Monitoring Settings are not provided. Also an Insufficient System Service
Time Error will not occur.
Unit of assign- 5
I/O refreshing target Assignable task
ment
Communications Coupler Unit with an NX-series Safety Primary periodic task or priority-5 By Slave Termi-
CJ-series Basic I/O Units*6 Primary periodic task and priority- By Unit
16 periodic task
CJ-series Special I/O Units*6
CJ-series CPU Bus Units*6
*1 If multiple Slave Terminals with mounted NX-series Safety Control Units exist, you cannot assign Slave Termi-
nals to a combination of the periodic tasks other than priority-5 periodic task and priority-5 periodic task.
*2 You can use the priority-5 periodic task only with the NX701 CPU Units.
*3 You can only use the primary periodic task with the NX102 CPU Units or NX1P2 CPU Units.
*4 You can use NX Units on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
*5 You can use I/Os built in the CPU Unit only with the NX1P2 CPU Units.
*6 You can use various CJ-series Units only with NJ-series CPU Units.
Additional Information
When using both EtherCAT slaves and CJ-series Units, you can shorten the task execution time
of the primary periodic task by assigning the I/O refreshing for EtherCAT slaves to a different
task than the I/O refreshing for CJ-series Units. Assign I/O refreshing for EtherCAT slaves to the
primary periodic task and assign I/O refreshing for CJ-series Units to the priority-16 periodic
task.
For the slaves and Units that are assigned to axes, specify the motion controls to use in Motion
Control Setup under Configurations and Setup of the Sysmac Studio. The tasks to perform I/O
refreshing are set.
Refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) for details.
Unit Configuration
A Slave Terminal is used. The following table shows the Unit configuration of the Slave Terminal.
I/O Map
The following I/O map is used. The table below shows the bits that are used in the sample program-
ming.
Data Variable
Position Port Description R/W Variable Variable type
type comment
Unit1 NX-ID3317
Input Bit 00 Input bit 00 R BOOL ComIn Common input Global variable
value
Unit2 NX-OD3256
Output Bit 00 Output bit 00 W BOOL OutA1 Output value A1 Global variable
Output Bit 01 Output bit 01 W BOOL OutA2 Output value A2 Global variable
Output Bit 02 Output bit 02 W BOOL OutB1 Output value B1 Global variable
Output Bit 03 Output bit 03 W BOOL OutB2 Output value B2 Global variable
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 after the value of ComIn changes to TRUE.
• 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
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 global
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
assignment 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 cal-
culation 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
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).
(1) ComIn is input during I/O refreshing in the primary periodic task.
(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. How-
ever, the values of tmp_OutB1 and tmp_OutB2 are the initial values because the values are
not assigned to tmp_OutB1 and tmp_OutB2 in the periodic task. Therefore, the values of 5
OutB1 and OutB2 are also the initial values.
(3) ComIn is input during I/O refreshing in the periodic task.
(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
between Tasks for details on task exclusive controls.
Data
Name Comment
type
ComIn BOOL Common input value
OutA1 BOOL Output value A1
OutA2 BOOL Output value A2
OutB1 BOOL Output value B1
OutB2 BOOL Output value B2
tmp_OutB1 BOOL Temporary variable for B1
tmp_OutB2 BOOL Temporary variable for B2
Algorithm
Input of ComIn, calculations and outputs and output of OutA1 and OutA2
A1_Wait
ComIn OutA1
TON
In Q
T#1s PT ET
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
tmp_OutB2 OutB2
5
Unlock
USINT#1 Index
Data
Name
type
B1_Wait TON
B2_Wait TON
Data
Name Comment
type
ComIn BOOL Common input value
tmp_OutB1 BOOL Temporary variable for B1
tmp_OutB2 BOOL Temporary variable for B2
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
required to use the Initial Status setting for programs at the start of operation, the PrgStart
instruction and the PrgStop instruction.
*1 The process data communications cycle (process data communications cycle 1) in the EtherCAT settings will
be the same as this period.
*2 With the NJ301-, you can use this setting with unit version 1.03 or later.
You cannot use this setting with the NJ101-.
*3 For the NX102- CPU Units, NX1P2- CPU Units, and NJ101- CPU Units, the default of
the primary periodic task is 2 ms.
Changes
Update
Parameter Setting range Default in RUN
timing
mode
Task Type Specify the priority-5 periodic task.*1 --- When Not
Execution pri- Automatically set to 5. --- down- allowed.
loaded to
*1 You cannot use the priority-16 periodic task with the NX102 CPU Units or NX1P2 CPU Units.
Changes
Update
Parameter Setting range Default in RUN
timing
mode
Task Type You can set any of the following. --- When Not
Priority-8 event task down- allowed.
Priority-48 event task loaded to
CPU Unit
Task Name Text string EventTask0
Execution Condition Select either Execution by instructions or Execution
When a variable expression is satisfied. with an
instruction
Task Execution Timeout Set the time to detect a timeout if task exe- • Execu-
Time cution does not end, e.g., if there is an tion prior-
infinite loop. The setting unit is millisec- ity of 8:
onds. 200 ms
• Execution priority of 8: 1 to 500 ms • Execu-
• Execution priority of 48: 1 ms to 10 s tion prior-
ity of 48:
1s
Introduction 5
You can specify the task that refreshes a global variable and the tasks that access the global vari-
able. This ensures the concurrency of the value of the global variable from the point of view of the
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
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
System
If a refreshing task is set for a global variable, the accessing task, at the start of accessing task exe-
cution, always reads the most recent value of the variable that was written at the completion of
refreshing task execution.
Task period of task A Task period of task A Task period of task A
This will allow you to maintain the concurrency of the values of global variables within the tasks with-
out 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.
Execution of
ActEventTask
Because of this, do not use exclusive control of variables in tasks to pass the values of global
variable 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 instruction to pre-
vent 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 details on the
Task_IsActive instruction.
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 refresh-
ing 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 elements.
Additional Information
You can use a data trace to sample an external variable for a global variable for which settings
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
for information on data tracing.
Task A
Program
Executed.
Lock instruction Global variable
Refreshed. Higher priority
Task B
Lock region 1
Executed. Executed.
Program
Unlock instruction Lock instruction
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
Task B
Lock region 1
Program
Executed.
Lock region 1
Refreshed.
Global variable
Unlock instruction
A sample programming that uses the task exclusive control instructions (i.e., the Lock and Unlock
instructions) to perform exclusive control is shown.
Global Variables
• 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;
Accessing Variables from Outside the Controller during the System Service
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.
NX-series CPU Unit
Accessing Variables from Outside the Controller during the System Common
Processing 2
Whether you use an NX-series CPU Unit or an NJ-series CPU Unit, access to multiple variables is
executed in the same period.
Primary period Primary 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 with 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.
*1 The constant value is 0.58 for a CPU Unit with unit version 1.02 or earlier.
*2 The constant value is 0.0009 for a CPU Unit with unit version 1.02 or earlier.
*3 The constant value is 1.03 for a CPU Unit with unit version 1.02 or earlier.
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 val-
ues.
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%.
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.
Number of vari-
able accesses in Processing
one task period
Multiple times Variable accesses are executed for the number of times that can be completed within
the set variable access time. The rest of accesses that could not be done will be exe-
cuted in the next task period.
This means, the multiple variable accesses cannot be completed within the same task
period.
Once Variable accesses continue even after the set variable access time is exceeded. This
means, the task execution time gets longer.
Primary
5
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 follow-
ing system-defined variables if task processing is not completed within the period: Task Period
Exceeded Flag (_TaskName_Exceeded), Task Period Exceeded Count (_TaskName_ExceedCount),
Controller Error Status (_ErrSta), and the event log.
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 slave*1 Outputs: The values from the previous period are output.
NX Units on the CPU Inputs: Inputs are refreshed, but the input data is not updated in the executed user
Unit*2 program.
Built-in I/O*3
CJ-series Unit 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 on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
*3 You can use the built-in I/O only with the NX1P2 CPU Units.
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 execution,
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 ser-
vice execution ratio, estimated CPU usage rate, tag data service execution ratio, expanded num-
ber 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 tasks.
Connected Connected
Monitor item Description to the Con- to the Sim-
troller ulator
Task exe- Min. The minimum value of the task execution time. Displayed. Not dis-
cution played.
time*1 Average The maximum value of the task execution time. Displayed.
Max. The maximum value of the task execution 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 variable 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 The time ratios are displayed with bars for the Not dis- Displayed.
tasks *3 system common processing, I/O refreshing, user played.
program execution, and motion control process-
ing. (Specific time values are not displayed.)
Average esti- The estimated average value of the real pro-
mation cessing time of task is displayed.
Max estimation The estimated maximum value of the real pro-
cessing time of task is displayed.
Task execution time ratio*4 The percentage of the total task execution time Displayed. Not dis-
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 executed
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
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.
5
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
High
Primary
periodic task
a
c d
Low b
Desktop Calculations
First, refer to A-2 Calculating Guidelines for the Real Processing Times of Tasks for the NX701 Sys-
tem, A-3 Calculating Guidelines for the Real Processing Times of Tasks for the NX102 System, A-4
Calculating Guidelines for the Real Processing Times of Tasks for the NX1P2 System and A-5 Cal-
culating Guidelines for the Real Processing Times of Tasks for the NJ-series System 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
5 Select the relevant hardware revision in the Unit that the hardware revision is displayed.
6 With an NJ-series CPU Unit, set the Expanded number of I/O points in the CJ-series Unit
parameters in the Task Execution Time Monitor to create user-defined variables for specified
CJ-series Special Units. Also set the sizes of the expansion areas (e.g., fixed I/O allocation
areas for the DeviceNet Unit) for AT specifications (i.e., the number of output words and the
number of input words). These sizes are used to calculate the I/O refresh time for the specific
Special Units.
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 Simulator
in Execution Time Estimation Mode. 5
• The average and maximum values of the task execution time
• The average and maximum values of the real processing times of the tasks
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 esti-
mated task processing time, the tag data link service execution time ratio, and the system ser-
vice processing 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 pro-
cessing and the system service monitoring settings.
This information 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 obtained values or the larger values in
the following calculating results as guidelines of maximum values.
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 Studio
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.
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.
1 Find the I/O response times that are required for the system from the equipment specifications.
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. 5
Place the Sysmac Studio online with the physical Controller and use Task Execution Time Mon-
itor to check the task execution times.
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
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)
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
Maximum 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 Peri-
odic 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) × 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
response times for an EtherCAT Slave Terminal that the NX Units are mounted after the Ether-
CAT Coupler Unit.
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
5
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
Example: Controlling Input Unit A and Output Unit B with the Priority-17 Periodic Task
Unit A Unit B
IN
OUT
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 primary 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.
Maximum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period x 2 + Tnx-OutDelay + Tnx-OutProc +
NX Unit processing time*1
*1 Refer to NX Unit Processing Time on page A-44 for information on the NX Unit processing time.
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. 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 syn-
chronous I/O refreshing.
The Controller makes a response in the following I/O response time.
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 5
Tnx-Indelay Tnx-InProc
Signals from output
terminals on NX
Output Unit B
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.
Maximum I/O response time = Tnx-InDelay + Tnx-InProc + Primary period x 2 + Tnx-OutDelay + Tnx-OutProc +
NX Unit processing time*1
*1 Refer to NX Unit Processing Time on page A-44 for information on the NX Unit processing time.
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.
The Controller makes a response in the following I/O response time.
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.
Maximum I/O response time = Tnx-InDelay + Tnx-InProc x 2 + Primary period x 2 + Tnx-OutDelay + Tnx-OutProc
x 2 + NX Unit processing time*1
*1 Refer to NX Unit Processing Time on page A-44 for information on the NX Unit processing time.
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.
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) × 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
5
Manual (Cat. No. W507).
Step 4. Wiring
Separate variables into those that you use in more than one 6-3-3 Types of
POU (global variables) and variables that you use in only User-defined
Variables in
specific POUs (local variables).
Respect to
POUs
Determine if you need to automatically generate the variable 3-3 I/O Ports
names for the device variables that you use to access slaves and Device
Variables
and Units or if you need to define them yourself.
Design the attributes for the variables. 6-3-4 Attributes
of Variables
Variable Name, Data Type, AT Specification, Initial Value, Retain, Constant, and Network
Publish 6-3-5 Data
Types
Decide the data types of your variables (including array specifications, range specifications,
structures, and enumerations). 6-3-6 Deriva-
tive Data Types
Keep the following precautions in mind when you design 6-3-4 Attributes
variables. of Variables
6-3-5 Data
• Retention:
Types
Set the Retain attributes to determine the values that are used for variables when the power
supply is turned ON or when the operating mode changes. 6-3-6 Deriva-
• Structures: tive Data Types
When a structure is used for a variable in an instruction, design the program to use the same
structure data type for the input parameter, output parameter, or in-out parameter.
Example: Communications Instructions
• Array Specifications:
When an array variable is used for the variable for an instruction, design the program to use
an array variable for the input parameter, output parameter, or in-out parameter.
Examples: Shift Instructions, Stack Instructions, and Table Instructions
• AT Specifications:
Use AT specifications for the variables used for input parameters to certain instructions.
Example: Fixed or user I/O allocations for DeviceNet Units
• Network Publishing:
Design the variables for EtherNet/IP tag data links.
Programs
Executing Programs and Execution Conditions
• You execute a task to execute the programs that are assigned to that task.
• Programs are always executed.
Notation
• The POUs must include at least one program. You can assign up to 128 programs to a single
task.
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 function blocks.
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.
Functions
Executing Functions and Execution Conditions
• You can call functions from programs, other functions, or function blocks to execute them.
• The EN input variable specifies the execution condition. A function is executed only once each
time EN changes to TRUE.
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 function blocks.
User-defined functions are called user-defined functions. System-defined functions are some-
times called FUN instructions.
For details on functions, refer to 6-2-6 Details on Functions.
The hierarchical relationships between programs, functions, and function blocks are shown in the fol-
lowing figure.
Task
Program 1
Program 2
Function blocks
Program Structure
Programs consist of a local variable table and an algorithm.
You can use any function or function block in the algorithm of a program.
Program
Task
Program
Local variable table Assigned.
Program
Algorithm
FUN
FB
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.
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required.
*2 To enable or disable the program, use the PrgStart or PrgStop instruction. You can make setting for the Prg-
Start instruction so that it executes the program without changing P_First_Run to TRUE.
Instance name
Function block name or instruction name
In-out variable
MyFB_instance Output variable
TRIG MyFB OUT
In Q
Algorithm
Instance name
6
Function block name
Algorithm
• Written as a ladder diagram or in ST.
• You can use any instructions,
user-defined functions, and user-
defined function blocks.
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 func-
tion block.
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.
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.
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.
TON_instance
a TON c
In Q
b PT ET d
Instance name
Refer to Function Block Calls in ST Language Statement on page 6-120 for details.
*1 In the Sysmac Studio version 1.01 or lower, at least one BOOL input variable is required when you use func-
tion blocks in a ladder diagram or in ST.
*2 In the Sysmac Studio version 1.07 or lower, it is impossible to change the value of an input variable from out-
side the function block. However, accessing it from outside the function block is possible.
*3 At least one BOOL output variable (including ENO) is required when you use function blocks in a ladder dia-
gram.
In the Sysmac Studio version 1.01 or lower, at least one BOOL output variable (including ENO) is required
when you use function blocks in ST.
Refer to 6-3-4 Attributes of Variables 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.
ENO
• When ENO is FALSE, the previous values of all other output variables are retained.
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.
timer2 NEXT
EN ENO
TON
IN[2] OUT[2]
In Q
PT[2] PT ET
timer3
Variable Table
TON
IN[3] OUT[3] Variable name Data type
In Q
IN ARRAY [0..4] OF BOOL
PT[3] PT ET OUT ARRAY [0..4] OF BOOL
PT ARRAY [0..4] OF TIME
timer ARRAY [0..4] OF TON
timer4
i UINT
TON
IN[4] OUT[4]
In Q
PT[4] PT ET
Refer to 6-5-2 Ladder Diagram Language for details on power flow output and parameter output.
You can specify the edge for an input variable to make the variable TRUE only when the input
parameter changes to TRUE.
Instance
Variable A FB
A
X
6
Instance X
Instance
Variable A FB
A
X
Instance X
Specifies detecting a change to FALSE.
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 the default value is not applied if an input parameter is
omitted
Structure of Functions
In a ladder diagram, functions are represented as rectangular boxes as shown below. Refer to Express-
ing Functions in ST on page 6-18 for details about how to express functions in ST. A function consists of
the following parts.
Function in Ladder Diagram:
EN input
Instance Name
Algorithm
You can code the algorithm either as a ladder diagram or in ST. You can use function instructions or
user-defined functions in the algorithm of a function. You cannot use any FB instructions or user-
defined function blocks. You also cannot use a differentiated instruction (e.g., R_TRIG or UP).
You cannot use the P_First_RunMode and P_First_Run system-defined variables.
Function
Algorithm
FUN instruction
User-defined
function
Parameters
Input Parameters to Input Variables
An input parameter passes a value to an input variable in a function when function execution begins.
An input parameter can be either a variable or a constant.
Expressing Functions in ST
The following example shows how to call functions from ST.
return_value:=function_name (input_variable_1:=input_parameter_1, ... input_variable_N:=input_pa-
rameter_N,in-out_variable_1:=in-out_parameter_1, ... in-out_variable_N:=in-out_parameter_N,out-
put_variable_1=>output_parameter_1, ... output_variable_N=>output_parameter_N);
However, you can also omit the return value.
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 function
definition.
Functions Expressed in ST:
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.
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 val-
ues 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 vari-
ables in functions. Take appropriate measures if necessary.
ENO
• When ENO is FALSE, the previous values of all other output variables are retained.
Return Values
• Return values are blank in ladder diagrams.
Case Ladder diagram notation ST language notation
Using return values variable_q:= MyFUN1(vari-
MyFUN1 able_i);
EN ENO
Variable i Variable q
IN
Variable i2 Variable q1
In2 OutEQ
OutGT
OutGE
Variable q4
OutNE
OutLT
OutLE
• The calling instruction is not required to use the return value in either a ladder diagram or ST. 6
• If you set the return value within a function algorithm, set the value to a variable with the same
name as the function.
Example:
BOOL variable B
in
Function
execution
BOOL variable A
BOOL variable B
* 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 output
variables of a function from outside the function.
FBinstance
FB
Omitted.
Done
Function
EN ENO
FALSE
x[i] IN1
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
The following recursive calls are not allowed for functions or function blocks. They will result in an error
when you build the user program on the Sysmac Studio.
• A function or function block cannot call itself.
• A called function or function block cannot call the calling parent.
Names
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names 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)
6
Example 2: Specifying a Structure Variable
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 designa-
tions in detail.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on setting vari-
ables 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 mem-
ory address if necessary (see note). The NJ/NX-series CPU Unit automatically allocates memory
addresses in the memory area for variables.
* 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 Specification
6-3 Variables
attribute of the variable. Refer to AT Specification on page 6-59 for details.
* You can use CJ-series Units only with NJ-series CPU Units.
User-defined Variables
6-3-1 Variables
The user defines all of the attributes of a user-defined variable. The rest of this section describes
user-defined variables.
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 Types of Variables and 3-
3-1 I/O Ports for details on device variables.
System-defined Variables
System-defined variables are provided in advance in an NJ-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 for details.
Refer to 2-3-1 Types of Variables for details on the different types of variables.
* You can define global variables as external variables to access the global variables through the external vari-
ables.
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 block or a function, “local variable” is a collective term for internal variables, input variables,
output variables, in-out variables, and external variables.
Internal Variables
A local variable can be used only within one POU. An internal variable is declared in the local vari-
able table for the POU. You cannot access the values of internal variables from outside of the POU.
You can declare internal variables with the same names in different POUs. Each of those variables
is assigned to a different memory area.
Input Variables
When a POU is called, the input variables are assigned to the values of the input parameters from
the calling POU. An input variable is declared in the local variable table of the POU.
Output Variables
Before processing a POU is completed, the output parameters returned to the calling POU are
assigned to the output variables. An output variable is declared in the local variable table of the
POU.
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.
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.
6-3 Variables
mode to initial value.
• When a major fault level Controller
error has occurred.
You can select to set or not set an initial Initial Value Depends on the
value. • Yes data type. (Refer to
Initial value setting: Specify the value of the section on initial
• None
the variable in the following cases and values.) 6
do not specify the Retain attribute.
Initial Value • When power turned ON
Additional Information
Classification Definition
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).
A data type that represents a date and time (year, month, day, hour, minutes,
Date and time
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.
Classification Data type Data size Alignment Range of values Notation
Boolean BOOL 16 bits 2 bytes FALSE or TRUE BOOL#1, BOOL#0, TRUE or FALSE
BYTE 8 bits 1 byte BYTE#16#00 to FF BYTE#2#01011010
WORD 16 bits 2 bytes WORD#16#0000 to FFFF BYTE#2#0101_1010
32 bits 4 bytes DWORD#16#00000000 to BYTE#16#5A
Bit strings DWORD
FFFFFFFF You can also use the “_” character as a
64 bits 8 bytes LWORD#16#0000000000000000 separator.
LWORD
6-3 Variables
to FFFFFFFFFFFFFFFF
SINT 8 bits 1 byte SINT#-128 to +127 100
INT 16 bits 2 bytes INT#-32768 to +32767 INT#2#00000000_01100100
32 bits 4 bytes DINT#-2147483648 to INT#8#144
DINT
+2147483647 INT#10#100
64 bits 8 bytes LINT#-9223372036854775808 to INT#16#64
Integers
LINT
+9223372036854775807 −100
6
USINT 8 bits 1 byte USINT#0 to +255
UINT 16 bits 2 bytes UINT#0 to +65535
*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 instruction specifications.
*2 Variables are compared with nanosecond precision for comparison instructions. To change the precision 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 dollar sign ($) as an
escape character before them. Refer to Text Strings on page 6-88 for a list of the escape characters.
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 for details.
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
IF WORD_BCD_TO _UINT (BCD_data) > UINT#1234 THEN
• You cannot perform logic processing on integer data types (SINT, INT, DINT, LINT, USINT,
UINT, UDINT, and ULINT). If logic processing is necessary, use instructions such as the
INT_TO_WORD instruction to convert to bit string data and perform the logic processing on
the bit string data variables.
Example:
In the following sample programming, 1 is added to variable a if the value of INT variable a is
an odd number.
6-3 Variables
Derivative Data Types
A derivative data type is a data type with user-defined specifications. Derivative data types are reg-
istered in the Data Type View in the Sysmac Studio. The following is a list of the derivative data
types.
Type Description
Structures This data type consists of multiple data types placed together into a single lay-
6
ered structure.
Unions This data type allows you to handle the same data as different data types
Refer to 6-3-7 Array Specifications and Range Specifications for Data Types for details.
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.
6-3 Variables
Data Formats
The floating-point 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) 6
• LREAL Data
Number = (−1)s2e−1023(1+f × 2−52)
4 From the above expression we can determine that e−127 = 6, so e = 133 (or 10000101 in
binary).
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.
Sign Exponent Mantissa
REAL data (32 bits) 1 10000101 01011010100000000000000
31 30 23 22 0
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.
Data type −∞ Negative numbers 0 Positive numbers +∞
REAL −∞ −3.402823e+38 to −1.175495e-38 0 +1.175495e−38 to +∞
+3.402823e+38
LREAL −∞ −1.79769313486231e+308 to 0 +2.22507385850721e−308 to +∞
−2.22507385850721e−308 +1.79769313486231e+308
−∞ 0 +∞
Special Values
Values such as positive infinity, negative infinity, +0, −0, and nonnumeric data are called special val-
ues. Nonnumeric data refers to data that you cannot express as a floating-point number and there-
fore cannot be treated as a numeric value. Although +0 and −0 both mathematically mean 0, they
are different for the purpose of data processing. This is discussed later in this section. The values for
the sign s, exponent e, and mantissa f of special numbers are given in the following table.
Data type name Special values Sign s Exponent e Mantissa f
REAL +∞ 0 255 0
−∞ 1 255 0
+0 0 0 0
−0 1 0 0
Nonnumeric --- 255 Not 0
−∞ 1 2047 0
+0 0 0 0
−0 1 0 0
Nonnumeric --- 2047 Not 0
Subnormal Numbers
You cannot use the floating-point 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 absolute 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
3 From (0.11)2 × 2−127 = 2−126(f × 2−23) we can see that f = (0.11)2 × 222.
6-3 Variables
Sign Exponent Mantissa
REAL data (32 bits) 0 00000000 01100000000000000000000
31 30 23 22 0
Subnormal numbers have less effective digits than normal numbers. Therefore, if a calculation with 6
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
number.
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 float-
ing-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.
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
When Data Type Conversion Occurs
Converting between data types occurs in the following two cases.
(1) Conversion by User Execution of Data Type Conversion Instructions
(2) Automatic Conversion for Assignments and Instructions
• ST assignments 6
• Connecting lines in ladder diagrams
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.
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
Specifying Members
The individual pieces of data that make up a structure are called “members.” You can express indi-
vidual members of a structure by putting a period after the variable name that represents the entire
structure followed by the member name that you want to access. You can even have a structure that
is the member of another structure.
Example: abc.x: Member x of structure variable abc
abc.Order.z: Member z of member structure variable Order of structure variable abc
Creating a Structure
1 Create a structure data type in the Data Type Table.
Specify the data type name, members, and the data type.
6-3 Variables
Name Member Data type
RGB red INT
green INT
blue INT
ITEM ItemNo INT
Color RGB
6
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 variable 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 mem- 1 to 2,048
bers
Nesting depth of Maximum of 8 levels (however, a member name must be 511 bytes or less, including the
structures variable name)
Maximum size of NX701-: 8 MB
one structure vari- NX102-: 4 MB
able NX1P2-: 1 MB
NJ501-: 4 MB
NJ301-: 2 MB
NJ101-: 2 MB
Note Recursions and loops are not allowed. (An error will occur
when the program is checked.)
Array specifications for structures, unions, and enumerations Supported.
POU instances Not sup-
ported.
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.
6-3 Variables
* You cannot select the memory offset type. You can set member offsets.
Setting Offsets
If you set the memory offset type to User, you can set memory offsets for each member of the struc-
ture. There are byte offsets and bit offsets. If you set the memory offset type to NJ or CJ, the mem- 6
ory configuration is determined automatically. You do not need to set offsets.
The meanings of the offsets are as follows:
Example:
This example shows the memory configuration when the following settings are made with the Struc-
ture Editor.
Bit 7 Bit 0
Memory
First byte Byte offset: 0
First byte + 1 Bit offset: 0
First byte + 2 VarA
First byte + 3
First byte + 4 Byte offset: 4
First byte + 5 VarB Bit offset: 0
First byte + 6
First byte + 7 Byte offset: 6
First byte + 8 VarC Bit offset: 0
First byte + 9
First byte + 10
First byte + 11
6-3 Variables
Memory Configuration The same memory location is User Change the values of
Overlap Error allocated to more than one the offsets to suitable
member. values.
Initial Value Setting Error An initial value was set for a CJ or User Do not set an initial
structure member for which an value.
offset was specified when cre-
ating the variable table.
6
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.
Specifying Members
When you define a union, you must name each data type that can be accessed. These names are
called members. You can express individual members of a union by putting a period after the vari-
able name that represents the entire union followed by the member name that you want to access.
Example:
Define the data type as a union as shown for My Union in the following example.
Data Type Definition
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 variable.
Creating Unions
1 Create a union data type in the Union Table.
Specify the data type names and different data types of the members of the union.
2 Specify the union data type from above as the data type and register the variable in the variable
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.
6-3 Variables
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; 6
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BoolData * * * * 1 * * * * * * * * * * *
Union Specifications
Item Specification
Data types that can be Refer to the table on the valid data types for union members that is given below.
specified for members
Number of members 4 max.
Setting initial values Not supported. Always zero.
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
enumerators (text strings). Use enumerations to make it easier for humans to understand the meaning
behind the values of a variable.
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.
Creating Enumerations
1 Create an enumeration data type in the Enumeration Table.
Set the enumerators and their values for the enumeration.
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
enumerators: red, yellow, and green. The numbers associated with these enumerators are as
follows: red = 0, yellow = 1, green = 2. 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
Enumeration Specifications
Item Specification
Enumerator names Enumerator names consist of single-byte alphanumeric characters. They are not case
sensitive. 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 compiling 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 enumera- 1 to 2,048
tors
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.
6-3 Variables
Example: Passing an Enumerator to the MOVE Instruction
MOVE
EN ENO
Color#red In Out ColorA
For a function or function block for which the parameter specifies an enumerator, you can also
use the Enumeration#Enumerator notation. Therefore, for the above BinToBCDs_WORD
instruction, the following notation can be used to pass the parameter to Format: _eBCD_FOR-
MAT# _BCD1.
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.
Specifying Elements
The individual pieces of data that make up an array are called “elements.”
The elements of an array are expressed by adding a subscript (element number) from the start of
the array to the name of the variable that represents the entire array.
Enclose the subscript in single-byte braces []. Subscripts can be either constants or variables. In ST,
you can also use expressions to express subscripts.
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).
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
6-3 Variables
abc[3]
abc[4]
Additional Information
6
You can use a fixed-length array specification for a variable when you specify the first number
and last number for the subscripts. You can use a variable-length array specification for a vari-
able when you specify a single-byte asterisk (*) for the subscript.
Version Information
A CPU Unit with unit version 1.18 or later and Sysmac Studio version 1.22 or higher are required
to use variable-length array specification.
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
abc[4].x
Variable Table abc[4].y
Variable name Data type
abc ARRAY [1..4 ] OF Str
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 Variable Table
x[0] y[0] Variable name Data type
In Out
x ARRAY [ 0..9 , 0..9 , 0..9 ]OF INT
y ARRAY [ 0..9 , 0..9 , 0..9 ]OF INT
× MOVE
EN ENO
x[0,1] y[0,1]
In Out
Array Protection
The following errors occur if you attempt to access an element that exceeds the number of elements
in an array.
Allowed or not
Array variable to declare
allowed
In-out variables for functions Allowed.
In-out variables for function blocks Allowed.
Input variables or output variables for functions Not allowed.
Allowed or not
Array variable to declare
allowed
Input variables or output variables for function Not allowed.
blocks
Internal variables, external variables, and global Not allowed.
variables
Members in structure variables or members in Not allowed.
union variables
When you declare an array variable with two or three dimensions as a variable-length array variable,
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.
Allowed or not
Array variable to declare Specification example
allowed
Variable-length array specification for all • ARRAY[*] Allowed.
dimensions • ARRAY[*, *]
• ARRAY[*, *, *]
Both variable-length dimension and fixed- • ARRAY[*, 3..5] Not allowed.
length dimension are used • ARRAY[*, *, 3..5]
6-3 Variables
Individual specification for first number or • ARRAY[1..*] Not allowed.
last number • ARRAY[*..*]
Restrictions on Processing 6
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
Allowed or
Example of in-out variable for function and
Example of in-out parameter to specify not
function block
allowed
Variable-length array whose data type is INT Variable-length array whose data type is INT Allowed.
and dimension is 1 and dimension is 1
Variable-length array whose data type is INT Fixed-length array whose data type is INT and Allowed.
and dimension is 1 dimension is 1
Variable-length array whose data type is INT Variable-length array whose data type is UINT Not
and dimension is 1 and dimension is 1 allowed.
Variable-length array whose data type is INT Variable-length array whose data type is INT Not
and dimension is 1 and dimension is 2 allowed.
Fixed-length array whose data type is INT and Variable-length array Not
dimension is 1 allowed.
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.
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
Making a Range Specification
Input the start point and end point after the data type name in the Data type Column in the variable
table.
Start point: The minimum value that you can store in the variable.
End point: The maximum value that you can store in the variable.
Example:
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
User program when the value of a variable changes due to the
execution of an instruction.
When the value is A command error occurs.
an integer
For an element of
an integer array
Write from the variable
Sysmac Studio
Operation for or a CIP mes- For a member of an
attempts to write sage integer structure
out-of-range Communi-
value cations For an integer struc- A command error does not
ture occur and the value is writ-
ten.
For an integer array
Tag data links An error occurs if you attempt to write to a single
6-3 Variables
(both via built- member that specifies a range. An error does not
in EtherNet/IP occur if you attempt to write to a structure that
ports and Eth- contains a member for which a range is specified.
erNet/IP Units)
Input refreshing from slaves An error does not occur and the value is written.
and Units
Forced refreshing values An error does not occur and the value is written.
6
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 ini-
tial value field on the Sysmac Studio is left blank, an initial value of 0 is used. This applies 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 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-
6-3 Variables
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
If this attribute is not set, the variable is automatically assigned to an address in variable memory.
Additional Information
When you assign a device variable to an I/O port, they are automatically given an AT specifica-
tion internally.
Allocation Areas
You can specify addresses in the following areas.
Area Expression
CIO CIO 0 to CIO 6143
Work W0 to W511
Holding H0 to H1535
DM D0 to D32767*1
NX102-: E0_0 to E18_32767
NJ501-: E0_0 to E18_32767
EM*2
NJ301-: E0_0 to E3_32767
NJ101-: E0_0 to E3_32767
The following table gives the data assignments by variable data type.
Variable data type Assignment position
BOOL You can specify an assignment for each bit.
You can specify bit 0 or bit 8 of the specified CJ-series address as the start
position of the data assignment.
Example 1: AT Specification at Bit 0 of D100 (%D100)
BYTE/SINT/USINT
D100: 16#**12....One-byte data (12) is stored from bit 0.
Example 2: AT Specification at Bit 8 of D100 (%D100.8)
D100: 16#12**....One-byte data (12) is stored from bit 8.
WORD/INT/UINT Stored in increments of the data size from bit 0 of the specified CJ-series
DWORD/DINT/UDINT address.
REAL
LWORD/LINT/ULINT
LREAL
You can specify bit 0 or bit 8 of the specified CJ-series address as the start
STRING
position of the data assignment.
TIME Stored in increments of the data size from bit 0 of the specified CJ-series
DATE address.
TIME_OF_DAY
DATER_AND_TIME
The following variables are also allocated an address internally. The following is displayed in the
Allocated Address Box.
Type of variable Displays in the AT field. Example
IOBus://rack#[rack_num- Basic I/O Units:
ber]/slot#[slot_num- IOBus://rack#0/slot#1/Ch1_In/C
Device variables for CJ-series ber]/[I/O_port_number] h1_In00
Units Special Units:
IOBus://rack#0/slot#1/PeakHold-
Cmd/ch1_PeakHoldCmd
For NX Units on EtherCAT Slave ECAT://node#[10.15]/Input1
Terminals: ECAT://node#[node_ad-
dress.NX_Unit_num-
Device variables for EtherCAT ber]/[I/O_port_name]
slaves
Other device variables: ECAT://node#1/Input1
ECAT://node#[node_ad-
dress]/[I/O_port_name]
• IOBus://unit#[NX_Unit_num- IOBus://unit#8/Input Bit 00
Device variables for NX Units*1
ber]/[I/O_port_name]
Device variables for built-in I/O*2 • BuiltInIO://cpu/#0/[I/O_port_name] BuiltInIO://cpu/#0/Input Bit 00
• BuiltInIO://opt/#[physi- BuiltInIO://cpu/#1/Ch1 Analog
Device variables for Option
cal_port_num- Input Value
6-3 Variables
Boards*2
ber*3]/[I/O_port_name]
MC://_MC_AX[] MC://_MC_AX[1]
Axis Variables MC://_MC1_AX[]*4
MC://_MC2_AX[]*4
MC://_MC_GRP[] MC://_MC_GR[1] 6
Axes Group Variables MC://_MC1_GRP[]*4
MC://_MC2_GRP[]*4
You can assign the same address to more than one variable. However, this is not recommended
as it reduces readability and makes the program more difficult to debug. If you do this, set an ini-
tial value for only one of the variables. If you set a different initial value for each individual vari-
able, 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 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 Controller 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)
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 down-
load 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 ini-
tialize 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
No Initial Value Specified
Initial value
None
The following table shows the variables for which you can set an initial value.
Type Example Enabling an Initial Value 6
Basic data type variables aaa Supported.
Arrays bbb Supported.
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.
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 value is set. If there is an instruction in a POU that attempts to write a value
to a variable with the Constant attribute, an error will occur when the user program is compiled.
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.
Source Operation for attempts to write the value
An error is detected during the program check. The Sysmac
User program Studio checks the program when it is built. A building error
occurs at that time.
Writing from Sys- Not supported.
mac Studio
CIP messages A command error occurs.
Communications
An error occurs when a tag data link starts. The tag data link will
Tag data links continue to operate. However, the values of variables with the
Constant attribute are not written.
Input refreshing from slaves and Units An error does not occur and the value is written.
Forced refreshing
6-3 Variables
Additional Information
You cannot write to variables with the Constant attribute from the user program.
6
Network Publish
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.
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.
Operation
• If you specify a change to TRUE, the input variable changes to TRUE only when the input param-
eter 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 param-
eter changes from TRUE to FALSE.
Specification Value of input parameter Value of variable
FALSE to TRUE TRUE
Change to TRUE
Other FALSE
TRUE to FALSE TRUE
Change to FALSE
Other FALSE
--- Changes according to the input
None
parameter value.
Version Information
With the combination of a CPU Unit with unit version 1.13 or later and Sysmac Studio version
1.17 or higher, you can set the operations when the operating mode changes or when download-
ing according to the setting of the _DeviceOutHoldCfg (Device Output Hold Configuration) sys-
tem-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
Retain present values of
When power is When operating When the check
attribute of Type of variable variables with
turned ON mode changes box is not
variable Retain attribute
selected.
Check Box is
selected.
User-defined vari- • If initial values are set, the variables change to the initial values.
6-3 Variables
ables • If initial values are not set (None), the variables change to 16#00.*1
AT specifi- • If initial values are set, the variables • If initial values are set, the variables
cations for change to the initial values. change to the initial values.
CIO and • If initial values are not set (None), the • If initial values are not set (None), the
Work Area variables change to 16#00.*1 previous value is retained.
addresses
in the mem- 6
ory used
for CJ-
series Units
After downloading
When the Clear the
Retain present values of
When power is When operating When the check
attribute of Type of variable variables with
turned ON mode changes box is not
variable Retain attribute
selected.
Check Box is
selected.
Retain No change (retains No change (i.e., • If initial values are The values from
condition is value before power the values in RUN set, the variables before the download
met.*4 interruption). mode are change to the ini- are retained.
retained). tial values.
• If initial values are
• If initial values are
set, the variables
not set (None),
change to the ini-
the variables
Retain con- tial values.
change to
dition is not • If initial values are
16#00.*1
met.*3 not set (None),
the variables
User- change to
defined 16#00.*1
vari-
ables • If initial values are
AT specifi- set, the variables
cations for change to the ini-
Holding, tial values.
DM, and EM • If initial values are
Area not set (None),
addresses the variables
in the mem- change to the val-
ory used ues of the mem-
for CJ- ory addresses in
series Units the AT specifica-
tions.
• If initial values are The variables
Retain set, the variables change to the val-
change to the ini- ues of the memory
tial values. addresses in the AT
• If initial values are specifications.
Device variables for not set (None),
CJ-series Units the variables
change to the val-
ues of the mem-
ory addresses in
the AT specifica-
tions.
The previous values The previous val-
are retained. ues are retained.
• If device vari-
ables for CJ-
series Units are
assigned to setup
data in the DM
Holding, DM, and EM Area, the initial
Area addresses in the
values that are set
memory used for CJ-
series Units*2
for the variables
are used.
• If user-defined
variables are
assigned, the ini-
tial values of the
variables are
used.
*1 Values other than 16#00 may be used depending on the data type. For details, refer to When the Initial Value
Specification Is Left Blank on page 6-64.
*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-70 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 specifica-
tions.
6-3 Variables
memory areas for CJ-
series Units
Forced refreshing Cleared. No change
Others
status
6
Precautions for Correct Use
You can use the memory used for CJ-series Units only with the NJ-series CPU Units, NX102
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.
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).
Item
EtherCAT Backup Parameter Settings of EtherCAT slaves
CPU/Expansion Racks Special Unit Settings of CJ 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 NX bus Unit operation settings.
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
6-3 Variables
transferred. In this case, device outputs of the slave or Unit are not retained. However, device outputs
are retained for the slave or Unit that the data is not transferred.
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-72 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-75 for the value of a variable
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 fol-
lowing 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
downloaded.
6-3 Variables
Project name: Project_A Project name: Project_A
POU name: POU_A POU name: POU_XXX
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 20
POU name: POU_C POU name: POU_YYY
Variable name: VarA Variable name: VarA 6
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 Pro-
ject_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.
6-3 Variables
• 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.
6
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
given below.
*1 The variable value will be the initial value when the Retain attribute of the variable is changed from Non-
retain to Retain.
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
6-3 Variables
the initial value.
*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-126 for details on
implicit casting.
*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.
Changes in a Union
Assume the union before changes on the Sysmac Studio is defined as in below.
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.
6-3 Variables
Change description Pattern 1 Pattern 2
No change The member value is retained.
ABC = WORD#16#0100
Changing the variable name from The member value will be the initial value.
ABC to DEF DEF = Initial value 6
Changing the data type of the The member value is retained.
member x from WORD to ABC = WORD#16#0100
*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-126 for details on
implicit casting.
Assume the Retain attribute of the variable ABC is set to retain, and the elements 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
the array element from 1 to 3 same, the values of the elements are numbers are retained. The values of
and the last number from 3 to retained from the top.*3 the new element numbers will be the
5*2 initial values.
ABC[3] = 100
(Same number of elements) ABC[3] = 300
ABC[4] = 200
ABC[4] = Initial value
ABC[5] = 300
ABC[5] = Initial value
6
*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-126 for details on
implicit casting.
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.
1 Select Watch Tab Page from the View Menu. The Watch Tab Page is displayed.
2 Establish an online connection with the Controller and register the variables in one of the follow-
ing 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
Multibyte Maximum
Case Charac-
Program-related Reserved character size (not
Applicable characters sensitiv- ter
name words compatibil- including
ity encoding
ity NULL)
Variable name Usable characters Refer to Supported. Not case 127 bytes UTF-8*
(including POU • 0 to 9, A to Z, and a to z Reserved sensitive.
instance names) • Single-byte kana Words
• _ (underlines) below.
POU definition
names • Multibyte characters (e.g., Japa-
nese)
Data type Refer to Reserved Words below
Structure member for a list of the reserved words.
names and union
member names Characters that cannot be used
together
Enumerators
• A text string that starts with a
6-3 Variables
Task names number (0 to 9) 63 bytes
Namespaces • Strings that start with “P_” 93 bytes
• A text string that starts in an
Full paths of vari- underline (_) character Network vari-
able names • A text string that contains more able: 255
than one underline (_) character bytes
• A text string that ends in an Other: 511
underline (_) character bytes 6
Device names • Any text string that consists of 127 bytes
an identifier and has a prefix or
Section names Case
postfix which contains more
* 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 NJ/NX-series Instructions
Reference Manual (Cat. No. W502)
• A name that is the same as any of the instructions that are described in 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.
Notation Meaning
TRUE or FALSE All of the following are equivalent: TRUE, BOOL#1,
BOOL#TRUE, and 1.
6
BOOL#1 or BOOL#0
BOOL#TRUE or BOOL#FALSE All of the following are equivalent: FALSE, BOOL#0,
BOOL#FALSE, and 0.
6-4-1 Constants
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.
{base}#{numeric_value}*1 16#0064
{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 base 10 on Sysmac Studio version 1.02 or lower.
Integer Data
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.
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.
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.
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.
TOD#{hour}:{minutes}:{seconds} TOD#23:59:59.999999999
6
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.
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 only
_BCD0.
Rungs
Logic blocks
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 electri-
cal 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 con-
figuration elements. This cascade of the TRUE state is called the “power flow.” The left bus bar is
the source of this power flow.
Connecting line
The straight horizontal lines that connect the bus bar and the configuration elements are called con-
necting lines. Connecting lines can be either TRUE or FALSE and can transfer the power flow from
the left to the right.
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
FLASE. For detailed specifications on inputs, refer to the NJ/NX-series Instructions Reference Man-
ual (Cat. No. W502).
Output
6
Order of Execution for Ladder Diagrams
Inputs, outputs, functions, and function blocks are executed when they receive the power flow. The
Input a
Label: ExceptionProcessing
Input b Input c
Label: ExceptionProcessing
Input d Input e
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.
Function/function block variables Input parameters Output parameters
Input variables You can specify variables or con- ---
stants.
Output variables --- You can specify only variables.
In-out variables You can specify only variables. You can specify only variables.
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
RS
(BOOL) (BOOL)
NG Set
(BOOL)
Q1
6
Reset1
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
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.
Example:
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
(BOOL) (INT)
IN Val_Out
MyFB
(INT) (BOOL) (BOOL) (INT)
Val_In Q IN Val_Out
(INT) (BOOL)
Val_In Q
OK 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)
RecvSize RecvSize
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
Reversing Inputs
You can reverse the value of a BOOL input variable when you input it to an instruction.
FB
(BOOL) (BOOL)
IN Q
TRUE→FALSE
FALSE→TRUE
6
Inline ST
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.
Structure of ST
ST code consists of one or more statements. One statement is the equivalent of one process. State-
ments 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, constants, function
return values, and/or a combination of those, along with various operators. A statement represents a
process that completes by itself. Expressions form a statement by using a combination of values and
keywords.
Example of an Assignment Statement:
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
6
ST Language Expressions
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;
Comment
• You can write comments in your program to make the code easier to understand.
• Statements written as comments are not executed.
Text Strings
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names for restrictions
on text strings.
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 prior-
ities 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 value is
64.
Multiplication * 100*200 5
Value: 20,000
Division / 100/200
Value: 0.5
Remainder MOD 10 MOD 7
Value: 3
−17 MOD 6
Value: −5
17 MOD 6
Value: 5
17 MOD (−6)
Value: 5
0101 OR 1100
Value: 1101
Additional Information
Calculations are performed based on the data types. For example, the result of calculations with
integer data will be integer data. Therefore, if the expression A/B is calculated with INT variables
A = 3 and B = 2, the result would not be 1.5 because all values after the decimal point are trun-
cated. In this case, the expression (A/B)*2 would evaluate to 2 instead of 3.
*1 If you select the version 1.15 or earlier in the Select Device Area of the Project Properties Dialog Box on the
Sysmac Studio for an NX701 CPU Unit and NJ-series CPU Unit, integer variables are calculated as real
number variables even if they set as operands. If a rounding error is included in the result of calculations,
the result may not be an intended value because all values after the decimal point are truncated. Use the
EXPT and TO_** (Integer Conversion Group) instructions together to round values after the decimal point.
Example: TO_INT(EXPT(X,Y))
*2 Do not use operators to compare text string variables. Use instructions (such as EQascii) instead.
ST Language Statements
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>;
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>.
6
Example:
Example 1: The following statement assigns the result of the expression X+1 to variable A.
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:
Variable
Data type Size
name
Var1 STRING 10
Var2 STRING 20
• User Program:
Var2 :='ABC';
Var1 := Var2;
You cannot make assignments to union variables. You must make the assignments to individual
members of the unions.
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.
Reserved Words:
RETURN
Statement Structure:
RETURN;
Application:
Use this statement to force the current program, function, or function block to end.
Overview:
The construct executes the specified statement when a condition is met. If the condition is not met,
another statement is executed. 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:
IF, THEN, (ELSE), END_IF
Note You can omit ELSE.
Construct 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).
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 (;). 6
Example: Another IF Statement before <statement_1>
Condition FALSE
expression 1
TRUE
Condition FALSE
expression 2
TRUE
Statement 1 Statement 2
• You can omit the ELSE statement. If it is omitted, nothing is executed when <condition_expres-
sion> is FALSE.
Process Flow Diagram:
FALSE
Condition
TRUE
Statement
Example:
Example 1: A value of 10 is assigned to variable X when the statement A > 0 is TRUE. A value
of 0 is assigned to variable X when the statement A > 0 is FALSE.
IF A>0 THEN
X:=10;
ELSE
X:=0;
END_IF;
Example 2: A value of 10 is assigned to variable X and a value of 20 is assigned to variable Y
when the statements A > 0 and B > 1 are both TRUE. A value of 0 is assigned to
variable X and variable Y when the statements A > 0 and B > 1 are both FALSE.
IF A THEN X:=10;
ELSE X:=0;
END_IF;
Overview:
The construct executes the specified statement when a condition is met. If a condition is not met but
another condition is met, another statement is executed. If neither condition is met, another state-
ment is executed.
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:
IF, THEN, ELSIF, (ELSE), END_IF
Note You can omit ELSE.
Construct Structure:
IF <condition_expression_1> THEN <statement_1>;
ELSIF <condition_expression_2> THEN <statement_2>;
ELSIF <condition_expression_3> THEN <statement_3>;
·
·
·
ELSIF <condition_expression_n> THEN <statement_n>;
ELSE<statement_m>;
END_IF;
Condition FALSE
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 <condition_expression_2> is TRUE, then
<statement_2> is executed.
If <condition_expression_2> is FALSE and <condition_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 BOOL variables (including functions that return a BOOL value) for the condi-
tion 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, 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.
CASE
Overview:
This construct executes a statement that corresponds to an integer set value that matches the value
of an integer expression.
Reserved Words:
CASE
Construct Structure:
CASE <integer_expression> OF
<integer_expression_value_1>:<statement_1>;
<integer_expression_value_2>:<statement_2>;
·
·
Equal to Yes
value 1? 6
No
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
multiple 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.
Example 2: You can give an integer variable, integer expression, integer function return value,
enumeration variable, or enumeration function return value for the <integer_expres-
sion>. An example is shown below.
• Example for an Integer Enumeration Variable
CASE ColorVar OF
RED:
X := 0;
BLUE:
X := 1;
ELSE
X := 2;
END_CASE;
CASE FUN( ) OF
0: Branches depending on the return value of FUN( ).
X := 10;
1:
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.
Construct Structure:
FOR <FOR_variable>:= <initial_value> TO <end_value> BY <increment/decrement> DO
<statement>;
END_FOR;
TRUE
FOR variable >
end value?
Repeated
FALSE
Statement
FOR variable +
Increment/decrement value
End
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/decre-
ment>.
When <FOR_variable> is <initial_value>, <statement> is executed.
After execution, the value of <increment/decrement> is added to <FOR_variable> and <statement>
is executed again if <FOR_variable> is less than the value of the <end_value>.
After execution, the value of <increment/decrement> is added to <FOR_variable> and <statement>
is executed again if <FOR_variable> is less than the value of the <end_value>.
This process is repeated.
The loop ends when <FOR_variable> > <end_value>.
If <increment/decrement> is negative, the directions of the comparison symbols in the above state-
ments are reversed.
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 pro-
cess 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:
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; 6
FOR n := 0 TO 50 BY 1 DO
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 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] < MAX 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>.
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>
do not change after the FOR loop operation is started.
For example, in the following case, the value of <end_value> is 10 and <increment/decrement>
is 3. Even after the FOR loop operation is started and the values of variable A and C are
changed, the value of <end_value> is still 10 and <increment/decrement> is still 3.
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;
WHILE
Overview:
This construct repeatedly executes the specified statements as long as a condition expression is
TRUE. 6
Reserved Words:
Construct 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 expression 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 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:
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;
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 the array variable element DATA[2]. This process is repeated.
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;
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
Construct Structure:
REPEAT
<statement>;
Statement
Repeated
Condition FALSE 6
expression
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 deter-
mine 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
exited.
Precautions:
• REPEAT must always be used together with END_REPEAT.
• Even if the <condition_expression> is TRUE before <statement> is executed, <statement> is exe-
cuted.
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:
Example 1: 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
END_REPEAT;
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
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 vari-
able 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;
Overview:
This statement calls a function block.
Statement Structure:
Give the argument specifications (to pass the values of the specified variables to the input variables
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 instance
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
• Ladder Diagram Expression
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 ini-
tial values.
• You can omit the output variables and output parameters. If they are omitted, the value of the out-
put 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
• Ladder Diagram Expression
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, Data32_2:=FixPointData2,
Notation 2
ChangeFixToFloat(Exe, FixPointData1, FixPointData2, FixPointPos1, FixPointPos2,
Done, RealData1, RealData2);
• Ladder Diagram Expression
ChangeFixToFloat
Exe ConvData32ToDouble Done
Execute OK
• Program Variables
Variable name Data type Comments
ChangeFixToFloat ConvData32ToDouble Convert from fixed-point to
floating-point.
Exe BOOL Execution trigger
FixPointData1 DINT Decimal point position specifi-
cation data 1
FixPointPos1 INT Number of digits below deci-
mal point 1
FixPointData2 DINT Decimal point position specifi-
cation data 2
FixPointPos2 INT Number of digits below deci-
mal point 2
Done BOOL Normal end
RealData1 LREAL Floating-point data 1
RealData2 LREAL Floating-point data 2
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.
Function Calls
Overview:
This statement calls a function.
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 specified
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:
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;
• Ladder Diagram Expression
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
I/O Variable name Data type
Input variables Execute BOOL
Data32_1 DINT
Data32_2 DINT
NoOfDigit_1 INT
NoOfDigit_2 INT
Output variables Double_1 LREAL
Double_2 LREAL
Return value --- BOOL
• Program Variables
Variable name Data type Comment
Omitting Parameters
When you call a function, you can omit parameters that are not required. The following table shows
when you can omit parameters.
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 Expression
• 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.)
Data Type Ranking Table:
The higher the rank, the larger the range of numerical values that the data type can express.
Rank Data type
1 SINT
2 USINT
3 INT
4 UINT
5 DINT
6 UDINT
7 LINT
8 ULINT
9 REAL
10 LREAL
11 BYTE
12 WORD
13 DWORD
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.
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.
Example: intVar := -1; (* intVar := 16#FFFF *)
uintVar := 1;
uintVar := intVar; (* uintVar:= 16#FFFF, or −1 was 6
assigned but the result is 65535 *)
Even if the arrow does not connect directly to a data type, you can still perform assignments for the
Example: For the following assignment statements, the result of the addition in the third state-
ment exceeds the range of 32-bit data. An overflow will result and 0 will be assigned
to LintVar.
UdintVar := UDINT#16#FFFF_FFFF; // Upper limit of 32-bit data
DintVar := DINT#1; // 1
LintVar := (UdintVar + DintVar)/DINT#2; // (Upper limit of 32-bit data + 1)/2
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;
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;
Notation of Constants
If a constant is given without a decimal point, such as 100, it is processed as an integer. If a constant
is given with a decimal point, such as 100.0, it is processed as a real number.
START
No 6
No
END
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.
start Clk Q do
start In do
start Clk Q do
• Method 3
Down
start In do
Func- Add a circle to indicate reversal at the intersec- Add a NOT operator to the argument.
tion/function tion of the BOOL argument and the func- * You can add NOT operators to any BOOL
block argu- tion/function block. variable, not just arguments.
ment rever-
sal Func
emergency
specifica- IF (NOT emergency) THEN
tions EN ENO
Func();
END_IF;
Func2
EN ENO
tmp in
Post-con- You can connect only other Out instructions You cannot continue the ladder diagram after
necting lad- after an Out instruction. inline ST.
der
instructions NG
// Inline ST
str :=‘ABC’;
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
Instructions
FUN instructions
6-6 Instructions
ST language statements
Programs, user-defined functions, and user-defined function blocks consist of these instructions.
6-6-1 Instructions
blocks.
This section describes specifications that are unique to instructions.
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.
Output
The output power flow changes to FALSE
in the next task period (after it is TRUE
for one task period).
1 task period 1 task period
Time Chart
Instruction Options
Instruction options cannot be specified.
FUN Instructions
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.
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 options.
6-6 Instructions
@ MAX
EN ENO
In1
In2
6
Information That Applies to Both FB Instructions and FUN
Instructions
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 instruction
error occurs.
6-6 Instructions
FALSE : Normal end, Execution in
progress, or Not executed
ErrorID WORD Error code on Error end, and WORD#16#0 Error code WORD#16#0
WORD#16#0 on Normal end
*1 If an instruction error occurs before execution of an instruction, the instruction will not be executed. There-
fore, the value of each output parameter before instruction execution will be retained.
*2 If an instruction error occurs after execution of an instruction, the instruction itself will be regarded as nor- 6
mally ended. Therefore, the values of output variables of the instruction will be assigned to the output
parameters. Values of the output parameter to which an error occurred are retained as the one before the
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-141.
Version Information
A CPU Unit with unit version 1.02 is required to create events for instruction errors.
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_block (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.
6-6 Instructions
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
6 x := 1;
7 ELSE
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.
Read
Variable Data
Meaning Function Range of values Initial value /writ
name type
e
P_PRGER Instruction Error Flag This flag changes to and BOOL TRUE or FALSE FALSE Read
remains TRUE when an /write
instruction error occurs. After
this flag changes to TRUE, it
stays TRUE until the program
changes it back to FALSE.
The user 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:
User Program
P_PRGER
Initial process
R
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
Version Information
6-6 Instructions
• A CPU Unit with unit version 1.02 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
required to specify whether to output instruction errors when they occur.
Additional Information 6
• If an error occurs in a motion control instruction, two events are created, one for the instruction
error and one for the motion control instruction. For details on events for motion control
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 required
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. Using
namespaces is not required.
Features of Namespaces
Namespaces provide the following features.
Namespace Usage
You can use namespaces for the entities that are listed in the following table. You cannot use them for
local variables.
Library object Details
POU definitions Function definition names and function block definition names
Data types Structure data type names, union data type names, and enumeration data
type names
Namespace Notation
Separate the levels in a namespace with backslashes (\). To use a namespace in a POU algorithm,
6-7 Namespaces
place two backslashes (\\) at the front of the namespace.
Examples:
Location of namespace Expression
Outside of an algorithm System_A\Read_recipe
Inside of an algorithm \\System_A\Read_recipe
6
Fully Qualified Names and Short Names
The fully qualified name of an entity is the name that includes the name of the namespace. The
Character
Name Maximum size
encoding
Names of name- 93 bytes UTF-8
spaces
Short names 127 bytes
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 Pro-
cess_A is in the same namespace.
POU Definitions
System_A\Read_recipe\Process_A
System_A\Read_recipe\Process_B
Process_A
If, however, a System_A POU definition also exists at a higher level than the Sys-
tem_A\Read_recipe namespace, “Process_A” exists twice. Therefore, an error will occur
when you build the program.
In this case, you must use the fully qualified name or change the short name.
POUPOU 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 defini-
tion 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.
Notation Examples
Notation examples are provided below for creating a function block definition when declaring the name-
spaces to use in the function block definition and when not declaring the namespaces.
Examples:
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 definition, only the System_C namespace is declared. The fully
qualified name must be given for the Read_recipe function block, which is not in the System_C name-
space. The short name can be given for the Calculate_upper_limit function block, which is in the Sys-
tem_C namespace.
6-7 Namespaces
System_C
Calculate_upper_limit
Restrictions of Declarations
• You can use short names only in the algorithm of a POU definition.
Additional Information
You cannot set a namespace for a program name. However, you can declare namespaces for
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 defini-
tion 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-E1-03 or later) 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-E1-03 or later) for specific procedures.
Version Information
A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required
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.
6-8 Libraries
Library
Sysmac Studio
Library objects
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.
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 automatically.
You cannot change it.
Display/hide source You can specify whether to display or hide the source.*
Attached files You can attach one or more files.
* 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-
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.
Library Synchronization
You can download a library to a Controller, upload a library from a Controller, or verify a Controller
library against one on the computer.
Additional Information
• If you transfer a project for which transferring the source program is disabled from the Sysmac
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.
* Data types are always included in the library object selections on the Sysmac Studio.
6-8 Libraries
Property Definition
Name The name of the library object.
Namespace The namespace of the library object.
Version* The version of the library object.
Author* The creator of the library object. (optional)
Creation date* The date that the library object was created.
6
Update date* The date that the object library was last updated.
* 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 other
libraries. For details on namespaces, refer to 6-7 Namespaces.
6-9-1 Array Specifications for Input Variables, Output Variables, In-Out Variables
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]
ErrorID
ErrorIDEx
RcvSize RecvSize
Introduction
Master control is used to make output FALSE for all processing between the MC (Master Control Start)
instruction and the MCR (Master Control End) instruction. Master control is useful to control the execu-
tion conditions of a relatively long series of instructions.
Refer to information on the MC and MCR instructions in the NJ/NX-series Instructions Reference Man-
ual (Cat. No. W502) for details.
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.
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.
1 Right-click a program under Programming − POU − Programs in the Multiview Explorer and
select SettingsForDebugging − Enable.
7-3-1 Procedures
The procedures from checking operation on the actual system to starting actual operation are given
below.
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
2. Place the Sysmac Studio online with the Controller. *1 Operation Manual (Cat.
No. W504)
3. Download the project (i.e., the user program, Unit configuration, and other
settings) from the Sysmac Studio.
*1 You cannot connect a computer to an NX102 CPU Unit or NX1P2 CPU Unit
because it does not provide a peripheral USB port. Refer to 10-2 Connection
with Sysmac Studio 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 Control-
ler. 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.
1 After you complete the necessary wiring, connect the Sysmac Studio online to the Controller.
3 Open the MC Test Run Tab Page and perform the following.
Example:
• Monitoring and checking wiring
• Jogging to check the direction of the motor
• Check travel distances for relative positioning (electronic gear settings).
• Confirming the homing operation
2 Check the operation by changing the status of program inputs and program outputs, and the
values of variables.
After you clear the memory, the CPU Unit 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
8
Introduction
CPU Unit
Clock data
• Event logs
• Time and date of files that are
created on SD Memory Card
Battery backup
Battery
CJ1W-BAT01
Additional Information
When a Battery is not mounted or when the Battery voltage is low, the time zone setting is
retained, but the clock data is not retained and will not be correct.
Specifications
An NTP client is provided.
Refer to the NJ/NX-series Built-in EtherNet/IP User’s Manual (Cat. No. W506) for details.
Logging 8
When you change the clock data, an event is recorded in the event log. However, nothing is recorded in
8-1-2 Clock
the event log if the time is corrected for the NTP.
Introduction
The RUN output on NX-PA9001, NX-PD7001, or NJ-P3001 Power Supply Unit is ON while the CPU
Unit is operating.
RUN
output
The ratings of the RUN output on NX-PA9001, NX-PD7001, or NJ-P3001 Power Supply Unit are as
follows:
Item Description
Contact form SPST-NO
2 A at 250 VAC for resistive load
Switching capacity 0.5 A at 120 VAC for inductive load
2 A at 24 VDC for resistive load
Application
You can use the RUN output for the following purposes:
• 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.
For I/O data that are handled by the NX Bus Function Module, there are two kinds of I/O data, the sta-
tus of NX Units managed by the NX Bus Function Module as the NX bus master and I/O data for indi-
vidual 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 sam-
ple using device variables.
Name Description
NX Unit Registration Status This status tells whether the NX Units are registered in the Unit Configuration.
Each bit has the following meaning.
TRUE: Registered
FALSE: Not registered
If the Unit configuration information is registered, the status is TRUE for each Unit
that is registered.
If the Unit configuration information was automatically created (with only the
actual Unit configuration information and no registered information), the status is
FALSE for all Units.
The status is TRUE for NX Units that are set as unmounted Units.
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 information
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 Sta- This status tells whether the NX Units can process I/O data communications.
tus 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 corresponding 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.
8
Refer to A-7-4 NX Bus Function Module, Category Name: _NXB on page A-154 for details on the
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
AryOut
AryOut1[1] 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 commissioning
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.
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.
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.
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 RestartNX-
Unit instruction.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the RestartNX-
Unit instruction.
The NX Bus Function Module and all NX Units that were not specified for restarting continue to operate.
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
specified NX Unit is restarted.
You can use the Sysmac Studio to check the wiring between NX Units on the CPU Unit and I/O devices
during system commissioning even if the user program is not created.
Preparation
Create the NX Unit configuration information and check whether the Unit configuration on the Sys-
mac Studio agrees with the actual Unit configuration if the NX Unit configuration information was
transferred to the CPU Unit.
If the NX Unit configuration information was not transferred to the CPU Unit, go online, right-click
anywhere in the CPU an Expansion Racks Tab Page and select Compare and Merger with Actual
Unit Configuration. The configuration is automatically configured.
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 Eth-
erCAT Coupler Unit. Refer to the NX-series EtherCAT Coupler Unit 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 Module.
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
Error occurs.
End Cover
8
CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5
NX Unit NX Unit NX Unit NX Unit NX Unit
Sample programming that determines whether NX Unit (NX Unit number: 5) I/O data on the CPU
Unit is given below.
R_HandSensor_Active R_HandSensor_Error
MemCopy1
MemCopy
EN ENO
In1[1] In Out
AryOut
AryOut1[1] AryOut1[1]
UINT#3 Size
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.
*1 When an error occurs, I/O refreshing for the NX Units on the CPU Unit that is not started, i.e., I/O refreshing for
the NX Units on the CPU Unit that is stopped is called “entire stop”.
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. Specially, error notification is provided and
errors are recorded in the event log.
Even if you enable fail-soft operation, the NX Bus Function Module may not start I/O refreshing for any
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the errors to which fail-soft
operation 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 NX1P2 CPU Unit.
Each of the NX Units on the CPU Unit records the total time that the Unit power supply is ON to it. You
can display these times on the Sysmac Studio.
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_ReadTotalPow-
erOnTime instruction.
8-2-6 Monitoring Total Power-ON Time for NX Units on the CPU Unit
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.
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
response time or OFF response time to less than the refresh time.
Input from a
proximity sensor
or other device
Input bit
Setting Methods
From the Multiview Explorer of the Sysmac Studio, double-click CPU/Expansion Racks under Config-
urations and Setup. Then select the input response times in the Unit information for the Basic I/O
Units.
ErrorID
If Special Unit settings are changed in any of the following ways, you must restart the Special Unit or 8
cycle the power supply to the Controller.
• Editing from the Special Unit Settings Tab Page of the Sysmac Studio
Sysmac Studio
SD Memory Card
Creating/reading files
from Sysmac Studio
Function Introduction
SD Memory Card operation You can access SD Memory Cards from instructions in the user program.
instructions
FTP client communications You can use these instructions to transfer files via FTP from the CPU Unit
instructions*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-
8
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
Capacity Number of
Model Card type Formatting Write protection
[GB] overwrites
HMC-SD291*1 SD card 2 FAT16 100,000 over- You can write-protect the SD
HMC-SD491 SDHC card 4 FAT32 writes Memory Card with a hardware
switch on the Card.
*1 You cannot use an HMC-SD291 for the NJ501- CPU Unit with the hardware revision A and unit version
1.15 or later.
The system-defined variable _Card1Err (SD Memory Card Error Flag) changes to TRUE (observation
level) in the following cases.
• When there is a format error
If an error occurs, the SD PWR indicator on the front of the CPU Unit goes out, and accessing the SD
Memory Card will not be possible.
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 required
to use the FTP client communcations instructions.
CPU Unit
FTP Client
FTP
commands
File transfers
Note Refer to 9-2 SD Memory Card Backups for the system-defined variables that are used with the SD Memory
Card backup function.
Additional Information
SD Memory Card inserted. Card recognized. Power supply stopped with power switch.
_Card1Ready
_Card1Err
_Card1Access
*1 Self-diagnosis is not executed if write protection is set on the SD Memory Card itself.
Results of Self-diagnosis
Indicators
Case Error type Correction Remarks
RUN SD PWR SD BUSY
Self-diagnosis in Flashing. Not lit. Lit. --- --- ---
progress
1. When self-diag- --- Lit. Not lit. Normal None ---
nosis found no
problems
2. The format of --- Not lit. Not lit. Observa- Use the Sysmac ---
the SD Memory tion Studio to format
Card is not cor- the SD Memory
rect. Card.
3. An error was --- Not lit. Flashes Observa- Use file operations If a cor-
detected during during tion in the Sysmac Stu- rupted file
the file system restore dio or insert the SD is detected,
check and the operation. Memory Card into an attempt
file system was Not lit after the computer to is made to
automatically restore check whether any restore the
restored. operation is files were deleted file.
completed. by the restore
operation.
4. The SD Mem- --- Not lit. Not lit. Observa- Replace the SD ---
ory Card failed. tion Memory Card.
However, if the same file on the SD Memory Card is accessed from different sources, unintended oper-
ations such as reading a file while it is being written or writing a file while it is being read may occur.
It is necessary to perform exclusive controls in order to prevent multiple accesses to the same file.
The following table shows the combinations of operations that require exclusive controls.
When you use a combination of operations that requires exclusive controls, execute the later process-
ing only after checking that the first processing is finished.
First access
File Operations from the
Instructions*1 FTP server
Sysmac Studio
*1 The instructions include the SD Memory Card operation instructions and the FTP client communications
instructions.
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 Con-
troller. To prevent incorrect operation, you can use security functions to restrict operations on the Sys-
mac Studio.
The NJ/NX-series Controller supports the following security functions.
* A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required.
Introduction
You can set a specific ID (called a user program execution ID) in the CPU Unit in advance. If you do,
you can execute only a user program with the same ID.
Sysmac Studio
You can therefore prevent different CPU Units (hardware) from executing a user program.
8-5 Security
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
8
1 Always backup the project files before you assign a user program execution ID.
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 regis-
tered.
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.
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.
When the User Program Execution ID Is Not Assigned to the User Program 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
Specifications
User Program Execution ID Verification Specifications
Timing of Verification
At startup, the CPU Unit compares the user program execution ID that is registered in the CPU Unit
with the user program execution ID that is assigned to the user program.
8-5 Security
Verification Conditions
The conditions for verifications are given in the following table.
“A” and “B” indicate the IDs.
User program execution User program execution
ID that is registered in ID that is assigned to the Error Operation 8
the CPU Unit user program
A A None Possible
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 proj-
ect file, select the Enable password protection for the project file Check Box to enable setting a
password.
Use the following procedure to open a project for which a password is set. If you try to open or
import a project file for which a password is set, the Enter a Password Dialog Box is displayed.
8-5 Security
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 required
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 protection is cleared depends on the
operation that you use.
Protected Data
Protection can be set for the following data. Only change protection can be set for cam profiles.
• 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.
Select Security − Temporarily Change Prohibition of Data Protection from the Controller Menu
of the Sysmac Studio to temporarily clear protection.
Select Security − Finish Temporary Change Prohibition of Data Protection from the Controller
Menu of the Sysmac Studio to end temporary change protection.
8-5 Security
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
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 correct
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
authority 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.
Operation
For operation authority verification, select Security − Setting of Operation Authority from the Control-
ler Menu on the Sysmac Studio.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Specifications
Types of Operation Authorities
You can use the following five operation authorities on the Sysmac Studio. They are given in
descending order of authority.
English name Password
Administrator Required.
Designer*1 Optional*2
Maintainer*1 Whether a password is required is determined by the default operation authority that is set in the
Setting of Operation Authority Dialog Box. The default operation authority is used when a pass-
Operator*1 word is not input.
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 perform operations
that require an operation authority that is equal to or lower than the default operation authority.
8-5 Security
Adminis- Main-
I/O monitor operations (examples) Designer Operator Observer
trator tainer
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 8
Forced refreshing OK OK OK NP NP
Password Specifications
Item Description
Valid number of characters 8 to 32
Applicable characters Single-byte alphanumeric characters (case sensitive)
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 Configurations and Setup − Controller Setup of the Sysmac Studio.
CPU Unit
None
You can turn write
protection ON and
OFF.
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 compared 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 effective
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
8-5 Security
1 Set the CPU Unit name when you create a project on the Sysmac Studio.
The CPU Unit name is displayed as shown below.
8
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 produc-
tion 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-6 Debugging
This section describes debugging.
The NJ/NX-series Controller provides the following debugging operations.
• Forced refreshing
• Changing present values
• Online editing
• Data tracing
• Differential monitoring
Description
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 vari-
ables, but for the I/O ports that are assigned 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 Hold-
ing/Clearing Forced Refreshing on page 8-50 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 performed, when the operating mode is changed, when
power is interrupted, or when the project is downloaded.
8-6 Debugging
Inputs
The I/O port and device variable change to the status that is specified with forced refreshing regard-
less of the status of the external input.
Sysmac Studio
I/O port
(1) I/O port changed to Device variable
TRUE with forced
refreshing. FALSE
TRUE TRUE
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 necessarily 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
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
• 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
• I/O ports for CJ-series Basic I/O Units
• I/O ports for CJ-series Special Units
• I/O bits for DeviceNet or CompoNet slaves that are specified for AT specifications from variables
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.
Application
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)
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 program
execution
Operating Procedure
Operations can be performed from the following panes.
• Program Panes (Ladder diagram language)
• I/O Map
• Watch Tab Page
2 Double-click the ladder program, ladder function, or ladder function block under Programming
in the Multiview Explorer.
8-6 Debugging
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- 8
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.
Forced status mark Operation
TRUE specified with forced refreshing
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.
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
8-6 Debugging
8
Description
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 operation of
the user program and settings.
Sysmac Studio
CPU Unit
Application
Changing Program Inputs and Outputs to TRUE or FALSE
You can change the value of any BOOL variable to TRUE or FALSE. The specified value is then
overwritten by the execution results of the user program. If the operating mode is changed or the
power supply is cycled, the initial value is restored. You can control BOOL variables in the Ladder
Editor, Watch Tab Page, or I/O Map.
Operating Procedure
Operations can be performed from the following panes to change the present values. Refer to the Sys-
mac 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
8-6 Debugging
Any value that is written to an I/O memory address that corresponds to an output bit that is assigned
to a CJ-series Basic Output Unit through a tag data link will be overwritten by the execution results
of the user program. The value that is written directly to the I/O memory address from the tag data
link will therefore not be output to the external device.
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.
8
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.
You can select any of the following to perform online editing.
• POUs (programs, functions, and function blocks)
For a ladder diagram program, select a section.
• Global variables
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 occur
if the I/O timing is disrupted. If you perform online editing, the task execution
time may exceed the task period, I/O may not be refreshed with external
devices, input signals may not be read, and output timing may be changed.
8-6 Debugging
8
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.
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
online, 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.
Continuous Tracing
Sampling starts without any trigger and continues on even after 10,000 samples are collected. Sam-
ple data is transferred to the 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.
8-6 Debugging
8
Item Description
Commands from Sys- Tracing is started when the Execute Button is clicked on
mac Studio the Sysmac Studio.
Starting a trace Tracing can be started when operation of the Controller
Starting tracing at start
starts (i.e., when the operating mode is changed from
of operation
PROGRAM mode to RUN mode).
• Tracing stops when the maximum value of 10,000
samples is reached.
Triggered traces
• Tracing is stopped when the Stop Button is clicked on
the Sysmac Studio.
8-6 Debugging
Setting of operation age time period or size limit is reached.
when limit is reached • Stopping the trace
• Deleting the oldest files and continuing
You can display a graph where the X axis represents
time and the Y axis represents the value of the variable.
Graph display
You can display both BOOL variables and other vari-
ables on the same graph. 8
You can display the maximum value, minimum value,
Displaying trace results
Table display average value, and value at the specified time for each
variable in a table.
*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 variable is
defined. If the different task is specified, the concurrency of variable values may not be ensured.
*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 variables
in functions.
*3 Data tracing will not start at the data trace starting point 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 con-
dition expression.
*5 Trace numbers 0 to 3 are set for the NX701 and NJ501. Trace numbers 0 and 1 are set for the NX102, NX1P2,
NJ301, and NJ101. These numbers are used to execute instructions and to access system-defined variables.
processing 2
processing 1
processing 2
Motion
control
Motion
control
Primary periodic I/O User program I/O User program
common
common
common
common
System
System
System
System
task refreshing execution refreshing execution
Display examples for data trace operations and execution results is given below for sampling in a spec-
ified task period.
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.
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.
2. SysRun is changed to TRUE in the user program.
3. In data trace processing in System Common Processing 1 in the next primary period, TRUE is
obtained 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
8-6 Debugging
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. 8
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
obtained 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
obtained 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 per-
form deceleration processing. The command value changes stepwise in synchronization with the pri-
mary periodic task. 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 control 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 deceleration starts and then STP_ACT changes to TRUE after another period.
Button2
STP_D
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 displays,
input parameters and input variable, 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 required
to use differential monitoring.
8-6 Debugging
Application
You can use differential monitoring to check or count the number of times an external input signal turns
ON or OFF or a 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 monitoring Number of variables 8 max.
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 Match count The number of times the specified variable matches the
condition is counted.
Starting and stopping Start condition Command from Sysmac Studio
Stop condition • Command from Sysmac Studio
• Occurrence of a major fault level Controller error
• User program download
• Clear All Memory operation
• Disconnecting online connection to Sysmac Studio
Operating modes • RUN mode
• PROGRAM mode
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.
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
You cannot specify an array, structure, or union.
The types of variables that you can specify are listed below.
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
8-6 Debugging
• 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 evaluations.
8
Start Condition and Stop Condition
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 Differen-
tial Monitor.
3 Set the differential monitoring condition expression for each variable in the Differential Monitor
Window.
The GVar1 global variable is read and written by the P1 program that is assigned to the primary peri-
odic 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 executes the
P2 program that is assigned to the periodic task. This means the external variable is updated only in
the task period of the periodic task. Because the task period of the periodic task is longer than the
primary period, the count for P2.GVar1 is updated fewer times than the count for GVar1.
8-6 Debugging
The GVar1 global variable is updated as soon as P1 writes a value to the
P1.GVar1 external variable.
TRUE
GVar 1 FALSE
(global
variable)
Timing for condition evaluation by differential monitoring
Primary period
8
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-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.
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.
8-7-1 Introduction
Features
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.
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.
*1 The source details information does not show information from the error histories from within CJ-series CPU
Special Units or EtherCAT slaves. Read the error histories from the appropriate Support Software.
*2 Only the NX102 CPU Units and NX1P2 CPU Units have the NX Bus Function Module.
Category
This information displays the category of event log. It is used to access error logs from the Sysmac Stu-
dio or an HMI.
Event type Event log category Description
Controller events System log The Controller automatically detects
and records these events. CJ-series
Unit errors are also included.
Access log This is a record of events that have
affect Controller operation due to
user actions.
User-defined events User event log This is a log of events that are
defined by the user.
Number of Records
Each event log can contain the following number of records. If the number of events exceeds the num-
ber of records permitted, the CPU Unit overwrites the oldest events.
Number of records permitted
Event type Event log category
NX701 NX102 NX1P2 NJ501 NJ301 NJ101
Controller events System log 2,048 768 576 1,024 512 512
Access log 1,024 576 528 1,024 512 512
Event Codes
Event codes are assigned to Controller events by the system in advance according to the type of event.
Event codes are assigned to user-defined events by the user. Controller event codes are 8-digit hexa-
decimal values. You can use the Get Error Status instruction to read the error codes of current errors.
You can assign a decimal number from 1 to 60,000 as the event code for a user-defined event.
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.
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.
No. Level Classification
1 High Controller errors Major fault level
2 Partial fault level
3 Minor fault level
4 Observation level
5 Low Controller information Information level
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.
User-defined Events
User-defined events are classified into the following levels. These levels are defined by the NJ/NX-
series System.
If an event occurs in the Controller that is not supported by the version of the Sysmac Studio or
8
an HMI, the source is displayed as “Unknown” and the event name is displayed as “Unknown
Event.” The event code and attached information are displayed correctly.
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.
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 on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
Note You can use CJ-series Units only with 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.
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
Introduction
These errors and information are defined by the user. You can use instructions to create them.
User-defined Errors
These errors are defined by the user. Use the Create User-defined Error (SetAlarm) instruction to
create user-defined errors. When this instruction is executed, a user-defined error is recorded in the
event log.
The corresponding system-defined variable changes to TRUE. User-defined errors are not reset
when the operating mode changes.
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 informa-
tion. When this instruction is executed, user-defined information is recorded in the event log.
Application Procedures
Use the following procedures.
User-defined Errors
1. Register a user-defined error in the Event Setting Table.
5. Check the user-defined error in the event log with the Sysmac Studio, an
instruction, or an HMI.
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
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.
Related Instructions
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 status 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.
A device failed. Call the following number for support.
Repair Contact
Hours: 8:00 AM to 9:00 PM
TEL: xxx-xxxx-xxxx
Version Information
A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are required
to change event levels.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for details on the types and levels
of the Controller events, and whether the event levels can be changed.
3 Change the levels of the required events in the Event Level column.
9-9-4 EtherCAT Slaves for Which You Can Back Up Data . . . . . . . . . . . . . . . . . . . . 9-54
9-10 Backup Functions When EtherCAT Slave Terminals Are Connected . . . 9-57
9-10-1 Backing Up Data in an EtherCAT Slave Terminal . . . . . . . . . . . . . . . . . . . . . . 9-57
9-10-2 Backup Support Depending on the EtherCAT Slave Terminal Status . . . . . . . 9-58
9-10-3 Conditions for Restoring EtherCAT Slave Terminal Data . . . . . . . . . . . . . . . . 9-58
9-11 Backup Functions When NX Units Are Connected . . . . . . . . . . . . . . . . . . 9-59
9-11-1 Backing Up Data in NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . 9-59
9-11-2 Backup Support Depending on the Controller Status . . . . . . . . . . . . . . . . . . . 9-59
9-11-3 Conditions for Restoring NX Unit Data on the CPU Unit . . . . . . . . . . . . . . . . . 9-60
9-12 Backup Functions When CJ-series Units Are Connected . . . . . . . . . . . . . 9-61
9-12-1 Backed Up CJ-series Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-61
9-12-2 Backup Support Depending on the Controller Status . . . . . . . . . . . . . . . . . . . 9-61
9-12-3 Conditions for Restoring CJ-series Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . 9-61
9-13 Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
9-13-1 Types of Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
9-13-2 Specifications of a Backup File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-64
9-13-3 Specifications of a Restore Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-64
9-13-4 Specifications of an Automatic Transfer Command File . . . . . . . . . . . . . . . . . 9-67
9-13-5 Specifications of a Controller Verification Results File . . . . . . . . . . . . . . . . . . 9-70
9-13-6 Specifications of an EtherCAT Verification Results File . . . . . . . . . . . . . . . . . 9-71
9-13-7 Specifications of an EtherCAT Slave Terminal Verification Results File . . . . . 9-72
9-13-8 Specifications of an NX Unit Verification Results File . . . . . . . . . . . . . . . . . . . 9-73
9-13-9 Specifications of CJ-series Unit Verification Results File . . . . . . . . . . . . . . . . 9-74
9-14 Compatibility between Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . 9-76
9-14-1 Compatibility between Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-76
9-14-2 Compatibility between CPU Unit Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-77
9-14-3 Compatibility between Unit Versions of CPU Units . . . . . . . . . . . . . . . . . . . . . 9-78
9-15 Functions That Cannot Be Executed during Backup Functions . . . . . . . 9-80
Function Description
Backing up You can back up all of the data in the Controller to an SD Memory Card or to a computer. The
data file that is saved 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. The data in the Controller is restored to the data at the time the backup file was
made.
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 functions Effective usage of the backup functions is described.
Examples of operating procedures for the The backup functions are executed with simple procedures.
backup functions Examples are provided.
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.
Relation between the different types of backup Different types of backup functions handle different data
functions and data groups groups. The relation between the different types of backup
Item Application
Program and setting changes When you change the user program and settings for equipment that is cur-
rently in operation.
Hardware replacements When you replace the hardware for the CPU Unit, other Units, or slaves.
Troubleshooting equipment fail- When you want to save data in the Controller to analyze the cause of an
ures error that occurs in the equipment.
Equipment backup and recovery When an error occurs in the equipment, and when you want to restore the
equipment with data from an 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.
Backup Procedure
Preparations
1 Insert the SD Memory Card into the CPU Unit.
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.
5 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.
Restoration Procedure
Preparations
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.
Restoring Data
4 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 indicator will stop flashing and
remain lit.
6 Turn OFF the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.
9 Turn ON the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.
the Controller will start operation before you can perform the verification procedure. That
means that operation could be started with data that is not correct. For information on Safe
Mode, refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503).
Verification Procedure
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 For the NX Units on the NX102 CPU Unit and NX1P2 CPU Unit, data of configuration information, Unit opera-
9-1-3 Data That Is Backed Up
Operating method
*1 An NX102 CPU Unit with unit version 1.31 or later and Sysmac Studio version 1.24 or higher are required to use the func-
tion. The safety unit restore function restores only the data in the NX-SL5. If you restore in the entire system, you must
execute the safety unit restore with a combination of the SD Memory Card backups.
*2 Set the front-panel DIP switch on the NX-SL5 Safety CPU Unit. Refer to the NX-series Safety Control Unit User’s Man-
ual (Cat. No. Z930-E1-12 or later) for details.
Operating method
Version Information
• A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are
required to use the following backup functions: SD Memory Card backups, automatic transfers
from SD Memory Cards, Sysmac Studio Controller backups, and importing and exporting Sys-
mac Studio backup file data.
• A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are
required 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
required 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
backup 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.
*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 backup data is processed only for the present values of variables that are specified for retention with the
Retain attribute.
*4 The backup data is processed only for the present values of addresses that are specified for retention with the
Retain attribute in the memory for CJ-series Units.
*5 Of the user program and setting data groups, the Data Trace Settings are not compared.
*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 variable is
transferred.
*8 If the CJ-series Units are specified for backup, the parameters in the CJ-series Units are backed up. If the Eth-
erCAT 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 Stu-
dio.
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 to 9-8 Sysmac Studio Variable and Memory Backup
Functions for details on the Sysmac Studio variable and memory backup functions.
*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 with 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
backup functions and Sysmac Studio Controller backup functions.
Computer HMI
NJ-series
CPU Unit NX Units or Expansion Rack CPU Unit NX Units or
CJ-series Units CJ-series Units
Slaves
EtherCAT slaves
Note You can use NX Units on the CPU Unit only with 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. 9
Version Information
9-1-6 Applicable Range of the Backup Functions
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required
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 Restor- Verifying
Contents
up data ing data data
Backup files This file contains the Controller data that is handled Created. Accessed. Accessed.
by the functions that are related to data backup.
Restore command This file specifies the data groups to restore when Created. Accessed. Accessed.
file 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 transfer when Created. Nothing is Nothing is
command file automatically transferring data from a SD Memory done. done.
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 results after data Nothing is Nothing is Created.
files is verified. done. done.
The execution method for the functions, applicable directory, and applicable operating modes are given
in the following table.
Applicable operating modes
Procedure Directory*1
Backing up data Restoring data Verifying data
CPU Unit front-panel The root directory RUN mode and At startup RUN mode and
DIP switch*2 PROGRAM mode PROGRAM mode
System-defined vari- The directory that you RUN mode and RUN mode and RUN mode and
ables*3*4 specified in the system- PROGRAM mode PROGRAM PROGRAM mode
defined variable mode*5
SD Memory Card The directory that you RUN mode and Execution is not RUN mode and
Window in Sysmac specified on the SD Mem- PROGRAM mode possible. PROGRAM mode
Studio ory Card Window
*4 Make arrangements to prevent backup or verification operations from being performed on HMIs while a
backup, restore, or verification operation is in progress. Otherwise, the intended operation may not occur.
*5 Execution is not possible for the CPU Unit with unit version 1.13 or earlier because the restore by the system-
defined variable is not supported.
Processing Contents
• This backup operation processes all data groups.
• 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.
• 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 the SD Memory Card, 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 power is continued to supply even if the SD Memory Card power supply switch is pressed when
a backup is in progress.
• The SD Memory Card will remain mounted after completion of the backup.
Procedure
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will
change to TRUE.
Execution results Normal End:
The SD PWR indicator will light.
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.
The indicator stop flashing and stay lit when the SD Memory Card power supply switch is
pressed.*1
*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.
Note You cannot access these system-defined variables from the user program.
Backing Up Data from the SD Memory Card Window on the Sysmac Studio
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.
Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required
to use the BackupToMemoryCard instruction.
Variable
Meaning Function Data type R/W
Member name
_Card1BkupCmd* SD Memory Card _sBKUP_CMD RW
Backup Commands
ExecBkup* Execute Backup Flag Change this variable to TRUE to back up BOOL RW
Controller data to an SD Memory Card.
CancelBkup* Cancel Backup Flag Change this variable to TRUE to cancel BOOL RW
backing up data to an SD Memory Card.
DirName* Directory Name Use this variable to specify the directory STRING(64) RW
name in the SD Memory Card for which to
back up data.
_Card1BkupSta* SD Memory Card _sBKUP_STA R
Backup Status
Done* Done Flag TRUE when a backup is completed. BOOL R
* You cannot access these system-defined variables from the user program.
Additional Information 9
• 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
9-2-1 Backup (Controller to SD Memory Card)
Controller.
• Refer to A-11 Registering a Symbol Table on the CX-Designer for the procedure 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 a 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.
Normal Operation
_Card1BkupCmd.ExecBkup TRUE
FALSE
_Card1BkupCmd.CancelBkup TRUE
FALSE
_Card1BkupSta.Done TRUE
FALSE
_Card1BkupSta.Active TRUE
FALSE
_Card1BkupSta.Err TRUE
FALSE
_BackupBusy TRUE
FALSE
Operation When the Backup Cannot Start Because Another Backup Function
Is in Progress
_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
_Card1BkupSta.Done TRUE
FALSE
_Card1BkupSta.Active TRUE
FALSE
TRUE
_Card1BkupSta.Err
FALSE
_BackupBusy TRUE
FALSE
Con-
*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 Digital
I/O Terminals.
Processing Contents
The following describes the processing contents for restoring data with the CPU Unit front-panel DIP
switch and with system-defined variables.
• 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 retained.
However, when the DM, EM and Holding Areas are newly generated or the area is expanded, the val-
ues in those areas will be the initial values.
• 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.
• With the _Card1RestoreCmd (SD Memory Card Restore Command) system-defined variable, you 9
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 vari-
9-2-2 Restore (SD Memory Card to Controller)
able. The target backup file must be stored in a directory on the SD Memory Card in advance.
• If the password set on the Password of the SD Memory Card Restore Setting differs 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 Pro-
gram/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 retained.
However, when the DM, EM and Holding Areas are newly generated or the area is expanded, the val-
ues 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
Restoring Data with the CPU Unit Front-panel DIP Switch
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.
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.
*2 If an SD Memory Card is not inserted, the SD PWR indicator will not light.
The restore operation starts when you change the _Card1RestoreCmd.Exec (Execute
Restore Flag) system-defined variable to TRUE.
Executing The _BackupBusy (Backup Function Busy Flag) system-defined variable changes to TRUE.
*1 You cannot execute the restore by the system-defined variable after you transfer a backup file for which
Restore by system-defined variable is set to Do not use in the Controller Setup. If you intend to continue restor-
ing, transfer a backup file for which the above setting is set to Use.
*2 The password is initialized when the restore by the system-defined variable is started. Specify a password
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 Setup, 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 _sRE- RW
Restore Com- STORE_C
mand MD
Exec Execute Restore Change this variable to TRUE to restore the BOOL RW
Flag data in a backup file on the SD Memory Card
to the Controller.
DirName Directory Name Use this variable to specify the directory name STRING RW
in the SD Memory Card in which the backup (64)
file to be restored by the system-defined vari-
able is stored.
Password Password Use this variable to specify the password that STRING(3 RW
is used for verification when you start the 3)
restore by the system-defined variable.
The password is initialized every time you
start transferring programs from the SD Mem-
ory Card.
_Card1RestoreSta SD Memory Card _sRE- R
Restore Status STORE_S
TA
Done Done Flag TRUE when a restore operation 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.
9
9-2-2 Restore (SD Memory Card to 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 restore
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.
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
TRUE
_Card1RestoreSta.Active FALSE
TRUE
_Card1RestoreSta.Err 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.
*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.
9
*4 Two NX1W-CIF01 Serial Communications Option Boards. 9-2-2 Restore (SD Memory Card to Controller)
*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 Digital I/O Terminals.
You can compare the Controller data and the data in a backup file on the SD Memory Card in the CPU
Unit.
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 verification 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 verifi-
cation is in process.
• When you verify the data, the verification results file (VerifyResult.log) is created in the specified
directory. 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 veri-
fication 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
Verifying Data with the CPU Unit Front-panel DIP Switch
Error End:
The SD PWR indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.
The indicator stop flashing and stay lit when the SD Memory Card power supply switch is
pressed.*1
*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 verification operation starts when you change the _Card1BkupCmd.ExecVefy (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.CancelVefy
(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.
Execution results Normal End with No Differences Found:
The _Card1BkupSta.Done (Done Flag) and the _Card1BkupSta.VefyRslt (Verify Result
Flag) system-defined variables change to TRUE.
Error End:
Note You cannot access these system-defined variables from the user program.
Verifying Data from the SD Memory Card Window on the Sysmac Studio
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* SD Memory Card _sBKUP_CMD RW
Backup Commands
ExecVefy* Execute Verify Flag Change this variable to TRUE to compare the BOOL RW
Controller data to a backup file in the SD Mem-
ory Card.
CancelVefy* Cancel Verify Flag Change this variable to TRUE to cancel com- BOOL RW
paring the Controller data to a backup file in the
SD Memory Card.
DirName* Directory Name Use this variable to specify the directory name STRING(64) RW
in the SD Memory Card for which to back up
data.
_Card1VefySta* SD Memory Card Ver- _sVEFY_STA R
ify Status
Done* Done Flag TRUE when a verification is completed. BOOL R
VefyRslt* Verify Result Flag TRUE if the data was the same. FALSE if differ- BOOL R
ences were found.
* You cannot access these system-defined variables 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 for the procedure 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 verify data is shown below. In
the charts, “pre-execution checks” indicates processing to check whether there is a SD Memory
Card in the CPU Unit and other items. The value of _Card1VefySta.Active (Active Flag) changes to
TRUE only after all of the pre-execution checks are cleared and the actual verification is started.
_Card1VefySta.Err TRUE 9
FALSE
_BackupBusy TRUE
FALSE
9-2-3 Verify (between Controller and SD Memory Card)
_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
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 required
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
related to data backup.
Automatic transfer command This file specifies the data groups to transfer when transferring data from a SD
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 Autload-
Command.ini file in the /autoload directory. Refer to 9-13-4 Specifications of an Automatic Transfer
Command File 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 previous
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 error)
will occur. If that occurs, the data in the Controller is not dependable. Use one of the following meth-
ods 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 Unit
or NX1P2 CPU Unit, the previous present values in the DM, EM and Holding Areas will be retained.
However, the values in the DM, EM and Holding Areas, which are newly generated or the area is
expanded, will be the initial values.
• The SD Memory Card will remain mounted after completion of the automatic 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 automatic transfer operation.
Procedure
Error End:
9
The RUN indicator goes out, the ERR indicator lights, and a major fault level Controller
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 direc-
tory 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 given
in the following table.
• 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 can-
not 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 such error occurs on the HMI you will use.
• If the power is interrupted while this function is in progress, a User Program/Controller Config-
urations and Setup Transfer Error (event code 10200000 hex) or other errors may occur.
• You cannot transfer programs after you transfer a backup file for which Program transfer by
system-defined variable is set to Do not use in the Controller Setup. If you intend to continue
transferring programs, transfer a backup file for which the above setting is set to Use.
• You cannot execute other backup function while a program transfer is in progress.
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 Card
in advance.
• The data of the programs to be transferred is the group of data specified with the system-defined
• 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 retained.
However, when the DM, EM and Holding Areas are newly generated or the area is expanded, the val-
ues 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.
Operating Method
_Card1PrgTransferCmd (SD Memory Card Program Transfer Command)
System-defined Variable
*1 You cannot transfer programs after you transfer a backup file for which Program transfer by system-defined
variable is set to Do not use in the Controller Setup. If you intend to continue transferring programs, transfer a
backup file for which the above setting is set to Use.
Variable name
Meaning Function Data type R/W
Member name
_Card1PrgTransfer- SD Memory Card _sPRG- RW
Cmd Program Trans- TRANS- 9
fer Command FER_CMD
Exec Execute Program Change this variable to TRUE to transfer the BOOL RW
Transfer Flag data in a backup file on the SD Memory Card
to the Controller by using the function to trans-
fer programs from the SD Memory Card.
DirName Directory Name Use this variable to specify the directory name STRING RW
in the SD Memory Card for which to back up (64)
data.
Password Password Use this variable to specify the password that STRING(3 RW
is used for verification when you start transfer- 3)
ring the programs.
The password is initialized every time you
start transferring programs from the SD Mem-
ory Card.
Variable name
Meaning Function Data type R/W
Member name
TargetUserPro- User Program and Change this variable to TRUE to set a user BOOL RW
gram Settings Transfer program or setting as the transfer target.
Flag*1
Always set this variable to TRUE for transfer-
ring programs from SD Memory Card.
TargetIPAdr IP Address Change this variable to TRUE to include the BOOL RW
Transfer Flag IP address of the built-in EtherNet/IP port as
the transfer target.
The IP address means setting type, IP
address, subnet mask, and default gateway.
TargetVariable Present Values Change this variable to TRUE to set the pres- BOOL RW
of Variables with ent values of variables with the Retain attri-
the Retain Attri- bute as the transfer target.
bute Transfer
Flag
TargetMemory Present Values Change this variable to TRUE to set the pres- BOOL RW
of Memory Used ent values of the memory used for CJ-series
for CJ-series Units with the Retain attribute as the transfer
Units with the target.
Retain Attribute
Transfer Flag
_Card1PrgTransfer- SD Memory Card _sPRG- R
Sta Program Trans- TRANS-
fer Status FER_STA
Done Done Flag TRUE when a program transfer is completed. BOOL R
*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 for the procedure 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 transfer programs from the SD
Memory Card is shown below.
In the charts, “checks performed before starting” indicates the processing performed before the pro-
gram transfer to check whether the password matches. The value of _Card1PrgTransferSta.Active
(Active Flag) changes to TRUE only after the checks performed before starting result in OK.
Normal Operation
Program Checks
transfer before starting
start a transfer was Controller
command OK. reset Normal end
TRUE
_Card1PrgTransferCmd.Exec FALSE
Setting Initial
_Card1PrgTransferCmd.Password Initial Setting value
value
TRUE
_Card1PrgTransferSta.Done FALSE
TRUE
_Card1PrgTransferSta.Active FALSE
TRUE
_BackupBusy TRUE
FALSE
_BackupBusy TRUE
FALSE
Operation When the Program Transfer Fails After a Normal Start of Program
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
given 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 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.
*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 transfer
command file.
The data in a backup file in the specified directory on the computer is transferred to the Controller. This
operation can only be performed in PROGRAM mode.
Processing Contents
• The data in a backup file in the specified directory on the computer is transferred 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.
• 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 Pro-
gram/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. 9
• 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
9-6-2 Restore (Computer to Controller)
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 retained.
However, when the DM, EM and Holding Areas are newly generated or the area is expanded, the val-
ues in those areas will be the initial values.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
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.
The Controller data and the data in a backup file in the specified directory on the computer are com-
pared.
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 specify all data, all of the following data will be com-
pared.
*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.
Procedure
1 Select Backup - Compare with Backup File from the Tools Menu on the Sysmac Studio.
You can create or read from a backup file in the specified directory on the computer from the Sysmac
Studio project without using the Controller. This following data is processed:
Data group
User program and Present
settings values of Absolute
Function Present Units and
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 Exporting OK*3 OK OK OK × ×
exporting Sysmac backup file
Studio backup file data
data Importing OK OK OK OK ×
OK*4
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
• Data Trace Settings
*4 The following data is not processed. The data that is not processed depends on the version of the Sysmac Stu-
dio.
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
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for more information on these
functions.
Sysmac Studio
Restoring
Present values of
battery-backup memory
Backup
9-8-1 Applicable Data for Sysmac Studio Variable and Memory Backup
Functions
Applicable Data for Sysmac Studio Variable and Memory Backup Functions
• 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
9
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.
Memory Backup Functions
9-8-1 Applicable Data for Sysmac Studio Variable and
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, and NC Inte-
grated 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 using
a CPU Unit with version 1.04 or later and Sysmac Studio version 1.05 or higher. The compatibil-
ity for all other cases is given in the following table.
(C: Compatible, N: Not compatible.)
CPU Unit model to restore to
NJ501-1500
CPU Unit model where data was backed up NJ301-1200
NJ501-1400
NJ301-1100
NJ501-1300
NJ501-1500, NJ501-1400, or NJ501-1300 C N
NJ301-1200 or NJ301-1100 N C
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
for CJ-series Units
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.
If Area Data in the Backup File Is Larger Than Area Data in the Restore CPU
Unit
Size of DM Area data when backed up = 8 Size of DM Area data in the restore CPU Unit
words = 4 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 - -
Size of DM Area data when backed up = 8 Size of DM Area data in the restore CPU Unit
words = 4 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.
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 Not possible.*2 Possible.*3
Network configuration mismatch with configu- Not possible.*1 Not possible.*2 Possible.3
ration information*5
Network configuration mismatch with configu- Possible. Not possible.*2 Possible.*3
ration at time of backup
Disabled slave in net- Disabled slaves in Possible. *6 Possible. *6 Possible. *6
work configuration actual configuration
No disabled slaves in Possible. Possible. Possible.
actual configuration
Execution
Controller status
Backing up data Restoring data Verifying data
Slave disconnected Disconnected slaves Not possible.*1 Possible, but data Possible, but data
for “Disconnect” des- in actual configuration for disconnected for disconnected
ignation in network slaves is not slaves is not
configuration restored. restored.
No disconnected Not possible.*1 Not possible.*2 Possible.*3
slaves in actual con-
figuration
Slave Initialization Error 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 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 Operation
Setting of “Stop”, and Link OFF Error.
• 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 configuration 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.
Display the Inverter parameters on the Inverter Parameters Tab Page for the Controller Configu-
rations 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.
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 set-
tings, 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 required
to use EtherCAT Slave Terminals.
Execution
EtherCAT Slave Terminal status Backing up
Restoring data Verifying data
data
Automatic creation of the Unit configuration information Possible.*1 Possible.*2 Possible.
Waiting for NX Unit participation Not possible.*3 Not possible.*4 Possible.*5
Watchdog time error in EtherCAT Coupler Unit or NX Not possible.*3 Not possible.*4 Possible.*5
Unit
During Bus Controller Error Not possible.*3 Not possible.*4 Possible.*5
During Unit Configuration Information Error Not possible.*3 Possible. 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 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.
Execution
Controller status Backing up
data
Restoring data Verifying data 9
Automatic creation of the Unit configuration information Possible.*1 Possible.*2 Possible.
Watchdog time error in NX Unit Not possible.*3 Not possible.*4 Possible.*5
9-11-1 Backing Up Data in NX Units on the CPU Unit
The following table shows when backup, restore, and verify operations can be performed for CJ-series
Units based on the Controller status.
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
9
Restarting the CJ-series Unit Not possible.*1 Possible. Possible.*3
*1 CJ-series Unit Backup Failed events are recorded in the event log.
9-12-1 Backed Up CJ-series Unit Data
*2 CJ-series Unit Restore Operation Failed events are recorded in the event log.
*3 The verification results will show differences.
Backup File
This file contains the Controller data that is handled by the backup-related functions. Backup files
are created when data is backed up.
Verification results
Description
files
Controller verification This file contains the verification results for all backup data specified by the restore
results file command file. 9
EtherCAT slave verifi- This file contains the verification results for each EtherCAT slave. It is created when
cation results file 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.
9-13-1 Types of Backup-related Files
EtherCAT Slave Ter- This file contains the verification results for each EtherCAT Coupler Unit and NX Unit.
minal verification This file is created when all of the following conditions are met.
results file • The Unit and slave settings are specified for restoration in the restore command
file.
• The EtherCAT slave settings are included in the backup file.
• One or more EtherCAT Slave Terminals is connected.
If an EtherCAT Slave Terminal verification results file is created, an EtherCAT slave
verification results file is always created at the same time.
NX Unit verification This file contains the verification results for each NX Unit on the CPU Unit. It is cre-
results file*1 ated when the Unit and slave settings are set to be restored in the restore command
file and the NX Unit settings on the CPU Unit are contained in the backup file.
CJ-series Unit verifi- This file contains the verification results for each CJ-series Unit. It is created when the
cation results file*2 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 on the CPU Unit only with the NX102 CPU Units and NX1P2 CPU Units.
*2 You can use CJ-series Units only with NJ-series CPU Units.
File Name
A different backup file name is given depending on the CPU Unit series.
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required.
File Name
; --- IP Address of Built-in EtherNet/IP Port Settings. --- IP address of built-in EtherNet/IP port
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.
2 The restore command file lists the restorable data groups that were in the backup file when the backup file
was created.
3 Only single-byte alphanumeric characters are used. The text is not case sensitive.
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 Settings 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-67 for compatibility between the restore command file with unit version 1.13 or earlier and the restore
command file with unit version 1.14 or later.
Unit version of CPU Unit that Unit version of CPU Unit where data is being restored
creates the restore command
file and backup file Version 1.13 or earlier Version 1.14 or later
; --- IP Address of Built-in EtherNet/IP Port Settings. --- IP address of built-in EtherNet/IP port
; "yes":will be transferred, "no":will not be transferred yes/no: Transfer/Do not transfer.
IPAdr=yes
Present values of variables (only variables that are set to be
; --- Present values of variables (Retained variables only). --- retained with the Retain attribute)
Variable=yes
; --- Present values of memory used for CJ-series Units (Hold- Present values of memory used for CJ-series Units (only
ing, EM, and DM Area data). --- addresses that are set to be retained with the Retain attribute)
; "yes":will be transferred, "no":will not be transferred yes/no: Transfer/Do not transfer.
Memory=yes
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.
2 The automatic transfer command file lists the transferable data groups that were in the backup file when
the backup file was created.
3 Only single-byte alphanumeric characters are used. The text is not case sensitive.
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 Settings for which the automatic transfer file is not created is used, the
operation is performed as “IPAdr=yes”. Refer to Compatibility between Automatic Transfer Files on page
9-69 for compatibility between the automatic transfer file with unit version 1.13 or earlier and the automatic
transfer file with unit version 1.14 or later.
Unit version of CPU Unit that Unit version of CPU Unit where data is being automatically trans-
creates the automatic transfer ferred
file 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 Port Settings is automatically trans-
transferred. ferred.
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 Port Settings corresponds to “yes/no”
of IP Address of Built-in Ether- of “IPAdr”.
Net/IP Port Settings cannot be
interpreted, an Error in Starting
Automatic Transfer in a major
fault level occurs. The error
details will be “0104 hex: The con-
tents of the automatic transfer
command file are not correct”.
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.
[UnitConfig]
; --- Unit/Slave Parameters. --- Units and slaves settings
Result=Not matched Matched: No differences were found, Not matched: Differ-
ences were found.
Note 1 The verification results are given only for the data groups that were compared.
2 The verification results of IP Address of Built-in EtherNet/IP Port Settings are including 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
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
[E002:NX]
Result=Matched
* If EtherCAT Slave Terminals are set for verification, the EtherCAT Slave Terminal verification results file is cre-
ated. 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
[E005:UnitNo.0 NX-ECC201]
Result=Not matched
Factor=Verification error
File Name
File File name
NX Unit verification results file VerifyResult_NXUnit.log
File name
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.
Result=Matched
Rack No.:
[Rack0 Slot9: CJ1W-DRM21 UnitNo.0] Text string of decimal numbers. The value will
be between 0 and 3.
Result=Not matched
Slot No.:
Text string of decimal numbers. The value will
[Rack1 Slot0: CJ1W-EIP21 UnitNo.10] be between 0 and 9.
Result=Matched
Unit Model
Text string that identifies the Unit model.
[Rack1 Slot1: CJ1W-PRM21-DPV1 UnitNo.1] The Unit model is obtained from the cyclic ini-
Result=Not matched tialization 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. Special I/O Units: 0 to
Note The verification results are given only for the EtherCAT slaves that were compared.
9
File
9-13-9 Specifications of CJ-series Unit Verification Results
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 for details on these functions.
*1 The Sysmac Studio variable and memory backup functions are compatible. However, a CPU Unit with unit ver-
sion 1.04 or later and Sysmac Studio version 1.05 or higher are required. Refer to 9-8-3 Compatibility between
CPU Unit Models for the compatibility 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, and NC Inte-
grated 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 mod-
els are compatible.
(R: Restored, x: Not restored)
Function used to restore data
Restoring with Restoring with
Restoring with
Compatibility Sysmac Studio Sysmac Studio Importing Sys-
SD Memory Automatic
between CPU Controller variable and mac Studio
Card backup transfer and
Unit Models backup func- memory backup backup file data
functions (SD program trans-
tions (com- functions (com- (computer to
Memory Card to fer
puter to puter to Con- project)
Controller)
Controller)*1 troller)
Compatible R*2 R*2 R R R
Not compatible ×*3 ×*4 × × ×
*1 Only the files that were backed up using this function can be restored.
*2 If the contents of the backup file are outside the range of specifications where the data is restored, the Control-
ler will not operate normally. When you operate the Controller, a major fault level Controller error or a partial
fault level Controller error will occur. For example, this error occurs if the number of controlled axes that is used
is outside the specifications.
*3 A Restore Start Failed observation will occur.
*4 The Error in Starting Automatic Transfer (a major fault level Controller error) occurs during an automatic trans-
fer. The SD Memory Card Program Transfer Failed to Start error (an observation level Controller error) occurs
during a program transfer.
*1 The Error in Starting Automatic Transfer (a major fault level Controller error) occurs during an automatic trans-
fer. The SD Memory Card Program Transfer Failed to Start error (an observation level Controller error) occurs
during a program transfer.
Communications Setup
This section describes how to go online with the CPU Unit and how to connect to other
devices.
Step 4. Wiring
Overview
You can use the NX701 System to build the communications system shown below.
Sysmac Studio
NTP server
BOOTP server
10
DNS server
EtherNet/IP
10-1-1 Introduction
HMI CJ2 series
Sysmac Studio
USB
General-purpose slaves
NX102 System
You can use the NX102 System to build the communications system shown below.
Sysmac Studio HMI NX-series Controller NJ-series Controller
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
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
Studio
10-2-1 Configurations That Allow Online Connections
10
You can connect online from the Sysmac Studio to the peripheral USB port or built-in EtherNet/IP port
of the NJ/NX-series CPU Unit.
Sysmac Studio
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 NX102 CPU Unit or NX1P2 CPU Unit because it does not provide a
peripheral USB port.
EtherNet/IP
EtherNet/IP
• A direct connection is made from the com- • Specify the IP address of the remote node from the Sysmac
puter that runs Sysmac Studio. You do not Studio.
need to specify the IP address or connec- • You can use either a cross cable or a straight cable.
tion device.
• You can make the connection either with
or without a Ethernet switch.
• You can use either a cross cable or a
straight cable.
• For NX701 CPU Units and NX102 CPU
Units, 1:1 connection is supported only for
port 1.
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 NX102 CPU Units and NX1P2 CPU Units do not provide a 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
Studio
Sysmac Studio
USB 10
DeviceNet network
Note You cannot connect a DeviceNet Unit with NX-series CPU Units.
EtherNet/IP
You can use the built-in EtherNet/IP ports or ports on CJ1W-EIP21 EtherNet/IP Units.
For information on 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 the CJ1W-EIP21 EtherNet/IP Unit, refer to the
CJ-series EtherNet/IP Unit Operation Manual for NJ-series CPU Unit (Cat. No. W495).
Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.
EtherNet/IP
Message Communications
You can send CIP messages from the user program.
EtherNet/IP
CIP communications
instruction
Controllers or Slaves
You can send and receive files on the SD Memory Card that is inserted in the NJ/NX-series CPU
Unit from an FTP client application.
SD Memory Card
Socket Services
You can directly use TCP or UDP from the user program to send and receive any data with remote
nodes between a host computer and the Controller, or between Controllers. The socket services are
supported only for the built-in EtherNet/IP ports.
Communications
EtherNet/IP
Socket service
instruction
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
Servo Drives
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.
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 Series 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.
RS-232C or
RS-422A/485
RS-232C or
RS-422A/485
RS-232C or
RS-422A/485
Sysmac Studio
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 vari-
ables that you use in only specific POUs (local variables)
• Defining the variable 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 resetting 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
select Add − Axis Settings from the menu.
2 Assign Servo Drives to the axes (axis variables) that you created in the EtherCAT configuration.
11
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 function block 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.
If necessary, review the task configuration, program assignments, and task periods.
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 performing forced-refreshing with user-specified values 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.
Actual Operation
Select Operation Mode − RUN Mode from the Controller Menu. If an error occurs, investigate the
cause and edit the user program.
11
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-E1-19 or later) for types of errors,
meanings, specific corrections when errors occur and for troubleshooting information on the entire
NJ/NX-series Controller.
A-1 Specifications
This section gives the specifications of the NJ/NX-series Controllers.
A-1 Specifications
• NJ-series CPU Unit Hardware User's Manual (Cat. No. W500)
Built-in 40,000 pps*14 12,000 pps*14 3,000 pps*14 (including heartbeat) (*)
Ether- Permissible communica- (including (including
Net/IP tions band heartbeat) heartbeat, CIP
port Safety routing)
Maximum number of tag 256 per port 32 per port 32
sets 512 total 40 total*15
Network vari- Network variables, CIO, Work, Network variables, CIO, Work, Holding,
Tag types
ables Holding and DM Areas DM, and EM Areas
CIP service:
Number of tags per connec- 8 (7 tags if Controller status is included in the tag set.)
Tag data links
tion (i.e., per tag set)
(cyclic com-
munications) 256 per port 256
Maximum number of tags
512 total
Maximum link data size per 369,664 bytes 19,200 bytes
node (total size for all tags)
Maximum data size per con- 1,444 bytes 600 bytes
nection
256 per port 32 per port 32 (1 connection = 1 tag set)
Maximum number of regis- 512 total 40 total*15
trable tag sets (1 connection (1 connection
= 1 tag set) = 1 tag set)
1,444 bytes 600 bytes (Two bytes are used if Controller status is included in the tag set.)
(Two bytes are
used if Con-
Maximum tag set size
troller status is
included in the
tag set.)
Multi-cast packet filter*16 Supported
A-1 Specifications
can com-
municate at
one time
Maximum number of --- 16 total ---
routable CIP Safety connec-
CIP Safety tions
routing (*)
Maximum routable safety --- 32 bytes ---
data length per connection
Number of TCP sockets 30 (*) 60 30 (*)
Built-in
Ether-
--- UA 1.02 Micro
Embedded
--- UA 1.02 Micro
Embedded
---
A
Net/IP Device Server Device Server
port Support Profile/Model Profile Profile
PLCopen PLCopen
A-1 Specifications
Power Supply Model NX-PD7001 DC input is built into the CPU
Unit for CPU Unit.
Rack and AC power 30 to 45 ms --- 30 to 45 ms
Power OFF
Expansion supply
detection
Racks DC power 5 to 20 ms 2 to 8 ms 22 to 25 ms
time
supply
--- Input: 8,192 bytes ---
Maximum NX Bus I/O data size
Output: 8,192 bytes
Option --- *21 ---
Board
Number of slots A
Input Number of points --- *22 ---
Built-in Number of points --- *23 ---
Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to A-
15 Version Information for NX-series Controllers and A-16 Version Information for NJ-series Controllers for information
on version upgrades.
NX701-
Item
17 16
Maximum number of controlled axes 256 axes 128 axes
Motion control axes 256 axes 128 axes
Single-axis position ---
control axes
Maximum number of used real axes 256 axes 128 axes
Number of Used motion control 256 axes 128 axes
controlled servo axes
axes*1 Used single-axis posi- ---
tion control servo
A-1 Specifications
axes
Maximum number of axes for linear 4 axes per axes group
interpolation axis control
Number of axes for circular interpola- 2 axes per axes group
tion axis control
Maximum number of axes groups 64 axes groups
Motion control period The same control period as that is used for the process data communications cycle for EtherCAT.
Number of Maximum points per 65,535 points
Cams
cam data
points
cam table A
Maximum points for 1,048,560 points
all cam tables
Maximum number of cam tables 640 tables
*1 Refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) for descriptions of axes.
NX102-
Item
12 11 10 90
Maximum number of controlled 15 axes 4 axes
axes
Motion control axes 11 axes ---
Single-axis posi- 4 axes
tion control axes
Maximum number of used real 12 axes 8 axes 6 axes 4 axes
axes
Number of
controlled Used motion con- 8 axes 4 axes 2 axes ---
axes*1 trol servo axes
Used single-axis 4 axes
position control
servo axes
Maximum number of axes for lin- 4 axes per axes group ---
ear interpolation axis control
Number of axes for circular 2 axes per axes group ---
interpolation 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.
Maximum points 65,535 points
Number of per cam table
cam data
Cams points 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 For details on each axis, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).
NX1P2-
Item
11 10 90
Maximum number of controlled axes 12 axes 10 axes 4 axes
Motion control axes 8 axes 6 axes ---
Single-axis position 4 axes
control axes
Maximum number of used real axes 8 axes 6 axes 4 axes
Number of Used motion control 4 axes 2 axes ---
controlled servo axes
axes*1 Used single-axis posi- 4 axes
tion control servo
axes
Maximum number of axes for linear 4 axes per axes group ---
interpolation 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 as for the primary periodic task.
Number of Maximum points per 65,535 points ---
cam data cam table
Cams points
Maximum points for 262,140 points
all 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
Maximum number of controlled axes 64 axes 32 axes 16 axes
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
Number of Used motion control 64 axes 32 axes 16 axes
controlled servo axes
axes*1 Used single-axis posi- ---
tion control servo
axes
Maximum number of axes for linear 4 axes per axes group
interpolation axis control
Number of axes for circular interpola- 2 axes per axes group
tion axis control
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.
Number of Maximum points per 65,535 points
cam data cam table
Cams points
Maximum points for 1,048,560 points
all cam tables
Maximum number of cam tables 640 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.
NJ301-
Item
12 11
Maximum number of controlled axes 15 axes (*)
Motion control axes 15 axes (*)
Single-axis position ---
control axes
Maximum number of used real axes 8 axes 4 axes
Number of Used motion control 8 axes 4 axes
controlled servo axes
axes*1 Used single-axis posi- ---
tion control servo
axes
Maximum number of axes for linear 4 axes per axes group
A-1 Specifications
interpolation axis control
Number of axes for circular interpola- 2 axes per axes group
tion axis control
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.
Number of Maximum points per 65,535 points
cam data cam table
Cams points
Maximum points for 262,140 points
all cam tables A
Maximum number of cam tables 160 tables
Position units Pulse, mm, µm, nm, degree, and inch
*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 upgrades. Refer to A-15 Version Information for NX-
series Controllers and A-16 Version Information for NJ-series Controllers for information on version upgrades.
NJ101-
Item
10 90
Maximum number of controlled axes 6 axes ---
Motion control axes 6 axes ---
Single-axis position ---
control axes
Maximum number of used real axes 2 axes ---
Number of Used motion control 2 axes ---
controlled servo axes
axes*1 Used single-axis posi- ---
tion control servo
axes
Maximum number of axes for linear 4 axes per axes group ---
interpolation axis control
Number of axes for circular interpola- 2 axes per axes group ---
tion axis control
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 Ether-
CAT.
Number of Maximum points per 65,535 points ---
cam data cam table
Cams points
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.
A-1 Specifications
ming number of
Array dimensions
specifi- Maximum 65,535
Data type number of ele-
cations
attributes ments
Array specifi- Supported
cations for FB
instances
Range specifications
You can specify a range for a data type in advance. The data type can take only val- A
ues that are in the specified range.
Libraries (*) You can use user libraries.
A-1 Specifications
group errors
Enabling axes Motion of an axes group is enabled.
groups
Axes groups Disabling axes Motion of an axes group is disabled.
groups
Auxil-
Stopping axes All axes in interpolated motion are decelerated to a stop.
iary groups
func-
Immediately All axes in interpolated motion are stopped immediately.
tions for
multi-
stopping axes A
axes groups
coordi- Setting axes The blended target velocity is changed during interpolated motion.
nated group override
A-1 Specifications
Packet monitoring master can be saved. The data that is saved can be viewed with WireShark or other
applications. (*)
Enable/disable settings The slaves can be enabled or disabled as communications targets.
for slaves
Disconnecting/reconnect- Temporarily disconnects a slave from the EtherCAT network for maintenance, such
ing slaves as for replacement of the slave, and then connects the slave again.
Commu- Support SDO messages of the CAN application can be sent to slaves via EtherCAT
nica- applica-
tions CoE
tion pro-
tocol A
--- Host link ---
(FINS), no-
A-1 Specifications
Verification of operation Online operations can be restricted by operation rights to prevent damage to equip-
authority ment or injuries that may be caused by operating mistakes.
Number of 5
groups (*)
Verification of user pro- The user program cannot be executed without entering a user program execution
gram execution ID ID from the Sysmac Studio for the specific hardware (CPU Unit).
Storage type SD card or SDHC card
Automatic transfer from When the power supply to the Controller is turned ON, the data that is stored in the
SD Memory Card (*) autoload directory of the SD Memory Card is transferred to the Controller. A
SD Program transfer from SD With the specification of the system-defined variable, you can transfer a program
Mem-
Memory Card (*) that is stored in the SD Memory Card to the Controller.
ory
*5 This is the total of 512 events for the CPU Unit and 256 events for the NX Unit.
*6 This is the total of 512 events for the CPU Unit and 64 events for the NX Unit.
*7 This is the total of 512 events for the CPU Unit and 64 events for the NX Unit.
*8 This is the total of 512 events for the CPU Unit and 16 events for the NX Unit.
Note Items that are marked with asterisks in the table were added for version upgrades. Refer to A-15 Version Information for
NX-series Controllers and A-16 Version Information for NJ-series Controllers for information on version upgrades.
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 pro-
cessing 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-113.
Priority-17
Primary Priority-5 Priority-16 and
Processing Processing contents periodic periodic periodic priority-18
task task task periodic
tasks
I/O refresh processing I/O is refreshed for Eth- Performed. Performed. Not per- Not per-
erCAT slaves. formed. formed.
User program execu- Programs assigned to Performed. Performed. Performed. Performed.
tion tasks are executed in
the order that they are
assigned.
Motion control process- • Motion control com- Performed. Performed. Not per- Not per-
ing mands from the user formed. formed.
program are exe-
cuted.
• Motion output pro-
cessing
Com- System • Variable refresh pro- Performed. Performed. Performed. Performed.
mon pro- common cessing (if there are
cessing processing accessing tasks) is
time 1 performed.
• Motion input process-
ing
• Data trace process-
ing
System • Variable refresh pro- Performed. Performed. Performed. Performed.
common cessing (if there are
processing refreshing tasks) is
2 performed.
• Variable access pro-
cessing external to
the Controller to
ensure concurrency
with task execution
System Other system common Performed. Performed. Performed. Performed.
overhead processing
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.
The following describes how to determine the EtherCAT slave processing time for each type of tasks.
A
Additional Information
EtherCAT slave processing time [µs] = 0.0006 × pDout + 0.0001 × pDin + 0.082 × pDinout
+ (1.24 × Snum + 0.01 × Clen) + 25.58
pDout : Total output processing data size [byte] of EtherCAT slaves assigned to the primary
periodic task or the priority-16 periodic task
pDin : Total input processing data size [byte] of EtherCAT slaves assigned to the primary
periodic task or the priority-16 periodic task
pDinout : Total of the larger of the input and output processing data size of each EtherCAT
slave assigned to the primary periodic task or the priority-16 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]
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 of PDO communications cycle 2 [µs] displayed on the Sys-
mac 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 periodic 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 assigned to the primary periodic task [byte]
*1 The value of sTsend (transmission delay time) cannot be calculated on paper. Assign the value of 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-E1-14 or later) for how to display
the PDO Communications Cycle 2: Transmission Delay Time on the Sysmac Studio.
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 A
• Execution time for trigonometric instructions for LREAL data
This will allow you to estimate the execution time of the user program.
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
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
group [%]
Ladder diagram instructions LD, AND, OUT, SET, and RESET 81.0% 40.2%
Comparison instructions EQ and LT 4.1% 8.3%
Timer and counter instructions Timer, TON/TOF, and CTU/CTD 1.6% 7.3%
Math instructions +, -, *, /, ADD, SUB, MUL, and DIV 2.4% 6.5%
BCD conversion instructions and INT_TO_DINT and WORD_BC- 0.2% 1.2%
data conversion instructions D_TO_UINT
Percent of
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
group [%]
Bit string processing instructions AND and OR 6.2% 13.0%
Data movement instructions MOVE 4.6% 23.5%
Total 100.0% 100.0%
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
900
800
Execution time (µs)
700
600
500
400
300
NX701-
100
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
NX701-
300
250
Processing time (µs)
200
150
100
50
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
cessing 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
GX-OD1611 (Ver. 1.1) Output Slave: 1
R88D-1SN-ECT Servo Drives: 4
EtherCAT Slave Terminal: 1
NX-ECC203 EtherCAT Coupler Unit: 1
Slaves/Units that are used EtherCAT slaves NX-ID5342 DC Input Unit: 1
NX-OD5121 Transistor Output Unit: 1
NX-AD3608 Analog Input Unit: 1
NX-DA2605 Analog Output Unit: 1
NX-CIF101 and NX-CIF105 Communications Inter-
face Units: 1 per Unit
Language Ladder diagrams
Standard instruction Number of instructions: 5,000
configuration
Arithmetic Number of instructions: 200
User program instructions for
LREAL data
Trigonometric Number of instructions: 100
instructions 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].
NX-DA2605 4 0
NX-CIF101 28 30
NX-CIF105 28 30
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]
From these values, the I/O refresh time is calculated by the following formula.
I/O refresh processing time
= 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 fol-
lowing formula.
User program execution time = 12 + 4 + 9
= 25 [µs]
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
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, as the value
larger than 1.1 times the average time, the task period is set to 125 µs.
The task execution times in the physical Controller depends 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. For details, refer to 5-11 Task Design Methods and I/O Response Times.
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 pro-
cessing 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-113.
Priority-17
Primary and
Processing Processing contents periodic priority-18
task periodic
tasks
I/O refresh processing I/O is refreshed for NX Units on the CPU Unit and Eth- Performed. Not per-
erCAT slaves. formed.
User program execution Programs assigned to tasks are executed in the order Performed. Performed.
that they are assigned.
Motion control process- • Motion control commands from the user program Performed. Not per-
ing are executed. formed.
• Motion output processing
Guidelines are provided below for calculating the various processing times.
A
I/O Refresh Processing Time
I/O refresh processing time = EtherCAT slave processing time + NX Unit processing time
The following describes how to determine EtherCAT slave processing time, 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 × 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 assigned 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.149 × Dnxout + 0.064 × Dnxin + 0.549 × Dnxnum + 97.48
Additional Information
The NX Unit processing time is 0 if NX Units are not connected to the CPU Unit.
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.
450
400
Execution time (µs)
350
300
250
200
150
0 1500 3000 4500 6000 7500 9000 10500 12000 13500 15000
Total number of instructions
900
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
900
800
Execution time (µs)
700
600
500
400
300
NX102-
200
100
900
800
Execution time (µs)
700
NX102-
600
500
400
NX102-
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
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
(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
EtherCAT slave processing data size the input and output
ing data size in bytes
in bytes data size
GX-ID1611 (Ver. 1.1) 0 3 3
GX-OD1611 (Ver. 1.1) 2 1 2
R88D-1SN-ECT 23 26 26
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]
NX Units Dnxout: Output data size in bytes Dnxin: Input data size in bytes
NX-PF0630 0 0
NX-ID5342 0 2
NX-OD3153 2 0
NX-AD4608 0 16
NX-DA3605 8 0
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 fol-
lowing 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
= 837 [µs]
The task execution times in the physical Controller depends 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. A
Use the physical Controller and verify the task execution time with the Task Execution Time Monitor.
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
You must use the physical Controller to check the real processing times of tasks and task execution
times. For details, refer to 5-11 Task Design Methods and I/O Response Times.
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 pro-
cessing 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-113.
Priority-17
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 EtherCAT slave processing time, 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 × 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 assigned 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
Additional Information
The NX Unit processing time is 0 if NX Units are not connected to the CPU Unit.
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 A
• Execution time for trigonometric instructions for LREAL data
This will allow you to estimate the execution time of the user program.
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
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
group [%]
Ladder diagram instructions LD, AND, OUT, SET, and RESET 81.0% 40.2%
Comparison instructions EQ and LT 4.1% 8.3%
Timer and counter instructions Timer, TON/TOF, and CTU/CTD 1.6% 7.3%
Math instructions +, -, *, /, ADD, SUB, MUL, and DIV 2.4% 6.5%
BCD conversion instructions and INT_TO_DINT and WORD_BC- 0.2% 1.2%
data conversion instructions D_TO_UINT
Percent of
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
group [%]
Bit string processing instructions AND and OR 6.2% 13.0%
Data movement instructions MOVE 4.6% 23.5%
Total 100.0% 100.0%
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
900
800
Execution time (µs)
700
600
500
400
300
NX1P2-
100
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
0
0 1 2 3 4 5 6 7 8
Number of axes
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
Standard instruction Number of instructions: 5,000
configuration
Arithmetic Number of instructions: 200
User program instructions for
LREAL data
Trigonometric Number of instructions: 100
instructions 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]
NX Units Dnxout: Output data size in bytes Dnxin: Input data size in bytes
NX-PF0630 0 0
NX-ID5342 0 2
NX-OD3153 2 0
NX-AD4608 0 16
NX-DA3605 8 0
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.248 × Dnxout + 0.241 × Dnxin + 0.549 × Dnxnum + 125.36
= 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.44 + 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 fol-
lowing formula.
User program execution time = 189 + 41 + 51
= 281 [µs]
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]
A
Setting the Task Period
The task period is set based on the average real processing time of the task that is calculated as above.
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
The task is the primary periodic task.
The value of the task period must be larger than the average real processing time of the task that you
calculated. More specifically, you should allow sufficient margin and set the task period value to at least
1.1 times as large as the average real processing time of the task.
Because the average real processing time of the task that is calculated above is 870 µs, as the value
larger than 1.1 times the average time, the task period is set to 2000 µs.
The task execution times in the physical Controller depends 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.
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 pro-
cessing 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-113.
Priority-17
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
time, and CJ-series Unit processing time used in the above formula.
EtherCAT slave processing time [µs] = Tout × Dout + Tin × Din + Tref × Dinout
+ (1.24 × Snum + 0.01 × Clen - Tec)
The values of the output processing time, input processing time, refresh processing time, and Ether-
CAT 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.
Tec: EtherCAT
Tout: Output Tin: Input pro- Tref: Refresh pro-
communications
CPU Unit processing time cessing time per cessing time per byte
adjustment time
per byte [µs] byte [µs] [µs]
[µs]
NJ501- 0.004 0.011 0.082 55*1
NJ301- 0.005 0.013 0.082 90
NJ101- 0.010 0.004 0.082 145
*1 The value is 70 for a CPU Unit with unit version 1.01 or earlier.
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 pro-
cessing time is regarded as 0 µs.
Simple Estimate
For the number of instructions in each group, read the execution time for each group from the follow-
ing 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.
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
Percent of exe-
Percent of
cution time in
Types of instructions Instructions instruc-
instruction
tions [%]
group [%]
Ladder diagram instructions LD, AND, OUT, SET, and RESET 81.0% 40.2%
Comparison instructions EQ and LT 4.1% 8.3%
Timer and counter instructions Timer, TON/TOF, and CTU/CTD 1.6% 7.3%
Math instructions +, -, *, /, ADD, SUB, MUL, and DIV 2.4% 6.5%
BCD conversion instructions and INT_TO_DINT and WORD_BC- 0.2% 1.2%
data conversion instructions D_TO_UINT
Bit string processing instructions AND and OR 6.2% 13.0%
Data movement instructions MOVE 4.6% 23.5%
Total 100.0% 100.0%
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
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
1600
NJ301-
Execution time (ms)
1400
1200
NJ101-
1000
NJ101- *1
800
NJ301- *1
600
400
NJ501- *1
200
Percent of exe-
Percent of
cution time in
Types of instructions Instructions instruc-
instruction
tions [%]
group [%]
ST constructs IF ELSIF END_IF 75.4% 41.6%
Comparison instructions EQ and LT 5.2% 8.7%
Timer and counter instructions Timer, TON/TOF, and CTU/CTD 2.1% 18.8%
Math instructions +, -, *, and / 3.1% 10.2%
BCD conversion instructions and INT_TO_DINT and WORD_BC- 0.2% 1.6%
data conversion instructions D_TO_UINT
Bit string processing instructions AND and OR 8.0% 11.7%
Data movement instructions := 5.9% 7.3%
Total 100.0% 100.0%
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
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
500 100
Unit version 1.01 Unit version 1.01
or earlier
Processing time (µs)
*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
*2 It is the case when the hardware revision for the Unit is A or B. The other cases are for the Units that hardware
revisions are in blank.
Note You cannot use the motion control functions with an NJ101-90 CPU Unit.
*1 The processing time is 265 µs for a CPU Unit with unit version 1.01 or earlier.
*2 The processing time is 360 µs for a CPU Unit with unit version 1.01 or earlier.
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
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
Slaves/Units that are EtherCAT slaves • GX-ID1611 (Ver. 1.1) Input Slave: 1
used • GX-OD1611 (Ver. 1.1) Output Slave: 1
• R88D-1SN-ECT Servo Drives: 4
CJ-series Units (on CPU • CJ1W-ID211 DC Input Unit: 1
Rack) • CJ1W-OD211 Transistor Output Unit: 1
• CJ1W-AD042 Analog Input Unit: 1
• CJ1W-DA021 Analog Output Unit: 1
• CJ1W-SCU42 Serial Communications Unit: 1
(Protocol macros are not used.)
User program Language Ladder diagrams
Standard instruction con- Number of instructions: 5,000
figuration
Arithmetic instructions for Number of instructions: 200
LREAL data
Trigonometric instructions Number of instructions: 100
for LREAL data
Motion control pro- Number of axes 4
cessing
Note Total length of cables connected to the built-in EtherCAT port is 10 [m].
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, and 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]
*1. 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, the CJ-series Unit processing time is regarded as 0 µs.
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.
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) A
= 65 + 11
= 76 [µs]
A-5-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
User Program Execution Time
The graphs show the following values.
• Standard instruction configuration
From the graph of the execution time for standard ladder diagram instructions, the user program
execution time of 5,000 instructions for the NJ501- is 100 µs.
• Arithmetic instructions for LREAL data
From the graph of the execution time for ladder diagram arithmetic and trigonometric instructions
for LREAL data, the user program execution time of 200 instructions for the NJ501- is
20 µs.
• Trigonometric instructions for LREAL data
From the graph of the execution time for ladder diagram arithmetic and trigonometric instructions
for LREAL data, the user program execution time of 100 instructions for the NJ501- is
27 µs.
Therefore, the user program execution time is the total of the above values, which is given by the fol-
lowing 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 execu-
tion time + Motion control processing time + Com-
mon processing time
= 76 + 147 + 46 + 150
= 419 [µs]
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 described. The data The range of The page of
defined variable ing of the vari- type of the values that the the individual
name. The prefix able. variable is variable can system-
gives the category given. take is given. defined vari-
name. able specifi-
cations table
is given.
A version in parentheses in the Variable name column is the unit version of the CPU Unit when the sys-
tem-defined variable was added.
Range of
Variable name Meaning Function Data type Reference
values
_CurrentTime System Time Contains the CPU Unit’s internal clock DATE_ • NX-series page A-126
data. AND_ CPU Units
TIME DT#1970-01-
01-00:00:00 to
DT#2069-12-
31-23:59:59
• NJ-series
CPU Units
DT#1970-01-
01-00:00:00 to
DT#2106-02-
06-23:59:59
Range of
Variable name Meaning Function Data type Reference
values
_TaskName_ Task Active Flag TRUE during task execution. BOOL TRUE or page A-126
Active FALSE when task execution is not in prog- FALSE
ress.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
_TaskName_ Last Task Contains the task execution time the last TIME Depends on page A-126
LastExecTime Execution Time time the task was executed (unit: 0.1 µs). data type.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
_TaskName_ Maximum Task Exe- Contains the maximum value of the task TIME Depends on page A-127
MaxExecTime cution Time execution time (unit: 0.1 µs). data type.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
_TaskName_ Minimum Task Execu- Contains the minimum value of the task TIME Depends on page A-127
MinExecTime tion Time execution time (unit: 0.1 µs). data type.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
_TaskName_ Task Execution Count Contains the number of executions of the UDINT Depends on page A-127
ExecCount task. data type.
If 4294967295 is exceeded, the value
returns to 0 and counting is continued.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
Range of
Variable name Meaning Function Data type Reference
values
_TaskName_ Task Period TRUE if the task period was exceeded. BOOL TRUE or page A-127
Exceeded Exceeded Flag FALSE if task execution was completed FALSE
within the task period.
Note You cannot use this system-defined
variable in the user program. It is
used only to access task status for
data tracing from the Sysmac Stu-
dio.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
_ErrSta Controller Error TRUE if there is a Controller error. WORD 16#0000 to page A-128
Status FALSE if there is no Controller error. 16#C0F0
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
variable in the user program. Use it in
CIP message communications when
sending a command from an HMI or
host computer.
CancelVefy Cancel Verify Change this variable to TRUE to cancel com- BOOL TRUE or page A-131
Flag paring the Controller data to a backup file in FALSE
the SD Memory Card.
Password Password Use this variable to specify the password that STRING(33) Depends on page A-134
is used for verification when you start transfer- data type.
ring the programs.
The password is initialized every time you
start transferring programs from the SD Mem-
ory Card.
TargetUserPro- User Program Change this variable to TRUE to set a user BOOL TRUE or page A-134
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
with the Retain target.
Attribute Trans-
fer Flag
_Card1PrgTransfer- SD Memory Card _sPRG- page A-135
Sta (Ver.1.11) Program Trans- TRANS-
fer Status FER_STA
Done Done Flag TRUE when a program transfer is completed. BOOL TRUE or page A-135
FALSE
Active Active Flag TRUE when a program transfer is in progress. BOOL TRUE or page A-135
FALSE
Err Error Flag TRUE when a program transfer ended in an BOOL TRUE or page A-135
error. FALSE
Active Active Flag TRUE when a restore operation is in prog- BOOL TRUE or page A-136
ress. FALSE
Err Error Flag TRUE when a restore operation ended in an BOOL TRUE or page A-136
error. FALSE
Range of
Variable name Meaning Function Data type Reference
values
_Card1RestoreCmd- User Program Change this variable to TRUE to set a user BOOL TRUE or page A-137
TargetUserProgram and Settings program or setting for the restore by the sys- FALSE
(Ver.1.14) Transfer Flag tem-defined variable as the transfer target.
Always set this variable to TRURE for the
restore by the system-defined variable.
_Card1RestoreCmd- IP Address Change this variable to TRUE to include the BOOL TRUE or page A-137
TargetIPAdr Transfer Flag IP address of the built-in EtherNet/IP port for FALSE
(Ver.1.14) the restore by the system-defined variable as
the transfer target.
The IP address means setting type, IP
address, subnet mask, and default gateway.
_Card1RestoreCmd- Present Values of Change this variable to TRUE to set the pres- BOOL TRUE or page A-137
TargetVariable Variables with the ent values of variables with the Retain attri- FALSE
(Ver.1.14) Retain Attribute bute for the restore by the system-defined
Transfer Flag variable as the transfer target.
_Card1RestoreCmd- Present Values of Change this variable to TRUE to set the pres- BOOL TRUE or page A-137
TargetMemory Memory Used for ent values of the memory used for CJ-series FALSE
(Ver.1.14) CJ-series Units Units with the Retain attribute for the restore
with the Retain by the system-defined variable as the transfer
Attribute Trans- target.
fer Flag
_Card1RestoreCmd- Unit and Slave Change this variable to TRUE to set the Unit BOOL TRUE or page A-138
TargetUnitConfig Parameters and slave settings for the restore by the sys- FALSE
(Ver.1.14) Transfer Flag tem-defined variable as the transfer target.
_Card1RestoreCmd- Absolute Change this variable to TRUE to set the abso- BOOL TRUE or page A-138
TargetAbsEncoder Encoder Home lute encoder home offset for the restore by the FALSE
(Ver.1.14) Offset Transfer system-defined variable as the transfer target.
Flag
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
To reset this value, overwrite the current value
with 0.
The value is not updated after it reaches
4294967295.
This variable is not initialized at startup.
_RetainFail Retention TRUE at the following time (failure of retention BOOL TRUE or page A-139
Failure Flag during power interruptions). FALSE
• When an error is detected in the battery-
backup memory check at startup.
FALSE at the following times (no failure of
retention during power interruptions).
• When no error is detected in the battery-
backup memory check at startup.
• When the user program is downloaded.
• When the Clear All Memory operation is
performed.
Range of
Variable name Meaning Function Data type Reference
values
_UnitVersion Unit Version Contains the unit version of the CPU Unit. ARRAY[0..1] 0 to 99 page A-141
(Ver.1.08) The integer part of the unit version is OF USINT
stored in element number 0.
The fractional part of the unit version is
stored in element number 1.
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
_SelfTest_HighTem- CPU Unit High Tem- TRUE when the internal temperature of BOOL TRUE or page A-142
perature perature Flag the CPU Unit is too high. FALSE
(Ver.1.10)
Note Always FALSE for the NX102 CPU
Unit and NX1P2 CPU Unit.
_SelfTest_LowBattery Low Battery Flag TRUE when the battery is disconnected or BOOL TRUE or page A-142
(Ver.1.10) the battery voltage is dropped. FALSE
_SelfTest_LowFan- Low FAN Revolution TRUE when the fan is disconnected or the BOOL TRUE or page A-142
Revolution Flag rotation speed of a fan is decreased. FALSE
(Ver.1.10)
Note Always FALSE for the NX102 CPU
Unit, NX1P2 CPU Unit, and NJ-series
CPU Unit.
Range of
Variable name Meaning Function Data type Reference
values
_DeviceOutHoldCfg Device Output Hold It is 16#A5A5 if you retain the target BOOL 16#0000 to page A-142
(Ver.1.13) Configuration device output when the operating mode is 16#FFFF
changed or when downloaded.
In the case other than 16#A5A5, the tar-
get device output is initialized when the
operating mode is changed or when
downloaded.
_DeviceOutHoldSta- Device Output Hold It is TRUE if the target device output is BOOL TRUE or page A-142
tus Status retained when the operating mode is FALSE
(Ver.1.13) changed or when downloaded.
When the device output hold configuration
is other than 16#A5A5, or when a major
fault level Controller error occurs, the tar-
get device output is initialized and
changes to FALSE.
_PLC_OptBoardSta Option Board Contains the status of Option Boards. This ARRAY[0..2 page A-144
(Ver.1.13) Status variable is commonly used regardless of the ] OF
models of Option Boards. _sOPT-
The array element 1 corresponds to the BOARD_S
option board slot 1 and array element 2 corre- TA
sponds to the option board slot 2.
Error Transmission Indicates whether a transmission error BOOL TRUE or page A-146
Error occurred. FALSE
TRUE: A parity error, framing error, or an
overrun error occurred.
FALSE: FALSE due to one of the following
causes.
• A parity error, framing error, or an overrun
error not occurred.
• A port is restarted.
• The Serial communications mode is not set
to Host Link (FINS).
• The Option Board that is mounted is not a
Serial Communications Option Board.
• The Option Board is not mounted.
ParityErr Parity Error Indicates whether a parity error occurred. If BOOL TRUE or page A-146
this error occurs, it means that the serial com- FALSE
munications settings may not apply to the
remote device to connect.
TRUE: A parity error occurred.
FALSE: FALSE due to one of the following
causes.
OverRun Overrun Error Indicates whether an overrun error occurred. BOOL TRUE or page A-147
If this error occurs, it means that the baud rate FALSE
of an Option Board may be too large.
TRUE: An overrun error occurred.
FALSE: FALSE due to one of the following
causes.
• An overrun error not occurred.
• A port was restarted.
• The Serial communications mode is not set
to Host Link (FINS).
• The Option Board that is mounted is not a
Serial Communications Option Board.
• The Option Board is not mounted.
Range of
Variable name Meaning Function Data type Reference
values
_CJB_IOUnitInfo Basic I/O Unit Shows the status of the Basic I/O Unit alarm ARRAY TRUE or page A-151
Information output (load short-circuit protection). [0..3, 0..9, FALSE
TRUE: Load short-circuit 0..7] OF
BOOL
FALSE: No load short-circuit
Range of
Variable name Meaning Function Data type Reference
values
_NXB_UnitRegTbl NX Unit Registra- Indicates whether the NX Units on the CPU ARRAY TRUE or page A-155
(Ver.1.13) tion Status Unit are registered in the Unit configuration. [0..32] OF FALSE
This status is given as an array of BOOL data. BOOL*2
The subscript of the array corresponds to the
NX Unit number. A subscript of 0 indicates the
NX Bus Function Module.
TRUE: Registered.
FALSE: Not registered.
If the Unit configuration information is not reg-
istered by the Sysmac Studio, the status is
FALSE for all Units. The status is TRUE for
NX Units that are set as unmounted Units.
Range of
Variable name Meaning Function Data type Reference
values
_NXB_ErrSta NX Bus Function Gives the NX Bus Function Module error WORD 16#0000 to page A-155
(Ver.1.13) Module Error Status status. 16#40F2
This system-defined variable provides the
collective status of the NX Bus Function
Module Master Error Status and NX Bus
Function Module Unit Error Status for all
NX Units.
Range of
Variable name Meaning Function Data type Reference
values
_NXB_UnitErrStaTbl NX Bus Function Gives the status of errors that are ARRAY 16#0000 to page A-156
(Ver.1.13) Module Unit Error detected in the NX Unit on the CPU Unit. [0..32] OF 16#40F2
Status This status is given as an array of BOOL WORD *1*2
data. The subscript of the array corre-
sponds to the NX Unit number.
Range of
Variable name Meaning Function Data type Reference
values
_MC_ErrSta Motion Control Func- Shows the status of errors that are WORD 16#0000 to page A-157
tion Module Error Sta- detected in the Motion Control Function 16#40F0
tus Module.
You can use this variable directly in the
user program.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_MC_ComErrSta Common Error Status Shows the status of errors that are WORD 16#0000 to page A-157
detected in common processing for 16#00F0
motion control.
You can use this variable directly in the
user program.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_MC_AX_ErrSta Axis Error Shows the error status for each axis. The ARRAY 16#0000 to page A-157
Status status of up to 256 axes*1 is shown. [0..255] OF 16#00F0
You can use this variable directly in the WORD*1
user program. Refer to information on the
meanings of the error status bits at the
end of this appendix for details.
_MC_GRP_ErrSta Axes Group Error Sta- Shows the error status for each axes ARRAY 16#0000 to page A-157
tus group. The error status for up to 64 axes [0..63] OF 16#00F0
groups*2 is shown. WORD*2
You can use this variable directly in the
user program. Refer to information on the
meanings of the error status bits at the
end of this appendix for details.
_MC_COM Common Shows the status that is common to the _sCOM- --- page A-158
Variable Motion Control Function Module. MON_REF
Refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No.
W508) for details on structure members.
_MC_GRP Axes Group Variables NX701 CPU Units: Used to specify axes ARRAY[0..63] --- page A-158
groups and shows multi-axes coordinated OF
control status, and multi-axes coordi- _sGROUP_R
nated control settings for motion control EF*3
instructions used for motion control 1.
NX102 CPU Units, NX1P2 CPU Units,
and NJ-series CPU Units: Used to specify
axes groups and shows multi-axes coordi-
nated control status, and multi-axes coor-
dinated control settings for motion control
instructions.
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 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_GRP Axes Group Variables Used to specify axes groups and shows ARRAY[0..63] --- page A-158
multi-axes coordinated control status, and OF
multi-axes coordinated control settings for _sGROUP_R
motion control instructions used for EF
motion control 1.
When you create an axes group on the
System Studio, a user-defined axes group
variable with a different name is created.
Range of
Variable name Meaning Function Data type Reference
values
_MC1_AX Axis Variables Used to specify axes and shows single- ARRAY[0..25 --- page A-159
axis control status, and single-axis control 5] OF _sAX-
settings for motion control instructions IS_REF
used for motion control 1.
When you create an axis on the System Stu-
dio, a user-defined axis variable with a differ-
ent 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
_EC_ErrSta Built-in This system-defined variable provides the WORD 16#0000 to page A-161
EtherCAT Error collective status of errors in the EtherCAT 16#40F0
Range of
Variable name Meaning Function Data type Reference
values
_EC_PDSendErr Process Data Trans- TRUE if there is a process data transmis- BOOL TRUE or page A-163
mission Error sion error (cannot send within the process FALSE
data communications cycle or transmis-
sion jitter is over the limit).
_EC_SlavAdrDupErr Slave Node Address TRUE if the same node address is set for BOOL TRUE or page A-163
Duplicated Error more than one slave. FALSE
_EC_SlavInitErr Slave TRUE if there is an error in an initialization BOOL TRUE or page A-164
Initialization Error command addressed to a slave. FALSE
_EC_SlavAppErr Slave TRUE if there is an error in the slave’s BOOL TRUE or page A-164
Application Error application status register. FALSE
_EC_MsgErr EtherCAT TRUE when a message is sent to a slave BOOL TRUE or page A-164
Message Error that does not support messages or when FALSE
there is an error in the format of the
response to a message that was sent to a
slave.
_EC_SlavEmergErr Emergency Message TRUE if the master detects an emergency BOOL TRUE or page A-164
Detected message that was sent by a slave. FALSE
_EC_IndataInvalidErr Input Process Data TRUE if the Input Data Invalid state con- BOOL TRUE or page A-164
(Ver.1.13) Invalid Error tinued for the following period because the FALSE
EtherCAT master could not perform pro-
cess data communications normally when
it was in the Operational state.
• When the task period is 10 ms or
shorter: 100 ms
• When the task period is longer than 10
ms: 10 periods o the task
_EC_CommErrTbl Communications Slaves are given in the table in the order ARRAY TRUE or page A-165
Error Slave Table of slave node addresses. The correspond- [1..512] OF FALSE
ing slave element is TRUE if the master BOOL*2
detected an error for the slave.
_EC_CycleExceeded EtherCAT Communi- TRUE if the CPU Unit cannot establish BOOL TRUE or page A-165
cations Cycle communications within the set communi- FALSE
Exceeded cations period at startup.
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 trouble-
shooting functions of the Sysmac Studio or the ResetECError instruction.
Range of
Variable name Meaning Function Data type Reference
values
_EC_RegSlavTbl Registered Slave This table indicates the slaves that are ARRAY TRUE or page A-165
Table registered in the network configuration [1..512] OF FALSE
information. Slaves are given in the table BOOL*1
in the order of slave node addresses. The
element for a slave is TRUE if the corre-
sponding slave is registered.
_EC_EntrySlavTbl Network This table indicates which slaves are con- ARRAY TRUE or page A-165
Connected Slave nected to the network. Slaves are given in [1..512] OF FALSE
Table the table in the order of slave node BOOL*1
addresses. The element for a slave is
TRUE if the corresponding slave has
entered the network.
_EC_MBXSlavTbl Message Communi- This table indicates the slaves that can ARRAY TRUE or page A-166
cations Enabled perform message communications. [1..512] OF FALSE
Slave Table Slaves are given in the table in the order BOOL*1
of slave node addresses.
The element for a slave is TRUE if mes-
sage communications are enabled for it
(pre-operational, safe-operation, or opera-
tional state).
Range of
Variable name Meaning Function Data type Reference
values
_EC_InData1Invalid Input Data1 Invalid TRUE when process data communica- BOOL TRUE or page A-168
tions performed in the primary periodic FALSE
task are not normal and the input data is
not valid.
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
_EIP_ErrSta Built-in This is the error status variable for the WORD 16#0000 to page A-170
EtherNet/IP Error built-in EtherNet/IP port. 16#00F0
NX-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP1_PortErr (Communications Port1
Error)
• _EIP2_PortErr (Communications Port2
Error)
• _EIP1_CipErr (CIP Communications1
Error)
• _EIP2_CipErr (CIP Communications2
Error)
• _EIP_TcpAppErr (TCP Application Commu-
nications Error)
NJ-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP_PortErr (Communications Port
Error)
• _EIP_CipErr (CIP Communications
Error)
• _EIP_TcpAppErr (TCP Application Com-
munications Error)
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-170
Error communications port. 16#00F0
NX-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP1_MacAdrErr (Port1 MAC Address
Error)
• _EIP1_LanHwErr (Port1 Communications
Controller Error)
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-170
Port1 Error communications port. 16#00F0
It represents the collective status of the
following error flags.
• _EIP1_MacAdrErr (Port1 MAC Address
Error)
• _EIP1_LanHwErr (Port1 Communications
Controller Error)
• _EIP1_EtnCfgErr (Port1 Basic Ethernet Set-
ting Error)
• _EIP1_IPAdrCfgErr (Port1 IP Address Set-
ting Error)
• _EIP1_IPAdrDupErr (Port1 IP Address
Duplication Error)
• _EIP1_BootpErr (Port1 BOOTP Server
Error)
• _EIP_DNSCfgErr (DNS Setting Error)
• _EIP_DNSSrvErr (DNS Server Connection
Error)
• _EIP_IPRTblErr (IP Route Table Error)
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-172
Error communications. 16#00F0
NX-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP1_IdentityErr (CIP Communications1
Identity Error)
• _EIP1_TDLinkCfgErr (CIP Communica-
tions1 Tag Data Link Setting Error)
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_CipErr CIP Communica- This is the error status variable for CIP WORD 16#0000 to page A-173
tions2 Error communications 2. 16#00F0
It represents the collective status of the
following error flags.
• _EIP2_IdentityErr (CIP Communications2
Identity Error)
• _EIP2_TDLinkCfgErr (CIP Communica-
tions2 Tag Data Link Setting Error)
• _EIP2_TDLinkOpnErr (CIP Communica-
tions2 Tag Data Link Connection Failed)
• _EIP2_TDLinkErr (CIP Communications2
Tag Data Link Communications Error)
• _EIP2_TagAdrErr (CIP Communications2
Tag Name Resolution Error)
• _EIP2_MultiSwONErr (CIP Communica-
tions2 Multiple Switches ON Error)
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_MacAdrErr Port2 MAC Address Indicates that an error occurred when the BOOL TRUE or page A-174
Error MAC address was read on the communi- FALSE
cations port 2 at startup.
TRUE: Error
FALSE: Normal
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_EtnCfgErr Port2 Basic Ethernet Indicates that the Ethernet communica- BOOL TRUE or page A-175
Setting Error tions speed setting (Speed/Duplex) for the FALSE
communications port 2 is incorrect. Or, a
read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
Range of
Variable name Meaning Function Data type Reference
values
_EIP_IPAdrDupErr IP Address Duplica- NX-series CPU Units: Indicates that the BOOL TRUE or page A-177
tion Error same IP address is assigned to more than FALSE
one node for the communications port 1.
TRUE: Duplication occurred.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that the
same IP address is assigned to more than
one node.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_BootpErr Port2 BOOTP Server Indicates that a BOOTP server connection BOOL TRUE or page A-178
Error failure occurred on the communications FALSE
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.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TDLinkCfgErr Tag Data Link Setting NX-series CPU Units: Indicates that the BOOL TRUE or page A-179
Error tag data link settings for CIP communica- FALSE
tions 1 are incorrect. Or, a read operation
failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
NJ-series CPU Units: Indicates that the
tag data link settings are incorrect. Or, a
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TDLinkOpnErr CIP Communica- Indicates that establishing a tag data link BOOL TRUE or page A-181
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 remote node.
FALSE: Other than the above.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TagAdrErr Tag Name Resolution NX-series CPU Units: Indicates that tag BOOL TRUE or page A-182
Error resolution for CIP communications 1 failed FALSE
(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 follow-
ing causes are possible.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TagAdrErr CIP Communica- Indicates that tag resolution for CIP com- BOOL TRUE or page A-183
tions2 Tag Name munications 2 failed (i.e., the address FALSE
Resolution Error 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 follow-
ing causes are possible.
• The size of the network vari-
able 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 direc-
tion of the variable in the CPU
Unit.
• There is no network variable
in the CPU Unit that corre-
sponds to the tag setting.
FALSE: Other than the above.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_NTPSrvErr NTP Server Connec- TRUE: The NTP client failed to connect to BOOL TRUE or page A-184
tion Error the server (timeout). FALSE
FALSE: NTP is not set or the connection
was successful.
_EIP_DNSSrvErr DNS Server Connec- TRUE: The DNS client failed to connect to BOOL TRUE or page A-184
tion Error the server (timeout). FALSE
FALSE: DNS is not enabled. Or, DNS is
enabled and the connection was
Note 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 same values of
_EIP1_PortErr (Communications Port1 Error) and _EIP_PortErr (Communcations Port Error).
Note You can use the system-defined variables whose variable names with _EIP2 only for the NX701 CPU Units
and NX102 CPU Units.
Range of
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TDLinkRunSta Tag Data Link Com- NX-series CPU Units: Indicates that at BOOL TRUE or page A-185
munications Status least one connection is in normal opera- FALSE
tion in CIP communications 1.
TRUE: Normal operation
FALSE: Other than the above.
NJ-series CPU Units: Indicates that at
least one connection is in normal opera-
tion.
TRUE: Normal operation
FALSE: Other than the above.
_EIP1_TDLinkRunSta CIP Communica- Indicates that at least one connection is in BOOL TRUE or page A-185
tions1 Tag Data Link normal operation in CIP communications FALSE
Communications Sta- 1.
tus TRUE: Normal operation
FALSE: Other than the above.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_RegTargetSta Registered Target NX-series CPU Units: Gives a list of ARRAY TRUE or page A-187
[255] Node Information nodes for which built-in EtherNet/IP con- [0..255] OF FALSE
nections are registered for CIP communi- BOOL
cations 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 tar-
Range of
Variable name Meaning Function Data type Reference
values
_EIP_EstbTargetSta Normal Target Node NX-series CPU Units: Gives a list of ARRAY TRUE or page A-188
[255] Information nodes that have normally established Eth- [0..255] OF FALSE
erNet/IP connections for CIP communica- BOOL
tions 1.
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 tar-
get node ID of x was not established, or
an error occurred.
NJ-series CPU Units: Gives a list of nodes
that have normally established Ether-
Net/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 tar-
get node ID of x was not established, or
an error occurred.
_EIP1_EstbTargetSta CIP Communica- Gives a list of nodes that have normally ARRAY TRUE or page A-188
[255] tions1 Normal Target established EtherNet/IP connections for [0..255] OF FALSE
Node Information CIP communications 1. BOOL
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 tar-
get node ID of x was not established, or
an error occurred.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TargetPLC- Target PLC Operat- NX-series CPU Units: Shows the operat- ARRAY TRUE or page A-189
ModeSta [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
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TargetPLC- CIP Communica- Shows the operating status of the target ARRAY TRUE or page A-189
ModeSta [255] tions2 Target PLC node Controllers that are connected for [0..255] OF FALSE
Operating Mode CIP communications 2, 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
Normal Target Node Information is
FALSE, the Target Node Controller Oper-
ating Information 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.
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_TargetPLCErr CIP Communica- Shows the error status (logical OR of fatal ARRAY TRUE or page A-190
[255] tions1 Target PLC and non-fatal errors) of the target node [0..255] OF FALSE
Error Information Controllers that are connected for CIP BOOL
communications 1, with the built-in Ether-
Net/IP ports as the originator. The array
elements are valid only when the corre-
sponding Normal Target Node Information
is TRUE. The immediately preceding
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TargetNodeErr Target Node Error NX-series CPU Units: Indicates that the ARRAY TRUE or page A-191
[255] Information connection for the Registered Target [0..255] OF FALSE
Node Information for CIP communications BOOL
1 was not established 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 estab-
lished with the target node for a target
node ID of x
(the Registered Target Node Informa-
tion 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 Tar-
get Node Information 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 Control-
ler (the Target PLC Error Information is
TRUE).
NJ-series CPU Units: Indicates that the
connection for the Registered Target
Node Information was not established or
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 estab-
lished with the target node for a target
node ID of x
(the Registered Target Node Informa-
tion 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 Tar-
get Node Information 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 Control-
ler (the Target PLC Error Information is
TRUE).
Range of
Variable name Meaning Function Data type Reference
values
_EIP1_Target- CIP Communica- Indicates that the connection for the Reg- ARRAY TRUE or page A-191
NodeErr [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 is
TRUE.
Range of
Variable name Meaning Function Data type Reference
values
_EIP_NTPResult NTP Operation Infor- Use the GetNTPStatus instruction to read _sNTP_ page A-192
mation the NTP operation information from the RESULT
user program. Direct access is not possi-
ble.
.ExecTime NTP Last Operation Gives the last time that NTP processing DATE_AND_ Depends on page A-192
Time ended normally. The time that was TIME data type.
obtained from the NTP server is stored
when the time is obtained normally. The
time is not stored if it is not obtained from
the NTP server normally.
Additional Information
Range of
Variable name Meaning Function Data type Reference
values
_EIP_TDLinkStart- Tag Data Link Com- NX-series CPU Units: Change this vari- BOOL TRUE or page A-193
Cmd munications Start able to TRUE to start tag data links for CIP FALSE
Switch communications 1.
It automatically changes back to FALSE
after tag data link operation starts.
NJ-series CPU Units: Change this vari-
able to TRUE to start tag data links.
It automatically changes back to FALSE
after tag data link operation starts.
Range of
Variable name Meaning Function Data type Reference
values
_EIP2_TDLinkStop- CIP Communica- Change this variable to TRUE to stop tag BOOL TRUE or page A-194
Cmd tions2 Tag Data Link data links for CIP communications 2. FALSE
Communications Stop It automatically changes back to FALSE
Switch after tag data link operation stops.
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WORD
Bit Meaning
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_U_ErrSta)
14 Collective slave error status: This bit indicates if a Controller error was detected for levels (e.g., a Unit, slave,
axis, or axes group) that are lower than the event source (i.e., for 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_ErrSta.)
8 to 13 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.
0 to 3 Reserved.
Variable name This is the system-defined variable name. The prefix Members (for The member names are given for
gives the category name. structures) structure 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 vari-
able can take is given.
R/W access R: Read only, Retained The Retain attri- Network Publish The Network Publish attribute of the
RW: Read/write bute of the vari- variable is given.
able is given.
Usage in user program Whether you Related instruc- The instructions that are related to the variable are given.
can use the vari- tions If you cannot use the variable directly in the user program, the instructions
able directly in that access the variable are given. A
the user pro-
gram is speci-
fied.
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- ActEventTask
tions You can access this variable from the user program only with the following
instruction.
• Task_IsActive
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type TIME Range of values Depends on data type.
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetMyTaskStatus
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type TIME Range of values Depends on data type.
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not supported. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetMyTaskStatus
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type TIME Range of values Depends on data type.
R/W access R Retained Not retained. Network Publish Not published. A
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
• GetMyTaskStatus
Note You cannot use these system-defined variables in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type UDINT Range of values Depends on data type.
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetMyTaskStatus
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetMyTaskStatus
Note You cannot use this system-defined variable in the user program. It is used only to access task status for
data tracing from the Sysmac Studio.
Data type UDINT Range of values Depends on data type.
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetMyTaskStatus
Note Do not use this variable in the user program. There may be a delay in updating it and concurrency prob-
lems in relation to the status of the function module. Use this variable only to access status through com-
munications from an external device. Refer to A-6-8 Meanings of Error Status Bits for the meanings of the
error status bits.
Data type WORD Range of values 16#0000 to 16#C0F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- • ResetPLCError
tions • ResetCJBError
• ResetECError
• ResetMCError
• MC_Reset
• MC_GroupReset
You can access this variable from the user program only with the following
instructions.
• GetPLCError
• GetCJBError
• GetECError
• GetMCError
• GetEIPError
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
tions
*1 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
when sending a command from an HMI or host computer.
Data type Structure: _sBKUP_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
when sending a command from an HMI or host computer.
Data type Structure: _sBKUP_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
when sending a command from an HMI or host computer.
Data type Structure: _sBKUP_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
when sending a command from an HMI or host computer.
Data type Structure: _sBKUP_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published. A
Usage in user program Not possible. Related instruc- ---
tions
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.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
when sending a command from an HMI or host computer.
Data type Structure: _sBKUP_CMD, Member: STRING(64) Range of values Depends on data type.
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sBKUP_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sBKUP_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sBKUP_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sVEFY_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sVEFY_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sVEFY_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
Note You cannot use this system-defined variable in the user program. Use it in CIP message communications
to read the status from an HMI or host computer.
Data type Structure: _sVEFY_STA, Member: BOOL Range of values TRUE or FALSE
R/W access Read Retained Not retained. Network Publish Published. A
Usage in user program Not possible. Related instruc- ---
tions
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.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*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.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*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.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*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.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained. *2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*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.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_STA, Member: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published. A
Usage in user program Possible. Related instruc- ---
tions
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.11 of the CPU Unit.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_STA, Member: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.11 of the CPU Unit.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_STA, Member: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.11 of the CPU Unit.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sRESTORE_CMD, Member: BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sRESTORE_CMD, Member: STRING(64) Range of values Depends on data type.
R/W access RW Retained Retained. *2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sRESTORE_CMD, Member: STRING(33) Range of values Depends on data type.
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
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 program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
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 program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
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 program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 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)
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained. *2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
*1 This system-defined variable was added for unit version 1.03 of the CPU Unit.
*1 This system-defined variable is not applicable for the data backup function even with a Retain attribute.
*1 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)
• When the user program is downloaded.
• When the Clear All Memory operation is performed.
Note When the encoder home offset data is not retained, the status is given in the error status of the axis vari-
able, and not in this flag.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.08 of the CPU Unit.
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type USINT Range of values 0 to 32
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- Communications instructions (ExecPMCR, SerialSend, SerialRcv, Send,
tions Rcv, and SendCmd)
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- Communications instructions (ExecPMCR, SerialSend, SerialRcv, Send,
tions Rcv, and SendCmd)
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type WORD Range of values 16#0000 to 16#FFFF
R/W access R Retained Not retained. Network Publish Published.*1
Usage in user program Possible. Related instruc- ---
tions A
*1 The network for CPU Units with unit version 1.07 or earlier is not published.
A-7-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Functional Classification: Version
*1 This system-defined variable was added for unit version 1.08 of the CPU Unit.
Note Always FALSE for the NX102 CPU Unit and NX1P2 CPU Unit.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.10 of the CPU Unit.
Note Always FALSE for the NX102 CPU Unit, NX1P2 CPU Unit, and NJ-series CPU Unit.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.10 of the CPU Unit.
Note You cannot use these system-defined variables in the user program. It is used only to monitor the status of
data tracing from the Sysmac Studio.
Data type Structure: _sTRACE_STA, Members: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- • TraceTrig
tions • TraceSamp
You can access this variable from the user program only with the following
instruction.
• GetTraceStatus
Note You cannot use these system-defined variables in the user program. It is used only to monitor the status of
data tracing from the Sysmac Studio.
Data type Structure: _sTRACE_STA, Members: BOOL Range of values TRUE or FALSE
R/W access R Retained Retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- • TraceTrig
tions • TraceSamp
You can access this variable from the user program only with the following
instruction.
• GetTraceStatus
Note You cannot use these system-defined variables in the user program. It is used only to monitor the status of
data tracing from the Sysmac Studio.
Data type Structure: _sTRACE_STA, Members: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetTraceStatus
Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY[0..2] OF _sOPTBOARD_STA Range of values
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY[0..2] OF _sOPTSERIALERR_STA Range of values
R/W access RW Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note We do not recommend the use of this variable in the user program. There may be a delay in updating it. Use
these variables only to access status through communications from an external device such as an HMI.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note We do not recommend the use of this variable in the user program. There may be a delay in updating it. Use
these variables only to access status through communications from an external device such as an HMI.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
A
Note We do not recommend the use of this variable in the user program. There may be a delay in updating it. Use
these variables only to access status through communications from an external device such as an HMI.
Note You can use this system-defined variable only for the NX1P2 CPU Units.
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 instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX102 CPU Units.
Data type ARRAY[0..1] OF _sSFLOG_STA Range of values
R/W access R Retained Not retained. Network Publish Not published.
Usage in user pro- Not possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.31 of the CPU Unit.
Note You can use this system-defined variable only for the NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user pro- Not possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.31 of the CPU Unit.
Note You can use this system-defined variable only for the NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user pro- Not possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.31 of the CPU Unit.
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type UINT Range of values 0 to 3
“0” means there are no Expansion
Racks.
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
Note You can use this system-defined variable only for NJ-series CPU Units.
Note Do not use this variable in the user program. There may be a delay in updating it and concurrency prob-
lems may occur. Use this variable only to access status through communications from an external device.
Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetCJBError
You can use the following instruction to clear this variable.
• ResetCJBError
Note Do not use this variable in the user program. There may be a delay in updating it and concurrency prob-
lems may occur. Use these variables only to access status through communications from an external
device. Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetCJBError
You can use the following instruction to clear this variable.
• ResetCJBError
Note Do not use this variable in the user program. There may be a delay in updating it and concurrency prob-
lems may occur. Use this variable only to access status through communications from an external device.
Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type ARRAY [0..3, 0..9] OF WORD Range of values 16#0000 to 16#80F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Not possible. Related instruc- You can access this variable from the user program only with the following
tions instruction.
• GetCJBError
You can clear this variable with the following instruction.
• ResetCJBError
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type ARRAY [0..3, 0..9] OF UINT Range of values 0 to 320
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type ARRAY [0..3, 0..9, 0..7] OF BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions
Auxiliary Words A50 to A69
Area Bits A50.00 to A69.15
addresses
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • ResetUnit
tions
Auxiliary Words A302
Area Bits A302.00 to A302.15
addresses
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • ResetUnit
tions
Auxiliary Words A330 to A335
Area
Bits A330.00 to A335.15
addresses
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • ResetUnit
tions
Auxiliary Words A501
Area Bits A501.00 to A501.15
addresses
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • ResetUnit
tions
Auxiliary Words A502 to A507
Area
Bits A502.00 to A507.15
addresses
Note You can use this system-defined variable only for NJ-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions A
Auxiliary Words Port on Serial Communications Unit with unit number 0: A620
Area Ports on Serial Communications Unit with unit numbers 1 to 15: A621 to A635
addresses
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type UINT Range of values 0 to 32*2
0: No NX Unit mounted.
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the range of values is 0 to 8.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type ARRAY[0..32] OF BOOL*2 Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF BOOL.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type ARRAY[0..32] OF BOOL*2 Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF BOOL.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type ARRAY[0..32] OF BOOL*2 Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- ---
gram tions
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF BOOL.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type WORD Range of values 16#0000 to 16#40F2
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- You can access this variable from the user program only with the following
gram tions instruction.
• GetNXBError
You can use the following instructions to clear this variable.
• ResetNXBError
• RestartNXUnit
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type WORD Range of values 16#0000 to 16#40F2
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- You can access this variable from the user program only with the following
gram tions instruction.
• GetNXBError
You can use the following instructions to clear this variable.
• ResetNXBError
• RestartNXUnit
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type ARRAY [1..32] OF WORD*2 Range of values 16#0000 to 16#40F2
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- You can access this variable from the user program only with the following
gram tions instruction.
• GetNXBError
You can use the following instructions to clear this variable.
• ResetNXBError
• RestartNXUnit
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF WORD.
Note You can use this system-defined variable only for the NX102 CPU Units and NX1P2 CPU Units.
Data type ARRAY [0..32] OF BOOL*2 Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related instruc- You can access this variable from the user program only with the following
gram tions instruction.
• GetNXBError
You can use the following instructions to clear this variable.
• ResetNXBError
• RestartNXUnit
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.
*2 For the NX1P2 CPU Units, the data type is ARRAY [0..8] OF BOOL.
Note You can use this system-defined variable only for the NX701 CPU Units. You can access the same values
of _MC1_GRP and _MC_GRP if the array element numbers of them are the same.
Data type ARRAY[0..63] OF _sGROUP_REF Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
Note You can use this system-defined variable only for the NX701 CPU Units.
Data type ARRAY[0..63] OF _sGROUP_REF Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units. You can access the same values of
_MC1_AX and _MC_AX if the array element numbers of them are the same.
Data type ARRAY[0..255] OF _sAXIS_REF Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units.
Data type ARRAY[0..255] OF _sAXIS_REF Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions
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 Sys-
mac Studio or the ResetECError instruction.
Note You can use this system-defined variable only for NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE A
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
Note Use this variable to confirm that message communications are possible for the relevant slave before you
execute message communications with an EtherCAT slave.
Data type ARRAY [1..512] OF BOOL*1 Range of values TRUE or FALSE
Note Use this variable to confirm that the data for the relevant slave is valid before controlling an EtherCAT
slave.
Data type ARRAY [1..512] OF BOOL*1 Range of values TRUE or FALSE
Note All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note You can use this system-defined variable only for NX-series CPU Units.
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 instruc- ---
gram tions
Note All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note You can use this system-defined variable only for NX-series CPU Units.
Note This variable is always TRUE for the NX102 CPU Units and NX1P2 CPU Units.
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 instruc- ---
gram tions
Note All system-defined variables that are related to the status of EtherCAT communications give the current status.
Note The write interval does not change even if you change the value of this system-defined variable while the A
diagnosis/statistics log operation is in progress.
Data type UINT Range of values 0, or 30 to 1800
Note Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following
tions instruction.
• GetEIPError
Note If a Link OFF Detected or Built-in EtherNet/IP Processing Error occurs, it is recorded in the event log and
then corresponding bit turns ON. Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error
status bits.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following
tions instruction.
• GetEIPError
Note If a Link OFF Detected or Built-in EtherNet/IP Processing Error occurs, it is recorded in the event log and
then corresponding bit turns ON. Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error
status bits.
Note You can use this system-defined variable only for NX-series CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following A
tions instruction.
• GetEIPError
Note If a Link OFF Detected or Built-in EtherNet/IP Processing Error occurs, it is recorded in the event log and
then corresponding bit turns ON. Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error
status bits.
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following
tions instruction.
• GetEIPError
Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following
tions instruction.
• GetEIPError
Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Note You can use this system-defined variable only for NX-series CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- You can access this variable from the user program with the following
tions instruction.
• GetEIPError
Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related You can access this variable from the user program with the following instruction.
instructions • GetEIPError
A
Variable name _EIP_TcpAppErr
Meaning TCP Application Communications Error Global/local Global
Note Refer to A-6-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type WORD Range of values 16#0000 to 16#00F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related You can access this variable from the user program with the following instruction.
instructions • GetEIPError
NJ-series CPU Units: Indicates that an error occurred when the MAC address was read at startup.
TRUE: Error
FALSE: Normal
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
A
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
Note You can use this system-defined variable only for NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for NX-series CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related ---
instructions
NJ-series CPU Units: Indicates that the same IP address is assigned to more than one node.
TRUE: Duplication 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 program Possible. Related ---
instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
NJ-series CPU Units: Indicates that the identity information (which you cannot overwrite) is 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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Indicates that tag 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 vari-
able in the CPU Unit.
•There is no network variable in the CPU Unit that corresponds to the tag setting.
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Indicates that the built-in EtherNet/IP port’s communications can be used via the communications
port (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.
FALSE: The built-in EtherNet/IP port’s communications is disabled due to an error in initial processing, restart pro-
cessing, 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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Indicates that all tag data links are communicating.
TRUE: Tag data links are communicating in all connections as the originator.
FALSE: An error occurred in at least one connection.
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Gives a list of nodes for which built-in EtherNet/IP connections are registered.
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.
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Gives a list of nodes that have normally established 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 occurred.
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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, the Target Node Controller Operating Information 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 ---
gram instructions A
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Shows the error status (logical OR of fatal and non-fatal errors) of the target node Controllers
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 vari-
able 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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
NJ-series CPU Units: Indicates that the connection for the Registered Target Node Information was not established
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 Regis-
tered 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 Informa-
tion is FALSE), or a connection was normally established with the target node (the Registered Target Node Infor-
mation is TRUE and the Normal Target Node Information is TRUE). An error occurred in the target Controller (the A
Target PLC Error Information is TRUE).
Data type ARRAY [0..255] OF BOOL Range of values TRUE or FALSE
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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.
Data type Structure: _sNTP_RESULT Range of values Depends on data type.
Members: DATE_AND_TIME
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Not possible. Related You can read the contents of this variable with the GetNTPStatus instruction.
gram instructions
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.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Not possible. Related You can read the contents of this variable with the GetNTPStatus instruction.
gram instructions
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 ---
gram instructions
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note Do not force this switch to change to FALSE from the user program or from the Sysmac Studio. It changes to
FALSE automatically.
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
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 ---
gram instructions
Note Do not force this switch to change to FALSE from the user program or from the Sysmac Studio. It changes to
FALSE automatically.
Note You can use this system-defined variable only for NX-series CPU Units.
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 ---
gram instructions
Note Do not force this switch to change to FALSE from the user program or from the Sysmac Studio. It changes to
FALSE automatically.
Note You can use this system-defined variable only for the NX701 CPU Units and NX102 CPU Units.
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 ---
gram instructions
Transfer-
ring data
Status changes with the
Data reten- Sysmac
Writing Studio Operating
tion at When Overwrit-
when write modes
CPU Unit data power power is Change When a ing in RUN
protection permitting
interrup- turned ON between Major Fault mode
is enabled writing
tions PRO- Level Con- Synchro-
GRAM troller nized data
mode and Error
RUN mode occurs
Retained Same as Retained. Retained. Not sup- Retained. CPU Unit Not sup-
(with non- before ported. name: ported.
volatile power inter- RUN/PRO-
Opera- Operation Set- memory). ruption. GRAM
tion Set- tings mode,
tings Error settings Other set-
tings: PRO-
GRAM
mode
Retained Same as Retained. Retained. Not sup- Retained. Write Pro- Supported.
(with non- before ported. tection and
Protection
Security volatile power inter- other set-
Settings at
Settings memory). ruption. tings: PRO-
Startup
GRAM
mode
TCP/IP Set- Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
tings, Built-in (with non- before ported. GRAM ported.
EtherNet/IP volatile power inter- mode
Port Link Set- memory). ruption.
tings, Service
Settings.
Built-in SNMP Set-
Ether- tings, SNMP
Net/IP Trap Settings,
Port Set- NTP Settings,
tings FTP Settings,
and IP Router
Control- Tables
ler Setup
Tag data link Retained Same as Retained. Retained. Supported Not PRO- Not sup-
settings for (with non- before retained. GRAM/ ported.
built-in Ether- volatile power inter- RUN
Net/IP port memory). ruption.
Node Address Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
Settings, (with non- before ported. GRAM ported.
FINS/UDP Set- volatile power inter- mode
tings, memory). ruption.
FINS Set- FINS/TCP Set-
tings tings, FINS
Routing
Tables, FINS
Write Protec-
tion
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
(with non- before ported. GRAM ported.
Built-in I/O Settings
volatile power inter- mode
memory). ruption.
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
(with non- before ported. GRAM ported.
Option Board Settings
volatile power inter- mode
memory). ruption.
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
Memory Settings for CJ- (with non- before ported. GRAM ported.
series Units volatile power inter- mode
memory). ruption.
Transfer-
ring data
Status changes with the
Data reten- Sysmac
Writing Studio Operating
tion at When Overwrit-
when write modes
CPU Unit data power power is Change When a ing in RUN
protection permitting
interrup- turned ON between Major Fault mode
is enabled writing
tions PRO- Level Con- Synchro-
GRAM troller nized data
mode and Error
Axis assignments, axis Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
Motion parameter settings, axes (with non- before ported. GRAM ported.
Control group parameter settings, volatile power inter- mode
Setup MC common parameter memory). ruption.
settings
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
(with non- before ported. GRAM ported.
Cam Data
volatile power inter- mode
memory). ruption.
Retained Same as Retained. Retained. Not sup- Retained. RUN/PRO- Not sup-
Event Event User-defined
(with non- before ported. GRAM ported.
Setting Setting error mes-
volatile power inter- mode
Table Table sages
memory). ruption.
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
(with non- before ported. GRAM ported.
NX Units
volatile power inter- mode
Bus con- memory). ruption.
figura-
tion CJ-series Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
bus con- (with non- before ported. GRAM ported.
I/O table
figura- volatile power inter- mode
tion memory). ruption.
Transfer-
ring data
Status changes with the
Data reten- Sysmac
Writing Studio Operating
tion at When Overwrit-
when write modes
CPU Unit data power power is Change When a ing in RUN
protection permitting
interrup- turned ON between Major Fault mode
is enabled writing
tions PRO- Level Con- Synchro-
GRAM troller nized data
mode and Error
RUN mode occurs
Data in CJ- Retained --- Retained. Retained. Supported. Not Depends
series Units, (in CJ- retained. on the Unit.
such as proto- series
col macros Units).
Special Words allo- Retained Same as Retained. Retained. Supported. Not RUN/PRO- Supported.
I/O Unit cated to CPU (with non- before retained. GRAM
Set- CJ-series Bus Units, volatile power inter- mode
tings/CP Unit Set- Example: Con- memory). ruption.
U Bus tings troller Link
Unit Set- Data Link
tings Tables.
Retained Same as Retained. Retained. Supported Retained. RUN/PRO- Supported.
Words allo-
(with Bat- before GRAM
cated in DM
tery). power inter- mode
Area
ruption.
Ether- Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
Ether-
CAT Net- Network con- (with non- before ported. GRAM ported.
CAT Con-
work figuration volatile power inter- mode
figuratio
Configu- information. memory). ruption.
n
ration
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
(with non- before ported. GRAM ported.
Master
Ether- Ether- volatile power inter- mode
CAT Set- CAT Set- memory). ruption.
tings tings Retained --- Retained. Retained. Supported. Retained. RUN/PRO- Supported.
Settings in
(by slaves). GRAM
Slaves
mode
Retained Same as Retained. Retained. Not sup- Not PRO- Not sup-
(with non- before ported. retained. GRAM ported.
Operation Authority Verification
volatile power inter- mode
memory). ruption.
Retained Same as Retained. Retained. Not sup- Not PRO- Not sup-
(with non- before ported. retained. GRAM ported.
User program execution ID in CPU Unit
volatile power inter- mode
memory). ruption.
Values of User-defined Not Initial val- Initial val- Initial val- Supported. Not RUN/PRO- Supported.
non- variables and retained. ues ues ues retained. GRAM
retained device vari- mode
Present variables ables
values of
variables User-defined Retained Same as Retained. Retained. Supported. Not RUN/PRO- Supported.
Values of
variables and (with Bat- before retained. GRAM
retained
device vari- tery*1). power inter- mode
variables
ables ruption.
Not 16#0000 16#0000 16#0000 Supported. Not RUN/PRO- Supported.
Contents CIO/WR retained. retained. GRAM
of mem- mode
ory used
for CJ- Retained Same as Retained. Retained. Supported. Not RUN/PRO- Supported.
series (with Bat- before retained. GRAM
HR/DM/EM
Units tery*1). power inter- mode
ruption.*2
Transfer-
ring data
Status changes with the
Data reten- Sysmac
Writing Studio Operating
tion at When Overwrit-
when write modes
CPU Unit data power power is Change When a ing in RUN
protection permitting
interrup- turned ON between Major Fault mode
is enabled writing
tions PRO- Level Con- Synchro-
GRAM troller nized data
mode and Error
*1 For the NX102 CPU Units and NX1P2 CPU Units, data is retained in the non-volatile memory.
*2 For the NX102 CPU Units and NX1P2 CPU Units, the value is 16#0000 if the Battery-related error detection is set to Do not use.
I/O Bits
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 oper-
ating mode is changed between PROGRAM and RUN mode.
Addresses
Addresses Word addresses Bit addresses
Range CIO 0 to CIO 159 0.00 to 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.
Addresses
Addresses Word addresses Bit addresses Words per Unit
The words that are allocated are listed in the following table.
Word addresses Unit Number
CIO 1500 to CIO 1524 0
CIO 1525 to CIO 1549 1
to to
CIO 1875 to CIO 1899 F
For details on how to use the allocated words, refer to the operation manual for the CJ-series CPU
Bus Unit.
Addresses
Addresses Word addresses Bit addresses Words per Unit
CIO 2000 to CIO 2959 CIO 2000.00 to CIO 2959.15 10 words
Range (10 words × 96 unit
numbers)
The words that are allocated are listed in the following table.
Word addresses Unit Number
CIO 2000 to CIO 2009 0
CIO 2010 to CIO 2019 1
to to
CIO 2950 to CIO 2959 95
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
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.
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.
Master to slave out-
Addresses Slave to master input area
put area
Fixed allocation area 1 CIO 3200 to CIO 3263 CIO 3300 to CIO 3363
Fixed allocation area 2 CIO 3400 to CIO 3463 CIO 3500 to CIO 3563
Fixed allocation area 3 CIO 3600 to CIO 3663 CIO 3700 to CIO 3763
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.
Master to slave out-
Addresses Slave to master input area
put area
Fixed allocation area 1 CIO 3370 CIO 3270
Fixed allocation area 2 CIO 3570 CIO 3470
Fixed allocation area 3 CIO 3770 CIO 3670
Refer to the CJ-series DeviceNet Units Operation Manual for NJ-series CPU Unit (Cat. No. W497)
for details.
Addresses
Addresses Word addresses Bit addresses
CIO 1300 to CIO 1499 and CIO 1300.00 to CIO 1499.15 and
Range
CIO 3800 to CIO 6143 CIO 3800.00 to CIO 6143.15
Addresses
Addresses Word addresses Bit addresses
Addresses
Addresses Word addresses Bit addresses
Range H0 to H511 H0.00 to H511.15
A-9-4 DM Area A
Description
Addresses
Addresses Word addresses Bit addresses
Range D0 to D32767 D0.00 to D32767.15
Addresses
Type of CJ-series
Addresses Word addresses Words per Unit
Special Unit
CJ-series Special I/O D20000 to D29599 (100 words 100 words
Units × 96 unit numbers)
Range
CJ-series CPU Bus D30000 to D31599 (100 words 100 words
Units × 16 unit numbers)
The words that are allocated are listed in the following table.
CJ-series Special I/O Units
Word addresses Unit Number
D20000 to D20099 0
D20100 to D20199 1
to to
D29500 to D29599 95
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
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 between PROGRAM and RUN mode.
Addresses
Addresses Word addresses Bit addresses
NJ501-: E0_0 to E18_32767 NJ501-: E0_0.00 to E18_3276.15
Range 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 vari-
ables are given below.
Item Specification
Amount of memory that is allocated An integral multiple of the alignment. However, the minimum amount of
memory is the data size.
Locations in memory At an integral multiple of the alignment starting from the start of the vari-
able in memory.
The alignments and the amounts of memory that are allocated for the basic data types and enumera-
tions are given below.
Amount of memory that
Data type Alignment [bytes]
is allocated [bytes]
BOOL 2 2
BYTE, USINT, or SINT 1 1
WORD, UINT, or INT 2 2
DWORD, UDINT, or DINT 4 4
LWORD, ULINT, or LINT 8 8
REAL 4 4
LREAL 8 8
TIME, DATE, TIME_OF_DAY, or DATE_AND_TIME 8 8
STRING[N+1]*1 1 N+1
Enumerations 4 4
*1 N is the maximum number of characters handled. For example, if a maximum of 10 single-byte characters are
handled, the NULL character is added, so memory for 11 characters must be reserved.
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.
* BOOL arrays are an exception. Refer to Precautions for Correct Use, below, for the amount of memory that is
allocated for BOOL arrays.
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.
Number of
elements − 1
Amount of memory = 2 +2
16
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: 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
First byte + Memory Variable Table
(integer multiple of 2) Bytes Name Data type
First byte + B[0, 0] First byte Variable B ARRAY[0..2, 0..2] OF WORD
(integer multiple of 2) First byte + 1
First byte + B[0, 1] First byte + 2
(integer multiple of 2) First byte + 3
First byte + B[0, 2] First byte + 4
(integer multiple of 2) First byte + 5
First byte + B[1, 0] First byte + 6
(integer multiple of 2) First byte + 7
First byte + B[1, 1] First byte + 8
(integer multiple of 2) First byte + 9
First byte + B[1, 2] First byte + 10
(integer multiple of 2) First byte + 11
First byte + B[2, 0] First byte + 12
(integer multiple of 2) First byte + 13
First byte + B[2, 1] First byte + 14
(integer multiple of 2) First byte + 15
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,
there can be unused memory between members or at the end of members. The alignment of a struc-
ture is the largest alignment of all of the members. The amount of memory that is allocated is the inte-
gral multiple of the alignment that is larger than the total amount of memory that is allocated when the
members are arranged in order at integral multiples of the alignment of the data types 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.
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.
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
c DINT First byte + 4 b c DINT First byte + 4 b
Variable Table First byte + 6 Not used. Variable Table First byte + 6 c
Name Data type First byte + 8 c Name Data type
Variable NJ_X Structure Y Variable CJ_X Structure Y
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.
* You cannot select the memory offset type. You can set 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-E1-03 or later) for the pro-
cedure to change the memory configuration of a structure variable.
Example: The following example shows how the memory configuration of the structure variable in
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.
A
Make the following changes to align the memory
configurations in the NJ/NX-series and CJ-series CPU Units.
(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/address and I/O comment col-
umns that are shown below.
2 Start the CX-Designer and open the Symbol Table Dialog Box.
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 required
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 Set-
tings. If you use the Sysmac Studio settings, however, you would have to use the Sysmac
Studio to change the settings every time or you would have to change the project file depend-
ing on the machine to handle the application that is described later in Application 1: Central-
ized Management of Machines with Different EtherCAT Slave Configuration and Axis
Composition on page A-224.
• 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 required
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 detailed spec-
ifications 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.
Version Information A
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required
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 select
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
Unit Unit
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.
EtherCAT Installed in Enable/disable Axis Use
Associated programs
slave EtherCAT network setting parameter setting
A, B, and C Installed. Enabled. Used Axis Executed.
D Installed. Enabled. Used Axis Executed.
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. A
External signal input.
No
Operation started.
CPU CPU
Unit Unit
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.
EtherCAT Installed in Enable/disable Axis Use
Associated programs
slave EtherCAT network setting parameter setting
A and B Installed. Enabled. Used Axis Run at the start of opera-
tion.
C, E, and D Installed. Enabled. Used Axis Run at the start of opera-
tion.
F and G Not installed. Disabled. Unused Axis Stop at the start of opera-
tion.
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
Unused Axis.
3 Use the EC_ChangeEnableSetting instruction to disable the settings for EtherCAT slaves C, D,
and E.
4 Use the PrgStop instruction to disable the programs associated with C, D 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.
10 Start production line 4 again.
As the result of the above steps, the EtherCAT slave enable/disable settings, Axis Use parameter set-
tings, and the associated programs enable/disable settings are changed as shown below.
EtherCAT Installed in Enable/disable Axis Use
Associated programs
slave EtherCAT network setting parameter setting
A and B Installed. Enabled. Used Axis Enabled.
C, E, and D Not installed. Disabled. Unused Axis Disabled.
F and G Installed. Enabled. Used Axis Enabled.
POU Restrictions
There are restrictions both on POU definitions and POU instances.
Refer to Number of POU Instances on page A-231 for information on counting POU instances.
Restrictions to Variables
There are restrictions to both variable usage and variable definitions.
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 computer to the
new CPU Unit.
Details on the above work is provided in the following sections. A
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.
The project in the Controller is uploaded to the computer.
1 Select Backup − Backup Variables and Memory from the Tools Menu on the Sysmac Stu-
dio.
2 Select the Present value of Retain attribute variable, 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 Con-
troller.
5 Select only the IP address of the connected CPU Unit as the device and click the OK But-
ton.
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 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 Stu-
dio.
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 Con-
troller.
3 Select File − Open and open the tag data link 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.
A-15-1 Relationship Between Unit Versions of CPU Units and Sysmac Studio Versions
Unit version of CPU Unit Corresponding version of Sysmac Studio
Ver.1.31*1 Ver.1.24
Ver.1.30*2 Ver.1.23
Ver.1.18*3 Ver.1.22
Ver.1.16*4 Ver.1.20
Ver.1.14 Ver.1.18
Ver.1.13*5 Ver.1.17*6
Ver.1.12 Ver.1.16
Ver.1.11 Ver.1.15
Ver.1.10 Ver.1.13
*1 This is the Unit version of NX102- CPU Units. There is no NX701- CPU Unit and NX1P2-
CPU Unit with unit version 1.31.
*2 This is the Unit version of NX102- CPU Units. There is no NX102- CPU Unit with unit version
1.29 or earlier. There is no NX701- CPU Unit and NX1P2- CPU Unit with unit version 1.30.
*3 There is no NX701- CPU Unit and NX1P2- CPU Unit with unit version 1.17.
*4 There are no NX701- and NX1P2- CPU Units with unit version 1.15.
*5 There is no NX1P2- CPU Unit with unit version 1.12 or earlier.
*6 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-15-2 Functions That Were Added or Changed for Each Unit Version
Addi- Sysmac
Unit ver-
Function tion/cha Studio Reference
sion
nge version
Program- Variables Arrays Variable- Addition Ver.1.18 Ver.1.22 6-3-7 Array
ming length array Specifications
and Range
Specifications
for Data Types
Communi- EtherNet/ TCP/IP func- Packet Filter Addition Ver.1.30 Ver.1.23 NJ/NX-series
cations IP port tion *1 CPU Unit
Built-in Ether- A
Net/IP Port
User’s Man-
A-15-2 Functions That Were Added or Changed for Each Unit Version
ual (Cat. No.
W506)
CIP Safety routing*1 Addition Ver.1.31 Ver.1.24 NX-series
Safety Control
Unit User’s
Manual (Cat.
No. Z930-E1-
12 or later)
OPC UA Server func- Addition Refer to the NJ/NX-series CPU Unit OPC
tion*1 UA User’s Manual (Cat. No. W588) for
unit versions and corresponding Sysmac
Studio versions.
Others Modbus/TCP Addition Ver.1.30 Ver.1.23 NJ/NX-series
CPU Unit
(Client)*1
Built-in Ether-
Net/IP Port
User’s Man-
ual (Cat. No.
W506)
FINS com- Addition Ver.1.30 Ver.1.23 NX-series
munications CPU Unit
service*1 FINS User’s
Manual (Cat.
No. W596)
Communications instructions Change Ver.1.11 Ver.1.15 NJ/NX-series
Ver.1.23 Instructions
Ver.1.30*1
Reference
Manual (Cat.
No. W502)
SD Mem- Application Program transfer from SD Addition Ver.1.11 Ver.1.15 9-5 Program
ory Cards Memory Card Transfer from
SD Memory
Card
Backing up Safety unit restore*1 Addition Ver.1.31 Ver.1.24 9-1-4 Types of
data Backup Func-
tions
*1 This addition applies only to NX102- CPU Unit.
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.
A-16-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions
Ver.1.20 Ver.1.26
Ver.1.19 Ver.1.24
Ver.1.18 Ver.1.22
Ver.1.17 Ver.1.21
Ver.1.16 Ver.1.20
Ver.1.15 Ver.1.19
Ver.1.14 Ver.1.18
Ver.1.13 Ver.1.17
Ver.1.12 Ver.1.16
Ver.1.11 Ver.1.15
Ver.1.10*1 Ver.1.13*2
Ver.1.12
Ver.1.09 Ver.1.10
Ver.1.08 Ver.1.09
Ver.1.07 Ver.1.08
Ver.1.06 Ver.1.07
Ver.1.05 Ver.1.06
Ver.1.04 Ver.1.05
Ver.1.03 Ver.1.04
Ver.1.02 Ver.1.03
Ver.1.01 Ver.1.02
Ver.1.00*3 Ver.1.01
Ver.1.00
*1 There is no NJ101- CPU Unit with unit version 1.09 or earlier.
*2 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.
*3 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.
Additional Information
A
A-16-2 Relationship between Hardware Revisions of CPU Units and
Sysmac Studio Versions
A-16-2 Relationship between Hardware Revisions of CPU Units and Sysmac Studio Versions
The following table shows how the hardware revisions of the NJ-series CPU Units correspond to Sys-
mac Studio versions. Use the corresponding version of Sysmac Studio or higher if you execute the Sim-
ulator in Execution Time Estimation Mode. You cannot select the relevant hardware revision if you use
a lower version of the Sysmac Studio.
Model number Hardware revision of CPU Unit Corresponding version of Sysmac Studio
NJ501- A Ver.1.14
B Ver.1.24
NJ301- A Ver.1.24
NJ101- A Ver.1.24
A-16-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.
Sysmac
Addition/ Unit
Function Studio Reference
change version
version
Tasks Function Conditionally executed tasks Addition 1.03 1.04 5-2 Overview of Tasks
Programming Namespaces Addition 1.01 1.02 6-7 Namespaces
Data types Structure data Specifying Addition 1.01 1.02 Specifying Structure
types member off- Member Offsets on
Change 1.03
sets page 6-42
Variables Arrays Variable- Addition 1.18 1.22 6-3-7 Array Specifica-
length array tions and Range
Specifications for
Data Types
Libraries Addition 1.01 1.02 6-8 Libraries
Motion control Single axes Single-axis Cyclic syn- Addition 1.03 1.04 NJ/NX-series CPU
position con- chronous Unit Motion Control
trol absolute posi- User’s Manual (Cat.
tioning No. W507)
Auxiliary func- Homing with Addition 1.03 1.04
tion for single- specified
axis control parameters
Enabling digi- Addition 1.06 1.07
tal cam
switches
Command Addition 1.10 1.12
position com-
pensation
Start velocity Addition 1.05 1.06
Axes groups Multi-axes Axes group Addition 1.01 1.02
coordinated cyclic synchro-
control nous absolute
positioning
Auxiliary func- Reading axes Addition 1.01 1.02
tions for multi- group posi-
axes coordi- tions
nated control
Changing the Addition 1.01 1.02
axes in a
group
Common Cams Generating Addition 1.08 1.09
items cam tables
Parameters Changing axis Addition 1.08 1.09
parameters
Auxiliary func- Input signal logic inversion Addition 1.05 1.06
tions
Unit (I/O) NX Units Addition 1.05 1.06 NX-series EtherCAT
management Coupler Unit User’s
Manual (Cat. No.
W519)
Sysmac
Addition/ Unit
Function Studio Reference
change version
version
A-16-3 Functions That Were Added or Changed for Each Unit Version
venting
Operation Number of Change 1.01 1.02 8-5-5 Operation
incorrect oper-
authority verifi- groups Authority Verification
ation cation
SD Memory Application Automatic transfer from SD Addition 1.03 1.04 9-4 Automatic Trans-
Cards Memory Card fers from SD Memory
Cards
Program transfer from SD Mem- Addition 1.11 1.15 9-5 Program Transfer
ory Card from SD Memory
Card
Backing up SD Memory Operating CPU Unit Addition 1.03 1.04 9-2 SD Memory Card
data Card backups methods front-panel Backups
DIP switch
Specification Addition 1.03 1.04
with system-
defined vari-
ables
SD Memory Addition 1.03 1.04
Card Window
in Sysmac Stu-
dio
Special Addition 1.08 1.09
instruction
Protection Disabling Addition 1.03 1.04 9-3 Disabling Back-
backups to SD ups to SD Memory
Memory Cards Cards
Sysmac Studio Controller backups Addition 1.03 1.04 9-6 Sysmac Studio
Controller Backups
*1 This addition applies only to an NJ301- CPU Unit. The NJ501- and NJ101- CPU Units support packet
monitoring with all versions.
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.
*3 The performance improvement applies only to an NJ301- CPU Unit. The maximum numbers of con-
trolled axes for the NJ501- are as follows:
NJ501-5: 64 axes, NJ501-4: 32 axes, and NJ501-3: 16 axes
*4 There is no change in the maximum number of used real axes.
*5 The performance improvement applies only to an NJ301- CPU Unit. The maximum numbers of axes
for single-axis control for the NJ501- are as follows:
NJ501-5: 64 axes, NJ501-4: 32 axes, and NJ501-3: 16 axes
*6 Here, pps means “packets per second” and indicates the number of packets that can be processed in one sec-
ond.
*7 The performance improvement applies only to an NJ301- CPU Unit. You can use 500, 1,000, 2,000 or
4,000 µs communications cycle with an NJ501- CPU Unit, and 1,000, 2,000 or 4,000 µs communica-
tions cycle with an NJ101- CPU Unit.
Index
Symbols _Card1PrgTransferCmd (SD Memory Card
Program Transfer Command) ....................... A-72, A-133
.IsComplete .................................................................A-82 _Card1PrgTransferSta (SD Memory Card
.IsOutput ......................................................................A-82 Program Transfer Status) ................. A-73, A-135, A-136
.IsStart .........................................................................A-82 _Card1Protect ........................................8-30, A-70, A-129
_Card1Ready .........................................8-30, A-70, A-129
A _Card1RestoreCmd (SD Memory Card
Restore Command) ................................................A-135
_Card1RestoreSta (SD Memory Card
accessing I/O with variables ........................................ 2-16
Restore Status) .........................................................A-74
Accessing Task ............................................................ 4-10
_Card1VefySta .................................... A-72, A-132, A-133
accessing tasks ........................................................... 5-97
Carry Flag .................................................6-8, A-76, A-139
_TaskName_Active .................................. 5-8, A-68, A-126
changing event levels .................................................. 8-84
_AlarmFlag ...................................................... A-69, A-128
changing present values ............................................. 8-52
algorithms ........................................................... 6-10, 6-17
CIP Communications Error .............................. A-99, A-172
All Tag Data Link Communications Status ................A-112
CIP Communications1 Error ........................................A-99
Always FALSE Flag ......................................... A-76, A-139
CIP Communications1 Identity Error .........................A-104
Always TRUE Flag .......................................... A-76, A-139
CIP Communications1 Multiple Switches ON Error ...A-108
array specification ..............................................6-33, 6-50
CIP Communications1 Tag Data Link
AT Specification ........................................................... 6-59
Communications Error ............................................A-106
Axes Group Error Status ................................. A-88, A-157
CIP Communications1 Tag Data Link
Axes Group Variables ...............................3-18, A-88, A-89
Connection Failed ...................................................A-106
Axis Error Status ............................................. A-88, A-157
CIP Communications1 Tag Data Link Setting Error ...A-105
Axis Variables ........................................... 3-18, A-89, A-90
CIP Communications1 Tag Name Resolution Error ..A-107
CIP Communications2 Error ......................................A-100
B
CIP Communications2 Identity Error .........................A-104
CIP Communications2 Multiple Switches ON Error ...A-108
backing up data ............................................................. 9-3
CIP Communications2 Tag Data Link
Backup Function Busy Flag ............................. A-75, A-138
Communications Error ............................................A-106
_BackupBusy .................................................. A-75, A-138
CIP Communications2 Tag Data Link
basic data types .......................................................... 6-30
Connection Failed ...................................................A-106
Basic Ethernet Setting Error ......................................A-101
CIP Communications2 Tag Data Link Setting Error ...A-105
Basic I/O Unit Information ............................... A-84, A-151
CIP Communications2 Tag Name Resolution Error ..A-108
Basic I/O Units ....................................................4-15, 8-22
CIP Safety communications ........................................ 2-10
Basic Input Unit Input Response Times . 8-23, A-83, A-150
CIP Safety routing .....................................................A-243
basic settings ................................................................. 4-4
_CJB_CBU00InitSta to _CJB_CBU15InitSta
basic system configuration ............................................ 1-7
.............................................................8-24, A-84, A-151
basic system configurations ..........................1-5, 1-9, 1-11
_CJB_CBU00Restart to _CJB_CBU15Restart
bit strings ..................................................................... 6-31
.............................................................8-24, A-84, A-152
Boolean ....................................................................... 6-31
_CJB_ErrSta ................................................... A-83, A-149
BOOTP Server Error .................................................A-103
_CJB_InRespTm ....................................8-23, A-83, A-150
Built-in EtherCAT Error .................................... A-91, A-161
_CJB_IOUnitInfo ............................................. A-84, A-151
Built-in EtherNet/IP Error ................................. A-96, A-170
_CJB_MaxRackNo .......................................... A-83, A-149
bus bars ....................................................................... 6-90
_CJB_MaxSlotNo ............................................ A-83, A-149
_CJB_MstrErrSta ............................................ A-83, A-150
C _CJB_SCU00P1ChgSta to _CJB_SCU00P2ChgSta
..................................................................................A-84
_Card1Access ........................................8-30, A-70, A-129 _CJB_SCU00P1ChgSta, _CJB_SCU00P2ChgSta to
_Card1BkupCmd ................................. A-71, A-130, A-131 _CJB_SCU15P1ChgSta, _CJB_SCU15P2ChgSta A-153
_Card1BkupSta ............................................... A-72, A-132 _CJB_SCU15P1ChgSta to _CJB_SCU15P2ChgSta ..A-84
_Card1Deteriorated ................................ 8-30, A-70, A-130 _CJB_SIO00InitSta to _CJB_SIO95InitSta
_Card1Err ............................................... 8-30, A-70, A-129 .............................................................8-24, A-84, A-151
_Card1PowerFail .................................... 8-30, A-70, A-130 _CJB_SIO00Restart to _CJB_SIO95Restart
_Card1PrgRestoreCmd (SD Memory Card .............................................................8-24, A-84, A-152
Restore Command) ..................................................A-73 _CJB_UnitErrSta ............................................. A-83, A-150
N ParityErr ......................................................................A-81
P_CY ...........................................................................A-76
names Period/Execution Condition ........................................... 4-8
restrictions ............................................................. 6-83 periodic tasks .....................................................5-19, 5-57
namespace declarations ........................................... 6-144 periodic tasks that control I/O .......................5-20, 5-58
namespaces .............................................................. 6-142 periodic tasks that do not control I/O ............5-19, 5-57
Network Communications Instruction Enabled Flag P_First_Run .............................................6-8, A-76, A-140
...................................................................... A-76, A-141 P_First_RunMode ........................................... A-76, A-140
network configuration .................................................... 1-8 PLC Function Module
Network Configuration Error ............................ A-91, A-163 initial settings ........................................................... 4-4
Network Configuration Information Error ......... A-91, A-162 PLC Function Module Error Status .................. A-78, A-144
Network Configuration Verification Error ......... A-91, A-163 _PLC_ErrSta ................................................... A-78, A-144
Network Configurations ............................................... 1-10 _PLC_OptBoardSta ............................. A-79, A-144, A-145
network configurations ................................................ 1-12 _PLC_OptSerialErrSta .................................... A-79, A-145
Network Connected Slave Table ..................... A-94, A-165 _PLC_SFLogSta ............................................. A-82, A-148
NTP Server Connection Error ...................................A-109 _PLC_TraceSta[0..3] ..................................... A-143, A-144
Number of Used Ports ..................................... A-76, A-140 _PLC_TraceSta[0..3].IsComplete ...................... 8-62, A-78
NX Bus Function Module Error Status ......................A-155 _PLC_TraceSta[0..3].IsStart .............................. 8-62, A-78
NX Bus Function Module Master Error Status ..........A-155 _PLC_TraceSta[0..3].IsTrigger .......................... 8-62, A-78
NX Bus Function Module Unit Error Status ...............A-156 _PLC_TraceSta[0..3].ParamErr ......................... 8-62, A-78
NX Unit Configuration .................................................... 1-9 P_Off ............................................................... A-76, A-139
NX Unit configuration .................................................... 1-7 P_On ............................................................... A-76, A-139
NX Unit Error Status ..................................................A-156 Port1 Basic Ethernet Setting Error ............................A-101
NX Unit I/O Data Active Status ..................................A-154 Port1 BOOTP Server Error ........................................A-103
NX Unit Message Enabled Status .............................A-154 Port1 Communications Controller Error ....................A-101
NX Unit Registration Status .......................................A-155 Port1 IP Address Duplication Error ............................A-103
_NXB_ErrSta ...............................................................A-86 Port1 IP Address Setting Error ..................................A-102
_NXB_MaxUnitNo .......................................................A-85 Port1 MAC Address Error ..........................................A-100
_NXB_MstrErrSta ........................................................A-86 Port2 Basic Ethernet Setting Error ............................A-102
_NXB_UnitErrFlagTbl ..................................................A-87 Port2 BOOTP Server Error ........................................A-104
_NXB_UnitErrStaTbl ...................................................A-87 Port2 Communications Controller Error ....................A-101
_NXB_UnitIOActiveTbl ................................................A-85 Port2 IP Address Duplication Error ............................A-103
_NXB_UnitMsgActiveTbl .............................................A-85 Port2 IP Address Setting Erro ...................................A-102
_NXB_UnitRegTbl .......................................................A-86 Port2 MAC Address Error ..........................................A-101
_Port_isAvailable ............................................. A-76, A-141
O _Port_numUsingPort ....................................... A-76, A-140
POUs
function blocks ......................................................... 6-6
offline debugging ........................................................... 7-3
functions .................................................................. 6-6
Online ........................................................................A-111
programs .................................................................. 6-6
online editing ............................................................... 8-54
restrictions ............................................................. 6-24
operation authority verification .................................... 8-42
POUs (program organization units) ............................... 6-5
Operation Settings ......................................................... 4-5
Power Interruption Count ................................ A-75, A-139
Operation Settings Tab Page ........................................ 4-4
_PowerOnCount .............................................. A-75, A-139
Option Board Error ....................................................A-145
_PowerOnHour ................................................ A-75, A-138
Option Board Mounted ..............................................A-144
P_PRGER ....................................................... A-76, A-140
Option Board Normal Operation ................................A-145
primary periodic task .................................5-17, 5-37, 5-56
Option Board Status ..................................................A-144
parameters ............................................................. 5-94
output variables .................................................. 6-11, 6-19
priority-5 periodic task ................................................. 5-18
outputs
Process Data Communicating Slave Table ..... A-94, A-166
program outputs .................................................... 6-91
Process Data Communications Error .............. A-91, A-163
overall project file protection ........................................ 8-39
Process Data Communications Status ............ A-94, A-167
OverRun ......................................................................A-82
Process Data Reception Timeout Error ........... A-91, A-163
overview of CPU Unit data .......................................... 2-36
Process Data Transmission Error .................... A-92, A-163
Program Assignment Settings ....................................... 4-9
P
Program Execution Order .............................................. 4-9
programming languages .............................................. 6-90
Packet Monitoring Stopped ............................. A-94, A-167
programs ....................................................................... 6-7
parameters for priority-16, priority-17,
execution conditions ................................................ 6-8
and priority-18 periodic tasks .................................... 5-95
EtherNet/IP communications errors .....................A-170 Trace Busy Flag .....................................8-62, A-78, A-143
I/O bus errors ............................................. A-83, A-149 Trace Completed Flag ............................8-62, A-78, A-143
I/O bus status ............................................ A-83, A-149 Trace Parameter Error Flag ....................8-62, A-78, A-144
meanings of error status bits ...............................A-123 Trace Trigger Monitor Flag .....................8-62, A-78, A-143
motion control functions .......................................A-157
NX Bus Function Module Errors ..........................A-155 U
NX Bus Function Module Status ................ A-85, A-154
Option Boards ........................................................A-79 unions .......................................................................... 6-46
power supply ............................................. A-75, A-138 Unit Version .................................................................A-77
programming ............................................. A-76, A-139 _UnitVersion .................................................... A-77, A-141
Safety Data Logging ..............................................A-82 Update Variable ........................................................... 4-10
SD Memory Cards ..................................... A-70, A-129 user program execution IDs ........................................ 8-35
tasks ....................................................................A-126 user program transfer with no restoration information . 8-38
User-defined Error Status ................................ A-69, A-128
T user-defined errors ...................................................... 8-77
user-defined events ..................................................... 8-70
Tag Data Link Communications Error ........................A-106 user-defined information .............................................. 8-77
Tag Data Link Communications Status .....................A-112 user-defined variables ................................................. 6-27
Tag Data Link Connection Failed ..............................A-105
Tag Data Link Setting Error .......................................A-105 V
Tag Name Resolution Error .......................................A-107
Task values of retain variables after newly creations
Specifications of the NX-series CPU Units ............ 5-32 or changes of POU names ....................................... 6-72
Task Active Flag .......................................5-8, A-68, A-126 Variable Access Time .................................................... 4-8
task design variable attributes
example ............................................................... 5-114 AT Specification ..................................................... 6-59
task exclusive control instructions ............................. 5-100 Constant ................................................................ 6-64
Task Execution Count ...............................5-9, A-68, A-127 Edge ...................................................................... 6-66
task execution status Initial Value ............................................................ 6-62
monitoring ............................................................ 5-110 Network Publish ..................................................... 6-65
Task Execution Status Monitor .................................... 4-11 Retain .................................................................... 6-61
Task Execution Time Monitor ...........................4-11, 5-111 Variable Name ....................................................... 6-59
Task Execution Timeout ............................................ 5-108 variable memory allocation
Task Execution Timeout Time ........................................ 4-8 rules .....................................................................A-205
task execution times .................................................. 5-114 variable names ............................................................ 6-59
Task Name .............................................................4-7, 4-9 restrictions ............................................................. 6-83
Task Period Exceeded ............................................... 5-107 variable values
Task Period Exceeded Count ...................5-9, A-69, A-128 ensuring concurrency ............................................ 5-97
Task Period Exceeded Error Detection ......................... 4-8 variable values when data types of
Task Period Exceeded Flag ......................5-9, A-69, A-127 retained variables are changed ................................ 6-75
task real processing time ........................................... 5-113 variable-length array specification ............................... 6-54
Task Settings ................................................................. 4-7 variables
Task Type ...................................................................... 4-7 attributes ................................................................ 6-29
tasks outline .................................................................... 6-27
assigning tasks to programs .................................. 5-93 types ...................................................................... 6-27
monitoring task execution status verifying data ................................................................. 9-3
and task execution times .................................. 5-110 version information ....................................................A-245
order of program execution ................................... 5-93
outline ...................................................................... 5-6 W
POUs that you can assign to tasks ........................ 5-93
processing of tasks and system services ..... 5-17, 5-56 write protection ............................................................ 8-44
synchronizing variable access with task execution
.......................................................................... 5-103
task execution priority ..........................5-13, 5-34, 5-51
TCP Application Communications Error ....................A-100
TCP/IP Setting Error ..................................................A-108
text strings ................................................................... 6-32
time of day ................................................................... 6-32
Total Power ON Time ...................................... A-75, A-138
OMRON (CHINA) CO., LTD. © OMRON Corporation 2011-2019 All Rights Reserved.
OMRON ASIA PACIFIC PTE. LTD.
Room 2211, Bank of China Tower, In the interest of product improvement,
No. 438A Alexandra Road # 05-05/08 (Lobby 2),
Alexandra Technopark, 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Singapore 119967 PuDong New Area, Shanghai, 200120, China
Tel: (65) 6835-3011/Fax: (65) 6835-2711 Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200 Cat. No. W501-E1-26 0119