NX_NJ_CPU unit software_User's Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 968

Machine Automation Controller

NJ/NX-series
CPU Unit
Software

User’s Manual

NX701-17
NX701-16
NX1P2-11
NX1P2-10
NX1P2-90
NJ501-5
NJ501-4
NJ501-3
NJ301-12
NJ301-11
NJ101-10
NJ101-90 CPU Unit

W501-E1-20
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.

• The SD and SDHC logos are trademarks of SD-3C, LLC.

Other company names and product names in this document are the trademarks or registered trademarks of their
respective companies.

Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
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
• NX1P2-11
• NX1P2-111
• NX1P2-10
• NX1P2-101
• NX1P2-90
• NX1P2-901

• NJ-series CPU Units


• NJ501-5
• NJ501-4
• NJ501-3
• NJ301-12
• NJ301-11
• NJ101-10
• NJ101-90

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 27.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1


Relevant Manuals

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 NX1P2 CPU Unit
Hardware User’s Manual
NJ-series CPU Unit
Software User’s Manual
NJ/NX-series CPU Unit

NX-series NX1P2 CPU Unit


Instructions Reference Manual
NJ/NX-series
Motion Control User’s Manual
NJ/NX-series CPU Unit
Motion Control Instructions Reference Manual
NJ/NX-series
Built-in EtherCAT Port User’s Manual
NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual
NJ/NX-series CPU Unit
User’s Manual
NJ-series Database Connection CPU Units
User’s Manual
NJ-series SECS/GEM CPU Units
CPU Unit User’s Manual
NJ-series NJ Robotics
Troubleshooting Manual
NJ/NX-series
Built-in I/O and Option Board User's Manual

Purpose of use

Introduction to NX701 CPU Units 


Introduction to NX1P2 CPU Units 
Introduction to NJ-series Controllers 
Setting devices and hardware   
Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Software settings 
Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Using the NX1P2 CPU Unit functions 
Writing the user program  
Using motion control  
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Programming error processing 
Using the NX1P2 CPU Unit functions 

2 NJ/NX-series CPU Unit Software User’s Manual (W501)


Relevant Manuals

Manual
Basic information

Hardware User’s Manual


NX-series 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

NX-series NX1P2 CPU Unit


Instructions Reference Manual
NJ/NX-series
Motion Control User’s Manual
NJ/NX-series CPU Unit
Motion Control Instructions Reference Manual
NJ/NX-series
Built-in EtherCAT Port User’s Manual
NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual
NJ/NX-series CPU Unit
User’s Manual
NJ-series Database Connection CPU Units
User’s Manual
NJ-series SECS/GEM CPU Units
CPU Unit User’s Manual
NJ-series NJ Robotics
Troubleshooting Manual
NJ/NX-series
Built-in I/O and Option Board User's Manual
Purpose of use

Testing operation and debugging 


Using motion control 
Using EtherCAT 
Using EtherNet/IP 
Using the database connection service 
Using the GEM Services 
Using robot control 
Using the NX1P2 CPU Unit functions 
Learning about error management
           
and corrections *1
Maintenance
Using motion control 
  
Using EtherCAT 
Using EtherNet/IP 

*1 Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the error management concepts and an overview of the error
items. Refer to the manuals that are indicated with triangles for details on errors for the corresponding Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) 3


Manual Structure

Manual Structure

Page Structure
The following page structure is used in this manual.

4 Installation and Wiring Level 1 heading


Level 2 heading
Level 2 heading 4-3 Mounting Units Level 3 heading
Gives the current
Level 3 heading 4-3-1 Connecting Controller Components headings.
The Units that make up an NJ-series Controller can be connected simply by pressing the Units together
and locking the sliders by moving them toward the back of the Units. The End Cover is connected in the
same way to the Unit on the far right side of the Controller.

A step in a procedure 1 Join the Units so that the connectors fit exactly.

Hook
Indicates a procedure. Connector
Hook holes

4-3 Mounting Units


4 Page tab
2 Gives the number

4-3-1 Connecting Controller Components


The yellow sliders at the top and bottom of each Unit lock the Units together. Move the sliders
toward the back of the Units as shown below until they click into place. of the main section.
Move the sliders toward the back
until they lock into place.

Lock

Release

Slider

Precautions for Correct Use


Special information The sliders on the tops and bottoms of the Power Supply Unit, CPU Unit, I/O Units, Special I/O
Units, and CPU Bus Units must be completely locked (until they click into place) after connecting
Icons indicate the adjacent Unit connectors.
precautions, additional
information, or reference
information.

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.

4 NJ/NX-series CPU Unit Software User’s Manual (W501)


Manual Structure

Special Information
Special information in this manual is classified as follows:

Precautions for Safe Use


Precautions on what to do and what not to do to ensure safe usage of the product.

Precautions for Correct Use


Precautions on what to do and what not to do to ensure proper operation and performance.

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.

Note References are provided to more detailed or related information.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5


Manual Structure

6 NJ/NX-series CPU Unit Software User’s Manual (W501)


Sections in this Manual

Sections in this Manual

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

4 Controller Setup A Appendices 6

7
5 Designing Tasks I Index

8
6 Programming
9
Checking Operation and
7 Actual Operation

8 CPU Unit Functions

9 Backup Functions

NJ/NX-series CPU Unit Software User’s Manual (W501) 7


CONTENTS

CONTENTS
Introduction ............................................................................................................... 1

Relevant Manuals ...................................................................................................... 2

Manual Structure ....................................................................................................... 4

Sections in this Manual ............................................................................................ 7

Terms and Conditions Agreement......................................................................... 16

Safety Precautions .................................................................................................. 18

Precautions for Safe Use........................................................................................ 19

Precautions for Correct Use................................................................................... 20

Regulations and Standards.................................................................................... 21

Versions ................................................................................................................... 23

Related Manuals ...................................................................................................... 27

Terminology ............................................................................................................. 30

Revision History ...................................................................................................... 35

Section 1 Introduction to NJ/NX-series Controllers


1-1 The NJ/NX-series Controllers ................................................................................................. 1-2
1-1-1 Features ...................................................................................................................................... 1-2
1-1-2 Introduction to the System Configurations .................................................................................. 1-5
1-2 Main Specifications ............................................................................................................... 1-11
1-3 Overall Operating Procedure for the NJ/NX-series Controller .......................................... 1-14
1-3-1 Overall Procedure ..................................................................................................................... 1-14
1-3-2 Procedure Details...................................................................................................................... 1-15

Section 2 CPU Unit Operation


2-1 Overview of CPU Unit Operation............................................................................................ 2-2
2-1-1 Introduction to CPU Unit ............................................................................................................. 2-2
2-1-2 Overview of Operation According to CPU Unit Status ................................................................ 2-3
2-2 Software ................................................................................................................................... 2-4
2-2-1 Software Configuration................................................................................................................ 2-4
2-2-2 Operation of Software ................................................................................................................. 2-5
2-3 Accessing I/O ......................................................................................................................... 2-11
2-3-1 Types of Variables ..................................................................................................................... 2-11
2-3-2 Accessing I/O with Variables..................................................................................................... 2-14
2-4 I/O Refreshing of NX Bus Function Module ........................................................................ 2-23
2-4-1 I/O Refreshing Methods ............................................................................................................ 2-23
2-4-2 I/O Refreshing Method Operation ............................................................................................. 2-24
2-5 Sequence Control and Motion Control ................................................................................ 2-27

8 NJ/NX-series CPU Unit Software User’s Manual (W501)


CONTENTS

2-5-1 Overview of Control .................................................................................................................. 2-27


2-5-2 Sequence Control System ........................................................................................................ 2-29
2-5-3 Motion Control System ............................................................................................................. 2-31
2-5-4 Synchronizing Sequence Control and Motion Control .............................................................. 2-33
2-6 Overview of CPU Unit Data ................................................................................................... 2-34
2-7 Operation for CPU Unit Status ............................................................................................. 2-35
2-7-1 CPU Unit Status........................................................................................................................ 2-35
2-7-2 Operation for CPU Unit Status.................................................................................................. 2-37
2-7-3 Operating Modes ...................................................................................................................... 2-38

Section 3 I/O Ports, Slave Configuration, and Unit Configuration


3-1 Procedure to Create the Slave and Unit Configurations...................................................... 3-2
3-2 Creating and Comparing the Slave and Unit Configurations .............................................. 3-5
3-2-1 Creating the EtherCAT Slave Configuration................................................................................ 3-5
3-2-2 Creating the Unit Configuration .................................................................................................. 3-6
3-2-3 Verifying the Unit Configuration .................................................................................................. 3-7
3-3 I/O Ports and Device Variables ............................................................................................... 3-8
3-3-1 I/O Ports...................................................................................................................................... 3-8
3-3-2 I/O Port Names ........................................................................................................................... 3-9
3-3-3 Device Variables ....................................................................................................................... 3-10
3-4 Allocating Variables to Units ................................................................................................ 3-14
3-4-1 Procedure to Assign Variables to Units .................................................................................... 3-14
3-4-2 Using Variables Assigned to Units............................................................................................ 3-15
3-5 Creating the Axes and Assigning Them to the Servo Drives/Encoder Input Slaves/NX Units
................................................................................................................................................. 3-17
3-5-1 Introduction ............................................................................................................................... 3-17
3-5-2 Axis Variables and Axes Group Variables................................................................................. 3-18
3-5-3 Creating and Using Axes and Axis Variables............................................................................ 3-20

Section 4 Controller Setup


4-1 Overview of the Controller Setup........................................................................................... 4-2
4-2 Initial Settings for the PLC Function Module ........................................................................ 4-4
4-2-1 Introduction ................................................................................................................................. 4-4
4-2-2 Controller Setup.......................................................................................................................... 4-4
4-2-3 Task Settings .............................................................................................................................. 4-7
4-2-4 Unit Configuration and Unit Setup for NX1P2 CPU Units ......................................................... 4-12
4-2-5 Unit Configuration and Unit Setup for NJ-series CPU Units ..................................................... 4-15
4-3 Initial Settings for NX Units .................................................................................................. 4-16
4-3-1 NX Unit Settings ....................................................................................................................... 4-16
4-3-2 I/O Allocation Settings .............................................................................................................. 4-17
4-3-3 Unit Operation Settings............................................................................................................. 4-19
4-4 Initial Settings for Special Units........................................................................................... 4-20
4-5 Initial Settings for the Motion Control Function Module.................................................... 4-22
4-5-1 Introduction ............................................................................................................................... 4-22
4-5-2 Setting Methods........................................................................................................................ 4-23
4-6 Initial Settings for the EtherCAT Master Function Module ................................................ 4-24
4-7 Initial Settings for the EtherNet/IP Function Module.......................................................... 4-25
4-8 Initial Settings for Built-in I/O ............................................................................................... 4-26
4-9 Initial Settings for Option Boards ........................................................................................ 4-27
4-10 Memory Settings for CJ-series Units................................................................................... 4-28

NJ/NX-series CPU Unit Software User’s Manual (W501) 9


CONTENTS

Section 5 Designing Tasks


5-1 Overview of Task Designing Procedure ................................................................................ 5-3
5-2 Overview of Tasks ................................................................................................................... 5-6
5-2-1 Tasks ........................................................................................................................................... 5-6
5-2-2 Instructions Related to Tasks ...................................................................................................... 5-8
5-2-3 System-defined Variables Related to Tasks................................................................................ 5-8
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units................................. 5-11
5-3-1 Specifications of Tasks for NX701 CPU Units ........................................................................... 5-11
5-3-2 Guidelines for Separating Tasks for NX701 CPU Units............................................................. 5-12
5-3-3 Basic Operation of Tasks for NX701 CPU Units........................................................................ 5-12
5-3-4 Event Task Execution Conditions for NX701 CPU Units ........................................................... 5-22
5-3-5 Event Task Execution Timing for NX701 CPU Units ................................................................. 5-27
5-3-6 Operation When Execution Condition Is Met Again before Execution of the Event Task Is
Completed................................................................................................................................. 5-31
5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units ................................ 5-32
5-4-1 Specifications of Tasks for NX1P2 CPU Units .......................................................................... 5-32
5-4-2 Guidelines for Separating Tasks for NX1P2 CPU Units ............................................................ 5-33
5-4-3 Basic Operation of Tasks for NX1P2 CPU Units ....................................................................... 5-33
5-4-4 Event Task Execution Conditions for NX1P2 CPU Units........................................................... 5-39
5-4-5 Event Task Execution Timing for NX1P2 CPU Units ................................................................. 5-44
5-4-6 Operation When Execution Condition Is Met Again before Execution of the Event Task Is
Completed................................................................................................................................. 5-48
5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers .......................... 5-49
5-5-1 Specifications of Tasks for NJ-series Controllers ...................................................................... 5-49
5-5-2 Guidelines for Separating Tasks for NJ-series Controllers........................................................ 5-50
5-5-3 Basic Operation of Tasks for NJ-series Controllers................................................................... 5-50
5-5-4 Event Task Execution Conditions for NJ-series Controllers ...................................................... 5-59
5-5-5 Event Task Execution Timing for NJ-series Controllers ............................................................ 5-64
5-5-6 Operation When Execution Condition Is Met Again before Execution of the Event Task Is
Completed................................................................................................................................. 5-68
5-6 Services Other Than Tasks................................................................................................... 5-69
5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks ............................... 5-71
5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service ......................... 5-74
5-6-3 Processing Performed in and Execution Timing of the Option Board Service .......................... 5-78
5-6-4 Processing Performed in and Execution Timing of the System Services.................................. 5-79
5-7 Assignment and Settings Related to Tasks ........................................................................ 5-82
5-7-1 Assigning I/O Refreshing to Tasks ............................................................................................ 5-82
5-7-2 Assigning Tasks to Programs.................................................................................................... 5-90
5-7-3 Parameters for Primary Periodic Task and Periodic Tasks........................................................ 5-91
5-8 Ensuring Concurrency of Variable Values .......................................................................... 5-94
5-8-1 Ensuring Concurrency of Variable Values between Tasks ........................................................ 5-94
5-8-2 Variable Access from Outside the Controller .......................................................................... 5-100
5-9 Errors Related to Tasks....................................................................................................... 5-104
5-10 Monitoring Task Execution Status and Task Execution Times ....................................... 5-107
5-11 Task Design Methods and I/O Response Times ............................................................... 5-111
5-11-1 Checking the Task Execution Time ......................................................................................... 5-111
5-11-2 Examples of Task Design........................................................................................................ 5-114
5-11-3 System Input and Output Response Times ............................................................................ 5-115

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

10 NJ/NX-series CPU Unit Software User’s Manual (W501)


CONTENTS

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-56
6-3-9 Changes to Variables for Status Changes ................................................................................ 6-64
6-3-10 Function Block Instances.......................................................................................................... 6-79
6-3-11 Monitoring Variable Values ....................................................................................................... 6-79
6-3-12 Restrictions on Variable Names and Other Program-related Names ....................................... 6-80
6-4 Constants (Literals) ............................................................................................................... 6-82
6-4-1 Constants.................................................................................................................................. 6-82
6-4-2 Notation for Different Data Types.............................................................................................. 6-82
6-5 Programming Languages ..................................................................................................... 6-87
6-5-1 Programming Languages ......................................................................................................... 6-87
6-5-2 Ladder Diagram Language ....................................................................................................... 6-87
6-5-3 Structured Text Language......................................................................................................... 6-93
6-6 Instructions .......................................................................................................................... 6-130
6-6-1 Instructions ............................................................................................................................. 6-130
6-6-2 Basic Understanding of Instructions ....................................................................................... 6-130
6-6-3 Instruction Errors .................................................................................................................... 6-133
6-7 Namespaces......................................................................................................................... 6-139
6-7-1 Namespaces........................................................................................................................... 6-139
6-7-2 Namespace Specifications ..................................................................................................... 6-140
6-7-3 Procedure for Using Namespaces.......................................................................................... 6-143
6-8 Libraries ............................................................................................................................... 6-144
6-8-1 Introduction to Libraries .......................................................................................................... 6-144
6-8-2 Specifications of Libraries....................................................................................................... 6-145
6-8-3 Library Object Specifications .................................................................................................. 6-146
6-8-4 Procedure to Use Libraries ..................................................................................................... 6-147
6-9 Programming Precautions.................................................................................................. 6-148
6-9-1 Array Specifications for Input Variables, Output Variables, In-Out Variables .......................... 6-148
6-9-2 Structure Variables for Input Variables, Output Variables, In-Out Variables ........................... 6-148
6-9-3 Master Control ........................................................................................................................ 6-149

Section 7 Checking Operation and Actual Operation


7-1 Overview of Steps in Checking Operation and Actual Operation....................................... 7-2
7-2 Offline Debugging.................................................................................................................... 7-3
7-2-1 Features of Simulation ................................................................................................................ 7-3
7-2-2 Simulation Execution .................................................................................................................. 7-3
7-2-3 Setting Up Simulations ............................................................................................................... 7-6
7-3 Checking Operation on the Actual System and Actual Operation...................................... 7-8
7-3-1 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

NJ/NX-series CPU Unit Software User’s Manual (W501) 11


CONTENTS

Section 8 CPU Unit Functions


8-1 Data Management, Clock, and Operating Functions............................................................ 8-3
8-1-1 Clearing All Memory.................................................................................................................... 8-3
8-1-2 Clock ........................................................................................................................................... 8-3
8-1-3 RUN Output................................................................................................................................. 8-6
8-2 Management Functions for NX Units..................................................................................... 8-7
8-2-1 NX Bus Function Module ............................................................................................................ 8-7
8-2-2 Mounting Settings of NX Units on the CPU Unit ....................................................................... 8-12
8-2-3 Restarting NX Units on the CPU Unit ....................................................................................... 8-15
8-2-4 Checking Wiring for NX Units on the CPU Unit......................................................................... 8-16
8-2-5 Fail-soft Operation for NX Units on the CPU Unit ..................................................................... 8-17
8-2-6 Monitoring Total Power-ON Time for NX Units on the CPU Unit ............................................... 8-21
8-3 Management Functions for CJ-series Units........................................................................ 8-22
8-3-1 Basic I/O Units .......................................................................................................................... 8-22
8-3-2 Special Units ............................................................................................................................. 8-23
8-4 SD Memory Card Operations................................................................................................ 8-25
8-4-1 SD Memory Card Operations.................................................................................................... 8-25
8-4-2 Specifications of Supported SD Memory Cards, Folders, and Files ......................................... 8-26
8-4-3 SD Memory Card Operation Instructions .................................................................................. 8-28
8-4-4 FTP Client Communications Instructions .................................................................................. 8-28
8-4-5 FTP Server................................................................................................................................ 8-29
8-4-6 File Operations from the Sysmac Studio................................................................................... 8-29
8-4-7 SD Memory Card Life Expiration Detection .............................................................................. 8-29
8-4-8 List of System-defined Variables Related to SD Memory Cards............................................... 8-30
8-4-9 SD Memory Card Self-diagnostic Functions ............................................................................. 8-31
8-4-10 Exclusive Control of File Access in SD Memory Cards............................................................. 8-33
8-5 Security .................................................................................................................................. 8-34
8-5-1 Authentication of User Program Execution IDs ......................................................................... 8-35
8-5-2 User Program Transfer with No Restoration Information........................................................... 8-38
8-5-3 Overall Project File Protection................................................................................................... 8-39
8-5-4 Data Protection ......................................................................................................................... 8-40
8-5-5 Operation Authority Verification................................................................................................. 8-42
8-5-6 CPU Unit Write Protection ........................................................................................................ 8-44
8-5-7 CPU Unit Names and Serial IDs ............................................................................................... 8-45
8-6 Debugging .............................................................................................................................. 8-47
8-6-1 Forced Refreshing..................................................................................................................... 8-47
8-6-2 Changing Present Values.......................................................................................................... 8-52
8-6-3 Online Editing............................................................................................................................ 8-54
8-6-4 Data Tracing .............................................................................................................................. 8-56
8-6-5 Differential Monitoring ............................................................................................................... 8-62
8-7 Event Logs ............................................................................................................................. 8-67
8-7-1 Introduction ............................................................................................................................... 8-67
8-7-2 Detailed Information on Event Logs .......................................................................................... 8-69
8-7-3 Controller Events (Controller Errors and Information)............................................................... 8-74
8-7-4 User-defined Events (User-defined Errors and Information)..................................................... 8-76
8-8 Changing Event Levels ......................................................................................................... 8-83
8-8-1 Applications of Changing Event Levels ..................................................................................... 8-83
8-8-2 Events for Which the Event Level Can Be Changed ................................................................. 8-83
8-8-3 Procedure to Change an Event Level ....................................................................................... 8-84

Section 9 Backup Functions


9-1 The Backup Functions ............................................................................................................ 9-3
9-1-1 Applications of Backup Functions ............................................................................................... 9-3
9-1-2 Examples of Operating Procedures for the Backup Functions.................................................... 9-4
9-1-3 Data That Is Backed Up .............................................................................................................. 9-6
9-1-4 Types of Backup Functions ......................................................................................................... 9-8

12 NJ/NX-series CPU Unit Software User’s Manual (W501)


CONTENTS

9-1-5 Relation Between the Different Types of Backup Functions and Data Groups......................... 9-10
9-1-6 Applicable Range of the Backup Functions .............................................................................. 9-11
9-2 SD Memory Card Backups.................................................................................................... 9-13
9-2-1 Backup (Controller to SD Memory Card) .................................................................................. 9-14
9-2-2 Restore (SD Memory Card to Controller) ................................................................................. 9-19
9-2-3 Verify (between Controller and SD Memory Card) ................................................................... 9-27
9-3 Disabling Backups to SD Memory Cards ............................................................................ 9-32
9-4 Automatic Transfers from SD Memory Cards ..................................................................... 9-33
9-5 Program Transfer from SD Memory Card ............................................................................ 9-35
9-6 Sysmac Studio Controller Backups..................................................................................... 9-42
9-6-1 Backup (Controller to Computer) .............................................................................................. 9-43
9-6-2 Restore (Computer to Controller) ............................................................................................. 9-44
9-6-3 Verify (between Controller and Computer) ............................................................................... 9-46
9-7 Importing and Exporting Sysmac Studio Backup File Data .............................................. 9-47
9-8 Sysmac Studio Variable and Memory Backup Functions.................................................. 9-48
9-8-1 Applicable Data for Sysmac Studio Variable and Memory Backup Functions .......................... 9-48
9-8-2 Using Sysmac Studio Variable and Memory Backup Functions ............................................... 9-48
9-8-3 Compatibility between CPU Unit Models .................................................................................. 9-49
9-9 Backup Functions When EtherCAT Slaves Are Connected............................................... 9-51
9-9-1 Backed Up EtherCAT Slave Data ............................................................................................. 9-51
9-9-2 Backup Support Depending on the Controller Status............................................................... 9-51
9-9-3 Conditions for Restoring EtherCAT Slave Data ........................................................................ 9-52
9-9-4 EtherCAT Slaves for Which You Can Back Up Data ................................................................. 9-53
9-10 Backup Functions When EtherCAT Slave Terminals Are Connected............................... 9-56
9-10-1 Backing Up Data in an EtherCAT Slave Terminal ..................................................................... 9-56
9-10-2 Backup Support Depending on the EtherCAT Slave Terminal Status....................................... 9-57
9-10-3 Conditions for Restoring EtherCAT Slave Terminal Data.......................................................... 9-57
9-11 Backup Functions When NX Units Are Connected ............................................................ 9-58
9-11-1 Backing Up Data in NX Units on the CPU Unit......................................................................... 9-58
9-11-2 Backup Support Depending on the Controller Status............................................................... 9-58
9-11-3 Conditions for Restoring NX Unit Data on the CPU Unit .......................................................... 9-59
9-12 Backup Functions When CJ-series Units Are Connected ................................................. 9-60
9-12-1 Backed Up CJ-series Unit Data ................................................................................................ 9-60
9-12-2 Backup Support Depending on the Controller Status............................................................... 9-60
9-12-3 Conditions for Restoring CJ-series Unit Data ........................................................................... 9-60
9-13 Backup-related Files ............................................................................................................. 9-62
9-13-1 Types of Backup-related Files................................................................................................... 9-62
9-13-2 Specifications of a Backup File................................................................................................. 9-63
9-13-3 Specifications of a Restore Command File............................................................................... 9-63
9-13-4 Specifications of an Automatic Transfer Command File ........................................................... 9-66
9-13-5 Specifications of a Controller Verification Results File.............................................................. 9-69
9-13-6 Specifications of an EtherCAT Verification Results File............................................................ 9-70
9-13-7 Specifications of an EtherCAT Slave Terminal Verification Results File ................................... 9-71
9-13-8 Specifications of an NX Unit Verification Results File............................................................... 9-72
9-13-9 Specifications of CJ-series Unit Verification Results File.......................................................... 9-73
9-14 Compatibility between Backup-related Files ...................................................................... 9-75
9-14-1 Compatibility between Backup Functions ................................................................................. 9-75
9-14-2 Compatibility between CPU Unit Models .................................................................................. 9-76
9-14-3 Compatibility between Unit Versions of CPU Units................................................................... 9-77
9-15 Functions That Cannot Be Executed during Backup Functions....................................... 9-78

Section 10 Communications Setup


10-1 Communications System Overview..................................................................................... 10-2
10-1-1 Introduction ............................................................................................................................... 10-3

NJ/NX-series CPU Unit Software User’s Manual (W501) 13


CONTENTS

10-2 Connection with Sysmac Studio .......................................................................................... 10-6


10-2-1 Configurations That Allow Online Connections......................................................................... 10-6
10-2-2 Configurations That Do Not Allow Online Connections............................................................. 10-7
10-3 Connection with Other Controllers or Slaves ..................................................................... 10-9
10-3-1 Connection Configurations between Controllers....................................................................... 10-9
10-3-2 Connection Configuration between Controllers and Slaves .................................................... 10-12
10-4 Connection with HMIs or Serial Communications Devices ............................................. 10-13
10-4-1 Connection with HMIs ............................................................................................................. 10-13
10-4-2 Connection with Serial Communications Devices................................................................... 10-14

Section 11 Example of Actual Application Procedures


11-1 Example Application ............................................................................................................. 11-2
11-1-1 System Configuration................................................................................................................ 11-2
11-1-2 Operation .................................................................................................................................. 11-2
11-2 Overview of the Example Procedure ................................................................................... 11-3
11-2-1 Wiring and Settings ................................................................................................................... 11-3
11-2-2 Software Design........................................................................................................................ 11-3
11-2-3 Software Settings from the Sysmac Studio............................................................................... 11-4
11-2-4 Programming with the Sysmac Studio ...................................................................................... 11-8
11-2-5 Simulation with the Sysmac Studio ........................................................................................... 11-9
11-2-6 Checking Operation and Starting Operation on the Actual System .......................................... 11-9

Section 12 Troubleshooting
12-1 Operation after an Error ........................................................................................................ 12-2
12-1-1 Overview of NJ/NX-series Status.............................................................................................. 12-2
12-1-2 Fatal Errors in the CPU Unit...................................................................................................... 12-5
12-1-3 Non-fatal Errors in the CPU Unit ............................................................................................... 12-7
12-2 Troubleshooting................................................................................................................... 12-16
12-2-1 Checking to See If the CPU Unit Is Operating ........................................................................ 12-16
12-2-2 Troubleshooting Flowchart for Non-fatal Errors....................................................................... 12-18
12-2-3 Error Table............................................................................................................................... 12-19
12-2-4 Error Descriptions ................................................................................................................... 12-37
12-2-5 Troubleshooting Errors That Are Not in the CPU Unit............................................................. 12-99

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-10
A-2 Calculating Guidelines for the Real Processing Times of Tasks for the NX701 System A-18
A-2-1 Calculating the Average Real Processing Times of Tasks ........................................................A-19
A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-26
A-3 Calculating Guidelines for the Real Processing Times of Tasks for the NX1P2 System A-29
A-3-1 Calculating the Average Real Processing Times of Tasks ........................................................A-30
A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-36
A-4 Calculating Guidelines for the Real Processing Times of Tasks for the NJ-series System
...............................................................................................................................................A-39
A-4-1 Calculating the Average Real Processing Times of Tasks ........................................................A-40
A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
..................................................................................................................................................A-50

14 NJ/NX-series CPU Unit Software User’s Manual (W501)


CONTENTS

A-5 System-defined Variables .....................................................................................................A-54


A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category) ................... A-55
A-5-2 PLC Function Module, Category Name: _PLC ......................................................................... A-65
A-5-3 PLC Function Module, Category Name: _CJB ......................................................................... A-70
A-5-4 NX Bus Function Module, Category Name: _NXB ................................................................... A-72
A-5-5 Motion Control Function Module, Category Name: _MC .......................................................... A-75
A-5-6 EtherCAT Master Function Module, Category Name: _EC....................................................... A-78
A-5-7 EtherNet/IP Function Module, Category Name: _EIP .............................................................. A-83
A-5-8 Meanings of Error Status Bits ................................................................................................. A-110
A-6 Specifications for Individual System-defined Variables ..................................................A-112
A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category) ................. A-113
A-6-2 PLC Function Module, Category Name: _PLC ....................................................................... A-130
A-6-3 PLC Function Module, Category Name: _CJB ....................................................................... A-135
A-6-4 NX Bus Function Module, Category Name: _NXB ................................................................. A-140
A-6-5 Motion Control Function Module, Category Name: _MC ........................................................ A-143
A-6-6 EtherCAT Master Function Module, Category Name: _EC..................................................... A-147
A-6-7 EtherNet/IP Function Module, Category Name: _EIP ............................................................ A-156
A-7 Attributes of CPU Unit Data ................................................................................................A-181
A-8 Contents of Memory Used for CJ-series Units .................................................................A-185
A-8-1 CIO Area................................................................................................................................. A-185
A-8-2 Internal I/O Area ..................................................................................................................... A-187
A-8-3 Holding Area ........................................................................................................................... A-188
A-8-4 DM Area.................................................................................................................................. A-188
A-8-5 EM Area.................................................................................................................................. A-189
A-9 Variable Memory Allocation Methods ................................................................................A-190
A-9-1 Variable Memory Allocation Rules .......................................................................................... A-190
A-9-2 Important Case Examples ...................................................................................................... A-198
A-10 Registering a Symbol Table on the CX-Designer .............................................................A-202
A-11 Enable/Disable EtherCAT Slaves and Axes.......................................................................A-205
A-11-1 Project Settings When Using EtherCAT Slaves and Axes ...................................................... A-205
A-11-2 Using Instructions to Enable/Disable EtherCAT Slaves and Axes .......................................... A-205
A-11-3 System-defined Variables That Indicate EtherCAT Slave or Axis Status................................ A-206
A-11-4 Enabling/Disabling Execution of Program............................................................................... A-207
A-11-5 Checking Enabled/Disabled Program ..................................................................................... A-207
A-11-6 Settings with the Sysmac Studio ............................................................................................ A-207
A-11-7 Examples of Applications of Enabling/Disabling EtherCAT Slaves and Axes ......................... A-208
A-12 Size Restrictions for the User Program.............................................................................A-211
A-12-1 User Program Object Restrictions .......................................................................................... A-211
A-12-2 Counting User Program Objects............................................................................................. A-215
A-13 Replacing CPU Units with Unit Version 1.02 or Earlier ....................................................A-217
A-13-1 Uploading the Data from the CPU Unit................................................................................... A-217
A-13-2 Connecting the New CPU Unit ............................................................................................... A-220
A-13-3 Downloading the Data to the CPU Unit .................................................................................. A-221
A-14 Version Information for NX-series Controllers..................................................................A-225
A-14-1 Relationship Between Unit Versions of CPU Units and Sysmac Studio Versions .................. A-225
A-14-2 Functions That Were Added or Changed for Each Unit Version............................................. A-227
A-15 Version Information for NJ-series Controllers ..................................................................A-228
A-15-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions................... A-228
A-15-2 Relationship between Hardware Revisions of CPU Units and Sysmac Studio Versions ........ A-230
A-15-3 Functions That Were Added or Changed for Each Unit Version............................................. A-231
A-15-4 Performance Improvements for Unit Version Upgrades.......................................................... A-234

Index

NJ/NX-series CPU Unit Software User’s Manual (W501) 15


Terms and Conditions Agreement

Terms and Conditions Agreement

Warranty, Limitations of Liability

Warranties
 Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and 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.

See http://www.omron.com/global/ or contact your Omron representative for published information.

Limitation on Liability; Etc


OMRON COMPANIES SHALL NOT BE LIABLE FOR SPECIAL, INDIRECT, INCIDENTAL, OR CON-
SEQUENTIAL DAMAGES, LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY
WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED IN CONTRACT,
WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual price of the Product on
which liability is asserted.

16 NJ/NX-series CPU Unit Software User’s Manual (W501)


Terms and Conditions Agreement

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 WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS PROPERLY RATED AND
INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.

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.

Errors and Omissions


Information presented by Omron Companies has been checked and is believed to be accurate; how-
ever, no responsibility is assumed for clerical, typographical or proofreading errors or omissions.

NJ/NX-series CPU Unit Software User’s Manual (W501) 17


Safety Precautions

Safety Precautions

Refer to the following manuals for safety precautions.


• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

18 NJ/NX-series CPU Unit Software User’s Manual (W501)


Precautions for Safe Use

Precautions for Safe Use


Refer to the following manuals for precautions for safe use.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

NJ/NX-series CPU Unit Software User’s Manual (W501) 19


Precautions for Correct Use

Precautions for Correct Use


Refer to the following manuals for precautions for correct use.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500)

20 NJ/NX-series CPU Unit Software User’s Manual (W501)


Regulations and Standards

Regulations and Standards

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)

 Low Voltage Directive


Always ensure that devices operating at voltages of 50 to 1,000 VAC and 75 to 1,500 VDC meet the
required safety standards. The applicable directive is EN 61010-2-201.

 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 21


Regulations and Standards

Conformance to KC Standards
Observe the following precaution if you use NX-series Units in Korea.

Class A Device (Broadcasting Communications Device for Office Use)


This device obtained EMC registration for office use (Class A), and it is intended to be used in places
other than homes.
Sellers and/or users need to take note of this.

Conformance to Shipbuilding Standards


The NJ/NX-series Controllers comply with the following shipbuilding standards. Applicability to the
shipbuilding standards is based on certain usage conditions. It may not be possible to use the prod-
uct in some locations. Contact your OMRON representative before attempting to use a Controller on
a ship.

Usage Conditions for NK and LR Shipbuilding Standards


• The NJ/NX-series Controller must be installed within a control panel.
• Gaps in the door to the control panel must be completely filled or covered with gaskets or other
material.
• The following noise filter must be connected to the power supply line.

Noise Filter

Manufacturer Model
Cosel Co., Ltd. TAH-06-683

Software Licenses and Copyrights


This product incorporates certain third party software. The license and copyright information associ-
ated with this software is available at http://www.fa.omron.co.jp/nj_info_e/.

22 NJ/NX-series CPU Unit Software User’s Manual (W501)


Versions

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.

Checking Unit Versions on ID Information Indications


The unit version is given on the ID information indication on the side of the product.
The ID information on an NX-series NX701- CPU Unit is shown below.

ID information indication

Lot number Serial number Unit version

LOT No. DDMYY xxxx Ver.1.


PORT1 :  HW Rev. 
PORT2 : 

MAC address Hardware revision

Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

The ID information on an NX-series NX1P2- CPU Unit is shown below.

MAC address

PORT1 : 
PORT2 : 
Hardware
Unit version Ver.1. HW Rev.  revision
LOT No. DDMYY xxxx
ID information indication

Lot number Serial number

Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

NJ/NX-series CPU Unit Software User’s Manual (W501) 23


Versions

The ID information on an NJ-series NJ501- CPU Unit is shown below.

ID information indication

Unit model Unit version Hardware revision

NJ501 -  Ver.1. HW Rev. 


PORT1 MAC ADDRESS: 
PORT2 MAC ADDRESS: 
Lot No. DDMYY xxxx

Lot number Serial number MAC address


Note The hardware revision is not displayed for the Unit that the hardware revision is in blank.

Checking Unit Versions with the Sysmac Studio


You can use the Sysmac Studio to check unit versions. The procedure is different for Units and for Eth-
erCAT slaves.

 Checking the Unit Version of an NX-series CPU Unit


You can use the Production Information while the Sysmac Studio is online to check the unit version
of a Unit. You can do this for the CPU Unit. For an NX1P2 CPU Unit, you can also check the unit
versions of the NX Units on the CPU Rack and Option Boards.

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.

 Checking the Unit Version of an NJ-series CPU Unit


You can use the Production Information while the Sysmac Studio is online to check the unit version
of a Unit. You can do this for the CPU Unit, CJ-series Special I/O Units, and CJ-series CPU Bus
Units. You cannot check the unit versions of CJ-series Basic I/O Units with the Sysmac Studio.
Use the following procedure to check the unit version.

1 Double-click CPU/Expansion Racks under Configurations and Setup in the Multiview


Explorer. Or, right-click CPU/Expansion Racks under Configurations and Setup and select
Edit from the menu.
The Unit Editor is displayed.

2 Right-click any open space in the Unit Editor and select Production Information.
The Production Information Dialog Box is displayed.

24 NJ/NX-series CPU Unit Software User’s Manual (W501)


Versions

 Changing Information Displayed in Production Information Dialog Box

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.

Outline View Detail View

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.

 Checking the Unit Version of an EtherCAT Slave


You can use the Production Information while the Sysmac Studio is online to check the unit version
of an EtherCAT slave. Use the following procedure to check the unit version.

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.”

 Changing Information Displayed in Production Information Dialog Box

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 25


Versions

Outline View Detail View

Unit Versions of CPU Units and Sysmac Studio Versions


The functions that are supported depend on the unit version of the NJ/NX-series CPU Unit. The version
of Sysmac Studio that supports the functions that were added for an upgrade is also required to use
those functions.
Refer to A-14 Version Information for NX-series Controllers and A-15 Version Information for NJ-series
Controllers for the relationship between the unit versions of the CPU Units and the Sysmac Studio ver-
sions, and for the functions that are supported by each unit version.

26 NJ/NX-series CPU Unit Software User’s Manual (W501)


Related Manuals

Related Manuals
The followings are the manuals related to this manual. Use these manuals for reference.

Manual name Cat. No. Model numbers Application Description


NX-series CPU Unit W535 NX701- Learning the basic An introduction to the entire NX701 system is
Hardware User’s Manual specifications of the provided along with the following information
NX701 CPU Units, on the CPU Unit.
including introductory • Features and system configuration
information, designing,
• Introduction
installation, and main-
tenance. • Part names and functions
Mainly hardware infor- • General specifications
mation is provided. • Installation and wiring
• Maintenance and inspection
NX-series NX1P2 CPU Unit W578 NX1P2- Learning the basic An introduction to the entire NX1P2 system is
Hardware User's Manual specifications of the provided along with the following information
NX1P2 CPU Units, on the CPU Unit.
including introductory • Features and system configuration
information, designing,
• Introduction
installation, and main-
tenance. • Part names and functions
• General specifications
Mainly hardware infor-
mation is provided. • Installation and wiring
• Maintenance and inspection
NJ-series CPU Unit W500 NJ501- Learning the basic An introduction to the entire NJ-series system
Hardware User’s Manual NJ301- specifications of the is provided along with the following informa-
NJ101- NJ-series CPU Units, tion on the CPU Unit.
including introductory • Features and system configuration
information, designing,
• Introduction
installation, and main-
tenance. • Part names and functions
Mainly hardware infor- • General specifications
mation is provided. • Installation and wiring
• Maintenance and inspection
NJ/NX-series CPU Unit W501 NX701- Learning how to pro- The following information is provided on a
Software User’s Manual NX1P2- gram and set up an Controller built with an NJ/NX-series CPU
NJ501- NJ/NX-series CPU Unit.
NJ301- Unit. • CPU Unit operation
NJ101- Mainly software infor-
• CPU Unit features
mation is provided.
• Initial settings
• Programming based on IEC 61131-3 lan-
guage specifications
NX-series NX1P2 CPU Unit W579 NX1P2- Learning about the Of the functions for an NX1P2 CPU Unit, the
Built-in I/O and Option Board details of functions following information is provided.
User's Manual only for an NX-series • Built-in I/O
NX1P2 CPU Unit and
• Serial Communications Option Boards
an introduction of
functions for an • Analog I/O Option Boards
NJ/NX-series CPU An introduction of following functions for an
Unit. NJ/NX-series CPU Unit is also provided.
• Motion control functions
• EtherNet/IP communications functions
• EtherCAT communications functions
NJ/NX-series Instructions W502 NX701- Learning detailed The instructions in the instruction set (IEC
Reference Manual NX1P2- specifications on the 61131-3 specifications) are described.
NJ501- basic instructions of
NJ301- an NJ/NX-series CPU
NJ101- Unit.
NJ/NX-series CPU Unit W507 NX701- Learning about The settings and operation of the CPU Unit
Motion Control User’s Manual NX1P2- motion control set- and programming concepts for motion control
NJ501- tings and program- are described.
NJ301- ming concepts.
NJ101-

NJ/NX-series CPU Unit Software User’s Manual (W501) 27


Related Manuals

Manual name Cat. No. Model numbers Application Description


NJ/NX-series W508 NX701- Learning about the The motion control instructions are described.
Motion Control Instructions NX1P2- specifications of the
Reference Manual NJ501- motion control
NJ301- instructions.
NJ101-
NJ/NX-series W505 NX701- Using the built-in Eth- Information on the built-in EtherCAT port is
CPU Unit NX1P2- erCAT port on an provided.
Built-in EtherCAT Port NJ501- NJ/NX-series CPU This manual provides an introduction and pro-
User’s Manual NJ301- Unit. vides information on the configuration, fea-
NJ101- tures, and setup.
NJ/NX-series W506 NX701- Using the built-in Eth- Information on the built-in EtherNet/IP port is
CPU Unit NX1P2- erNet/IP port on an provided.
Built-in EtherNet/IP Port NJ501- NJ/NX-series CPU Information is provided on the basic setup, tag
User’s Manual NJ301- Unit. data links, and other features.
NJ101-
NJ-series W527 NJ501-120 Using the database Describes the database connection service.
Database Connection CPU Units NJ101-20 connection service
User’s Manual with NJ-series Con-
trollers.
NJ-series W528 NJ501-1340 Using the GEM Ser- Provides information on the GEM Services.
SECS/GEM CPU Units vices with NJ-series
User’s Manual Controllers.
NJ-series NJ Robotics CPU W539 NJ501-4 Controlling robots Describes the functionality to control robots.
Unit User’s Manual with NJ-series CPU
Units.
NJ/NX-series W503 NX701- Learning about the Concepts on managing errors that may be
Troubleshooting Manual NX1P2- errors that may be detected in an NJ/NX-series Controller and
NJ501- detected in an information on individual errors are described.
NJ301- NJ/NX-series Con-
NJ101- troller.
Sysmac Studio Version 1 W504 SYSMAC Learning about the Describes the operating procedures of the
Operation Manual -SE2 operating proce- Sysmac Studio.
dures and functions
of the Sysmac Studio.
NX-series W519 NX-ECC Learning how to use The following items are described: the overall
EtherCAT Coupler Unit an NX-series Ether- system and configuration methods of an Eth-
User’s Manual CAT Coupler Unit and erCAT Slave Terminal (which consists of an
EtherCAT Slave Ter- NX-series EtherCAT Coupler Unit and NX
minals. Units), and information on hardware, setup,
and functions to set up, control, and monitor
NX Units through EtherCAT.
NX-series Data Reference W525 NX- Referencing lists of Lists of the power consumptions, weights, and
Manual the data that is other NX Unit data that is required to config-
required to configure ure systems with NX-series Units are pro-
systems with NX- vided.
series Units.
NX-series NX Units User’s W521 NX-ID Learning how to use Describes the hardware, setup methods, and
Manuals NX-IA NX Units. functions of the NX Units.
NX-OC Manuals are available for the following Units.
NX-OD
NX-MD Digital I/O Units, Analog I/O Units, System
Units, Position Interface Units, Communica-
W522 NX-AD
tions Interface Units, Load Cell Input Units,
NX-DA
and IO-Link Master Units.
W566 NX-TS
NX-HB
W523 NX-PD1
NX-PF0
NX-PC0
NX-TBX01
W524 NX-EC0
NX-ECS
NX-PG0
W540 NX-CIF
W565 NX-RS
W567 NX-ILM

28 NJ/NX-series CPU Unit Software User’s Manual (W501)


Related Manuals

Manual name Cat. No. Model numbers Application Description


NX-series Z930 NX-SL Learning how to use Describes the hardware, setup methods, and
Safety Control Unit NX-SI NX-series Safety functions of the NX-series Safety Control
User’s Manual NX-SO Control Units Units.
Vision System Z340 FH-1 Learning how to use Describes the software functions, setup and
FH/FZ5 Series Vision System FH-3 the FH/FZ5-series operating methods required for using the
User’s Manual FZ5-L35 Vision Systems. FH/FZ5-series system.
FZ5-6
FZ5-11
Vision Sensor FQ-M series Z314 FQ-MS12 Learning how to use Describes the hardware, setup methods and
Specialized Vision Sensor for the Specialized functions of the Specialized Vision Sensors
Positioning Vision Sensors for for Positioning.
User’s Manual Positioning.
Vision Sensor FZ3 Series Z290 FZ3- Learning how to use Describes the software functions, setup and
User’s Manual the FZ3-series Vision operating methods of the FZ3-series Vision
Sensors. Sensors.
Displacement Sensor ZW Z332 ZW-CE1 Learning how to use Describes the hardware, setup methods and
series the ZW-series Dis- functions of the ZW-series Displacement Sen-
Confocal Fiber Type Displace- placement Sensors. sors.
ment Sensor
User’s Manual
CJ-series Special Unit W490 CJ1W-AD Learning how to use The methods and precautions for using CJ-
Manuals CJ1W-DA CJ-series Units with series Units with an NJ501 CPU Unit are
for NJ-series CPU Unit CJ1W-MAD42 an NJ-series CPU described, including access methods and pro-
W491 CJ1W-TC Unit. gramming interfaces.
Manuals are available for the following Units.
W492 CJ1W-CT021
Analog I/O Units, Insulated-type Analog I/O
W498 CJ1W-PDC15
Units, Temperature Control Units, ID Sensor
CJ1W-PH41U
Units, High-speed Counter Units, Serial Com-
CJ1W-AD04U
munications Units, DeviceNet Units, Ether-
W493 CJ1W-CRM21 Net/IP Units and CompoNet Master Units.
W494 CJ1W-SCU Use this manual together with the NJ-series
W495 CJ1W-EIP21 CPU Unit Hardware User's Manual (Cat. No.
W497 CJ1W-DRM21 W500) and NJ/NX-series CPU Unit Software
User's Manual (Cat. No. W501).
Z317 CJ1W-V680
NA-series Programmable Ter- V118 NA5-W Learning about NA- Describes the pages and object functions of
minal series PT pages and the NA-series Programmable Terminals.
Software User’s Manual object functions.
NS-series Programmable Ter- V073 NS15- Learning how to use Describes the setup methods, functions, etc. of
minals NS12- the NS-series Pro- the NS-series Programmable Terminals.
Programming Manual NS10- grammable Termi-
NS8- nals.
NS5-
CX-Designer V099 --- Learning to create Describes operating procedures for the CX-
User’s Manual screen data for NS- Designer.
series Programma-
ble Terminals.

NJ/NX-series CPU Unit Software User’s Manual (W501) 29


Terminology

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-.

30 NJ/NX-series CPU Unit Software User’s Manual (W501)


Terminology

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 31


Terminology

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 One type of I/O memory in an NX1P2 CPU Unit and NJ-series CPU Unit. It contains
addresses that can be directly specified by the user.
It can be accessed only with variables with an AT attribute. This memory is used to
access CJ-series Units and CJ-series networks.
However, you cannot connect the CJ-series Units to the NX1P2 CPU Units.
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.

32 NJ/NX-series CPU Unit Software User’s Manual (W501)


Terminology

Term Description
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.
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 33


Terminology

Term Description
variable A representation of data, such as a numeric value or character string, that is used in
a user program.
You can change the value of a variable by assigned the required value. “Variable” is
used as opposed to “constant,” for which the value does not change.
variable memory A memory area that contains the present values of variables that do not have AT
specifications. It can be accessed only with variables without an AT attribute.

34 NJ/NX-series CPU Unit Software User’s Manual (W501)


Revision History

Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.

Cat. No. W501-E1-20


Revision code

Revision code Date Revised content


01 July 2011 Original production
02 March 2012 • Added information on the NJ301-.
• Added information on the functions supported by unit ver-
sion 1.01 of the CPU Units.
• Corrected mistakes.
03 May 2012 • Added information on the functions supported by unit ver-
sion 1.02 of the CPU Units.
• Corrected mistakes.
04 August 2012 • Added information on the functions supported by unit ver-
sion 1.03 of the CPU Units.
• Corrected mistakes.
05 February 2013 • Added information on the functions supported by unit ver-
sion 1.04 of the CPU Units.
• Corrected mistakes.
06 April 2013 • Added information on the functions supported by unit ver-
sion 1.05 of the CPU Units.
• Added information on the NX Series.
• Corrected mistakes.
07 June 2013 • Added information on the functions supported by unit ver-
sion 1.06 of the CPU Units.
• Corrected mistakes.
08 September 2013 • Added information on the functions supported by unit ver-
sion 1.07 of the CPU Units.
• Corrected mistakes.
09 December 2013 • Added information on the functions supported by unit ver-
sion 1.08 of the CPU Units.
• Corrected mistakes.
10 July 2014 • Corrected mistakes.
11 January 2015 • Added information on the functions supported by unit ver-
sion 1.10 of the CPU Units.
• Corrected mistakes.
12 April 2015 • Added information on the NX701- and NJ101-
.
• Corrected mistakes.
13 October 2015 • Added information on the hardware revision.
• Corrected mistakes.
14 April 2016 • Added information on the functions supported by unit ver-
sion 1.11 of the CPU Units.
• Corrected mistakes.
15 July 2016 • Added information on the functions supported by unit ver-
sion 1.12 of the CPU Units.
16 October 2016 • Added information on the NX1P2-.
• Added information on the functions supported by unit ver-
sion 1.13 of the CPU Units.
17 January 2017 • Corrected mistakes.

NJ/NX-series CPU Unit Software User’s Manual (W501) 35


Revision History

18 April 2017 • Added information on the functions supported by unit ver-


sion 1.14 of the CPU Units.
• Corrected mistakes.
19 June 2017 • Corrected mistakes.
20 June 2017 • Added information on the functions supported by unit ver-
sion 1.15 of the CPU Units.

36 NJ/NX-series CPU Unit Software User’s Manual (W501)


1

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.

1-1 The NJ/NX-series Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2


1-1-1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1-1-2 Introduction to the System Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1-2 Main Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
1-3 Overall Operating Procedure for the NJ/NX-series Controller . . . . . . . . . 1-14
1-3-1 Overall Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
1-3-2 Procedure Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-1


1 Introduction to NJ/NX-series Controllers

1-1 The NJ/NX-series Controllers


The SYSMAC NJ/NX-series Controllers are next-generation machine automation controllers that pro-
vide the functionality and high-speed performance that are required for machine control.
They provide the safety, reliability, and maintainability that are required of industrial controllers.
The NJ/NX-series Controllers provide the functionality of previous OMRON PLCs, and they also pro-
vide the functionality that is required for motion control. Synchronized control of I/O devices on high-
speed EtherCAT can be applied to safety devices, vision systems, motion equipment, discrete I/O, and
more.
OMRON offers the new Sysmac Series of control devices designed with unified communications speci-
fications and user interface specifications. The NJ/NX-series Machine Automation Controllers are part
of the Sysmac Series. You can use them together with EtherCAT slaves, other Sysmac products, and
the Sysmac Studio Automation Software to achieve optimum functionality and ease of operation. With a
system that is created from Sysmac products, you can connect components and operate the system
through unified concepts and usability.

Sysmac Studio
Automation Software

Multitasking, Synchronized Control


Sequence control Motion control
NJ/NX-series Controller

IEC programming

EtherCAT control network

Safety devices I/O controls Servo Drives and Machine vision


Inverters

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.

 Support for EtherCAT Slave Terminals


You can use EtherCAT Slave Terminals to save space. You can also flexibly build systems with the
wide variety of NX Units.

1-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-1 The NJ/NX-series Controllers


 Achieving a Safety Subsystem on EtherCAT
You can use NX-series Safety Control Units to integrate safety controls in a sequence and motion
control system as a subsystem on EtherCAT.

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

 NX Units (Only for the NX1P2)

1-1-1 Features
The NX1P2 CPU Units allow you to mount NX-series Digital I/O Units, Analog I/O Units and other
Units on the CPU Unit, in addition to EtherCAT network slaves.

Precautions for Correct Use


You cannot mount NX-series Safety Control Units on the CPU Unit and use them. Use NX-series
Safety Control Units as a subsystem on EtherCAT.

 CJ-series Units (Only for the NJ01)


NJ-series CPU Units allow you to mount CJ-series Basic I/O Units and Special Units on the I/O bus,
in addition to EtherCAT network slaves.

 Standard-feature EtherNet/IP Communications Port


All CPU Units provide an EtherNet/IP port for EtherNet/IP communications. EtherNet/IP is a multi-
vendor industrial network that uses Ethernet. You can use it for networks between Controllers or as
a field network. The use of standard Ethernet technology allows you to connect to many different
types of general-purpose Ethernet devices.

 Standard-feature USB Port (Only for the NX701 and NJ01)


You can connect a computer that runs the Support Software directly to the CPU Unit with a USB
connection.

Precautions for Correct Use


An NX1P2 CPU Unit does not provide a USB port.

 Standard-feature SD Memory Card Slot


You can access an SD Memory Card that is mounted in the CPU Unit from the user program.

 Highly Reliable Hardware


The NJ/NX-series Controllers provide the hardware reliability and RAS functions that you expect of
a PLC.

 Parallel Execution of Tasks with a Multi-core Processor (Only for the NX701 and NX1P2)
The NX701- CPU Unit has a multi-core processor that can execute more than one task in
parallel. This enables high-speed control of even large-scale devices including an improvement of
communications performance for large capacity data.
The NX1P2- CPU Unit has a multi-core processor that can execute the tasks, tag data
link service, and system services in parallel. This secures communications performance with the
Sysmac Studio, an HMI, or other devices.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-3


1 Introduction to NJ/NX-series Controllers

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.

 Programming Languages Based on the IEC 61131-3 International Standard


The NJ/NX-series Controllers support language specifications that are based on IEC 61131-3. To
these, OMRON has added our own improvements. Motion control instructions that are based on
PLCopen® standards and an instruction set (POUs) that follows IEC rules are provided.

 Programming with Variables to Eliminate Worrying about the Memory Map


You access all data through variables in the same way as for the advanced programming languages
that are used on computers. Memory in the CPU Unit is automatically assigned to the variables that
you create so that you do not have to remember the physical addresses.

 A Wealth of Security Features


The many security features of the NJ/NX-series Controllers include operation authority settings and
restriction of program execution with IDs.

 Complete Controller Monitoring


The CPU Unit monitors events in all parts of the Controller, including mounted Units and EtherCAT
slaves. Troubleshooting information for errors is displayed on the Sysmac Studio or on an NS-series
PT. Events are also recorded in logs.

 Sysmac Studio Automation Software


The Sysmac Studio provides an integrated development environment that covers not only the Con-
troller, but also covers peripheral devices and devices on EtherCAT. You can use consistent proce-
dures for all devices regardless of the differences in the devices. The Sysmac Studio supports all
phases of Controller application, from designing through debugging, simulations, commissioning,
and changes during operation.

 A Wealth of Simulation Features


The many simulation features include execution, debugging, and task execution time estimates on a
virtual controller.

1-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-1 The NJ/NX-series Controllers


1-1-2 Introduction to the System Configurations
This section describes the system configurations of the NX-series and NJ-series Controllers.

Introduction to the System Configurations of the NX701 CPU Units


The NX701 CPU Unit supports the following system configurations.
1
 Basic System Configurations
The NX701 basic configurations include the EtherCAT network configuration and the Support Soft-

1-1-2 Introduction to the System Configurations


ware.
• EtherCAT Network Configuration
You can use the built-in EtherCAT port to connect to EtherCAT Slave Terminals, to general-pur-
pose slaves for analog and digital I/O, and to Servo Drives and encoder input slaves. An Ether-
CAT network configuration enables precise sequence and motion control in a fixed cycle with
very little deviation.
• Support Software
The Support Software is connected to the peripheral USB port on the CPU Unit with a commer-
cially 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
Support Software.

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

Precautions for Correct Use


NX Units should be connected to Slave Terminals. The NX bus connector of the CPU Unit is pro-
vided for future expansion so that it cannot be used to connect any NX Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-5


1 Introduction to NJ/NX-series Controllers

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.

Host computer HMI

EtherNet/IP

HMI

NX-series Controller EtherNet/IP


Power Supply Unit CPU Unit NJ-series Controller EtherNet/IP slave

Built-in EtherNet/IP port Built-in EtherCAT port

Refer to Section 10 Communications Setup for details on the network configuration.

 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.

Configuration software Application


The Sysmac Studio is used for sequence control, motion control, and all
Sysmac Studio
other operations except those described below.
The Network Configurator is used for tag data links on EtherNet/IP ports or
Network Configurator
Units.*1
The CX-Integrator is used for remote I/O communications with a DeviceNet
CX-Integrator
Unit or CompoNet Master Unit.
The CX-Protocol is used for protocol macros with Serial Communications
CX-Protocol
Units.
CX-Designer The CX-Designer is used to create screens for NS-series PTs.
*1 If the NJ/NX-series Controller is a target device, you may also use Sysmac Studio version 1.10 or
higher. Use the Network Configurator if a CS/CJ-series PLC operates as the originator device.

1-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-1 The NJ/NX-series Controllers


Introduction to the System Configurations of the NX1P2 CPU Units
The NX1P2 CPU Unit supports the following system configurations.

 Basic System Configurations


The NX1P2 basic configurations include the EtherCAT network configuration, NX Unit configuration,
and the Support Software.
• EtherCAT Network Configuration 1
You can use the built-in EtherCAT port to connect to EtherCAT Slave Terminals, to general-pur-
pose slaves for analog and digital I/O, and to Servo Drives and encoder input slaves. An Ether-

1-1-2 Introduction to the System Configurations


CAT network configuration enables precise sequence and motion control in a fixed cycle with
very little deviation.
• NX Unit Configuration
In addition to the EtherCAT network, you can mount NX-series Digital I/O Units, Analog I/O
Units and other Units.
• Support Software
You can connect the Support Software 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
Support Software.

NX Unit
Support Software Configuration

NX-series NX1P2
CPU Unit

LAN

EtherNet/IP

Built-in EtherNet/IP port

NX Units
Built-in EtherCAT port
CPU Rack

EtherCAT Network
EtherCAT
Configuration

Servo Drive/encoder
Slave Terminal input slaves General-purpose slaves

Precautions for Correct Use


An NX1P2 CPU Unit does not provide a USB port.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-7


1 Introduction to NJ/NX-series Controllers

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.

Host computer HMI

EtherNet/IP

Built-in EtherNet/IP port

NX-series
NX1P2
CPU Unit

Serial NJ/NX-series CPU Unit


Communications NX-series
Option Board Communications Interface Unit

Serial-communications devices

General-purpose components or OMRON components

Refer to Section 10 Communications Setup for details on the network configuration.

 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.

Configuration software Application


The Sysmac Studio is used for sequence control, motion control, and all
Sysmac Studio
other operations except those described below.
The Network Configurator is used for tag data links on EtherNet/IP ports or
Network Configurator
Units.*1
The CX-Integrator is used for remote I/O communications with a DeviceNet
CX-Integrator
Unit or CompoNet Master Unit.
CX-Designer The CX-Designer is used to create screens for NS-series PTs.
*1 If the NJ/NX-series Controller is a target device, you may also use Sysmac Studio version 1.10 or
higher. Use the Network Configurator if a CS/CJ-series PLC operates as the originator device.

1-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-1 The NJ/NX-series Controllers


Introduction to the System Configurations of the NJ-series
Controllers
The NJ Series supports the following system configurations.

 Basic System Configurations


The NJ-series basic configurations include the EtherCAT network configuration, CJ-series Unit con-
figuration, and the Support Software. 1
EtherCAT Network Configuration

1-1-2 Introduction to the System Configurations


You can use the built-in EtherCAT port to connect to EtherCAT Slave Terminals, to general-purpose
slaves for analog and digital I/O, and to Servo Drives and encoder input slaves. An EtherCAT net-
work configuration enables precise sequence and motion control in a fixed cycle with very little devi-
ation.

CJ-series Unit Configuration


In addition to the EtherCAT network, you can mount CJ-series Basic I/O Units and Special Units. CJ-
series Units can be mounted both to the CPU Rack where the CPU Unit is mounted and to Expan-
sion Racks.

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.

Support Software CJ-series Unit


Configuration
Peripheral USB port
Sysmac Studio

NJ-series Controller CJ-series Units


Power
Supply Unit CPU Unit

LAN USB
Or
CPU Rack
EtherNet/IP

EtherCAT Network
Configuration
Built-in EtherNet/IP port EtherCAT

Built-in EtherCAT port

Slave Terminal Servo Drive/encoder


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-9


1 Introduction to NJ/NX-series Controllers

 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

Serial Communications Unit

EtherNet/IP Unit

NJ-series Controller EtherNet/IP

Power Supply Unit CPU Unit NJ-series Controller EtherNet/IP slave

CompoNet Master 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

Built-in EtherCAT port


OUT OUT

CRT1 OD16
CRT1-OD16 OD16
CRT1-OD16
CRT1
REMOTE TERMINAL REMOTE TERMINAL

Serial General-purpose
device with serial
DeviceNet Unit communications

DeviceNet

Refer to Section 10 Communications Setup for details on the network configuration.

 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.

Configuration software Application


The Sysmac Studio is used for sequence control, motion control, and all
Sysmac Studio
other operations except those described below.
The Network Configurator is used for tag data links on EtherNet/IP ports or
Network Configurator
Units.*1
The CX-Integrator is used for remote I/O communications with a DeviceNet
CX-Integrator
Unit or CompoNet Master Unit.
The CX-Protocol is used for protocol macros with Serial Communications
CX-Protocol
Units.
CX-Designer The CX-Designer is used to create screens for NS-series PTs.
*1 If the NJ/NX-series Controller is a target device, you may also use Sysmac Studio version 1.10 or
higher. Use the Network Configurator if a CS/CJ-series PLC operates as the originator device.

1-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-2 Main Specifications


1-2 Main Specifications
This section gives the main specifications of the NJ/NX-series Controllers. Refer to A-1 Specifications
for general specifications, performance specifications, and function specifications.

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Size
Number of
80 MB
6,000
1.5 MB
450
20 MB
3,000
5 MB
750
3 MB
450
1
POU defini-
Program
tions
capacity*1 Quantity
Number of 48,000 1,800 9,000 (*) 3,000 (*) 1,800
POU
Instances
Size 4 MB 32 KB*3 2 MB 0.5 MB
Retain attri-
Number of 40,000 5,000 10,000 5,000 (*)
Memory butes*2
variables
capacity for
variables Size 256 MB 2 MB 4 MB 2 MB
No Retain
Number of 360,000 90,000 90,000 22,500
attributes*4
Program- variables
ming Data types Number of data types 8,000 1,000 2,000 1,000
--- 6,144 words (CIO 0 to 6,144 words (CIO 0 to CIO 6143)
CIO Area
CIO 6143)*5
--- 512 words (W0 to 512 words (W0 to W511)
Memory for Work Area
W511)*5
CJ-series
--- 1,536 words (H0 to 1,536 words (H0 to H1535)
Units (Can be Holding Area
specified with H1535)*6
AT specifica- --- 16,0000 words (D0 to 32,768 words (D0 to D32767)
DM Area
tions for vari- D15999)*6
ables.) --- --- 32,768 words × 32,768 words × 4 banks
25 banks (E0_00000 to E3_32767)
EM Area
(E0_00000 to
E18_32767)
Motion control Refer to Performance Specifications of Motion Control for Each Type of CPU Units on page A-7.
Sysmac Studio --- Sysmac Studio connection
Supported services
connection
Periph-
USB 2.0-compli- --- USB 2.0-compliant B-type connector
eral USB
Physical layer ant B-type con-
port
nector
Transmission distance 5 m max. --- 5 m max.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-11


1 Introduction to NJ/NX-series Controllers

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Number of ports 2 1
10BASE- 10BASE-T/100BASE-TX
Physical layer T/100BASE-TX/
1000BASE-T
Frame length 1,514 bytes max.
Media access method CSMA/CD
Modulation Baseband
Topology Star
1 Gbps 100 Mbps (100BASE-TX)
Baud rate
(1000BASE-T)
Transmission media STP (shielded, twisted-pair) cable of Ethernet category 5, 5e or higher
Maximum transmission distance between 100 m
Ethernet switch and node
Maximum number of cascade connections There are no restrictions if an Ethernet switch is used.
Maximum number of con- 256 per port 32
nections 512 total
Can be set for Can be set for each Can be set for each connection.
each connec- connection. 1 to 10,000 ms in 1.0-ms increments (*)
tion. 2 to 10,000 ms in 1.0-
Packet interval*8
0.5 to 10,000 ms ms increments
in 0.5-ms incre-
ments
40,000 pps*8 3,000 pps*8 (including heartbeat) (*)
Built-in Permissible communica-
(including heart-
Ether- tions band
beat)
Net/IP
port Maximum number of tag 256 per port 32
sets 512 total
Network vari- Network variables, Network variables, CIO, Work, Holding, DM, and
Tag types ables CIO, Work, Holding EM Areas
and DM 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 (1 connection = 1 tag set)
Maximum number of regis- 512 total
trable tag sets (1 connection =
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 Controller
Maximum tag set size
status is
included in the
tag set.)
Multi-cast packet filter*9 Supported
Built-in IEC 61158 Type12
Ether- Communications standard
CAT port
EtherCAT master specifications Class B (Feature Pack Motion Control compliant)
Physical layer 100BASE-TX
Modulation Baseband
Baud rate 100 Mbps (100BASE-TX)
Duplex mode Auto
Built-in Topology Line, daisy chain, and branching
Ether- Twisted-pair cable of category 5 or higher (double-shielded straight cable with aluminum tape
CAT port Transmission media
and braiding)
Maximum transmission distance between 100 m
nodes
Maximum number of slaves 512 16 192 64

1-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-2 Main Specifications


NX701- NX1P2- NJ501- NJ301- NJ101-
Item
    
--- Half duplex (when ---
connected to the
Communications method
Serial Communica-
tions Option Board)
--- Start-stop synchroni- ---
zation (when con-
Serial
Synchronization method nected to the Serial
commu-
Communications
nications
Option Board)
--- 1.2/2.4/4.8/9.6/19.2/3 --- 1
8.4/57.6/115.2 kbps
Baud rate (when connected to
the Serial Communi-
cations Option Board)
Maximum number of CJ --- 10
Units per CPU Rack or
Expansion Rack
Maximum number of NX --- 8 ---
Maximum Units per CPU Rack
number of
Maximum number of CJ --- 40
connectable
Units for entire controller
Units
4,096 24 4,096 400
Maximum number of NX (On EtherCAT (On CPU Rack: 8 and (On EtherCAT Slave Terminals) (On EtherCAT
Units for entire controller Slave Terminals) on EtherCAT Slave Slave Termi-
Unit con- nals)
Terminals: 16)
figura-
tion Maximum number of Expansion Racks 0 3
Maximum number of I/O --- 2,560
I/O capacity
points on CJ-series Units
NX-PA9001 A non-isolated power NJ-P3001
NX-PD7001 supply for DC input is
Power Supply Model
built into the CPU
Unit for CPU Unit.
Rack and
AC power 30 to 45 ms --- 30 to 45 ms
Expansion Power OFF supply
Racks detection
time DC power 5 to 20 ms 2 to 8 ms 22 to 25 ms
supply
*1 Execution objects and variable tables (including variable names)
*2 Does not include Holding, DM, and EM Area memory for CJ-series Units.
*3 Memory for CJ-series Units is included.
*4 Does not include CIO and Work Area memory for CJ-series Units.
*5 Variables without a Retain attribute are used. The value can be set in 1-word increments.
*6 Variables with a Retain attribute are used. The value can be set in 1-word increments.
*7 Data will be refreshed at the set interval, regardless of the number of nodes.
*8 “pps” means packets per second, i.e., the number of communications packets that can be sent or received in one second.
*9 As the EtherNet/IP port implements the IGMP client, unnecessary multi-cast packets can be filtered by using an Ethernet switch that supports IGMP Snoop-
ing.

Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to A-
14 Version Information for NX-series Controllers and A-15 Version Information for NJ-series Controllers for information
on version upgrades.

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-13


1 Introduction to NJ/NX-series Controllers

1-3 Overall Operating Procedure for the


NJ/NX-series Controller
This section gives the overall operating procedure of the NJ/NX-series Controllers and then describes it
in more detail.

1-3-1 Overall Procedure


The overall procedure to use an NJ/NX-series Controller is given below.

Step 1. Software Design


Design the overall system configuration, task configuration, programs, and vari-
ables.

Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Create the system configurations that you designed in step 1 on the Support Soft-
ware and assign the variables. Create the tasks and programs, and debug them,
e.g., with simulations.

Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware


Mount the Units and make the required hardware settings.

Step 4. Wiring
Connect the network cables and wire the I/O.

Step 5. Checking Operation and Starting Actual Operation


on the Actual System
Connect the Support Software to the physical system and download the project.
Check operation on the physical system and then start actual system operation.

1-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-3 Overall Operating Procedure


for the NJ/NX-series Controller
1-3-2 Procedure Details

Step 1. Software Design


Step Description Reference

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 NX1P2 CPU Unit
Hardware User's Manual

1-3-2 Procedure Details


(Cat. No. W578)
NJ-series CPU Unit Hard-
ware User’s Manual (Cat.
No. W500)

Step 1-2 • Task configuration 4-2-3 Task Settings


Designing Tasks • Relationship between tasks and programs
• Task periods
• Slave and Unit refresh times
• Exclusive control methods for variables between tasks

Step 1-3
Designing Pro-
grams

POU (Program • Programs Section 6 Programming


Organization Unit) • Functions and function blocks
Design • Determining the algorithm languages

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

Step 2. Software Setups and Programming


Step Description Sysmac Studio Oper- Reference
ations

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)

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-15


1 Introduction to NJ/NX-series Controllers

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.)

(The following step is for motion control.)

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

1-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-3 Overall Operating Procedure


for the NJ/NX-series Controller
Step 2-2 Setting the following parameters from the Section 4 Controller Setup
Controller Setup Sysmac Studio

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 NX1P2 CPU Units) Each setting is given 8-1-2 Clock


• Setting the clock data with clock below. 4-2-4 Unit Configuration and 1
function when a Battery is mounted • Controller − Con- Unit Setup for NX1P2 CPU
• Initial settings for the NX Bus Func- troller Clock Units
tion Module

1-3-2 Procedure Details


• Configurations and 4-3 Initial Settings for NX
• Initial settings for NX Units Setup − CPU Rack Units
• Initial settings for built-in I/O • Configurations and NX-series NX1P2 CPU Unit
• Initial settings for Option Boards Setup − Built-in I/O Built-in I/O and Option
• Memory settings for CJ-series Settings Board User's Manual (Cat.
Units • Configurations and No. W579)
Setup − Option
Board Settings
• Configurations and
Setup − Memory
Settings for CJ-
series Units

(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

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-17


1 Introduction to NJ/NX-series Controllers

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)

Step 3. Mounting and Setting Hardware


Step Description Reference

1. Mounting • Connecting adjacent Units NX-series CPU Unit Hard-


• Mounting to DIN Track ware User’s Manual (Cat.
No. W535)
NX-series NX1P2 CPU Unit
Hardware User's Manual
(Cat. No. W578)
NJ-series CPU Unit Hard-
ware User’s Manual (Cat.
No. W500)

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-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


1 Introduction to NJ/NX-series Controllers

1-3 Overall Operating Procedure


for the NJ/NX-series Controller
Step 4. Wiring
Step Description Reference

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 NX1P2 CPU Unit
Hardware User's Manual
(Cat. No. W578) 1
NJ-series CPU Unit Hard-
ware User’s Manual (Cat.

1-3-2 Procedure Details


No. W500)

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 NX1P2 CPU Unit
Hardware User's Manual
(Cat. No. W578)
NJ-series CPU Unit Hard-
ware User’s Manual (Cat.
No. W500)

• Checking wiring Sysmac Studio Version 1


Operation Manual (Cat. No.
W504)

3. Connecting the • Connecting USB Cable*1 Sysmac Studio Version 1


Computer That • Connecting the built-in EtherNet/IP port Operation Manual (Cat. No.
Runs the Sysmac W504)
Studio
*1 An NX1P2 CPU Unit does not provide a USB port.

Step 5. Checking Operation and Starting Operation on the Actual System


Step Description Sysmac Studio Reference
Operations

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.)

NJ/NX-series CPU Unit Software User’s Manual (W501) 1-19


1 Introduction to NJ/NX-series Controllers

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.

3. Actual Controller Start actual operation.


Operation

* Use the Synchronize Menu of the Sysmac Studio to download the project.

1-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


2
CPU Unit Operation
This section provides information that is necessary to use the CPU Unit, including how
the CPU Unit works and the operations that it performs depending on the status of the
CPU Unit.

2-1 Overview of CPU Unit Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2


2-1-1 Introduction to CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2-1-2 Overview of Operation According to CPU Unit Status . . . . . . . . . . . . . . . . . . . 2-3
2-2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2-2-1 Software Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2-2-2 Operation of Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
2-3 Accessing I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2-3-1 Types of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
2-3-2 Accessing I/O with Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2-4 I/O Refreshing of NX Bus Function Module . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2-4-1 I/O Refreshing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2-4-2 I/O Refreshing Method Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
2-5 Sequence Control and Motion Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2-5-1 Overview of Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2-5-2 Sequence Control System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
2-5-3 Motion Control System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
2-5-4 Synchronizing Sequence Control and Motion Control . . . . . . . . . . . . . . . . . . 2-33
2-6 Overview of CPU Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34
2-7 Operation for CPU Unit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
2-7-1 CPU Unit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-35
2-7-2 Operation for CPU Unit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
2-7-3 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-1


2 CPU Unit Operation

2-1 Overview of CPU Unit Operation


This section describes the operation of the CPU Unit and gives an overview of how it operates depend-
ing on the status of the CPU Unit.

2-1-1 Introduction to CPU Unit


The NJ/NX-series CPU Unit executes the user program for sequence control and motion control. It also
performs other processing, such as I/O refreshing and external communications. These processes are
performed by the software in the CPU Unit.

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

Motion control EtherCAT slaves


I/O refreshing Variables
NX Units on the CPU Unit
External communications
Built-in I/O

Analog I/O Option Boards

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, built-in I/O, 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-11
Sequence control and motion control P.2-27
Overview of CPU Unit data P.2-34
Operation for CPU Unit status P.2-35

2-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-1 Overview of CPU Unit Operation


Additional Information

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-1-2 Overview of Operation According to CPU Unit Status


The status of the CPU Unit changes when an error occurs or when you change the operating mode.
Changes in the status of the CPU Unit affect user program execution, I/O refreshing, and the process-
ing of external communications.
The CPU Unit operation according to the status of the CPU Unit is described in 2-7 Operation for CPU
Unit Status.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-3


2 CPU Unit Operation

2-2 Software
This section describes the software configuration of the CPU Unit, and how the software components
operate.

2-2-1 Software Configuration


The software in the CPU Unit is divided into five modules. These functional units are called function
modules.
The function modules and the processing that they perform are described in the following table.
Function module name Processing
PLC Function Module Performs the following services: task scheduling, commands for other func-
tion modules, event logging, execution of the user program, I/O refreshing*1
for the CJ-series Units, USB port services*2, SD Memory Card services, and
data trace processing.
NX Bus Function Module*3 Performs processing such as event logging and I/O refreshing for the NX
Units that are connected to the NX bus of the CPU Unit.
Motion Control Function Module Performs motion control processing.*4
EtherCAT Master Function Mod- Performs communications with EtherCAT slaves as the EtherCAT master,
ule including I/O refreshing*5 for the EtherCAT slaves, EtherCAT message com-
munications*6, etc.
EtherNet/IP Function Module Performs processing for EtherNet/IP communications, including tag data link
processing, built-in EtherNet/IP port servicing, etc.

*1 Some CJ-series Units can also be connected to an NJ-series CPU Unit.


*2 An NX1P2 CPU Unit does not provide a USB port.
*3 Only the NX1P2 CPU Units have the NX Bus Function Module.
*4 This function module executes motion processing based on target values (such as the position or velocity tar-
get value) from the motion control instructions. It outputs command values, controls status, and obtains infor-
mation through the EtherCAT Master Function Module.
*5 I/O refreshing for EtherCAT slaves is performed by using process data communications (also called PDO com-
munications). In PDO communications, the master and slaves exchange data cyclically at regular intervals.
*6 This module communicates with the EtherCAT slaves as the EtherCAT master.

2-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-2-2 Operation of Software


The software in the CPU Unit performs the following four processes. Which process is performed
depends on the status of the CPU Unit and the execution conditions of the process itself.
Type of CPU Unit pro- Status of CPU
Execution conditions Processing example

2-2 Software
cessing 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 User program execution
with tasks and error states the assigned task. These tasks are and I/O refreshing
executed either periodically or only
once when the specified condition 2
is met.
Tag data link service These services are performed only Tag data links

2-2-2 Operation of Software


upon requests from the hardware or I/O refreshing for Analog
Option board service*1
other external devices. I/O Option Boards
System services USB port service*2, SD
Memory Card service, and
communications process-
ing for Serial Communica-
tions Option Boards*3

*1 The option board service is executed only by an NX1P2 CPU Unit.


*2 An NX1P2 CPU Unit does not provide a USB port.
*3 Only the NX1P2 CPU Units support Serial Communications Option Boards.

Refer to 2-7-1 CPU Unit Status for information on the CPU Unit status.

This section describes the operation of the processes.

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 12-1-2 Fatal Errors in the CPU Unit 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 memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.
*3 You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.
*4 You can use CJ-series Units only with NJ-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-5


2 CPU Unit Operation

Processing Executed with Tasks


 Types of Processing That Are Executed with Tasks
The following processing is performed with tasks.
Processing Description
I/O refreshing Data I/O for EtherCAT slaves, NX Units on the CPU Unit*1, I/O built in the
CPU Unit*2, Analog I/O Option Boards in the CPU Unit*3, CJ-series*4 Basic
I/O Units, and CJ-series Special Units is performed.
User program execution The user programming for sequence control is executed. It also sends com-
mands to the motion control process.
Motion control Motion control is executed based on commands from the user program.
System common process- System common processing, such as data trace processing and tag data link
ing processing, is performed.
*1 You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.
*2 You can use the built-in I/O only with the NX1P2 CPU Units.
*3 You can use Analog I/O Option Boards only with the NX1P2 CPU Units.
*4 You can use CJ-series Units only with NJ-series CPU Units.
Refer to 5-3-3 Basic Operation of Tasks for NX701 CPU Units, 5-4-3 Basic Operation of Tasks for
NX1P2 CPU Units, and 5-5-3 Basic Operation of Tasks for NJ-series Controllers for details on the
processing that is executed with tasks.

 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 NX1P2 CPU Units.

2-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

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.

Task period of primary Task period of primary Task period of primary


periodic task periodic task periodic task

2-2 Software
Primary Task Task Task
periodic task
Task period of periodic task Task period of periodic task

Periodic task Task Task Task


2
The operation of tasks with lower priority when a task with higher priority is in execution differs
between the NX701 CPU Units, NX1P2 CPU Units, and NJ-series CPU Units. Refer to 5-2 Overview

2-2-2 Operation of Software


of Tasks for details on task operation.

 Operation of Processing with Tasks


Processing that is assigned to a task is executed within the task in the order shown in the following
diagram. If the program contains a motion control instruction, the execution process for the program
in the task will send a command to the motion control process. The motion control process is exe-
cuted based on commands.

Task period Task period

Task Task

Processing

I/O System System


common User program execution Motion control common
refreshing processing 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-7


2 CPU Unit Operation

Tag Data Link Service


 Processing Performed by the Tag Data Link Service
The tag data link service processes communications that use tags with other controllers or devices
on an EtherNet/IP network. You can use the built-in EtherNet/IP port in the CPU Unit or a CJ-series
CJ1W-EIP21 EtherNet/IP Unit to connect to an HMI.
Note You can use the CJ1W-EIP21 EtherNet/IP Unit only with NJ-series CPU Units.

 Operation of the Tag Data Link Service


The tag data link service is executed periodically. The period and the time that is required for each
execution depend on the model of the CPU Unit and on the tag data link settings.
The execution priority of the tag data link service for an NJ-series CPU Unit is between the execu-
tion priorities of the priority-16 periodic task and the priority-17 periodic task. Therefore, the tag data
link service will be given priority over execution of the priority-17 periodic task, but if the primary peri-
odic task or the priority-16 periodic task is executed, the execution of the primary periodic task or the
priority-16 periodic task is prioritized.

Task period of Task period of Task period of


primary periodic task primary periodic task primary periodic task

Primary Task Task Task


periodic task
Task period of periodic task Task period of periodic task

Priority-16 periodic Task Task


task

Tag data link


service
Task period of periodic task
Priority-17 periodic
task Task

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-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

Option Board Service


 Processing Performed by the Option Board Service
The option board service processes the I/O refreshing for an Analog I/O Option Board that is
mounted on the NX1P2 CPU Unit.

2-2 Software
Note The option board service is executed only by an NX1P2 CPU Unit.

 Operation of the Option Board Service


The option board service for an NX1P2 CPU Unit is executed in parallel with the execution of tasks.
However, during execution of the tag data link service, the option board service is not executed.
2
Task period of Task period of Task period of
primary periodic task primary periodic task primary periodic task

2-2-2 Operation of Software


Primary Task Task Task
periodic task

Tag data link


service

Option boad
service

Task period of periodic task


Priority-17 periodic
Task
task

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-9


2 CPU Unit Operation

System Services
 System Services
System services include the following processing.
Processing Contents
USB port service*1 • Processing of service requests from the Sysmac Studio or host computers
Built-in EtherNet/IP port 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
Communications processing • Execution of communications processing for a Serial Communications
for a Serial Communications Option Board
Option Board*2
CJ-series Special Unit service • Event servicing for CJ-series Special Units
*3 • Execution of communications instructions (CIP)
SD Memory Card service • Access from FTP client
• SD Memory Card operations from the Sysmac Studio
• Execution of SD Memory Card instructions
Self-diagnosis • Hardware error detection

*1 An NX1P2 CPU Unit does 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.

 System Service Operations


For the NX701 CPU Units, if a request comes from the hardware or from outside of the CPU Unit,
system services are executed in parallel with other processes. System services are executed at the
required time without being affected by the execution of tasks.
For the NX1P2 CPU Units, if a request comes from the hardware or from outside of the CPU Unit,
system services are executed in parallel with other processes. System services are executed at the
required time without being affected by the execution of tasks. However, during execution of the tag
data link service or option board service, system services are not executed.
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

Primary Task Task Task Task


periodic task
Task period of periodic task Task period of periodic task

Periodic task Task Task Task Task

System
services

The system service is executed during unused time between


the execution of all tasks.
Refer to 5-6 Services Other Than Tasks for details on the system services.

2-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-3 Accessing I/O


The CPU Unit uses variables to access I/O. This section describes how variables are used to access

2-3 Accessing I/O


I/O.
In this manual, I/O on EtherCAT slaves, NX Units on the CPU Unit, built-in I/O, Analog I/O Option
Boards, and CJ-series Units are treated as I/O. Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP
Port User’s Manual (Cat. No. W506) for details on how to access data in other Controllers with tag data
links.

2-3-1 Types of Variables 2

In an NJ/NX-series CPU Unit, you use variables in the user program to access I/O and memory in the

2-3-1 Types of Variables


CPU Unit.
The type of a variable depends on whether it has attributes that are set by the user, and what it can
access.

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*4
Device variables Analog I/O Option Boards
for Option
Boards*4
Device variables CJ-series Basic I/O Units and
for CJ-series CJ-series Special Units
Units*5
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*6

*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-11


2 CPU Unit Operation

*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 device variables for NX Units, built-in I/O, and Option Boards only with the NX1P2 CPU Units.
*5 You can use CJ-series Units only with NJ-series CPU Units.
*6 You can use system-defined variables for NX bus only with the 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.

Type of device variable Device Accessed data


Device variables for EtherCAT slaves EtherCAT slaves*1 Process data for EtherCAT slaves*2
Device variables for NX Units*3 NX Units on the CPU Unit I/O data for NX Units

Device variables for built-in I/O*3 Built-in I/O I/O data for built-in I/O

Device variables for Option Boards*3 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*4 CJ-series Special Units Operating data*5 and setup data for
Special Units*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 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 device variables for NX Units, built-in I/O, and Option Boards only with the N1P2 CPU Units.
*4 You can use CJ-series Units only with NJ-series CPU Units.
*5 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.
*6 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.

2-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

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

2-3 Accessing I/O


User program

Instruction
Device variable
EtherCAT slave, NX
I/O port Unit, or CJ-series Unit

2-3-1 Types of Variables


Refer to 3-3-1 I/O Ports for details on I/O ports and device variables.

 Cam Data Variables


Cam data variables are used to access data in cam tables, which are used for motion control. For
details, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).

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.

Function module Type of system-defined variable


PLC Function Module System-defined variables for PLC Function Module
NX Bus Function Module*1 System-defined variables for NX bus
Motion Control Function Module System-defined variables for motion control
EtherNet/IP Function Module System-defined variables for EtherNet/IP
EtherCAT Master Function Module System-defined variables for EtherCAT master

*1 Only the 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.

System-defined variables for


Description
motion control
MC Common Variable Common processing for the entire Motion Control Function Module
Axis variables Control of individual axes
Axes Group variables Control of axes groups*1

*1 An axes group consists of multiple axes. An axes group is used for interpolation.

Refer to A-5 System-defined Variables for details on system-defined variables.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-13


2 CPU Unit Operation

2-3-2 Accessing I/O with Variables


In the CPU Unit, variables are used in the user program. Variables access the data of the assigned I/O.
The following table shows how I/O and variables are assigned in the CPU Unit. The type of variable that
is used by a CJ-series Special Unit depends on the data to access.

I/O Data Variables


EtherCAT slaves EtherCAT slaves to which --- Device variables for EtherCAT slaves
axes are not assigned
EtherCAT slaves to which --- • Device variables for EtherCAT
axes are assigned slaves*1
• Axis variables
NX Units on the NX Units to which axes --- Device variables for NX Units
CPU Unit*2 are not assigned
NX Units to which axes --- • Device variables for NX Units
are assigned • Axis variables
Built-in I/O*3 --- Device variables for built-in I/O

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

EtherCAT slaves EtherCAT NX Units to Built-in Analog I/O Basic I/O


or NX Units to slaves to which which axes are I/O Option Units Assigned
which axes are axes are not not assigned Boards memory areas
assigned assigned
Operating data
Setup data
Special Units

2-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

Accessing EtherCAT Slaves


The method that is used to access an EtherCAT slave depends on the type of EtherCAT slave.

2-3 Accessing I/O


Type of EtherCAT slave Access method
• Servo Drive and encoder input slaves*1 These slaves are accessed through I/O ports by using
• General-purpose slaves device variables for EtherCAT slaves.

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.

2-3-2 Accessing I/O with Variables


Note EtherCAT slaves that cannot be assigned to axes are called general-purpose slaves. EtherCAT slaves that
can be assigned to axes are called Servo Drive and encoder input slaves. Refer to the NJ/NX-series CPU
Unit Motion Control User’s Manual (Cat. No. W507) for details on Servo Drive and encoder input slaves.

 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

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-15


2 CPU Unit Operation

 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.

Precautions for Correct Use


If you perform the following steps, the system will clear the assignment of the device variable to
the I/O port of a Servo Drive and encoder input slave to which an axis is assigned.
(1) With the Sysmac Studio version 1.09 or higher, assign device variables to the I/O ports of
Servo Drive and encoder input slaves to which axes are assigned.
(2) Save the project data.
(3) Open the saved project data with the Sysmac Studio version 1.08 or lower.

Additional Information

There are two types of EtherCAT communications, PDO communications and SDO 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.

2-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

Accessing NX Units on the CPU Unit


The method that is used to access an NX Unit on the NX1P2 CPU Unit depends on the type of NX Unit.

2-3 Accessing I/O


Type of NX Unit on the CPU Unit*1 Access method
NX Units that are not assigned to axes These Units are accessed through I/O ports by using
device variables for NX Units.
NX Units that are assigned to axes These Units are accessed directly with axis variables.
These Units are accessed through I/O ports by using
device variables for NX Units. 2
*1 You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.

2-3-2 Accessing I/O with Variables


 Accessing NX Units That Are Not Assigned to Axes
These Units are accessed through I/O ports for device variables for NX Units.

CPU Unit Digital Output Unit Digital Input Unit


Device variables
for NX Units I/O ports

Variable 00
Output Bit 00

Variable mm
Output Bit mm
Variable 00
Input Bit 00

Variable nn
Input Bit nn

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-17


2 CPU Unit Operation

 Accessing NX Units That Are Assigned to Axes


NX Units that are assigned to axes are accessed directly through the Axis variable. You can also
assign the device variables to the I/O ports of NX Units that are assigned to axes.

CPU Unit

Example: Pulse Output Unit Servo Drive


System-defined variables

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.

Precautions for Correct Use


The I/O port to which a device variable can be assigned in the NX Unit that is assigned to an axis
must meet either of the following conditions.
• The value of the R/W attribute is R (Read only).
• The value of the R/W attribute is W (Write only), and <Not assigned> is set for the process
data field under Detailed Settings on the Axis Basic Settings Display in the Sysmac Studio.

2-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

Accessing Built-in I/O


You access I/O that is built in an NX1P2 CPU Unit through the I/O ports for device variables for built-in
I/O.

2-3 Accessing I/O


CPU Unit
Device variables
for built-in I/O I/O ports Built-in I/O

Variable 00
Output Bit 00


… mm
2
Variable
Output Bit mm

2-3-2 Accessing I/O with Variables


Variable 00
Input Bit 00


Variable nn
Input Bit nn

Refer to 3-3-1 I/O Ports for details.

Accessing Analog I/O Option Boards


You access Analog I/O Option Boards in an NX1P2 CPU Unit through the I/O ports for device variables
for Option Boards.

CPU Unit Option Board


Device variables
for Option Boards I/O ports

Variable 00
Ch1 Analog Output Value

Variable mm
Ch2 Analog Output Value

Variable 00
Ch1 Analog Input Value

Variable nn
Ch2 Analog Input Value

Refer to 3-3-1 I/O Ports for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-19


2 CPU Unit Operation

Accessing Basic I/O Units


With an NJ-series CPU Unit, you access Basic I/O Units through the I/O ports for device variables for
the CJ-series Unit.

CPU Unit Basic Output Unit Basic Input Unit


Device variables
for CJ-series Units I/O ports

Variable 00
Ch1_In00



Variable 15
Ch1_In15
Variable 00
Ch2_In00


Variable 15
Ch2_In15

Refer to 3-3-1 I/O Ports for details.

2-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

Accessing Special Units


With an NJ-series CPU Unit, there are two methods that you can use to access Special I/O Units.
Which method is used depends on the data to access.

2-3 Accessing I/O


Access method Data
Accessing Special Units through I/O ports by using device variables for CJ-series • Operating data
Units • Setup data
Accessing Special Units by using user-defined variables with AT specifications Assigned memory area
data

 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

2-3-2 Accessing I/O with Variables


the CJ-series Unit. The data is exchanged during I/O refreshing.

CPU Unit Example: Analog Input Unit


Device variables
I/O ports
for CJ-series Unit
Operating data Operating data

Variable Input 1 converted


Ch1_RdAI value

Variable Input 1 disconnection


Ch1_SensErr detection

Setup data Setup data

Variable Input 1 enable setting


Ch1_InChUseCfg

Variable Input 1 mean value


processing setting
Ch1_AveCfg

Refer to 3-3-1 I/O Ports for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-21


2 CPU Unit Operation

 Accessing Special Units by Using User-defined Variables with AT


Specifications
The assigned memory area addresses are accessed by using AT specifications for user-defined
variables to the memory addresses that are used for the CJ-series Units. The data in the memory
used for CJ-series Units is exchanged with the data in the CJ-series Units during I/O refreshing.

CPU Unit Example: DeviceNet Unit


Memory used Fixed allocations
User-defined variables for CJ-series Units for remote I/O
CIO
%3200.00
Variable 3200.00 Slave

%3201.00
Variable 3201.00 Slave

Variables that are assigned to memory Assigned memory addresses within


addresses with AT specifications the fixed allocations for remote I/O

The assigned memory addresses including the following addresses.


• Addresses in fixed allocations for DeviceNet Units
• Addresses in user-specified allocations for DeviceNet Units or CompoNet Master Units from
the CX-Integrator (A CompoNet Master Unit must be set to communications mode 8 to use
the CX-Integrator.)
• Addresses in expansion memory for High-speed Counter Units
• Addresses in expansion memory for Process I/O Units

Refer to A-8 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.

2-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-4 I/O Refreshing of NX Bus Function


2-4 I/O Refreshing of NX Bus Function Module
This section describes I/O refreshing of the NX Bus Function Module for the NX1P2 CPU Units.

The NX Bus Function Module of the NX1P2 CPU Unit performs the data exchange cyclically with the
NX Units on the CPU Unit.

Module
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.

Precautions for Correct Use 2


Only the NX1P2 CPU Units have the NX Bus Function Module.

2-4-1 I/O Refreshing Methods


2-4-1 I/O Refreshing Methods
The I/O refreshing methods of NX Units that are mounted on the NX1P2 CPU Unit are listed below.

I/O refreshing method for NX Units Actual operation


NX Units that support both Free-Run refreshing and synchronous Operates with synchronous I/O refreshing.
I/O refreshing
NX Units that support Free-Run refreshing, synchronous I/O
refreshing, and task period prioritized refreshing
NX Units that support only time stamp refreshing Operates with time stamp refreshing.
NX Units that support only Free-Run refreshing Operates with Free-Run refreshing.

Note NX Units with different I/O refreshing methods can be mixed on the NX1P2 CPU Unit.

Note You cannot change the I/O refreshing methods for NX Units on the NX1P2 CPU Unit.

An outline of the I/O refreshing methods that are actually operated in the NX1P2 CPU Unit is listed
below.

I/O refreshing method Outline


Synchronous I/O refreshing With this I/O refreshing method, the timing to read inputs or to refresh
outputs is synchronized on a fixed interval between more than one NX Units.
Time stamp refreshing With this I/O refreshing method, the NX Units record the DC times*1 when
inputs change or perform outputs at specified DC times. Data exchange
between the NX Units and CPU Unit are performed cyclically on the NX bus
refresh cycles.
Input refreshing with input With this I/O refreshing method, the Input Units record the DC times when
changed times the inputs change.
Output refreshing with With this I/O refreshing method, the Output Units change outputs at specified
specified time stamps DC times.
Free-Run refreshing With this I/O refreshing method, the refresh cycle of the NX bus and the I/O
refresh cycles of the NX Units are asynchronous.
*1 The slaves or Units that support distributed clock synchronization have a clock that is shared by the slaves or
Units. The time that is based on this distributed clock is called the DC time.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-23


2 CPU Unit Operation

2-4-2 I/O Refreshing Method Operation


This section describes the operation of each I/O refreshing method in the NX1P2 CPU Unit.
The detailed operation of the I/O refreshing methods depends on the NX Units. Refer to the manuals for
the NX Units.

Operation of Synchronous I/O Refreshing


All NX Units that support synchronous I/O refreshing on the NX1P2 CPU Unit read their inputs at the
same time that is synchronized with the I/O refreshing in the primary periodic task. Outputs are also
refreshed simultaneously, but at a separately set timing from inputs.

Precautions for Correct Use


The NX Units on the CPU Unit, EtherCAT slaves, and EtherCAT Slave Terminals do not read
inputs or refresh outputs simultaneously.

 Operation Example of Synchronous I/O Refreshing


All NX Units that support synchronous I/O refreshing read their inputs at the same time.
All NX Units that support synchronous I/O refreshing refresh their outputs at the same time.

Primary period Primary period

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)

Synchronized ch1 ch2 ch1 ch2 ch1 ch2 ch1 ch2


NX Unit (N3)

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

2-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-4 I/O Refreshing of NX Bus Function


Operation of Time Stamp Refreshing
The following describes the operation of time stamp refreshing.

 Operation of Input Refreshing with Input Changed Times


All NX Units that support input refreshing with input changed times on the NX1P2 CPU Unit record

Module
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

2-4-2 I/O Refreshing Method Operation


The timing when the input changed times are read is the same as that for reading the inputs for
NX Units that support synchronous input refreshing.

 Operation of Output Refreshing with Specified Time Stamps


All NX Units that support output refreshing with specified time stamps on the NX1P2 CPU Unit
change the outputs at the specified DC times for each NX Unit.

 Operation Example of Time Stamp Refreshing


All NX Units that support input refreshing with input changed times record the DC times when inputs
change for each NX Unit and read the input changed times at the same time.
All NX Units that support output refreshing with specified time stamps change the outputs at the
specified DC times for each NX Unit.

Primary period Primary period

Primary Output data Input data UPG MC Output data Input data UPG MC
periodic task processing Refreshing processing processing Refreshing processing

DC time when input All Units that support input


changed is recorded. refreshing with input
NX Units in Input changed time read their
Refreshing with Input
Changed Time (N1) input changed times
simultaneously.
ON/OFF response time
NX Units in Output
Refreshing with
Specified Time Stamp
(N2)
Output at specified
DC time.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-25


2 CPU Unit Operation

Operation of 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.

 Operation Example of Free-Run Refreshing


An example of operation for Free-Run refreshing method in the NX1P2 CPU Unit is provided in the
following figure.
The NX Units that support Free-Run refreshing perform I/O processing based on their own unique
timings that is asynchronous with the I/O refreshing in the primary periodic task.

Primary period Primary period

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)

2-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-5 Sequence Control and Motion Control


2-5 Sequence Control and Motion
Control
This section describes the sequence control and motion control systems that are used by the CPU Unit.

2-5-1 Overview of Control


The NJ/NX-series CPU Unit can perform both sequence control and motion control.
You execute sequence control with instructions other than motion control instructions in the user pro- 2
gram. Sequence control is for EtherCAT slaves, NX Units on the CPU Unit, built-in I/O, Option Boards,
and CJ-series Units that are not assigned to axes. Control is performed by the PLC Function Module,
NX Bus Function Module, and the EtherCAT Master Function Module.

2-5-1 Overview of Control


You perform motion control with motion control instructions in the user program for EtherCAT Servo
Drive and encoder input slaves that are assigned to axes. Control is performed by the PLC Function
Module, Motion Control Function Module, NX Bus Function Module, and the EtherCAT Master Function
Module.

NJ/NX-series CPU Unit


PLC Function Module

User program execution


Sequence control
CJ-series Units

Basic I/O Unit


Device variables

Executed. Special Unit


Instruction
I/O ports

other than
a motion Built-in I/O
control
instruction Option Boards

NX Bus NX Units on the CPU Unit


Function that are not assigned to
Module axes
PDO
communi- EtherCAT slaves
cations
Servo Drive, encoder
input, and general-purpose
slaves that are not
EtherCAT assigned to axes
Master
Motion control Function EtherCAT
Executed. Module communi-
cations Servo Drive and encoder
Motion Motion Control input slaves that are
control Function assigned to axes
instruction Module
Axis variable

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, built-in I/O, and Option Boards only with the NX1P2 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-27


2 CPU Unit Operation

Additional Information

Instruction Types in Terms of Control Systems


In terms of the controls, the instructions can be broadly separated into the following two types of
instructions.
Type of instruction Definition
All instructions other than These instructions are executed in the user program in the PLC Function
motion control instructions Module and processing for them is completed there.
(sequence control)
Motion control instructions These instructions are executed in the user program in the PLC Function
Module to send commands to the Motion Control Function Module.
MC_Home (Homing), MC_Move (Positioning), MC_CamIn (Start Cam Oper-
ation), and other instructions for motion control operations

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.

Precautions for Correct Use


If you perform the following steps, the system will clear the assignment of the device variable to
the I/O port of a Servo Drive and encoder input slave to which an axis is assigned.
(1) With the Sysmac Studio version 1.09 or higher, assign device variables to the I/O ports of
Servo Drive and encoder input slaves to which axes are assigned.
(2) Save the project data.
(3) Open the saved project data with the Sysmac Studio version 1.08 or lower.

2-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-5 Sequence Control and Motion Control


2-5-2 Sequence Control System
The way that the sequence control works depends on the device to control. This section describes the
operation of the function modules and the control period as part of the sequence control system.
Sequence Control System
Device
Operation of the function module Control period
Servo Drive, encoder • The PLC Function Module executes the user pro- The task period of the task to
input*1, and general-pur- gram and refreshes the device variables. which the program is
pose slaves • The EtherCAT Master Function Module exchanges assigned (i.e., the task period
data with the slaves through the I/O ports for device of the primary periodic task
variables. or a periodic task)*2
NX Units on the CPU • The PLC Function Module executes the user pro-
2
Primary periodic task*4
Unit that are not gram and refreshes the device variables.
assigned to axes*3 • The NX Bus Function Module exchanges data with

2-5-2 Sequence Control System


the NX Units on the CPU Unit through the I/O ports
for device variables.
Built-in I/O*5 The PLC Function Module executes the user pro- Primary periodic task
gram, refreshes the device variables, and exchanges
data with the built-in I/O.
Option Boards*6 The PLC Function Module executes the user pro- Primary periodic task*7
gram, refreshes the device variables, and exchanges
data with the Option Boards.
CJ-series Units*8 The PLC Function Module executes the user pro- The task period of the task to
gram, refreshes the device variables, and exchanges which the program is
data with the CJ-series Units. assigned (i.e., the task period
of the primary periodic task
or a periodic task)*9

*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 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 variable 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-29


2 CPU Unit Operation

NJ/NX-series CPU Unit


PLC Function Module
NX Units on the CPU Unit
User program NX Bus
Function that are not assigned to axes
execution
Module
Built-in I/O

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 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, built-in I/O, and Option Boards only with the NX1P2 CPU
Units.
• You can use CJ-series Units only with NJ-series CPU Units.

2-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-5 Sequence Control and Motion Control


2-5-3 Motion Control System
This section describes the operation of the function modules and the control period as part of the
motion control system.
 Operation of Function Modules
• The PLC Function Module executes motion control instructions in the user program and sends
commands for motion control to the Motion Control Function Module. Axis variables are used for
these commands.
• The Motion Control Function Module performs motion control processing based on commands
from the PLC Function Module. It then reflects the results of this processing in the Axis variables.
• The EtherCAT Master Function Module sends the command values of the Axis variable to the 2
Servo Drive or other slave by using EtherCAT communications.
• The NX Bus Function Module outputs the command values of the Axis variable to the NX-series

2-5-3 Motion Control System


Pulse Output Unit or other Unit on the CPU Unit.
 Control Period
The motion control period is the task period of the primary periodic task or the priority-5 periodic task.
Motion control processing in the Motion Control Function Module is executed in the task period of
the primary periodic task or the priority-5 periodic task. The Motion Control Function Module also
exchanges data with Servo Drive and encoder input slaves that are assigned to the axes to control
in the process data communications cycle of the primary periodic task or the priority-5 periodic task.
The process data communications cycle is synchronized with the primary periodic task or the prior-
ity-5 periodic task.
Furthermore, the Motion Control Function Module exchanges data with NX Units on the CPU Unit
that are assigned to the axes to control in the primary periodic task.
This makes the motion control period the same as the task period of the primary periodic task or the
priority-5 periodic task, which allows complete synchronization of multiple axes.
However, the following restrictions apply:
• The motion control instruction is executed and the command for motion control is sent in the
sequence control period.
• The data refresh period in the EtherCAT slave depends on settings in the slave.

NJ/NX-series CPU Unit

PLC Function Module Motion Control EtherCAT


Function Master
User program execution Module Function Servo Drive and encoder
Module input slaves that are
assigned to axes
Executed. EtherCAT
Motion Motion communications
control
Axis variable

control processing
instruction Command
Axis variable

Motion control period = The process data communications Data refresh


Sequence control period (task period (i.e., task period of the cycle is the same as the task period period in slave
of the primary periodic task or the primary periodic task or of the primary periodic task or the
priority-5, or -16 periodic task) the priority-5 periodic priority-5 periodic task.
task)

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-31


2 CPU Unit Operation

Precautions for Correct Use


• You can use the priority-5 periodic task only with the NX701 CPU Units.
• With an NX701 CPU Unit, you can execute motion control in the primary periodic task and in
the priority-5 periodic task. If these two motion controls need to be identified, the motion con-
trol in the primary periodic task is called motion control 1, while the motion control in the prior-
ity-5 periodic task is called motion control 2.
• The NX1P2 CPU Units and NJ-series CPU Units perform motion control only in the primary periodic
task.

Additional Information

• You must use the Sysmac Studio to assign an axis to an EtherCAT slave or an NX Unit on the
NX1P2 CPU Unit to control it from the Motion Control Function Module. This allows the PLC
Function Module to send commands to the Motion Control Function Module for motion control
instructions that are executed in the user program. It also allows the PLC Function Module to
obtain information from the Motion Control Function Module through the Axis variables.
• The task to which the program that contains the motion control instructions is assigned deter-
mines the I/O response time of the motion control system. For details, refer to 5-11-3 System
Input and Output Response Times.

2-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-5 Sequence Control and Motion Control


2-5-4 Synchronizing Sequence Control and Motion Control
The sequence control period is the task period of the task to which the program and I/O refreshing are
assigned. However, motion control is always executed in the task period of the primary periodic task or
the priority-5 periodic task. The process data communications cycle for the EtherCAT slave to use for
motion control is synchronized with the primary periodic task or the priority-5 periodic task.
With an NX701 CPU Unit, you can set motion control to execute motion processing for each axis and
each axes group. For axes or axes groups for which you set motion control 1, motion control and pro-
cess data communications are executed in the task period of the primary periodic task. For axes or
axes groups for which you set motion control 2, motion control and process data communications are
executed in the task period of the priority-5 periodic task.
The NX1P2 CPU Units and NJ-series CPU Units perform motion control and process data communica- 2
tions for axes and axes groups in the task period of the primary periodic task.
If you assign the sequence control program to the task that motion control is executed, you can syn-

2-5-4 Synchronizing Sequence Control and Motion Control


chronize the sequence and motion control periods with the process data communications cycle for Eth-
erCAT.
The following diagram shows a program assigned to the primary periodic task. In the following diagram,
the period of sequence control, motion control, and process data communications on EtherCAT are all
synchronized.
Sequence control
period (i.e., period of
primary periodic task) Sequence control period Sequence control period

User program User program User program


Sequence control execution execution execution

Motion control period Motion control period Motion control period

Motion Motion Motion


Motion control control control control

Process data Process data Process data


PDO communi-
communications cycle communications cycle communications cycle
cations on
EtherCAT

I/O refreshing I/O refreshing I/O refreshing

Slave/Unit Slave/Unit Slave/Unit

Additional Information

• Relationship among motion controls, tasks, and process data communications cycles for the
NX701 CPU Units

Motion control Task to execute Process data communications cycle


Motion control 1 Primary periodic task Process data communications cycle 1
Motion control 2 Priority-5 periodic task Process data communications cycle 2
• Relationship among motion controls, tasks, and process data communications cycles for the
NX1P2 CPU Units and NJ-series CPU Units

Process data communications


Motion control Task to execute
cycle
Motion control Primary periodic task Process data communications cycle

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-33


2 CPU Unit Operation

2-6 Overview of CPU Unit Data


The CPU Unit also contains settings, the user program, present values, and other data. The main data
is described in the following table.
Refer to A-7 Attributes of CPU Unit Data for information on all of the data in the CPU Unit.
Type of data Description
EtherCAT Slave This is information on the EtherCAT slave configuration.
EtherCAT
Configuration
Configura-
EtherCAT Mas- The EtherCAT Master Settings contain parameter settings for the Ether-
tion
ter Settings CAT Master Function Module, such as the communications cycle.
The Unit Configuration and Unit Setup contain information on the Unit
Unit Configuration and Unit
configuration that enables the CPU Unit to recognize the Units, and the
Setup
initial settings of Units.
The I/O Map contains assignment information between the variables and
I/O Map the I/O ports that are automatically created based on the Unit Configura-
tion.
Operation Set- The Operation Settings include the Startup Mode setting, Security Set-
tings tings, and System Service Monitoring Settings.
Controller
Built-in Ether- The Built-in EtherNet/IP Port Settings contain the following settings:
Setup
Net/IP Port Set- TCP/IP settings, Ethernet settings, DHCP settings, DNS settings, FTP
tings settings, NTP settings, and SNMP settings
The Motion Control Setup consists of settings for Axis variables and Axes
Set- Motion Control Setup Group variables for axis and axes groups, and motion control parameter
tings settings.
The cam data includes cam tables that consist of phase/displacement
Cam Data Settings
data for use in cam operation for motion control instructions.
Event Setup These settings are for user-defined errors and user-defined information.
The Task Setup contain settings for the task types, number of tasks, task
Task Setup execution conditions, task names, programs executed in the task, and
other task settings.
Data Trace Settings The Data Trace Settings include settings for trigger conditions.
The Tag Data Link Tables contain the tag data link settings for Ether-
Tag Data Link Tables
Net/IP.
Controller Name The Controller name is the name of the CPU Unit.
Operation Authority Verifica- This data contains the operation authority passwords to perform Sysmac
tion Studio operations for the CPU Unit.
Set Time This is the time information that is used inside the CPU Unit.
Built-in
Time Zone Set- This is the time zone that is set for the clock in the CPU Unit.
Clock
ting
These are the definitions of the programs, functions, and function blocks.
POUs (program organization
The local variable tables and the initial values of the variables are also
User units)
included.
Pro-
Data Types This data contains the definitions of the data types.
gram
Data This data gives the attribute information of the global variables. It
Global Variables
includes the Initial Value and Retain attributes.
Values of Variables This data contains the values of the variables.
Present
Contents of Memory Used for These are the values of the CIO, Working, Holding, DM, and EM Areas in
Values
CJ-series Units*1 the memory for CJ-series Units.
The event logs include the error log for the Controller, and logs of events
Event Logs other than errors, such as when the power supply was turned ON and
OFF and when operation started.
Other
Data This data is used to restore the actual position of a Servo Drive with an
Absolute Encoder Home Off- absolute encoder in motion control. The offset is the difference between
sets the command position after homing and the absolute data that is read
from the absolute encoder.
*1. You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

2-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-7 Operation for CPU Unit Status

2-7 Operation for CPU Unit Status


This section describes the processing that is performed for user program execution, I/O refreshing, and
external communications according to the status of the CPU Unit. It also describes the operating modes
that change the execution status of the user program when the CPU Unit is in the normal operation
state.

2-7-1 CPU Unit Status


The CPU Unit can be in any of three states: startup state, normal operation state, or error state. These 2
states are defined as follows:
State Definition

2-7-1 CPU Unit Status


Startup state The software is initializing the system.
Normal operation The software is executing processing for instructions that are executed in a task or it is exe-
cuting a system service. A Controller error has not occurred.
Error state A Controller error occurred when the software was executing processing for instructions
that are executed in a task or it was executing a system service.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-35


2 CPU Unit Operation

 CPU Unit Status


The CPU Unit enters the startup state after the power supply is turned ON. About 10 to 20 seconds
after the CPU Unit enters the startup state, software processing begins and the CPU Unit changes
to normal operation. If a Controller error occurs during normal operation, the CPU Unit changes to
the error state. When you reset the Controller error, the CPU Unit returns to normal operation.
When the CPU Unit changes from startup state to normal operation, it will change to the operating
mode that you specify in the Controller Setup. You can set the operating mode at startup to PRO-
GRAM mode or RUN mode. Thereafter, changing the operating mode causes the CPU Unit to
change between PROGRAM mode and RUN mode. If you download data from the Sysmac Studio
during PROGRAM mode, the CPU Unit will change to the downloading state. The CPU Unit will
return to PROGRAM mode when the download is completed.

Power ON

Execution and comple- Startup state


tion of data download
from the Sysmac Studio. Software processing started.

Normal operation

PROGRAM
Controller error occurs
mode

Error state
Downloading Controller error is reset.
RUN mode

Operating mode is changed.

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 Operation after an Error for troubleshooting procedures
using the status indicators.
• Refer to A-7 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.

2-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-7 Operation for CPU Unit Status


2-7-2 Operation for CPU Unit Status
Changes in the status of the CPU Unit affect user program execution, I/O refreshing, and the operation
of external communications. The following table shows how each process operates in startup state and
during normal operation.
Refer to 12-1-3 Non-fatal Errors in the CPU Unit for information on the error state.

Operation Operation during normal operation


CPU Unit process-
during execu- PROGRAM
ing RUN mode Downloading
tion mode
User program Stopped. Stopped. Executed. Stopped.
I/O Refreshing for Stopped. Executed. EtherCAT communications
2
EtherCAT slaves changes to safe-operational
state. *1*2

2-7-2 Operation for CPU Unit Status


I/O refreshing for NX Stopped. Executed. Stopped.*2
Units on the CPU
Unit, built-in I/O, or
Analog I/O Option
Boards
I/O Refreshing for CJ- Stopped. Executed.
series Units*2
External communica- Stopped. Executed. Executed. *3
tions

*1 Only the input values are refreshed.


*2 I/O refreshing is executed when the device output hold configuration is set to enable (16#A5A5) in the _Devi-
ceOutHoldCfg (Device Output Hold Configuration) system-defined variable. Refer to Device Output Hold Con-
figurations on page 6-67 for the device output hold configurations. 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.
*3 The tag data links remain in effect, but the values of those links are not refreshed. The output tags retain the
values from before the download was started. The values in the input tags are not reflected in the variables.

 Values of Outputs in I/O Refreshing


The following table shows the values of the outputs in each state after I/O refresh processing.
Operation during normal operation
Operation
Outputs PROGRAM
during startup RUN mode Downloading
mode
Outputs from Ether- Controlled by the The outputs have the values Controlled by the slave set-
CAT slaves slave settings.*1 of the device variables for tings.*2*3
EtherCAT slaves.
Outputs from NX Units Changed to the The outputs have the values Controlled by the Unit set-
on the CPU Unit initial values of of the device variables for NX tings.*3
Units. Units.
Outputs from built-in Turned OFF. The outputs have the values Turned OFF.*3
I/O of the device variables for
built-in I/O.
Outputs from Analog Turned OFF. The outputs have the values Turned OFF.*3
I/O Option Boards of the device variables for
Option Boards.
Outputs from CJ- Turned OFF. The output have the values of the device variables for CJ-series
series Basic Output Units. *3*4
Units

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-37


2 CPU Unit Operation

*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-67 for details on the device output hold con-
figurations.

Precautions for Correct Use


• You can use NX Units on the CPU Unit, built-in I/O, and Analog I/O Option Boards only with
the NX1P2 CPU Units.
• You can use CJ-series Units only with NJ-series CPU Units.

Additional Information

Servo Drive Response to Changes in Operating Mode


If the operating mode changes from RUN to PROGRAM mode during a motion control operation,
the axes will decelerate to a stop at the maximum deceleration rate.

Changing the Operating Mode during Initialization of EtherCAT Slaves


You can change the operating mode of the CPU Unit to RUN mode while EtherCAT slaves initial-
ization is in progress. If you do, provide programming to confirm that communications are estab-
lished before you attempt to use slave data in control operations. Your program can use the
_EC_PDSlavTbl (Process Data Communicating Slave Table) system-defined variable to see if
the process data inputs and outputs are valid for all of the slaves.

2-7-3 Operating Modes


You can change the operating mode according to the purpose of operation, such as functional testing or
actual operation. You can set the operating mode to RUN mode or PROGRAM mode, depending on the
purpose. The execution status of the user program is different in each operating mode. The following
table gives the purpose for each operating mode and the execution status of the user program.
Operating mode Application User program execution status
RUN mode*1 RUN mode is for trial operation or actual operation. Executed.
PROGRAM mode PROGRAM mode is for checking I/O wiring and Not executed.
other functional testing without executing the user
program.

*1 For the default setting, the CPU Unit will enter RUN mode when the CPU Unit changes from startup state to
normal operation.

2-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


2 CPU Unit Operation

2-7 Operation for CPU Unit Status


Additional Information

The CPU Unit performs various operations when the operating mode is changed, i.e., the axes
are stopped, and motion control instructions are aborted. For details on how the Motion Control
Function Module operates when the operating mode is changed, refer to the NJ/NX-series
Motion Control Instructions Reference Manual (Cat. No. W508).

Operations Allowed from the Sysmac Studio or an HMI in Each


Operating Mode
The major operations that you can perform from the Sysmac Studio or an HMI in each operating mode 2
are listed in the following table.
Operation RUN mode PROGRAM mode

2-7-3 Operating Modes


Sysmac Studio Synchronization Not possible. Possible.
Online editing Possible.
Forced refreshing Possible.
Changing the values of variables or memory Possible.
used for CJ-series Units*1
HMI Changing the values of variables or memory Possible.
used for CJ-series Units*1

*1. You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

Retention of Variable Values during Changes in Operating Mode


The following table shows how the Retain attribute affects the variable values when the operating mode
is changed between RUN mode and PROGRAM mode.
Retain attribute of
Values of variables
variable
Non-retain If initial values are set, the variables change to the initial values.
If no initial values are set, the variables change to the system-defined initial values.*1
Retain The values before the operating mode changed are retained.

*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-61.
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.

Setting and Changing the Operating Mode


When operation starts after the power supply is turned ON, the CPU Unit operates in the operating
mode that you specify in the Controller Setup. During normal operation, you change the operating
mode for different purposes. You use the Sysmac Studio to set and change the operating mode.

 Operating Mode Setting after the Power Supply Is Turned ON


When the CPU Unit starts operating after the power supply is turned ON, the CPU Unit operates in
the operating mode that you set as the Startup Mode. Specify RUN mode or PROGRAM mode in the
Startup Mode setting in the Operation Settings in the Controller Setup. Refer to 4-2-2 Controller
Setup for details on the Startup Mode setting.

NJ/NX-series CPU Unit Software User’s Manual (W501) 2-39


2 CPU Unit Operation

 Changing the Operating Mode during Operation


You can change the operating mode from the Sysmac Studio. Select the RUN mode or PROGRAM
mode from Controller - Operating Mode on the menu bar.

Precautions for Safe Use


Always confirm the safety of the controlled system before you change the setting of the Startup
Mode or the current operating mode.

Checking the Operating Mode


You can check the operating mode with the RUN indicator on the CPU Unit or the Sysmac Studio.

 Checking the RUN Indicator


The RUN indicator on the CPU Unit indicates the operating mode as given below.

RUN indicator
Operating mode
status
Not lit PROGRAM mode
Lit RUN mode

 Checking the Operating Mode from the Sysmac Studio


You can check the operating mode from the Controller Status Pane of the Sysmac Studio. The fol-
lowing Controller Status Pane indicates that the CPU Unit is in 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.

2-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


I/O Ports, Slave Configuration,
and Unit Configuration
3
This section describes how to use I/O ports, how to create the slave and Unit configura-
tions, and how to assign functions.

3-1 Procedure to Create the Slave and Unit Configurations . . . . . . . . . . . . . . 3-2


3-2 Creating and Comparing the Slave and Unit Configurations . . . . . . . . . . 3-5
3-2-1 Creating the EtherCAT Slave Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3-2-2 Creating the Unit Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3-2-3 Verifying the Unit Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3-3 I/O Ports and Device Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
3-3-1 I/O Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
3-3-2 I/O Port Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3-3-3 Device Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
3-4 Allocating Variables to Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
3-4-1 Procedure to Assign Variables to Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
3-4-2 Using Variables Assigned to Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
3-5 Creating the Axes and Assigning Them to the Servo Drives/Encoder
Input Slaves/NX Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
3-5-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
3-5-2 Axis Variables and Axes Group Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
3-5-3 Creating and Using Axes and Axis Variables . . . . . . . . . . . . . . . . . . . . . . . . . 3-20

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-1


3 I/O Ports, Slave Configuration, and Unit Configuration

3-1 Procedure to Create the Slave and


Unit Configurations
This section provides the procedures for the slave and Unit configurations.
The shaded steps in the overall procedure that is given below are for the slave and Unit configurations.

Step 1. Software Design


Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System
For details, refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller.

3-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-1 Procedure to Create the Slave and Unit


Step 1 Create the EtherCAT slave configuration (if EtherCAT is used) and the Reference
Unit configuration (if NX Units or CJ-series Units are used).
• Create the EtherCAT slave configuration. 3-2-1 Creating
EtherCAT slave configuration the EtherCAT
Slave Configu-
Sysmac Studio
ration
CPU 3-2-2 Creating
Unit
the Unit Config-

Configurations
uration
EtherCAT

Slave configuration information


3
Created with the EtherCAT slave configuration settings.

• Create the Unit configuration.


Unit configuration
Sysmac Studio Unit configuration information

CPU
Unit

Created in the Unit Configuration and Unit Setup

Step 2 Assign device variables to I/O ports. Reference

• Register the device variables. 2-3-1 Types of


Registering the device variables Variables
Sysmac Studio
Slave/Unit I/O port Device variable 3-3 I/O Ports
and Device
Assign a new device Variables
variable or a variable
from a variable table for
each I/O port.
Created in the I/O Map.

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-3


3 I/O Ports, Slave Configuration, and Unit Configuration

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

Servo Drives/encoder input slaves

Encoder input slave


Axis variable d D

Assigned in the Axis Setup. From EtherCAT configuration/Unit configuration

3-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-2 Creating and Comparing the Slave and Unit


3-2 Creating and Comparing the Slave
and Unit Configurations
To enable accessing the slaves and Units in the Controller, you create a slave configuration and a Unit
configuration on the Sysmac Studio. You can also compare the Unit configuration that was created on
the Sysmac Studio with the physical Unit configuration.

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

3-2-1 Creating the EtherCAT Slave Configuration


EtherCAT

EtherCAT EtherCAT EtherCAT


slave slave slave

EtherCAT slave configuration

Created with the Sysmac Studio.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-5


3 I/O Ports, Slave Configuration, and Unit Configuration

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.

3-2-2 Creating the Unit Configuration


Use the Unit Editor in the Unit Configuration and Setup Tab Page of the Sysmac Studio to create the
Unit configuration that is recognized as correct by the CPU Unit.
Create the Unit Configuration with the Unit Editor of the Sysmac Studio.

Unit Configuration

CPU Unit
Basic I/O 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 Man-
ual (Cat. No. W504) for specific procedures to create the Unit configuration.

Precautions for Correct Use


• You can start the Controller without creating the Unit configuration. However, if you do so, the
I/O ports and device variables will not be registered automatically, so you will not be able to
access the Units from the user program.
• Create the Unit configuration to use NX Units with an NX1P2 CPU Unit or CJ-series Units with
an NJ-series CPU Unit.
The NX701 CPU Units do not have the Unit configuration because Units are not used.

3-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-2 Creating and Comparing the Slave and Unit


3-2-3 Verifying the Unit Configuration
You can use either of the following two methods to compare the Unit configuration.

Comparison between the Unit Configuration on the Sysmac Studio


and the Physical Unit Configuration
You can verify if the Unit configuration on the Sysmac Studio and the physical Unit configuration are the

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.

Sysmac Studio Unit Configuration

Compared.
3

3-2-3 Verifying the Unit Configuration


CPU Unit Configuration of physical Units

Comparison between the Unit Configuration on the Sysmac Studio


and the Unit Configuration in the CPU Unit
You can verify if the Unit configuration on the Sysmac Studio and the Unit configuration that is saved in
the CPU Unit are the same. You can compare the Unit configuration on the Sysmac Studio with the Unit
configuration information that is stored in the CPU Unit to see if they match before you download the
Unit configuration to the CPU Unit from the Sysmac Studio.

Sysmac Studio Unit Configuration

Compared. CPU Unit

Unit Configuration Information

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-7


3 I/O Ports, Slave Configuration, and Unit Configuration

3-3 I/O Ports and Device Variables


This section describes the I/O ports and device variables that you use to access the EtherCAT slaves, NX
Units on the CPU Unit, built-in I/O, Option Boards, and CJ-series Units of an NJ/NX-series Controller.

Precautions for Correct Use


• You can use NX Units on the CPU Unit, built-in I/O, and Analog I/O Option Boards only with
the NX1P2 CPU Units.
• You can use CJ-series Units only with NJ-series CPU Units.

3-3-1 I/O Ports


An I/O port is a logical interface that is used by the CPU Unit to exchange data with external devices
(slaves and Units), built-in I/O, and Analog I/O Option Boards. I/O ports are automatically created when
you create the Slave and Unit configurations and other configurations on the Sysmac Studio. You
assign device variables to I/O ports to enable accessing the slaves and Units from the user program.

CPU Unit

User program (or external communications)

Variables
Device variables
I/O ports are logical interfaces used by
the CPU Unit to exchange data with
external devices.

I/O ports

EtherCAT NX Units Built-in I/O Option CJ-series


slaves Boards Units

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

3-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-3-2 I/O Port Names


The I/O port names are registered automatically. The I/O port names differ as given below depending

3-3 I/O Ports and Device Variables


on whether the device is an EtherCAT slave, NX Unit on the CPU Unit, built-in I/O, Analog I/O Option
Board, CJ-series Basic I/O Unit, or CJ-series Special Unit.

EtherCAT Slave Devices


The following I/O port names are used for Remote I/O Terminals that are EtherCAT slave devices.
Example for a 16-point Remote I/O Terminal: Bit00 to Bit15
For other slaves, all or part of the object names that are defined in the EtherCAT object dictionary are
used.
Example for Analog Input Unit: CH0_input16-bit
Examples for the R88D-KN50H-ECT: Position actual value and Digital inputs 3

3-3-2 I/O Port Names


NX Unit Devices on the CPU Units
If the device is an NX Unit on the CPU Unit, I/O port names are determined by the model number of the
NX Unit and the functionality.
Example for an Digital Input Unit: Input Bit 00
Example for an Analog Output Unit: Ch1 Analog Output Value

Built-in I/O Devices


If the device is a built-in I/O, I/O port names are created only for the number of bits for the model num-
ber of the NX1P2 CPU Unit.
Example for an NX1P2-9024DT CPU Unit:
Input bits: Input Bit 00 to Input Bit 13
Output bits: Output Bit 00 to Output Bit 09

Option Board Devices


If the device is an Option Board, I/O port names are determined by the model number of the Option
Board and the functionality.
Example for an Analog Input Option Board: Ch1 Analog Input Value
Example for an Analog Output Option Board: Ch1 Analog Output Value

CJ-series Basic I/O Unit Devices


If the device is a CJ-series Basic I/O Unit, I/O port names are created according to the following rules.

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-9


3 I/O Ports, Slave Configuration, and Unit Configuration

 Rules for I/O Port Names for Basic I/O Units


Inputs Outputs

Ch_In Ch_Out

Terminal number: 00 to 15 Terminal number: 00 to 15

16-bit words: 1 to 4 16-bit words: 1 to 4

 Example of I/O Port Names for Specific Numbers of I/O Points


Number of I/O port names
input points
Number of out- Inputs Data type Outputs Data type
put points
32 points Ch1_In WORD Ch1_Out WORD
Ch1_In00 to Ch1_In15 BOOL Ch1_Out00 to Ch1_Out15 BOOL
Ch2_In WORD Ch2_Out WORD
Ch2_In00 to Ch2_In15 BOOL Ch2_Out00 to Ch2_Out15 BOOL

CJ-series Special Unit Devices


If the device is a CJ-series Special Unit, I/O port names are determined by the model number of the
Unit and the functionality.
Examples for a CJ1W-AD041-V1 Analog Input Unit:
Ch1_PkHdCmd, Ch1_AveCfg, etc.

3-3-3 Device Variables


In an NJ/NX-series Controller, external devices are not assigned to specific memory addresses in the
CPU Unit. Rather, variables are assigned to the I/O ports. These variables are called device variables.

Slave and Unit Configuration I/O ports Variables assigned to I/O ports:
Information created. created. Device variables

Slave and Unit Configurations I/O ports 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).

3-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

CPU Unit

User program (or external communications)

3-3 I/O Ports and Device Variables


Variables are assigned to I/O ports.
These variables are called device
Variables variables.

Device variables

I/O ports

EtherCAT NX Units Built-in I/O Option CJ-series


slaves Boards Units

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.

3-3-3 Device Variables

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-11


3 I/O Ports, Slave Configuration, and Unit Configuration

Device Variable Attributes


The attributes of the device variables are described in the following table. You can change the settings
of some of the attributes, but not all of them.
Attribute Setting Changes to settings
Variable Name Automatically generated variables: [device_name] + Allowed.
[I/O_port_name]
The default device names are as follows:

• For EtherCAT slaves, an E followed by a sequential number


starting from 001.
• For CJ-series Units, the device names start with a J followed
by a sequential number starting from 01.
Refer to 3-3-2 I/O Port Names for more information on I/O port
names.
If entered manually, the variable name is the string you enter.
Data Type According to the data type of the I/O port. Allowed.
AT Specification • NX Units connected through an EtherCAT Coupler Unit: Not allowed.
ECAT://node#[EtherCAT_Coupler_Unit_node_ad-
dress.NX_Unit_number]/[I/O_port_name]
• NX Units on the CPU Unit: IOBus://unit#[NX_Unit_num-
ber]/[I/O_port_name]
• Built-in I/O: BuiltInIO://cpu/#0/[I/O_port_name]
• Option Boards: BuiltInIO://opt/#[physical_port_num-
ber]/[I/O_port_name]
• EtherCAT slaves: ECAT://node#[node_ad-
dress]/[I/O_port_name]
• CJ-series Units: IOBus://rack#[rack_num-
ber]/slot#[slot_number]/[I/O_port_name]
Retain • Device variables for EtherCAT slaves: Not retained. Not allowed.
• Device variables for NX Units: Not retained.
• Device variables for built-in I/O: Not retained.
• Device variables for Option Boards: Not retained.
• Device variables for CJ-series Units assigned to the Operat-
ing Data (CIO Area): Not retained
Device variables for CJ-series Units assigned to the Setup
Data (DM Area): Retained
Initial Value None Allowed.
Constant None Allowed.
Network Publish Do not publish. Allowed.
Edge None Not allowed.

Note You can use CJ-series Units only with NJ-series CPU Units.

Note You can use NX Units on the CPU Unit, built-in I/O, and Option Boards only the with NX1P2 CPU Units.

Note You can use device variables for NX Units, built-in I/O, and Option Boards only with the NX1P2 CPU Units.

Note The physical port number indicates a physical location for an I/O port. 0 is given for the option board slot 1
and 1 is given for the option board slot 2.

Refer to 6-3-4 Attributes of Variables for the meanings of the attributes.

3-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

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

3-3 I/O Ports and Device Variables


or OFF to check the wiring.
• You can choose the variable table (global variable table or local variable table for one POU) in
which to register a device variable in the I/O Map.

3-3-3 Device Variables

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-13


3 I/O Ports, Slave Configuration, and Unit Configuration

3-4 Allocating Variables to Units


For some instructions, the Units on EtherCAT Slave Terminals and NX Units on the NX1P2 CPU Units
are specified by using variables. Therefore, you must assign variables to the Units in advance. After you
assign variables to the Units, the connection locations of the Units are automatically updated in the vari-
ables even if you change the locations. This means that you do not have to assign variables again every
time you change the Unit connection locations.

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.

3-4-1 Procedure to Assign Variables to Units


The variables assigned to the Units are not created automatically when you make configuration settings
for an EtherCAT Slave Terminal or Unit on the Sysmac Studio. You must make the following settings to
assign the variables to the 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.

3-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

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.

Variable Name Meaning Data type


User specified Specified Unit Specified Unit _sNXUNIT_ID

3-4 Allocating Variables to Units


NodeAdr Node address Node address of the Communications Coupler UINT
Unit*1
IPAdr IP address*2 IP address of the Communications Coupler Unit*1 BYTE[5]
UnitNo Unit number Unit number of the specified Unit UDINT
Path Path*2 Path information to the specified Unit BYTE[64]
PathLength Valid path length Valid path length USINT
*1 This address is not used for an NX Unit on the CPU Unit.
*2 This information is used only inside the Controller. You cannot access or change it.

Precautions for Correct Use 3


The values of variables assigned to the Units will be set automatically when you register the vari-
ables. Do not change the values of the variables. If you change the value, the Controller may not

3-4-2 Using Variables Assigned to Units


perform the intended operation.

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.

Variable Name Meaning Data type


User specified Specified slave Specified slave _sECAT_ID
NodeAdr Node address Node address of the EtherCAT Coupler Unit UINT

3-4-2 Using Variables Assigned to Units


This section describes how to use the variables assigned to the Units in the user program. In any
cases, the variable with the same name as the variable assigned to the Unit on the I/O Map must be
registered in the variable table in advance. The data type of the variable is _sNXUNIT_ID structure.

Designating Units
The variables assigned to the Units are passed as parameters to the instructions for which specify the
Units.

Example: Executing the NX_SaveParam Instruction


In the following example, the NX Unit to which the NX1 variable is assigned is specified when the
NX_SaveParam instruction is executed. NX1 is passed to the UnitProxy variable.

Variable assigned to NX Unit

NX_SaveParam_instance
A NX_SaveParam B
Execute Done
NX1 UnitProxy Busy
UINT#0 TimeOut Error
ErrorID
ErrorIDEx

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-15


3 I/O Ports, Slave Configuration, and Unit Configuration

Designating Unit Attributes


You can specify members of the variables that you assign to Units to specify some of the Unit attributes.

Example: Executing an Instruction with the Unit Number of an NX Unit


The following programming example reads a data object from an NX Unit if the NX Unit number of the
NX Unit to which the NX1 variable is assigned is 2. The NX1.UnitNo member gives the NX Unit number.

IF (NX1.UnitNo = UINT#2) THEN


NX_ReadObj_instance(Execute:=TRUE, UnitProxy:=NX1, Obj:=S_Obj, ReadDat:=Rdat);
END_IF;

Designating More Than One Unit


To designate more than one Unit, you can specify the elements of an array of the variables that are
assigned to the Units. This allows you to use loop processing to perform the same process for more
than one Unit.

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

Variable Data type


NXTable ARRAY[0..2] OF_sNXUNIT_ID

• 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-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-5 Creating the Axes and Assigning Them to the Servo


3-5 Creating the Axes and Assigning
Them to the Servo Drives/Encoder

Drives/Encoder Input Slaves/NX Units


Input Slaves/NX Units
This section describes how to create axes in the NJ/NX-series Controller and how to assign the axes to
the Servo Drive, encoder input slaves, and NX Units.

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 B Functional units within the


EtherCAT master

Axis A
Motion Control Function Module
Created. Created.

Axis variable A Axis variable B

Assigned. Assigned.

EtherCAT

EtherCAT
slave

Servo Drive/encoder Servo Drive/encoder


input slave input 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-17


3 I/O Ports, Slave Configuration, and Unit Configuration

3-5-2 Axis Variables and Axes Group Variables


The following table lists the types of Axis Variables and Axes Group Variables.
Type of variable Application Device to access Creation method
Axis Variables System-defined axis An Axis Variable is The EtherCAT slave Provided by the sys-
variables used to control a sin- (Servo Drive or tem.
Axis Variables auto- gle axis. encoder input slave) You must create an
matically created or NX Unit that is axis with Sysmac
when axes are cre- assigned to the axis Studio and assign
ated with the Sys- the device to the
mac Studio axis.
Axes Group Vari- System-defined An Axes Group Vari- The EtherCAT Provided by the sys-
ables axes group variables able is used for slaves (Servo Drive tem.
Axes Group Vari- multi-axes coordi- or encoder input You must create an
ables automatically nated control. slaves) or NX Units axes group with the
created when axes that are assigned to Sysmac Studio.
groups are created the axes group
with the Sysmac
Studio

Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details on
Axis Variables and Axes Group Variables.

Specifying Axis and Axes Group Variables


The variables can be specified with variable names that are created with the Sysmac Studio or with
system-defined variable names.
Names
Type
Axis Variables Axes Group Variables
Variable names created with the Sys- MC_Axis*** (“***” is assigned in ascend- MC_Group*** (“***” is assigned in
mac Studio ing order from 000 in the order the vari- ascending order from 000 in the order
ables are created.) the variables are created.)
You can change the names as required. You can change the names as required.
System-defined variable names _MC_AX[***]*1 _MC_GRP[***]*1
(The array element numbers are (The array element numbers are
assigned in ascending order from 0 in assigned in ascending order from 0 in
the order the variables are created.) the order the variables are created.)
*1 With the NX701 CPU Unit, you can also use _MC1_AX[***], _MC2_AX[***], _MC1_GRP[***], and _MC2_GRP[***]. For
details, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).

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-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-5 Creating the Axes and Assigning Them to the Servo


Additional Information

Drives/Encoder Input Slaves/NX Units


Details on Axis Variables
1. Assume that you create an axis with an axis name of A on the Sysmac Studio. An Axis Vari-
able with a variable name of A is created automatically based on the system-defined axis vari-
able. The Axis Variable consists of Axis Basic Settings, Unit Conversion Settings, I/O, operating
status, current values, error status, and warning status.
2. You specify the axis variable name A for the in-out variable of a motion control instruction. With
the axis variable name, you can access the OMRON Servo Drive or encoder input slave, sup-
ported Servo Drive or encoder input slave from another company, or NX Unit and perform opera-
tions for it.
3. You can specify the Axis Variable to use instructions as required to monitor the actual position,
error information, or other information on the Servo Drive, encoder input slave, or NX Unit.

NJ/NX-series CPU Unit


3
2. An axis or axes group is specified for a Global Variable Table 1. The axis MC_Axis*** is created on the Sysmac Studio.
motion control instruction.
Axis Variable An Axis Variable is made System-defined Variable
Only the axis variable name under a different name.

3-5-2 Axis Variables and Axes Group Variables


is specified. Axis variable name: MC_Axis*** _MC_AX[], _MC1_AX[], _MC2_AX[]
Axis basic settings and unit conversions Axis basic settings and unit conversions

Motion I/O The data types I/O


control cannot be
Operating status and current values Operating status and current values
instruction changed.
Axis variable name: MC_Axis***
Error/warning status Error/warning status

3. You can monitor the members of the axis variable with instructions.

The values can be read and written with instructions.


A.××
Value of a member of
the Axis Variable

Assigned
axis

Control operations
OMRON Servo Drives or
EtherCAT
encoder input slaves, or
supported Servo Drives or
encoder input slaves from
other companies

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-19


3 I/O Ports, Slave Configuration, and Unit Configuration

3-5-3 Creating and Using Axes and Axis Variables


You can create and use axes and Axis Variables as described below.

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 con-
trol 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.

3-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


3 I/O Ports, Slave Configuration, and Unit Configuration

3-5 Creating the Axes and Assigning Them to the Servo


Example:

In-out variable Axis

Drives/Encoder Input Slaves/NX Units


Specify an axis MyAxis1On
variable name. MC_Power
MyAxis1 Axis Axis MyAxis1 MyAxis1OnStatus

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.

Precautions for Correct Use 3


• For an NX701 CPU Unit, use the system-defined variables that correspond to the Motion Con-
trol parameter for Axis Settings or Axes Group Settings. A building error will occur if you use

3-5-3 Creating and Using Axes and Axis Variables


the system-defined variables that do not correspond.

Motion Control setting Corresponding system-defined variable


MC1: Primary periodic task _MC_AX[***], _MC1_AX[***], _MC_GRP[***],
_MC1_GRP[***]
MC2: Priority-5 periodic task _MC2_AX[***], _MC2_GRP[***]

NJ/NX-series CPU Unit Software User’s Manual (W501) 3-21


3 I/O Ports, Slave Configuration, and Unit Configuration

3-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


Controller Setup
This section describes the initial settings of the function modules.

4-1 Overview of the Controller Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2


4-2 Initial Settings for the PLC Function Module . . . . . . . . . . . . . . . . . . . . . . . 4-4
4-2-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4-2-2 Controller Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4-2-3 Task Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4-2-4 Unit Configuration and Unit Setup for NX1P2 CPU Units . . . . . . . . . . . . . . . 4-12
4-2-5 Unit Configuration and Unit Setup for NJ-series CPU Units . . . . . . . . . . . . . 4-15
4-3 Initial Settings for NX Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
4-3-1 NX Unit Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
4-3-2 I/O Allocation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
4-3-3 Unit Operation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
4-4 Initial Settings for Special Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
4-5 Initial Settings for the Motion Control Function Module . . . . . . . . . . . . . 4-22
4-5-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22
4-5-2 Setting Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
4-6 Initial Settings for the EtherCAT Master Function Module . . . . . . . . . . . . 4-24
4-7 Initial Settings for the EtherNet/IP Function Module . . . . . . . . . . . . . . . . 4-25
4-8 Initial Settings for Built-in I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
4-9 Initial Settings for Option Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27
4-10 Memory Settings for CJ-series Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-1


4 Controller Setup

4-1 Overview of the Controller Setup


This section provides an overview of the Controller Setup.
The shaded steps in the overall procedure that is shown below are related to the Controller Setup.

Step 1. Software Design


Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System

Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for details.

4-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

Controller Setup Reference

 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

4-1 Overview of the Controller Setup


 Initial Settings for NX Units: 4-3 Initial Set-
tings for NX
Unit Configuration and Setup: Initial settings for the NX Units
Units

 Initial Settings for Special Units: 4-4 Initial Set-


tings for Special
Unit Configuration and Setup: Initial settings for the Special Units
Units

 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

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-3


4 Controller Setup

4-2 Initial Settings for the PLC Function


Module
This section describes the initial settings that are required for the PLC Function Module.

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

4-2-2 Controller Setup

Operation Settings Tab Page


 Basic Settings
The Operation Settings are for functions supported by the CPU Unit, such as the definitions of oper-
ations when the power is turned ON or when the operating mode changes.

4-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

Setting Update tim- Changes in


Parameter Description Set value Default
group ing RUN mode
Operation Startup Mode Sets the CPU Unit’s RUN or PRO- RUN mode When down- Not allowed.

4-2 Initial Settings for the PLC Function Module


Settings operating mode at GRAM mode loaded to
startup. CPU Unit
Start delay Sets the time to wait for 0 to 10 s 0s When down- Not allowed.
time at an NS-series PT to per- loaded to
startup*1 form the tag verifications CPU Unit
with priority during
startup after the power
supply is turned ON.*2
Battery- Sets whether to use bat- Do not use. Do not use. When down- Not allowed.
related error tery-related error detec- Use. loaded to
detection*3 tion. CPU Unit
SD Memory Memory Card Sets whether to execute Do not check. Do not check. When down- Not allowed.
Card Setting Diagnosis at self-diagnosis (file sys- Check. loaded to
Startup tem check and recovery) CPU Unit
on the inserted SD Mem-
ory Card when the power
is turned ON. 4
System Ser- System Ser- Sets the interval of sys- 10 ms to 1 s 10 ms When down- Not allowed.
vice Monitor- vice Execu- tem service execution. loaded to
ing Settings*4 tion Interval CPU Unit

4-2-2 Controller Setup


[ms]
System Ser- Sets the ratio of execu- 5% to 50% 10% When down- Not allowed.
vice Execu- tion for monitoring sys- loaded to
tion Time tem services in relation to CPU Unit
Ratio [%] overall processing of the
CPU Unit.
SD Memory Program Sets whether to use the Use. Do not use. When trans- Not allowed.
Card Pro- transfer by program transfer from Do not use. ferred to CPU
gram Trans- system- SD Memory Card. Unit
fer Setting*5 defined vari-
able
Password Sets the password that is 8 to 32 single- None When trans- Not allowed.
used for verification byte alphanu- ferred to CPU
when you execute the meric charac- Unit
program transfer from ters (case
the SD Memory Card. sensitive)
SD Memory Restore by Set whether to use the Use. Do not use. When trans- Not allowed.
Card Restore system- restore of SD Memory Do not use. ferred to CPU
Setting*6 defined vari- Card backups by the sys- Unit
able tem-defined variable.
Password Sets the password that is 8 to 32 single- None When trans- Not allowed.
used for verification byte alphanu- ferred to CPU
when you execute the meric charac- Unit
restore of SD Memory ters (case
Card backups by the sys- sensitive)
tem-defined variable.
Event Log Instruction Sets whether to output Do not use. Do not use. When trans- Not allowed.
Settings*7 Error Output events to an event log Use. ferred to CPU
when instruction errors Unit
occur.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-5


4 Controller Setup

Setting Update tim- Changes in


Parameter Description Set value Default
group ing RUN mode
Security Set- Write Protec- Sets whether to automat- Do not use. Do not use. When power Supported.
ting tion at Startup ically enable or disable Use. is turned ON
write protection when
you turn ON the power
supply to the Controller.
Prohibit data Sets whether to enable Do not use. Do not use. When down- Supported.
backup to the or disable SD Memory Use. loaded to
SD Memory Card backups. CPU Unit
Card*8

*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 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.

Operation item Description


Setting Change You can change the set values of parameters that can be changed during RUN mode.
during RUN Mode Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the operations.
Start: Enables writing set values.
Transfer: Transfers set values to the Controller. The set values are overwritten.
Cancel: Prohibits writing set values.

Precautions for Correct Use


If Use is selected for Event Log Settings − Instruction Error Output, an instruction error is output
each time an error occurs when an instruction with an error is executed repetitively. This may
cause the event log to exceed the maximum number of events. If this occurs, older events are
overwritten.

4-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-2-3 Task Settings


 Task Settings

4-2 Initial Settings for the PLC Function Module


The Task Settings are used to add and set up tasks.

Setting Update Changes in


Parameter Description Set value Default
group timing RUN mode
Task Type Sets the task type. Primary periodic Primary peri- When down- Not allowed. 4
task odic task loaded to
Priority-5 periodic CPU Unit

4-2-3 Task Settings


task*1
Priority-16 periodic
task*2
Priority-17 periodic
task
Priority-18 periodic
task
Priority-8 event task
Priority-48 event
task
Execution Sets the task execution Automatically set Primary peri- When down- Not allowed.
Priority priority. according to the odic task: 4 loaded to
task type. CPU Unit
Task Name Sets the task name. Text string Primary peri- When down- Not allowed.
odic task: Pri- loaded to
maryTask CPU Unit
Periodic
tasks: Period-
icTask0
Event tasks:
EventTask0

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-7


4 Controller Setup

Setting Update Changes in


Parameter Description Set value Default
group timing RUN mode
Period/Exe- Sets the task period. Primary periodic Primary When down- Not allowed.
cution Con- task/Periodic tasks: periodic task: loaded to
ditions Refer to 5-3-1 1 ms*3 CPU Unit
Specifications of Periodic
Tasks for NX701 tasks:
CPU Units. 2 ms (Priority
Refer to 5-4-1 5)
Specifications of 10 ms (Prior-
Tasks for NX1P2 ity 16, 17, and
CPU Units. 18)
Refer to 5-5-1 Event tasks:
Specifications of Execution
Tasks for NJ-series with an
Controllers. instruction
Event tasks:
Executed with an
instruction or when
a variable expres-
sion is satisfied.
Task Period Sets whether to detect • Detect. (Minor Primary peri- When down- Not allowed.
Exceeded an error when the task fault level Con- odic task and loaded to
Detection period is exceeded. troller error gen- periodic CPU Unit
erated.) tasks: Detect
• Do not detect. Event tasks:
(Store an obser- Do not detect
vation level log (cannot be
record.) changed).
Task Time- Sets the task execution Primary periodic Primary peri- When down- Not allowed.
out Detec- timeout time. A Task task and periodic odic task and loaded to
tion Time Execution Timeout tasks: Task period × periodic CPU Unit
occurs when the time- 1 to Task period × 5 tasks: Task
out time is exceeded. Event tasks: Execu- period × 5
tion priority of 8: 1 Event tasks:
to 500 ms Execution pri-
Execution priority of ority of 8: 200
48: 1 ms to 10 s ms
Execution pri-
ority of 48: 1 s
Variable Sets the percentage of Primary periodic 3% When down- Not allowed.
Access Time the task period to task and periodic loaded to
[%] assign to variable tasks: 1% to 50% CPU Unit
access from outside Event tasks: None
the Controller.

*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 NX1P2 CPU Units.
*3 For an NX1P2 CPU Unit and NJ101 CPU Unit, the default of the primary periodic task is 2 ms.

4-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

 I/O Control Task Settings


The I/O Control Task Settings are used to set the timing of refresh execution of inputs and outputs.

4-2 Initial Settings for the PLC Function Module


Changes in
Parameter Description Set value Default Update timing
RUN mode
Task Name Sets the task to use to PrimaryTask or PrimaryTask When down- Not allowed.
refresh the specified Units PeriodicTask loaded to CPU
or slaves. Unit

 Program Assignment Settings 4


The Program Assignments Settings are used to assign the programs to tasks, set the program exe-
cution order, and set the operation of the programs at the start of operation.

4-2-3 Task Settings


Changes in
Parameter Description Set value Default Update timing
RUN mode
Program Execu- Assigns the programs to the Assign the pro- Program0 When down- Not allowed.
tion Order specified tasks and sets the grams in the loaded to CPU
order of program execution order to execute Unit
within the tasks. them from top to
bottom.
Initial Status of Set whether to run the pro- Run Run When down- Not allowed.
Program*1 gram at the start of opera- Stop loaded to CPU
tion. Unit

*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-9


4 Controller Setup

Precautions for Correct Use


• A program that contains the device variables used to access slaves and Units must be
assigned to the same task as the one to which the slaves and Units that are set in the I/O Con-
trol Task Settings are assigned. A building error will occur if you assign the program to other
tasks.
• The default task set in the I/O Control Task Settings is the primary periodic task. If you want to
assign the program to a task other than the primary periodic task, change the setting in the I/O
Control Task Settings in advance to prevent a building error.
• For an NX-series CPU Unit, a program used to control slaves and Units that are assigned to
axes must be assigned to the tasks that correspond to the Motion Control parameter for Axis
Settings or Axes Group Settings. A building error will occur if you assign the program to the
tasks that do not correspond.
Use the system-defined variables that correspond to the setting values of the Motion Control
parameter when you specify axes or axes groups in programs.

Corresponding task to program Corresponding system-


Motion Control setting
assignment defined variable
MC1: Primary periodic task Primary periodic task _MC_AX[], _MC1_AX[],
Priority-16 periodic task _MC_GRP[], _MC1_GRP[]
MC2: Priority-5 periodic task Priority-5 periodic task _MC2_AX[], _MC2_GRP[]

 Settings for Exclusive Control of Variables in Tasks


The Settings for Exclusive Control of Variables in Tasks are used to set the tasks that refresh speci-
fied global variables and the tasks that access specified global variables.

Set Update tim- Changes in


Item Parameter Description Default
value ing RUN mode
Each Task Variables to Sets the variables to refresh in the None When down- Not allowed.
be refreshed primary periodic task or periodic loaded to
task. CPU Unit
Data Type Sets the data type of variable. None
Variable Com- Sets a comment for the variable. None
ment
Accessing Sets the tasks that access the vari-
Task able.

4-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

 Task Execution Status Monitor


The Task Execution Status Monitor displays the execution status of the programs.

4-2 Initial Settings for the PLC Function Module


4

4-2-3 Task Settings


 Task Execution Time Monitor
The Task Execution Time Monitor displays the execution times of the tasks.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-11


4 Controller Setup

4-2-4 Unit Configuration and Unit Setup for NX1P2 CPU Units
This section describes the Unit configurations and settings for the 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.

Unit Configuration Information


The Unit configuration information describes the configuration of the NX Bus Function Module: the
number and order of NX Units connected to the NX bus of the NX1P2 CPU Unit, individual Unit infor-
mation, and information about the CPU Unit itself.

The settable items for the selected CPU Unit are listed below.

Item Description Set values Default


Serial Number Check Method Set this setting to Setting = Actual device to No check. No check.
compare the serial numbers of the NX Units at Setting =
these times: when the power is turned ON and Actual device
after the CPU Unit is restarted. The serial
numbers of the NX Units saved in the Unit
configuration information are compared with
the actual serial numbers of the NX Units.*1
If differences are found, a Unit Configuration
Verification Error will occur.
Fail-soft Operation Setting Set whether to use fail-soft operation for the NX Fail-soft Fail-soft
Bus Function Module. Select Fail-soft operation operation operation
to perform fail-soft operation. Stop
Refer to 8-2-5 Fail-soft Operation for NX Units
on the CPU Unit.
*1 If this setting is set to Setting = Actual device and you replace an NX Unit on the CPU Unit, a Unit Configura-
tion Verification Error will occur. A Unit Configuration Verification Error will also occur if you swap the mounting
position of two Units of the same model. If it becomes necessary to replace an NX Unit, or swap the mounting
positions of two Units of the same model while this setting is set to Setting = Actual device, you must correct
the Unit configuration information and download it to the CPU Unit. Set this parameter to Setting = Actual
device if strict management of the equipment configuration is required.

4-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

Precautions in Changing the Unit Configuration


This section provides precautions that apply when you change the NX Unit configuration on an NX1P2

4-2 Initial Settings for the PLC Function Module


CPU Unit.

 I/O Data That Require Specification of NX Unit Numbers


You must specify the NX Unit number to access some system-defined variables in I/O data. If you
change the Unit configuration on the CPU Unit, you must correct the specified NX Unit numbers,
such as those in programs.

_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 NX1P2 CPU Units
NX Unit Registration Status _NXB_UnitRegTbl[1] _NXB_UnitRegTbl[2] _NXB_UnitRegTbl[3]

CPU Unit NX Unit A NX Unit B NX Unit C

The addition changes the NX Unit numbers,


NX Unit D added as 2nd NX Unit so you must correct the subscripts to specify
the same NX Units as before the addition in
the NX Unit Registration Status.

NX Unit Number 1 2 3 4
NX Unit Registration Status _NXB_UnitRegTbl[1] _NXB_UnitRegTbl[2] _NXB_UnitRegTbl[3] _NXB_UnitRegTbl[4]

CPU Unit NX Unit A NX Unit D NX Unit B NX Unit C

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-13


4 Controller Setup

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

NX Unit Mounting Settings


If an NX Unit is removed or if you know in advance that an NX Unit is planned to be added, you
can use the NX Unit mounting settings to prevent the NX Unit numbers from changing.
Refer to 8-2-2 Mounting Settings of NX Units on the CPU Unit.

4-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

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

4-2 Initial Settings for the PLC Function Module


NX-series CPU Units.

 Unit Information

 Settings for All Units


Set the device names.
4
Device names are automatically created when Units are added in the Unit Editor.
Default names: “J” followed by serial numbers that start from 01

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.

Precautions for Correct Use


Make sure you set the same unit numbers as the unit numbers that are set on the rotary
switches on the front of the Special Units. If they are not the same, operation will be according to
the unit numbers that are set on the front-panel rotary switches.

 Basic I/O Units


The following settings are made in the Unit Information of the Basic I/O Units.

Setting Set Update tim- Changes in


Access point Description Default
group values ing RUN mode
Unit Informa- Basic Input Sets the input response time (ON No filter 8 ms When power Not allowed.
tion Unit Input response time = OFF response 0.5 ms, is turned ON
Response time) of the Basic Input Unit. You 1 ms, or the CPU
Note Set the Time can set no filter or you can set the 2 ms, Unit is reset
informa- value in increments from 0 to 32 ms. 4 ms,
tion for You can increase the value to 8 ms,
each reduce chattering and the effects of 16 ms,
slot. external noise. If you decrease the or
value, shorter input pulses are 32 ms
received (but the pulses must be
longer than the task period).

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-15


4 Controller Setup

4-3 Initial Settings for NX Units


This section describes the initial settings that are required for NX Units on the NX1P2 CPU Units.
These settings are not provided for the NX701 CPU Units and NJ-series CPU Units.

4-3-1 NX Unit Settings


Select an NX Unit to set and make the settings on the CPU and Expansion Racks Tab Page on the Sys-
mac Studio.

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.

4-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-3-2 I/O Allocation Settings


This section provides an overview of I/O allocation settings and how to edit the settings.

An Overview of I/O Allocation Settings


To allocate I/O, select an I/O entry mapping and register an I/O entry to the I/O entry mapping.

4-3 Initial Settings for NX Units


 Selecting I/O Entry Mappings
An I/O entry mapping defines a set of I/O data. Each Unit has its I/O entry mapping.
The data for each I/O entry included in the selected I/O entry mappings are exchanged. Default val-
ues are assigned to the I/O entry mapping selections. Change the I/O entry mapping selections as
necessary. If an I/O entry mapping must be selected, the option to deselect it will not be available.

 Registering I/O Entries


The I/O data assigned to an I/O entry mapping is called an I/O entry. 4
Default values are assigned to the I/O entries in each I/O entry mapping. Some I/O entry mappings
allow you to add or delete I/O entries. Also, the I/O data that you can assign to an I/O entry mapping

4-3-2 I/O Allocation Settings


is predetermined. Change the I/O entries as necessary.

Allocatable I/O data points


I/O entry Selection of I/O I/O entry mapping Editing I/O entries I/O data not included
mapping entry mapping I/O entry in the I/O entry
selection
example
I/O data A I/O data I
Added.
Selected. Possible. I/O entry mapping A Possible. I/O data B
I/O data J I/O data K

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

I/O data G I/O data L


Selected. Possible. I/O entry mapping D Possible. Deleted.

I/O data H I/O data M

*The shaded I/O data is not exchanged with process data communications.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-17


4 Controller Setup

Editing the I/O Allocation Settings


You can edit the I/O allocation settings for the NX Units as necessary.
When you click the Edit I/O Allocation Settings Button in the CPU and Expansion Racks Tab Page on
the Sysmac Studio, the Edit I/O Allocation Settings Pane is displayed.

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.

4-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-3-3 Unit Operation Settings


The settings that 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.

4-3 Initial Settings for NX Units


Editing the Unit Operation Settings
You can edit the Unit operation settings for the NX Units as necessary.
When you click the Edit Unit Operation Settings Button in the CPU and Expansion Racks Tab Page
on the Sysmac Studio, the Edit Unit Operation Settings Tab Page is displayed.

4-3-3 Unit Operation Settings


Precautions for Correct Use
If the connected position of an NX Unit is changed, the Unit operation settings return to initial val-
ues. Transfer the Unit operation settings again as necessary.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-19


4 Controller Setup

4-4 Initial Settings for Special Units


This section describes the initial settings that are required for the Special Units used with NJ-series
CPU Units. These settings are not provided for NX-series CPU Units.
You can use any of the following methods to set the initial settings of the Special Units.

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.

4-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

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.

4-4 Initial Settings for Special Units


Download the variable table from the Sysmac Studio to the CPU Unit.
Select the Clear the present values of variables with Retain attribute Check Box.

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

Precautions for Safe Use


When you restart a Special Unit after you change the settings, confirm the safety of the devices
at the connection target before you restart the Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-21


4 Controller Setup

4-5 Initial Settings for the Motion Control


Function Module
This section describes the initial settings that are required for the MC Function Module.

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.

Read and check


Download. Axis Parameter Settings data. Axis Parameter Settings

User program
Axes Group
Upload. Axes group
Parameter Settings
parameter settings MC_Write instruction

Temporarily changes
some parameters.

4-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-5 Initial Settings for the Motion Control Function Module


4-5-2 Setting Methods
You can use either of the following methods to set motion control parameters.

Method 1: Setting the Motion Control Setup in the Sysmac Studio


Right-click Axis Settings from under Configurations and Setup - Motion Control Setup in the Sys-
mac Studio and make the settings in the Axis Setting Table.

4-5-2 Setting Methods


Download the motion control parameters to the CPU Unit to save them in the non-volatile memory in
the CPU Unit. The downloaded settings are enabled when the power is turned ON or a download is
performed.

Method 2: Setting with the MC_Write Instruction


You can temporarily overwrite some motion control parameters with the MC_Write instruction.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-23


4 Controller Setup

4-6 Initial Settings for the EtherCAT


Master Function Module
This section describes the initial settings that are required for the EtherCAT Master Function Module.

The initial settings for the EtherCAT Master Function Module are listed below.
• 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.

4-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-7 Initial Settings for the EtherNet/IP

4-7 Initial Settings for the EtherNet/IP Function Module


Function Module
This section describes the initial settings that are required for the EtherNet/IP Function Module.

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*1

*1 For the NX701 CPU Unit, FINS Settings are not provided. 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-25


4 Controller Setup

4-8 Initial Settings for Built-in I/O


This section describes the initial settings that are required for I/O built in the NX1P2 CPU Units.

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.

4-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


4 Controller Setup

4-9 Initial Settings for Option Boards


This section describes the initial settings that are required for Option Boards in the NX1P2 CPU Units.

4-9 Initial Settings for Option Boards


The initial settings for the Option Boards are listed below.
• Configuration
• Option Board 1 Serial Communications Settings
• Option Board 2 Serial Communications Settings

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 4-27


4 Controller Setup

4-10 Memory Settings for CJ-series Units


This section describes the initial settings that are required for memory used for CJ-series Units with
NX1P2 CPU Units.

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

Additional Information

You cannot use the EM Area for the NX1P2 CPU Units.

Select Configurations and Setup − Controller Setup − Memory Settings for CJ-series Units 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.

4-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


Designing Tasks
This section describes the task system and types of tasks.

5-1 Overview of Task Designing Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3


5-2 Overview of Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 5
5-2-1 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
5-2-2 Instructions Related to Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
5-2-3 System-defined Variables Related to Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units . . . . 5-11
5-3-1 Specifications of Tasks for NX701 CPU Units . . . . . . . . . . . . . . . . . . . . . . . . 5-11
5-3-2 Guidelines for Separating Tasks for NX701 CPU Units . . . . . . . . . . . . . . . . . 5-12
5-3-3 Basic Operation of Tasks for NX701 CPU Units . . . . . . . . . . . . . . . . . . . . . . 5-12
5-3-4 Event Task Execution Conditions for NX701 CPU Units . . . . . . . . . . . . . . . . 5-22
5-3-5 Event Task Execution Timing for NX701 CPU Units . . . . . . . . . . . . . . . . . . . 5-27
5-3-6 Operation When Execution Condition Is Met Again before Execution of
the Event Task Is Completed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units . . . . 5-32
5-4-1 Specifications of Tasks for NX1P2 CPU Units . . . . . . . . . . . . . . . . . . . . . . . . 5-32
5-4-2 Guidelines for Separating Tasks for NX1P2 CPU Units . . . . . . . . . . . . . . . . . 5-33
5-4-3 Basic Operation of Tasks for NX1P2 CPU Units . . . . . . . . . . . . . . . . . . . . . . 5-33
5-4-4 Event Task Execution Conditions for NX1P2 CPU Units . . . . . . . . . . . . . . . . 5-39
5-4-5 Event Task Execution Timing for NX1P2 CPU Units . . . . . . . . . . . . . . . . . . . 5-44
5-4-6 Operation When Execution Condition Is Met Again before Execution of
the Event Task Is Completed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48
5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers 5-49
5-5-1 Specifications of Tasks for NJ-series Controllers . . . . . . . . . . . . . . . . . . . . . . 5-49
5-5-2 Guidelines for Separating Tasks for NJ-series Controllers . . . . . . . . . . . . . . 5-50
5-5-3 Basic Operation of Tasks for NJ-series Controllers . . . . . . . . . . . . . . . . . . . . 5-50
5-5-4 Event Task Execution Conditions for NJ-series Controllers . . . . . . . . . . . . . . 5-59
5-5-5 Event Task Execution Timing for NJ-series Controllers . . . . . . . . . . . . . . . . . 5-64
5-5-6 Operation When Execution Condition Is Met Again before Execution of
the Event Task Is Completed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68
5-6 Services Other Than Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-69
5-6-1 Execution Priorities and Execution Orders of Services Other Than
Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-71
5-6-2 Processing Performed in and Execution Timing of the Tag Data Link Service 5-74

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-1


5 Designing Tasks

5-6-3 Processing Performed in and Execution Timing of the Option Board Service 5-78
5-6-4 Processing Performed in and Execution Timing of the System Services . . . . 5-79
5-7 Assignment and Settings Related to Tasks . . . . . . . . . . . . . . . . . . . . . . . . 5-82
5-7-1 Assigning I/O Refreshing to Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82
5-7-2 Assigning Tasks to Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-90
5-7-3 Parameters for Primary Periodic Task and Periodic Tasks . . . . . . . . . . . . . . . 5-91
5-8 Ensuring Concurrency of Variable Values . . . . . . . . . . . . . . . . . . . . . . . . . 5-94
5-8-1 Ensuring Concurrency of Variable Values between Tasks . . . . . . . . . . . . . . . 5-94
5-8-2 Variable Access from Outside the Controller . . . . . . . . . . . . . . . . . . . . . . . . 5-100
5-9 Errors Related to Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-104
5-10 Monitoring Task Execution Status and Task Execution Times . . . . . . . . 5-107
5-11 Task Design Methods and I/O Response Times . . . . . . . . . . . . . . . . . . . . 5-111
5-11-1 Checking the Task Execution Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-111
5-11-2 Examples of Task Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-114
5-11-3 System Input and Output Response Times . . . . . . . . . . . . . . . . . . . . . . . . . 5-115

5-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-1 Overview of Task Designing


Procedure
This section provides an overview of the task designing procedure.
The shaded steps in the overall procedure that is shown below are related to the task designing proce-

5-1 Overview of Task Designing Procedure


dure.

Step 1. Software Design


Step 1-1 I/O Processing Design

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations
5
Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-3


5 Designing Tasks

Designing the Tasks Reference


 Design the task configuration. 5-3-3 Basic Operation
of Tasks for NX701 CPU
Design the task configuration based on the I/O response perfor- Units
mance that is required by the controlled devices. 5-4-3 Basic Operation
of Tasks for NX1P2
CPU Units
5-5-3 Basic Operation
of Tasks for NJ-series
Controllers
5-11 Task Design Meth-
ods and I/O Response
Times
 Determine whether to use the primary periodic task, or the 5-7-1 Assigning I/O
Refreshing to Tasks
priority-5 or priority-16 periodic task for the I/O refreshing
of each Unit and slave.
Devices (slaves/Units)

Primary periodic task

Priority-16 periodic task

Assign the slaves and Units to


the task for I/O refreshing.

 Determine which programs to assign to the primary 5-7-2 Assigning Tasks to


Programs
periodic task, to the priority-5, priority-16, priority-17, and
priority-18 periodic tasks, and to the priority-8 and
priority-48 event tasks.
 Design the exclusive control methods for variables 5-8-1 Ensuring Con-
currency of Variable
between tasks.
Values between Tasks
Design the exclusive control methods for variables between tasks
when the same global variables are used in different tasks.
 Design the tasks to access variables from outside of the 5-8-2 Variable Access
from Outside the Con-
Controller. troller
Design the tasks to enable synchronization of accessing variables in
the CPU Unit from outside of the Controller with the execution of a
program in a specific task. EtherNet/IP tag data links are included in
accessing variables.

Task Settings on the Sysmac Studio

Setting the Tasks Reference


 Initial Settings for the PLC Function Module: 4-2 Initial Settings for
the PLC Function Mod-
Task Settings: Task Periods, I/O Settings, Program Assignments,
ule
Task Interface Settings, and other settings

5-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Offline Debugging with the Sysmac Studio

Desktop Operation Check Reference


 Perform desktop debugging of sequence control and Section 7 Checking
Operation and Actual
motion control with the Simulator (virtual controller).
Operation

5-1 Overview of Task Designing Procedure


5-10 Monitoring Task
 Monitor the task execution times in the Task Execution Execution Status and
Time Monitor Display. Task Execution Times

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-5


5 Designing Tasks

5-2 Overview of Tasks


This section provides an overview of tasks.

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.

Type of Number Task execu-


Definition Main processing content
task of tasks tion priority
Primary 1 4 The primary periodic task is executed I/O refreshing, user pro-
periodic once every task period. It has the highest gram execution, and
task execution priority. motion control
Motion control instructions and EtherCAT
communications of the primary periodic
task are executed on the primary peri-
odic task period.
Periodic 0 to 1 5*1 The priority-5 periodic task is executed I/O refreshing, user pro-
tasks once every task period. It has the second gram execution, and
highest execution priority after the pri- motion control
mary periodic task.
Motion control instructions and EtherCAT
communications of the priority-5 periodic
task are executed on the priority-5 peri-
odic task period.
0 to 3 16*2, 17, or The priority-16, priority-17, and priority- The processing that can
18 18 periodic tasks are executed once be performed depends on
every task period. the task execution priority.
Motion control instructions and EtherCAT • Execution priority 16:
communications of the priority-16 peri- I/O refreshing and user
odic task are executed on the primary program execution
periodic task period. • Execution priority 17 or
18: User program exe-
cution
Event tasks 0 to 32 8 or 48 An event task is executed only once User program execution
when the specified execution 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 NX1P2 CPU Units.

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.

5-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing 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.

 Primary Periodic Task and Periodic Tasks


The CPU Unit periodically executes both the primary periodic task and periodic tasks.
(The interval in which the CPU Unit executes the primary periodic task or a periodic task is called the
task period.)

5-2 Overview of Tasks


Fixed period (an
Primary periodic task Fixed Periodic task integer multiple of
Task period Task period
period the task period of
the primary
periodic task)

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 fol-
lowing two types of execution conditions for event tasks.

Execution condition Specification


Execution with an instruc- The event task is executed when the ActEventTask (Execute Event Task)
tion instruction is executed.
Execution when a condi- The event task is executed when the specified variable matches a predefined
tion for a variable is met condition.

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.

Precautions for Correct Use


• I/O refreshing and motion control are not executed in event tasks. This means that you cannot
assign programs to event tasks if the program performs I/O control or executes motion control
instructions.
• Event tasks are not executed repeatedly every task period. Therefore, you cannot assign a
program to an event task if that program contains an instruction whose execution is not
completed within one task period. Instructions that are executed over more than one task
period include some of the basic instructions, such as instructions for SD Memory Cards and
communications, all motion control instructions, and all simulation instructions. Refer to the
NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the basic instruc-
tions that cannot be used in event tasks.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-7


5 Designing Tasks

Additional Information

Tasks operate differently between the NX701 CPU Units, NX1P2 CPU Units, and NJ-series CPU
Units. Refer to 5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units, 5-4 Spec-
ifications and Basic Operation of Tasks for NX1P2 CPU Units, and 5-5 Specifications and Basic
Operation of Tasks for NJ-series Controllers for details.

5-2-2 Instructions Related to Tasks


The following instructions are supported to read the status of the current task, to determine if execution
is in progress for other tasks, and to perform exclusive control for regional concurrency between tasks.

Instruction Instruction name Introduction


GetMyTaskStatus Read Current Task Reads the following status of the current task.
Status Last Task Execution Time, Maximum Task Execution Time, Minimum
Task Execution Time, Task Execution Count, Task Period Exceeded
Flag, and Task Period Exceeded Count
GetMyTaskInterval Read Current Task Reads the task period of the current task.
Period
Task_IsActive Determine Task Determines if the specified task is currently in execution.
Status
Lock Lock Tasks Starts a lock between tasks. Execution of any other task with a
Unlock Unlock Tasks Stops a lock between tasks. lock region with the same lock
number is disabled.
ActEventTask Activate Event Activates the specified event task.
Task

5-2-3 System-defined Variables Related to Tasks


The following system-defined variables are provided for each task to show task status.
Do not use these variables in the user program. There may be a delay in updating them and concur-
rency problems in relation to the error status of the Function Module. It is used only to sample the task
status for data tracing from the Sysmac Studio.
You can also use the GetMyTaskStatus and Task_IsActive instructions to read task status from the user
program. You cannot access the following variables directly through system-defined variables.

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.

5-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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

5-2 Overview of Tasks


value of the data type, the present value
returns to 0 and the count is continued.

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

5-2-3 System-defined Variables Related to Tasks


Task A

_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

* When the ActEventTask instruction is used


to execute an event task, the Task Active
Flag changes to TRUE.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-9


5 Designing Tasks

 Task Period Exceeded Flag (_TaskName_Exceeded)


Task period

Primary
periodic task: IO IO IO UPG M
IO UPG M
Task A M
C C
UPG C

Period exceeded.

_TaskA Exceeded

5-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
5-3 Specifications and Basic Operation
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.

5-3-1 Specifications of Tasks for NX701 CPU Units


The specifications of tasks are given in the following table.

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

5-3-1 Specifications of Tasks for NX701 CPU Units


250 µs to 100 ms (in 250-µs increments)
• Priority 16, 17, or 18
1 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: 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.

Precautions for Correct Use


Do not set the task period of primary periodic task to 4 ms or more when you use the priority-5
periodic task. If you set the task period to 4 ms or more, a Slave Application Error may occur.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-11


5 Designing Tasks

5-3-2 Guidelines for Separating Tasks for NX701 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.

Task Programs that are suitable for this task


Primary periodic task • Programs that require periodic I/O refreshing, user program execution,
motion control, or system common processing at an exact execution
period.
• Programs that require the highest execution priority and contain controls
that need high-speed response.
• Programs that contain motion control instructions with the highest execu-
tion priority.
Priority-5 periodic task • Programs that require periodic I/O refreshing, user program execution,
motion control, or system common processing at an exact execution
period.
• Programs that require the second highest execution priority after the pri-
mary periodic task and contain controls that need high-speed response.
• Programs that contain motion control instructions with a relatively high
execution priority.
• Programs used for applications where the processes that require the
highest-speed processing are controlled with the primary periodic task
and the rest is controlled separately with the priority-5 periodic task.
Priority-16 periodic task • Programs with a relatively low execution priority that require periodic user
program execution or system common processing.
• Programs that contain controls for some slaves and Units whose I/O
refreshing is assigned to the primary periodic task.
• Programs that contain motion control instructions with a relatively low
execution priority.
• Programs used for applications where, among the processes for slaves
and Units controlled with the primary periodic task, those with a relatively
low execution priority are controlled separately with the priority-16 peri-
odic task.
Priority-17 or priority-18 periodic • Programs with a relatively low execution priority that require periodic user
task program execution or system common processing.
• Programs that contain data processing and communications processing
controls that do not need high-speed response.
Event task • Programs that are executed only when specified conditions are met.

5-3-3 Basic Operation of Tasks for NX701 CPU Units


With a multi-core processor, the NX701 CPU Units can execute the primary periodic task and the
priority-5 periodic task in parallel. The order in which tasks are executed depends on the execution pri-
ority that is set for each task.

Additional Information

With an NX701 CPU Unit, you can execute multiple tasks, the tag data link service, and system
services in parallel.

5-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

High Numbers of tasks

5
Primary
4 1
periodic task

5-3-3 Basic Operation of Tasks for NX701 CPU Units


5 Periodic task 0 or 1

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-13


5 Designing Tasks

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.

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-3-5 Event Task Execution Timing for NX701 CPU Units for the order of execution of
event tasks.

 Projects with Only the Primary Periodic Task


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. System services are executed in the unused time between execution of the tasks. Refer
to Processing Performed in System Services on page 5-79 for details on the system services.

Execution priority Primary period Primary period


High
Primary
periodic IO UPG MC IO UPG MC
task
A double line means
that all processing for
that task has been
System SS completed.
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.

5-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 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.

Group Type of task


Group 1 Primary periodic task
Priority-16 periodic task
Group 2 Periodic task (priority 5, 17, or 18)
Event task (priority 8 or 48)

• 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 primary
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 peri-
odic task once every two primary periods for the priority-5 periodic task and once every four pri-
mary periods for the priority-16 periodic task. 5
• The system services are executed at the required time without being affected by the tasks.

5-3-3 Basic Operation of Tasks for NX701 CPU Units


Execution priority Primary period Primary period Primary period Primary period Primary period

High Primary
periodic task IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC

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

Task execution Task Task execution Task Task execution Task


condition is execution condition is execution condition is execution
met. is completed. met. is completed. met. is completed.
Task period

Priority-16
UPG UPG
periodic task

Task execution Task Task execution Task


condition is execution condition is execution
met. is completed. met. is completed.
Task period

Priority-17
UPG
periodic task

Task execution Task


condition is execution
met. is completed.
System
SS
Low services

Precautions for Correct Use


If you have multiple tasks that read and write to the same variables, make sure to use exclusive
control of variables between the tasks. Otherwise, a task other than the one currently in execu-
tion may change the variable values. Refer to 5-8-1 Ensuring Concurrency of Variable Values
between Tasks for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-15


5 Designing Tasks

Tasks and Operating Modes


The relationship between CPU Unit operating modes and tasks is given in the following table.

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.

Precautions for Correct Use


• Even if the execution condition for an event task is already met when you change the operating
mode to RUN mode, the event task will not be executed. An event task is executed only when
its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.

5-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-3 Specifications and Basic Operation of Tasks for NX701 CPU Units
The Processing Performed in Each Task

 Primary Periodic Task


The primary periodic task has the highest execution priority. It executes processes with high speed
and high precision.
In the specified period, this task performs system common processing, I/O refreshing, user program
execution, and motion control.
Task period*1 = Primary period (fixed)

Task execution time*2 (varies)

I/O refreshing Control processing


Output data

processing

processing 2
processing

processing 1
Input data

Motion
control

common
common

System
System

Refreshing User program


execution

*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.

Processing Processing contents


5
I/O refresh- Output data • Output refresh data is created for Output Units that refresh I/O.
ing processing

5-3-3 Basic Operation of Tasks for NX701 CPU Units


• If forced refreshing is set, the forced refreshing values are reflected in the output
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 and the priority-16 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-17


5 Designing Tasks

Task period = Primary period (fixed)

I/O refreshing Control processing I/O refreshing

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.

 Priority-5 Periodic Task


The priority-5 periodic task has the next highest execution priority after the primary periodic task. It
executes processes with high speed and high precision.
In every period, this task performs system common processing, I/O refreshing, user program execu-
tion, and motion control.
The priority-5 periodic task is available only for the NX701 CPU Units.

Task period (fixed)

Task execution time (varies)


Priority-5 periodic task is executed
* in parallel with primary periodic task.
I/O refreshing Control processing Pausing task is not necessary when
the primary periodic task is in
Output data

processing

processing 2
processing

processing 1
Input data

Motion
control

common
common

System
System

User program execution.


Refreshing
execution

Processing Processing contents


I/O Output data pro- • Output refresh data is created for Output Units that refresh I/O.
refreshing cessing • If forced refreshing is set, the forced refreshing values are reflected in the
output refresh data.
Refreshing • This process exchanges data with I/O.
Input data process- • Input refresh data is loaded from Input Units that refresh I/O.
ing • If forced refreshing is set, the forced refreshing values are reflected in the
input refresh data that was read.
System common processing 1 • Processing for exclusive control of variables in tasks is performed (when
accessing tasks are set).
• Motion input processing is performed.*1
• Data tracing 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 priority-5 periodic task are executed.
• Processing the motion outputs for I/O refreshing in the next priority-5
periodic task.

5-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

Task period (fixed)

I/O refreshing Control processing I/O refreshing


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


are updated for use in the following motion
When the CPU Unit executes a motion
control instruction, it executes the result of During output data processing in the next task period
5
control instructions. that instruction in motion control processing of priority-5 periodic task, the CPU Unit sends the
immediately afterward. results of motion control processing to the Servo Drive
via EtherCAT.

5-3-3 Basic Operation of Tasks for NX701 CPU Units


 Priority-16, Priority-17, or Priority-18 Periodic Task
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 allows you to write control programs for the slaves and Units for which
you set the priority-16 periodic task in the I/O Control Task Settings.
Processing for periodic tasks that do not control I/O is different from processing for periodic tasks
that do control I/O.

Periodic Tasks That Do Not Control I/O

Task period (fixed)


Task execution time (varies)
* The Controller may pause the execution of
a priority-16, -17, or -18 periodic task in
* * order to execute a task with a higher
Control processing execution priority.
In the rest of this manual, description of
processing 2
processing 1

tasks in the NX-series CPU Unit will not


common
common

System

User
System

program refer to the pausing task scenario.


execution

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-19


5 Designing Tasks

Processing Processing contents


System common processing 1 • Processing for exclusive control of variables in tasks is performed (when
accessing tasks are set).
• 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.
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.

Note The processes in each cell in the above table are executed in the order of description.

Priority-16 Periodic Task That Controls I/O


Task period (fixed)
Task execution time (varies)
* The Controller may pause the execution of
a priority-16 periodic task in order to
* * execute a task with a higher execution
Control processing priority.
In the rest of this manual, description of
processing 2
processing 1

tasks in the NX-series CPU Unit will not


common
common

System

User
System

program refer to the pausing task scenario.


execution

Processing Processing contents


System common pro- • Reflecting the input refresh data.*1
cessing 1 • Processing for exclusive control of variables in tasks is performed (when
accessing tasks are set).
• Data tracing processing (sampling and trigger checking) is performed.
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).
• 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.
• Reflecting the execution results in the output refresh data.*2
*1 This loads the input refresh data from the EtherCAT slaves for which you set the priority-16 periodic task in
the I/O Control Task Settings. Input refresh data refers to the data that is input in process data communica-
tions during I/O refreshing in the primary periodic task.
*2 This reflects the execution results of the user program for the EtherCAT slaves for which you set the priority-
16 periodic task in the I/O Control Task Settings in the output refresh data. The output refresh data will be
output in process data communications during I/O refreshing in the primary periodic task.

Note The processes in each cell in the above table are executed in the order of description.

5-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 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.

Task execution time (varies)


* The Controller may pause the
execution of a task in order to
* * execute a task with a higher
Control processing execution priority.
In the rest of this manual, description
System common

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.

Processing Processing contents


System common pro- • Processing for exclusive control of variables in tasks is performed (when
cessing 1 accessing tasks are set).*1
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-3-3 Basic Operation of Tasks for NX701 CPU Units

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-21


5 Designing Tasks

5-3-4 Event Task Execution Conditions for NX701 CPU Units


An event task is executed only once when the specified execution condition is met. There are the follow-
ing two types of execution conditions for event tasks.

Execution condition Event task execution timing Reason for use


Execution with the ActEvent- When ActEventTask instruction is • When you need to explicitly specify which
Task instruction executed event tasks to execute in the user program
• When the execution condition for the event
task may change before meeting the con-
dition expression for the variable is deter-
mined
Execution when a condition When the specified variable value When you want to simplify the user program
expression for a variable is matches the specified condition by executing event tasks without user pro-
met expression* gramming

* 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.

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.

 Example of User Programming Using the ActEventTask Instruction


Example 1: Executing an Event Task Only Once When the Value of a Variable Changes
In the following example, the upward differentiation option is used for the ActEventTask instruction.
This causes the Task1 event task to be executed only once when the BoolVar BOOL variable
changes to TRUE.

5-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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

ActEventTask The event task is executed only once.


instruction is executed.

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-

5-3-4 Event Task Execution Conditions for NX701 CPU Units


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-23


5 Designing Tasks

Executing Event Tasks When Condition Expressions for Variables


Are Met
This method executes the event task once when the specified condition expression is met for the value
of a variable that was specified on the Sysmac Studio. The event task is not executed repeatedly while
the value of the variable matches the condition expression. It is executed only once when the value of
the variable first changes so that it meets the condition expression. This method of execution does not
require user programming to execute the event task.

 Variables for Which You Can Specify Condition Expressions


The following table lists the variables that you can specify for condition expressions.

Type of variables Specification


System-defined variables Possible.*1
Semi-user-defined variables Possible.
User-defined vari- Global variables Possible.
ables Variables used in a program Possible.
Variables used in a function block Possible.*2
Variables used in a function Not possible.

*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.

 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.

*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-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Condition Expressions That You Can Specify

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.

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}

 Valid Range of Comparison Constants


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. The valid range of com-
parison constants is the same as the valid range of the data type of the variable that you specify for
the condition expression.
5
Refer to Basic Data Types and Derivative Data Types on page 6-30 for the valid range of values for
each data type. For example, if the variable that you specify for the condition expression is a BYTE

5-3-4 Event Task Execution Conditions for NX701 CPU Units


variable, the valid range of comparison constant values is from BYTE#16#00 to BYTE#16#FF.

 Example of Executing Event Tasks When Condition Expressions for Variables


Are Met
Example 1: Execution Condition for Event Task Set to a Change to TRUE of the Program1.trigger1
Boolean Variable
When the value of Program1.trigger1 changes to TRUE, the event task is executed only once.

Execution
priority
Primary period
High

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

The event task is executed only once.


Condition expression Condition expression
is not met. is met.

Event task

TRUE is assigned to
Program1.trigger1 variable.

Low

TRUE
Program1.trigger1
FALSE

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-25


5 Designing Tasks

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

Condition expression Not met. Value of 10 Value of 11 Value of 9


is not met. is assigned. is assigned. is assigned.
Not met.
Met
Event task Value of 9 is assigned to
Program1.curVal variable.

The event task is executed only once when


Low the value of the Program1.curVal variable
changes from less than 10 to 10 or higher.

Program1.curVal 0 9 10 11 9

Precautions for Correct Use


If the value of a specified variable changes in the primary periodic task, the CPU Unit evaluates
whether the condition expression is met in the next primary periodic task. This means that the
event task will be executed on completion of this evaluation against the condition expression in
the next primary periodic task after the CPU Unit evaluates that the condition expression is met.

5-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

Purpose Function to use


Accessing the same global variable from an event task Exclusive control of variables in tasks
and from another task • Settings for exclusive control of variables in tasks
• Lock (Lock Tasks) instruction
• 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
execution priority for more than one event task. You must be careful when the execution conditions are

5-3-5 Event Task Execution Timing for NX701 CPU Units


met for more than one event task that has the same execution priority.

Differences in Execution Timing Based on the Execution Conditions


of Event Tasks
The execution timing for event tasks depends on whether the execution condition is triggered by an
ActEventTask instruction or by when a condition expression for a variable is met.

 Execution Timing When the Execution Condition Is an ActEventTask


Instruction
If the execution condition for an event task is triggered by an ActEventTask instruction, the event
task execution condition will be met immediately after the ActEventTask instruction is executed. The
NX-series CPU Unit executes event tasks for which the execution condition is met according to the
task execution priority.
Example 1: Executing an Event Task with an Execution Priority Higher Than the Task That Executes
an Instruction

The event task execution condition is met immediately after


Execution
the ActEventTask instruction is executed.
priority
High

Event task
(execution priority of 8)

Task period

Priority-16
periodic task

ActEventTask instruction
Low is executed.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-27


5 Designing Tasks

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

The event task execution condition is met immediately after


the ActEventTask instruction is executed.

 Execution Timing When the Execution Condition Is a Condition Expression


for a Variable
The condition expression is evaluated for a match inside the primary periodic task. The execution
condition for an event task is met when it is evaluated to match the condition expression. The NX-
series CPU Unit executes event tasks for which the execution condition is met according to the task
execution priority.
Example 1: Project with a Priority-16 Periodic Task and an Event Task Execution with a Priority of 8

Execution
priority
High Primary period

Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task

Value is assigned Event task is executed only once.


to variable in user
program.
Event task (execution
priority of 8)
Condition
Task period expression is met.

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

Value is assigned Condition expression


to variable in user is met.
Task period program.

Priority-16
periodic task Event task is executed
only once.

Event task (execution


priority of 48)

Low

5-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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

5-3-5 Event Task Execution Timing for NX701 CPU Units


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 instruction,
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

T1 event task is executed first because the ActEventTask


instruction that triggered it was executed first.
User program
T1 event task ActEventTask(‘T1’);
ActEventTask(‘T2’);
(execution priority of 8)

Execution priority
is the same.
T2 event task
(execution priority of 8)

Low

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-29


5 Designing Tasks

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

Condition expression The match for the condition


for VarA is met. ActEventTask expression for VarA and
Condition expression instruction is executed. VarB is detected.
for VarB is met.
T1 event task
(execution priority of 8)

T2 event task
(execution priority of 8)

T3 event task
(execution priority of 8)

Low

5-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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

Task Is Completed
5-3-6 Operation When Execution Condition Is Met Again before Execution of the Event
Primary periodic
task

ActEventTask instruction ActEventTask instruction


is executed for T1 and T2. is executed for T2.
Task period

T1 event task
(execution priority of 8)

This event task (T2) was triggered by the first


ActEventTask instruction and is still waiting for
T2 event task execution. The second ActEventTask
(execution priority of 8) instruction is ignored.

Low

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-31


5 Designing Tasks

5-4 Specifications and Basic Operation


of Tasks for NX1P2 CPU Units
This section describes the specifications and basic operation of tasks for the NX1P2 CPU Units with a
multi-core processor.

5-4-1 Specifications of Tasks for 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 2 ms to 8 ms (in 250-µs increments)
Task periods of periodic tasks • Priority 17 or 18
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-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
5-4-2 Guidelines for Separating Tasks for 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.

Task Programs that are suitable for this task


Primary periodic task • Programs that require periodic I/O refreshing, user program execution,
motion control, or system common processing at an exact execution
period.
• Programs that require the highest execution priority and contain controls
that need high-speed response.
• Programs that contain motion control instructions with the highest execu-
tion priority.
Priority-17 or priority-18 periodic • Programs with a relatively low execution priority that require periodic user
task program execution or system common processing.
• Programs that contain data processing and communications processing
controls that do not need high-speed response.
Event task • Programs that are executed only when specified conditions are met.

5-4-3 Basic Operation of Tasks for NX1P2 CPU Units


The NX1P2 CPU Units cannot execute more than one task at the same time. The order in which tasks 5
are executed depends on the execution priority that is set for each task.

5-4-2 Guidelines for Separating Tasks for NX1P2 CPU Units


Additional Information

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-33


5 Designing Tasks

Task Execution Priority


The type of the task determines its execution priority. If the execution condition is met for another task,
Tb, that has a higher execution priority while task Ta execution is in progress, execution of Ta will be
interrupted to allow execution of Tb. Processing for Ta will resume when processing for Tb is completed.
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 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 NX1P2 CPU
Units for the order of execution.

High Numbers of tasks

Primary
4 1
periodic task

Event tasks 0 to 32
8
Execution priority
(0 to 63)
A total of up to 32
tasks for both
priority levels.
17 Periodic task 0 or 1

18 Periodic task 0 or 1

Event tasks 0 to 32
48

Low

5-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
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.

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 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 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-79 for details on the sys-
tem services.

Execution priority Primary period Primary period


High
Primary
periodic IO UPG MC IO UPG MC
task
A double line means
that all processing for
that task has been
System SS completed.
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-35


5 Designing Tasks

 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 primary
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

Task execution Task execution Task execution


condition is met. is completed. condition is met.

System
SS
services

Low

Precautions for Correct Use


If you have multiple tasks that read and write to the same variables, make sure to use exclusive
control of variables between the tasks. Otherwise, a task other than the one currently in execu-
tion may change the variable values. Refer to 5-8-1 Ensuring Concurrency of Variable Values
between Tasks for details.

Tasks and Operating Modes


The relationship between CPU Unit operating modes and tasks is given in the following table.

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.

Precautions for Correct Use


• Even if the execution condition for an event task is already met when you change the operating
mode to RUN mode, the event task will not be executed. An event task is executed only when
its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.

5-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
The Processing Performed in Each Task

 Primary Periodic Task


The primary periodic task has the highest execution priority. It executes processes with high speed
and high precision.
In the specified period, this task performs system common processing, I/O refreshing, user program
execution, and motion control.
Task period*1 = Primary period (fixed)

Task execution time*2 (varies)

I/O refreshing Control processing


Output data

processing

processing 2
processing

processing 1
Input data

Motion
control

common
common

System
System

Refreshing User program


execution

*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.

Processing Processing contents


5
I/O refresh- Output data • Output refresh data is created for Output Units that refresh I/O.
ing processing

5-4-3 Basic Operation of Tasks for NX1P2 CPU Units


• If forced refreshing is set, the forced refreshing values are reflected in the output
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-37


5 Designing Tasks

Task period = Primary period (fixed)

I/O refreshing Control processing I/O refreshing

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.

 Priority-17 or Priority-18 Periodic Task


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 2 periodic tasks.

Task period (fixed)

Task execution time (varies)


* The Controller may pause the execution of a priority-17,
or -18 periodic 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

Processing Processing contents


System common processing 1 • Processing for exclusive control of variables in tasks is performed (when
accessing tasks are set).
• 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.
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.

Note The processes in each cell in the above table are executed in the order of description.

5-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
 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.

Processing Processing contents


System common pro- • Processing for exclusive control of variables in tasks is performed (when
cessing 1 accessing tasks are set).*1
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 NX1P2 CPU Units
An event task is executed only once when the specified execution condition is met. There are the follow-

5-4-4 Event Task Execution Conditions for NX1P2 CPU Units


ing two types of execution conditions for event tasks.

Execution condition Event task execution timing Reason for use


Execution with the ActEvent- When ActEventTask instruction is • When you need to explicitly specify which
Task instruction executed event tasks to execute in the user pro-
gram
• When the execution condition for the
event task may change before meeting
the condition expression for the variable
is determined
Execution when a condition When the specified variable value When you want to simplify the user pro-
expression for a variable is matches the specified condition gram by executing event tasks without user
met expression* programming

* 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-39


5 Designing Tasks

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.

 Example of User Programming Using the ActEventTask Instruction


Example 1: Executing an Event Task Only Once When the Value of a Variable Changes
In the following example, the upward differentiation option is used for the ActEventTask instruction.
This causes the Task1 event task to be executed only once when the BoolVar BOOL variable
changes to TRUE.

BoolVar @ActEventTask
EN ENO
'Task1' TaskName

Execution
priority
Primary period
High

Primary
periodic task

ActEventTask The event task is executed only once.


instruction is executed.

Task1 Interrupted.
event task

Low

TRUE
BoolVar
FALSE

5-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
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 Interrupted. Interrupted.


event task
5
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

5-4-4 Event Task Execution Conditions for NX1P2 CPU Units


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

Executing Event Tasks When Condition Expressions for Variables


Are Met
This method executes the event task once when the specified condition expression is met for the value
of a variable that was specified on the Sysmac Studio. The event task is not executed repeatedly while
the value of the variable matches the condition expression. It is executed only once when the value of
the variable first changes so that it meets the condition expression. This method of execution does not
require user programming to execute the event task.

 Variables for Which You Can Specify Condition Expressions


The following table lists the variables that you can specify for condition expressions.

Type of variables Specification


System-defined variables Possible.*1
Semi-user-defined variables Possible.
User-defined vari- Global variables Possible.
ables Variables used in a program Possible.
Variables used in a function block Possible.*2
Variables used in a function Not possible.

*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-41


5 Designing Tasks

 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.

*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.

 Condition Expressions That You Can Specify


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.

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}

 Valid Range of Comparison Constants


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. The valid range of com-
parison constants is the same as the valid range of the data type of the variable that you specify for
the condition expression.
Refer to Basic Data Types and Derivative Data Types on page 6-30 for the valid range of values for
each data type. For example, if the variable that you specify for the condition expression is a BYTE
variable, the valid range of comparison constant values is from BYTE#16#00 to BYTE#16#FF.

5-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
 Example of Executing Event Tasks When Condition Expressions for Variables
Are Met
Example 1: Execution Condition for Event Task Set to a Change to TRUE of the Program1.trigger1
Boolean Variable
When the value of Program1.trigger1 changes to TRUE, the event task is executed only once.

Execution
priority
High Primary period

Primary IO UPG MC IO UPG MC


IO UPG MC IO UPG MC IO UPG MC
periodic task

Condition expression Condition expression The event task is executed only once.
is not met. is met.

Event task

TRUE is assigned to
Program1.trigger1 variable.

Low

TRUE
Program1.trigger1
FALSE 5

5-4-4 Event Task Execution Conditions for NX1P2 CPU Units


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

Condition expression Not met. Value of 10 Value of 11 Value of 9


is not met. is assigned. is assigned. is assigned.
Met Not met.

Event task Value of 9 is assigned to


Program1.curVal variable.

The event task is executed only once when


Low the value of the Program1.curVal variable
changes from less than 10 to 10 or higher.

Program1.curVal 0 9 10 11 9

Precautions for Correct Use


If the value of a specified variable changes in the primary periodic task, the CPU Unit evaluates
whether the condition expression is met in the next primary periodic task. This means that the
event task will be executed on completion of this evaluation against the condition expression in
the next primary periodic task after the CPU Unit evaluates that the condition expression is met.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-43


5 Designing Tasks

5-4-5 Event Task Execution Timing for 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.

Purpose Function to use


Accessing the same global variable from an event task Exclusive control of variables in tasks
and from another task • Settings for exclusive control of variables in tasks
• Lock (Lock Tasks) instruction
• 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.

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.

Differences in Execution Timing Based on the Execution Conditions


of Event Tasks
The execution timing for event tasks depends on whether the execution condition is triggered by an
ActEventTask instruction or by when a condition expression for a variable is met.

 Execution Timing When the Execution Condition Is an ActEventTask


Instruction
If the execution condition for an event task is triggered by an ActEventTask instruction, the event
task execution condition will be met immediately after the ActEventTask instruction is executed. The
NX1P2 CPU Units execute event tasks for which the execution condition is met according to the task
execution priority.
Example 1: Executing an Event Task with an Execution Priority Higher Than the Task That Executes
an Instruction

The event task is executed immediately after execution of ActEventTask.


Execution
priority
High
Event task
(execution
priority of 8)

Task period

Priority-17 Interrupted.
periodic task
ActEventTask
Low instruction is executed.

5-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
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

Event task is executed when the primary periodic task is completed.

 Execution Timing When the Execution Condition Is a Condition Expression


for a Variable
The condition expression is evaluated for a match inside the primary periodic task. The execution
condition for an event task is met when it is evaluated to match the condition expression. The NX1P2
CPU Unit executes event tasks for which the execution condition is met according to the task execu-
tion priority.
Example 1: Project with a Priority-17 Periodic Task and an Event Task Execution with a Priority of 8
The execution priority of the event task (execution priority of 8) is higher than the execution pri-
ority of the priority-17 periodic task. The priority-17 periodic task is therefore executed after the 5
event task is executed.

5-4-5 Event Task Execution Timing for NX1P2 CPU Units


Execution
priority
Primary period
High

Primary IO UPG MC IO UPG MC IO UPG MC


periodic task IO UPG MC IO UPG MC

Value is assigned Condition Event task is executed


to variable in user expression only once.
program. is met.
Event task
(execution
priority of 8)

Task period

Priority-17 Interrupted.
periodic task

Low

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-45


5 Designing Tasks

Example 2: Project with a Priority-17 Periodic Task and an Event Task Execution with a Priority of 48
The execution priority of the event task is lower than the execution priority of the priority-17 peri-
odic task. The event task is therefore executed after the priority-17 periodic task is executed.
Execution
priority
Primary period
High

Primary IO UPG MC IO UPG MC IO UPG MC


periodic task IO UPG MC IO UPG MC

Value is assigned Condition


to variable in user expression
Task period program. is met.

Priority-17 Interrupted. Interrupted.


periodic task

Event task Event task is executed


(execution immediately after completion
priority of 48) of the periodic task.

Low

Precautions for Correct Use


• For the NX1P2 CPU Units, the timing at which the execution condition for an event task is met
is the same regardless of whether the condition expression match is triggered by I/O 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.

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 instruction,
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.

5-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-4 Specifications and Basic Operation of Tasks for NX1P2 CPU Units
Execution
priority
High Primary period

Primary
periodic task

T1 event task is executed first because the ActEventTask


instruction that triggered it was executed first.
User program
T1 event task ActEventTask(‘T1’);
ActEventTask(‘T2’);
(execution priority of 8)

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 5
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.

5-4-5 Event Task Execution Timing for NX1P2 CPU Units


(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 IO UPG MC IO UPG MC


periodic task

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-47


5 Designing Tasks

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.

T1 event task
Interrupted.
(execution priority of 8)

Low

Execution
priority
Primary period
High

Primary
periodic task

ActEventTask instruction ActEventTask instruction


is executed for T2. is executed for T2.
Task period

T1 priority-17
periodic task Interrupted. Interrupted.

This event task (T2) was triggered by the first


ActEventTask instruction and is still waiting
T2 event task for execution. The second ActEventTask
(execution instruction is ignored.
priority of 48)

Low

5-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


5-5 Specifications and Basic Operation
of Tasks for NJ-series Controllers
This section describes the specifications and basic operation of tasks for NJ-series CPU Units.

5-5-1 Specifications of Tasks for NJ-series Controllers


The specifications of tasks are given in the following table.

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 5
periodic task
Task periods of periodic Set the task period of each periodic task to an integer multiple of the task period of

5-5-1 Specifications of Tasks for NJ-series Controllers


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-.

 Valid Task Periods for Periodic Tasks

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-.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-49


5 Designing Tasks

5-5-2 Guidelines for Separating Tasks for NJ-series Controllers


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.

Task Programs that are suitable for this task


Primary periodic task • Programs that require I/O refreshing at an exact execution period.
• Programs that require the highest execution priority.
• Programs that contain motion control instructions with a high execution
priority.
Priority-16 periodic task • Programs that require I/O refreshing.
• Programs with a relatively low execution priority that must be executed
periodically.
• Programs that contain motion control instructions with a relatively low
execution priority.
Priority-17 or priority-18 periodic • Programs with a relatively low execution priority that must be executed
task periodically.
Event task • Programs that are executed only when specified conditions are met.

5-5-3 Basic Operation of Tasks for NJ-series Controllers

The CPU Unit cannot execute more than one task at the same time. The order in which tasks are exe-
cuted depends on the execution priority that is set for each task.

Task Execution Priority


The type of the task determines its execution priority. If the execution condition is met for another task,
Tb, that has a higher execution priority while task Ta execution is in progress, execution of Ta will be
interrupted to allow execution of Tb. Processing for Ta will resume when processing for Tb is completed.
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 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.

5-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


High Numbers of tasks
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

5
Task Periods for the Primary Periodic Task and Periodic Tasks
The CPU Unit repeatedly and cyclically executes the primary periodic task and periodic tasks. The task

5-5-3 Basic Operation of Tasks for NJ-series Controllers


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-51


5 Designing Tasks

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-5-5 Event Task Execution Timing for NJ-series Controllers for the order of execution of
event tasks.

 Projects with Only the Primary Periodic Task


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. System services are executed in the unused time between execution of the tasks. Refer
to Processing Performed in System Services on page 5-79 for details on the system services.

Execution priority Primary period Primary period


High
Primary
periodic IO UPG MC IO UPG MC
task
A double line means
that all processing for
that task has been
System SS SS completed.
Pausing
services

Low

A dotted line represents a transition to another task.

IO: Indicates I/O refreshing (data outputs and then data inputs).
UPG: User program execution.
MC: Indicates motion control.
SS: Indicates system services.

5-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


 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 primary
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

Priority-16 Pausing IO UPG Pausing UPG Pausing IO UPG Pausing


periodic task

Task execution Task execution Task execution


5
condition is met. is completed. condition is met.

Task period

5-5-3 Basic Operation of Tasks for NJ-series Controllers


Priority-17 Pausing UPG Pausing UPG Pausing
periodic task

Task execution
Task execution
condition is met.
is completed.

System SS
Low services

Precautions for Correct Use


If you have multiple tasks that read and write to the same variables, make sure to use exclusive
control of variables between the tasks. Otherwise, a task other than the one currently in execu-
tion may change the variable values. Refer to 5-8-1 Ensuring Concurrency of Variable Values
between Tasks for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-53


5 Designing Tasks

Executing Other Tasks during the Unused Time of a Task


A task with a higher execution priority is never interrupted to start execution of a task with a lower exe-
cution priority. However, for NJ-series CPU Units, if unused time occurs during a task with higher prior-
ity, that time may be used to start execution of a task with lower priority. An example of this is the time
spent waiting for a data transfer to be completed in an I/O refresh process. As soon as processing
resumes for the task with higher priority, the task with lower priority will be interrupted. This processing
order is illustrated in the following figure.
Execution Primary period
priority
High Primary IO UPG MC IO UPG MC
periodic task Unused

Task period

Priority-17 Interrupted.
UPG UPG
periodic task

Task execution Task execution


condition is met. is completed.
Low The priority-17 periodic task is executed during
the unused time of the primary periodic task.

Precautions for Correct Use


Even if unused time occurs in the primary periodic task, the priority-16 periodic task is always
executed after the primary periodic task is completed. However, for NJ-series CPU Units, this
restriction does not apply to the priority-17 or priority-18 periodic tasks. This restriction also does
not apply to I/O refreshing in the priority-16 periodic task. I/O refreshing for the priority-16 peri-
odic task may be executed during the unused time of the primary periodic task.

Tasks and Operating Modes


The relationship between CPU Unit operating modes and tasks is given in the following table.

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.

Precautions for Correct Use


• Even if the execution condition for an event task is already met when you change the operating
mode to RUN mode, the event task will not be executed. An event task is executed only when
its execution condition changes from not met to met during RUN mode.
• Even in RUN mode, an event task is not executed if there is a major fault level error.

5-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


The Processing Performed in Each Task

 Primary Periodic Task


The primary periodic task has the highest execution priority. It executes processes with high speed
and high precision.
In every period, this task performs system common processing, I/O refreshing, user program execu-
tion, and motion control. The primary periodic task performs motion control processing (MC).
Task period*1 = Primary period (fixed)

Task execution time*2 (varies)

I/O refreshing Control processing


Output data

processing

processing 2
processing

processing 1
Input data

Motion
control

common
common

System
System

Refreshing User program


execution

*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
Processing Processing contents
I/O refresh- Output data • Output refresh data is created for Output Units that refresh I/O.

5-5-3 Basic Operation of Tasks for NJ-series Controllers


ing processing • If forced refreshing is set, the forced refreshing values are reflected in the output
refresh data.
Refreshing • This process exchanges data with I/O.
Input data • Input refresh data is loaded from Input Units that refresh I/O.
processing • 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.
• Whether the condition expression for event task execution is met or not is deter-
mined.
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 execution 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. 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-55


5 Designing Tasks

Task period = Primary period (fixed)

I/O refreshing Control processing I/O refreshing

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.

Periodic Tasks That Do Not Control I/O


Task period (fixed)

Task execution time (varies)


* The Controller will pause the execution of a
periodic task in order to execute a task with
* * a higher execution priority.
Control processing
processing 2
processing 1

common
common

System

User
System

program
execution

Processing Processing contents


System common processing 1 • Processing for exclusive control of variables in tasks is performed (when
accessing tasks are set).
• 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.
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.

Note The processes in each cell in the above table are executed in the order of description.

5-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


Periodic Tasks That Control I/O
Task period (fixed)

Task execution time (varies)


* The Controller will pause the
execution of a periodic task in
* * order to execute a task with a
I/O refreshing Control processing higher execution priority.

Output data

processing
processing

Input data

processing 1

processing 2
common

common
System
User

System
Refreshing program
execution

Processing Processing contents


I/O refresh- Output data • Output refresh data is created for Output Units that refresh I/O.
ing*1 processing • If forced refreshing is set, the forced refreshing values are reflected in the
output refresh data.
Refreshing • This process exchanges data with I/O.
Input data • Input refresh data is loaded from Input Units that refresh I/O.*2
processing • If forced refreshing is set, the forced refreshing values are reflected in the
input refresh data that was read.
System common processing • Processing for exclusive control of variables in tasks is performed (when
1 accessing tasks are set).
• Data trace processing (sampling and trigger checking) is performed. 5
User program execution • Programs assigned to tasks are executed in the order that they are
assigned.

5-5-3 Basic Operation of Tasks for NJ-series Controllers


System common processing • Processing for exclusive control of variables in tasks is performed (when
2 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 vari-
able 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 processing is performed.

*1 I/O refreshing of CJ-series Units is executed.


*2 If the input refresh data loaded in the priority-16 periodic task is accessed in the primary periodic task for the
NJ-series CPU Unit, copy the input refresh data to access in the priority-16 periodic task to a global variable
and access the values of the copied global variable in the primary periodic task. Ensure concurrency of vari-
able values for the global variable. Refer to 5-8-1 Ensuring Concurrency of Variable Values between Tasks
for details. If you do not perform the above processing, when an execution of the primary periodic task is
started during I/O refreshing in the priority-16 periodic task, the concurrency of values of the input refresh
data accessed in the primary periodic task may not be ensured.

Note The processes in each cell in the above table are executed in the order of description.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-57


5 Designing Tasks

 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
System common

processing 2
System common
User program
execution

Task execution
condition is met.

Processing Processing contents


System common pro- • Processing for exclusive control of variables in tasks is performed (when
cessing 1 accessing tasks are set).*1
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-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


5-5-4 Event Task Execution Conditions for NJ-series Controllers
An event task is executed only once when the specified execution condition is met. There are the follow-
ing two types of execution conditions for event tasks.

Execution condition Event task execution timing Reason for use


Execution with the ActEvent- When ActEventTask instruction is • When you need to explicitly specify which
Task instruction executed event tasks to execute in the user pro-
gram
• When the execution condition for the
event task may change before meeting
the condition expression for the variable
is determined
Execution when a condition When the specified variable value When you want to simplify the user pro-
expression for a variable is matches the specified condition gram by executing event tasks without user
met expression* programming

* 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.

Executing Event Tasks for the ActEventTask Instruction 5


When the ActEventTask (Execute Event Task) instruction is executed in the user program, the specified

5-5-4 Event Task Execution Conditions for NJ-series Controllers


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-59


5 Designing Tasks

 Example of User Programming Using the ActEventTask Instruction


Example 1: Executing an Event Task Only Once When the Value of a Variable Changes
In the following example, the upward differentiation option is used for the ActEventTask instruction.
This causes the Task1 event task to be executed only once when the BoolVar BOOL variable
changes to TRUE.
BoolVar @ActEventTask
EN ENO
'Task1' TaskName

Execution
priority
Primary period
High

Primary
periodic task

ActEventTask The event task is executed only once.


instruction is executed.

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 Interrupted. Interrupted.


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

5-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


Executing Event Tasks When Condition Expressions for Variables
Are Met
This method executes the event task once when the specified condition expression is met for the value
of a variable that was specified on the Sysmac Studio. The event task is not executed repeatedly while
the value of the variable matches the condition expression. It is executed only once when the value of
the variable first changes so that it meets the condition expression. This method of execution does not
require user programming to execute the event task.

 Variables for Which You Can Specify Condition Expressions


The following table lists the variables that you can specify for condition expressions.

Type of variables Specification


System-defined variables Possible.*1
Semi-user-defined variables Possible.
User-defined vari- Global variables Possible.
ables Variables used in a program Possible.
Variables used in a function block Possible.*2
Variables used in a function Not possible.

*1 The following variables cannot be used. EN, ENO, P_Off, P_CY, P_First_RunMode, P_First_Run and
P_PRGER 5
*2 In-out variables cannot be used.

5-5-4 Event Task Execution Conditions for NJ-series Controllers


 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.

*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-61


5 Designing Tasks

 Condition Expressions That You Can Specify


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.

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}

 Valid Range of Comparison Constants


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. The valid range of com-
parison constants is the same as the valid range of the data type of the variable that you specify for
the condition expression.
Refer to Basic Data Types and Derivative Data Types on page 6-30 for the valid range of values for
each data type. For example, if the variable that you specify for the condition expression is a BYTE
variable, the valid range of comparison constant values is from BYTE#16#00 to BYTE#16#FF.

 Example of Executing Event Tasks When Condition Expressions for Variables


Are Met
Example 1: Execution Condition for Event Task Set to a Change to TRUE of the Program1.trigger1
Boolean Variable
When the value of Program1.trigger1 changes to TRUE, the event task is executed only once.

Execution
priority
Primary period
High

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

The event task is executed only once.


Condition expression Condition expression
is not met. is met.

Event task

TRUE is assigned to
Program1.trigger1 variable.

Low

TRUE
Program1.trigger1
FALSE

5-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


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

Condition expression Not met. Value of 10 Value of 11 Value of 9


is not met. is assigned. is assigned. is assigned.
Not met.
Met
Event task Value of 9 is assigned to
Program1.curVal variable.

The event task is executed only once when


Low the value of the Program1.curVal variable
changes from less than 10 to 10 or higher.

Program1.curVal 0 9 10 11 9

Precautions for Correct Use


The CPU Unit evaluates whether the condition expression is met before the programs that are 5
assigned to the primary periodic task are executed. Even if the specified value of the variable
matches the condition expression during execution of the program in the primary periodic task,

5-5-4 Event Task Execution Conditions for NJ-series Controllers


the condition is not evaluated until just before the next execution of the primary periodic task.
This means that the event task will be executed after the end of the execution of the primary peri-
odic task that follows the execution of the primary periodic task in which the value of the variable
meets the condition expression.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-63


5 Designing Tasks

5-5-5 Event Task Execution Timing for NJ-series Controllers

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.

Differences in Execution Timing Based on the Execution Conditions


of Event Tasks
The execution of event tasks depends on whether the execution condition is triggered by an ActEvent-
Task instruction or by when an condition expression for a variable is met.

 Execution Timing When the Execution Condition Is an ActEventTask


Instruction
If the execution condition for an event task is triggered by an ActEventTask instruction, the event
task will be executed immediately after the ActEventTask instruction is executed.
Example 1: ActEventTask Instruction Executed in Priority-16 Periodic Task and an Event Task with
an Execution Priority of 8
The execution priority of the event task (execution priority of 8) is higher than the execution
priority of the priority-16 periodic task. Execution of the priority-16 periodic task is therefore
interrupted and the event task is executed.

The event task is executed immediately after execution of ActEventTask.


Execution
priority
High

Event task
(execution priority of 8)

Task period

Priority-16 Interrupted.
periodic task

ActEventTask instruction
Low is executed.

Example 2: Executing an ActEventTask Instruction within the Primary Periodic Task


The event task has a lower execution priority than the primary periodic task, so the event task
is executed after execution of the primary periodic task is completed.

Execution
Primary period
priority
High
Primary
periodic task

ActEventTask instruction
is executed.

Event task
(execution priority of 8)

Low

Event task is executed when the primary periodic task is completed.

5-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


 Execution Timing When the Execution Condition Is a Condition Expression
for a Variable
The condition expression is evaluated for a match inside the primary periodic task. This means that
the event task will be executed immediately after the first execution of the primary periodic task after
the specified value of the variable meets the condition expression. However, if there are tasks with a
higher execution priority than the event task, those tasks will be executed first.
Example 1: Project with a Priority-16 Periodic Task and an Event Task Execution with a Priority of 8
The event task is executed immediately after the first execution of the primary periodic task
after the condition expression is met. The execution priority of the event task (execution priority
of 8) is higher than the execution priority of the priority-16 periodic task. The priority-16 periodic
task is therefore executed after the event task is executed.

Execution
priority
High Primary period

Primary periodic
IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
task

Value is assigned Condition Event task is executed


to variable in user expression immediately after the
program. is met. condition expression is met.

Event task (execution


priority of 8)

Task period

5
Priority-16 Interrupted.
Interrupted.
periodic task

5-5-5 Event Task Execution Timing for NJ-series Controllers


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

Value is assigned Condition expression


to variable in user is met.
Task period program.

Priority-16
Interrupted. Interrupted.
periodic task

Event task (execution Event task is executed


priority of 48) immediately after completion
of the periodic task.

Low

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-65


5 Designing Tasks

Precautions for Correct Use


• The execution timing of an event task depends on how the condition expression is met. The
match can be triggered by I/O refreshing in the primary periodic task, or by execution of a pro-
gram that is assigned to the primary periodic task. This difference is described in the following
table. This difference occurs because the condition expression is evaluated for a match by sys-
tem common processing 1 inside the primary periodic task. Processing in the primary periodic
task takes place in this order: I/O refreshing, system common processing 1, and user program
execution.
Trigger for condition expression to match Event task execution timing
I/O refreshing in the primary periodic task After completion of the primary periodic
task
Execution of the programs in the primary periodic After completion of the next execution of
task the primary periodic 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 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.

Execution Timing for Event Tasks with the Same Execution Priority
You can also set the same execution priority for more than one event task. If the execution conditions
are met for more than one event task that has the same execution priority, the event tasks will be exe-
cuted in the order that their execution conditions are met.
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

T1 event task is executed first because the ActEventTask


instruction that triggered it was executed first.
User program
T1 event task ActEventTask(‘T1’);
ActEventTask(‘T2’);
(execution priority of 8)

Execution priority
is the same.
T2 event task
(execution priority of 8)

Low

5-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-5 Specifications and Basic Operation of Tasks for NJ-series Controllers


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 exe-
cuted.
(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
task
IO UPG MC IO UPG MC 5
Condition expression
for VarA is met. ActEventTask

5-5-5 Event Task Execution Timing for NJ-series Controllers


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-67


5 Designing Tasks

5-5-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.

T1 event task
Interrupted.
(execution priority of 8)

Low

Execution
priority
High Primary period

Primary periodic
task

ActEventTask instruction ActEventTask instruction


is executed for T2. is executed for T2.
Task period

Priority-16
Interrupted. Interrupted.
periodic task: T1

This event task (T2) was triggered by the first


ActEventTask instruction and is still waiting for
T2 event task execution. The second ActEventTask
(execution priority of 48) instruction is ignored.

Low

5-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-6 Services Other Than Tasks


The CPU Unit performs processing other than the primary periodic task, periodic tasks, and event
tasks. This section describes the services other than tasks for the NX701 CPU Units, NX1P2 CPU
Units, and NJ-series CPU Units.

 NX701 CPU Units


For the NX701 CPU Unit, the processing includes the tag data link service and system services. The
processing that is performed, the execution priority, and the execution timing for these two services
are given in the following table.

5-6 Services Other Than Tasks


Item Tag data link service System services
Execution prior- The tag data link service is executed in System services are executed in parallel with
ity parallel with the task execution and system the task execution and tag data link service.
services.
Processing Data is exchanged by using tags with other System services include services with low exe-
controllers and devices on an EtherNet/IP cution priority, such as the USB port service and
network. You can use the built-in Ether- SD Memory Card service.
Net/IP port in the CPU Unit.*1
Execution timing The execution interval and the time that is System services are executed at the required
required for each execution depend on the time if a request comes from the hardware or
model of the CPU Unit and on the tag data from outside of the CPU Unit. 5
link settings.*2
*1 For details on the processing that is performed for tag data links, refer to the NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual (Cat. No. W506).
*2 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.

 NX1P2 CPU Units


For the NX1P2 CPU Unit, the processing includes the tag data link service, option board service,
and system services. The processing that is performed, the execution priority, and the execution tim-
ing for these three services are given in the following table.

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-
task execution. It is prioritized task execution. However, tion. However, during execu-
than the option board service during execution of the tag tion of the tag data link
and system services. data link service, the option service or option board ser-
board service is not exe- vice, system services are not
cuted. It is prioritized than executed.
system services.
Processing Data is exchanged by using I/O refreshing for Analog I/O System services include ser-
tags with other controllers and Option Boards is executed. vices with low execution prior-
devices on an EtherNet/IP ity, such as the USB port
network. You can use the service and SD Memory Card
built-in EtherNet/IP port in the service.
CPU Unit.*1
Execution timing The execution interval and the The option board service is System services are executed
time that is required for each executed depends the exe- depend on the execution pri-
execution depend on the cution priority if a request ority if a request comes from
model of the CPU Unit and on comes from the Option the hardware or from outside
the tag data link settings.*2 Board. of the CPU Unit.
*1 For details on the processing that is performed for tag data links, refer to the NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual (Cat. No. W506).
*2 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-69


5 Designing Tasks

 NJ-series CPU Units


For the NJ-series CPU Unit, the processing includes the tag data link service and system services.
The processing that is performed, the execution priority, and the execution timing for these two ser-
vices are given in the following table.

Item Tag data link service System services


Execution prior- The execution priority is between the exe- The execution priority is lower than that of any
ity cution priorities of the priority-16 periodic of the tasks.
task and the priority-17 periodic task.
Processing Data is exchanged by using tags with other System services include services with low exe-
controllers and devices on an EtherNet/IP cution priority, such as the USB port service and
network. You can use the built-in Ether- SD Memory Card service.
Net/IP port in the CPU Unit or a CJ-series
CJ1W-EIP21 EtherNet/IP Unit to connect
to an HMI.*1
Execution timing The execution interval and the time that is System services are executed in the unused
required for each execution depend on the time between execution of the tasks and tag
model of the CPU Unit and on the tag data data link service.*3
link settings.*2
*1 For details on the processing that is performed for tag data links, refer to the NJ/NX-series CPU Unit
Built-in EtherNet/IP Port User’s Manual (Cat. No. W506).
*2 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.
*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.

5-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-6-1 Execution Priorities and Execution Orders of Services Other Than


Tasks
This section provides examples of the execution priorities and execution orders of the tag data link ser-
vice, option board service, and system services.

Execution Priorities of Services Other Than Tasks

 NX701 CPU Units

5-6 Services Other Than Tasks


The tag data link service is not affected by the task execution priority and system services.
System services are not affected by the task execution priority and tag data link service.

 NX1P2 CPU Units


The tag data link service, option board service and system services are not affected by the task exe-
cution priority. The tag data link service, option board service and system services are executed in
descending order of execution priority.

 NJ-series CPU Units


The execution priorities of the tag data link service and system services are shown below.
The execution priority of the tag data link service is between the execution priorities of the priority-16 5
periodic task and the priority-17 periodic task. The execution priority of the system services is lower
than the execution priority of any of the tasks.

5-6-1 Execution Priorities and Execution Orders of Services Other Than Tasks
High
Numbers of tasks

Primary periodic
4 1
task

8 Event tasks 0 to 32

16 Periodic task 0 or 1

Tag data link A total of up to 32 tasks


Execution service for both priority levels.
priority
(0 to 63)
17 Periodic task 0 or 1

18 Periodic task 0 or 1

Event tasks 0 to 32
48

System services

Low

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-71


5 Designing 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.

 NX701 CPU Units


• The tag data link service is executed without being affected by the tasks and system services.
• The system services are executed at the required time without being affected by the tasks and tag
data link service.

Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task

Task period

Priority-16
periodic task
IO UPG Execution period of the IO UPG
tag data link service

Tag data link


service

Task period

Priority-17 System services are executed at the required


UPG
periodic task
time without being affected by the tasks and
tag data link service.
Sysem
services

Low

 NX1P2 CPU Units


• You can execute the tag data link service, option board service or system services in parallel with the exe-
cution of tasks.
• The order of execution priority is tag data link service, option board service and then system services.

Execution Primary period


priority
High IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
Primary
periodic task

Execution period of the tag data link service

Tag data link


service

Option board
service
Task period

Priority-17
UPG Interrupted.
periodic task

System
services

Low

5-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 NJ-series CPU Units


• Execution of the tag data link service is given priority over execution of the priority-17 periodic
task. However, execution of the primary periodic task and priority-16 periodic task is given even
higher priority.
• The system services are executed in the unused time between execution of all of the tasks and
tag data link service.

Execution
Primary period
priority
High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task

Task period

5-6 Services Other Than Tasks


Priority-16
periodic task
IO UPG Execution period of the IO UPG
tag data link service

Tag data link


service

Task period

Priority-17
UPG Interrupted.
periodic task

Execution of the tag data link service


System is given priority over execution of the
services
priority-17 periodic task.
Low 5
The system services are executed in the
unused time between execution of the

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-73


5 Designing Tasks

5-6-2 Processing Performed in and Execution Timing of the Tag Data


Link Service

Processing Performed in Tag Data Link Service


The processing for tag data links is separated in multiple processes. This processing is performed in
the tag data link service, the system services, and the tasks. The following example shows the process-
ing that is performed for the tag data links when the built-in EtherNet/IP port on the CPU Unit is used.

 Flow of Tag Data Reception Processing


• The tag data link service reads the tag data from the received tag sets.
• If a refreshing task is set, the task writes the values of the tag data to the variables that are
assigned to the tags.
• If a refreshing task is not set, a system service writes the values of the tag data to the variables
that are assigned to the tags.
Task set as
refreshing task

Writes values Refreshing task


to variables. is specified.
Tag data Tag data
link service
Received Reads the
tag set tag data.
System service
Tag data Refreshing task
Writes values
to variables. is not specified.

 Flow of Tag Data Transmission Processing


• If a refreshing task is set, the task reads the values of the tag data from the variables that are
assigned to the tags.
• If a refreshing task is not set, a system service reads the values of the tag data from the variables
that are assigned to the tags.
• Then, in the tag data link service, the tag set is created from the tag data and the tag set is sent.
Task set as
refreshing task
Refreshing task Reads values Tag data
is specified. from variables. Tag data
link service Tag set
Creates the is sent.
System service tag set.
Refreshing task Reads values
is not specified. from variables. Tag data

5-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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

5-6 Services Other Than Tasks


In this example, the primary periodic task is set as the refreshing task. Values are written to
the variables in the next primary periodic task after the tag data links service.
Values are written to the variables in the next primary
periodic task after the tag data links service.

Execution
Primary period
priority

High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task

Task period

Priority-16
IO UPG IO UPG
periodic task
5
Tag data link
service

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

• When a Refreshing Task Is Not Specified


The values are written to the variables in a system service.
Execution
Primary period
priority

High
Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC IO UPG MC
periodic task

Task period

Priority-16
IO UPG IO UPG
periodic task

Tag data link


service

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-75


5 Designing Tasks

Execution Timing of the Tag Data Link Service


The execution interval and the execution time depend on the model of the CPU Unit and on the tag
data link settings. Guidelines are provided below. For an NJ-series CPU Unit, however, if a task with
a higher execution priority than the tag data link service is executed, the execution interval and the
execution time will be longer than the following values.
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 interval of the tag data IO UPG
link service

Tag data link


service

Task period

Priority-17
UPG Interrupted.
periodic task

System Execution interval of the


service
tag data link service
Low

 Using the Built-in EtherNet/IP Port on the CPU Unit

Tag data link settings


Execution Execution
CPU Unit Number Number of RPI interval (ms) time (ms)
of tags connections [ms]
NJ501- 8 1 1 1 0.02 to 0.04
4 2 1 0.02 to 0.10
32 50 1 0.02 to 0.10
NJ301- 8 1 1 1 0.03 to 0.06
4 2 1 0.03 to 0.15
32 50 1 0.03 to 0.15
NJ101- 8 1 1 1 0.04 to 0.09
4 2 1 0.04 to 0.28
32 50 1 0.04 to 0.28

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-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Using the CJ1W-EIP21 EtherNet/IP Unit

Tag data link settings


Execution Execution
CPU Unit Number of Number of RPI Send/re interval (ms) time (ms)
tags connections [ms] ceive
NJ501- 8 1 1 Send 3 0.10
Receive 3 0.10
4 2 Send 4 0.22
Receive 4 0.13
32 50 Send 12 0.68
Receive 6 to 35 0.23 to 0.66
NJ301- 8 1 1 Send 3 0.16

5-6 Services Other Than Tasks


Receive 3 0.16
4 2 Send 3 0.21
Receive 4 0.33
32 50 Send 15 1.05
Receive 8 to 35 0.29 to 1.85
NJ101- 8 1 1 Send 3 0.21
Receive 3 0.21
4 2 Send 6 0.46
Receive 13 0.80
32 50 Send 12 to 50 2.97 to 4.09
Receive 25 2.36 5

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.

Sysmac Studio version


Unit version of CPU Unit
1.03 or lower 1.04 or higher
1.03 or later Built-in EtherNet/IP port ser- Tag data link service*
vice in system services
1.02 or earlier Built-in EtherNet/IP port service in system services
* If a unit version of 1.02 or earlier is set on the Sysmac Studio, the tag data links are processed in the built-
in EtherNet/IP port service in the system services.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-77


5 Designing Tasks

5-6-3 Processing Performed in and Execution Timing of the Option


Board Service

Processing Performed in Option Board Service


For the NX1P2 CPU Units, I/O refreshing for Analog I/O Option Boards is executed in the processing
performed in the option board service.

Execution Timing of the Option Board Service


For the NX1P2 CPU Units, the option board service is executed without being affected by the tasks.
However, the tag data link service, option board service and system services are not executed in
parallel.
The option board service is executed depends on the execution priority if a request comes from the
Option Board. The internal processing of an Option Board, the option board service for an NX1P2
CPU Unit, and the task execution are performed asynchronously.
When you input the data, the input data is read in the internal processing of an Option Board and
processed in the option board service for an NX1P2 CPU Unit. When the processing in the option
board service is completed, you can use the input data in user program execution in the next pri-
mary periodic task.

Input data Input data

Option Board

Option board
service

Primary
MC

MC

MC

MC

IO UPG IO UPG IO UPG IO UPG


periodic task

Primary period

When you output data, the output data is processed in the option board service after user program
execution is completed. When the processing in the option board service is completed, the output
data is output in the next internal processing of the Option Board.

Output data Output data

Option Board

Option board
service

Primary
MC

MC

MC

MC

IO UPG IO UPG IO UPG IO UPG


periodic task

Primary period

5-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-6-4 Processing Performed in and Execution Timing of the System


Services

Processing Performed in System Services


System services include the following processing.

System service Description


USB port service*1 • Processing of service requests from the Sysmac Studio or host comput-
ers.

5-6 Services Other Than Tasks


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
Communications processing for • Execution of communications processing for a Serial Communications
a Serial Communications Option Board
Option Board*2
Service for CJ-series Special • Event servicing for CJ-series Special Units
Units*3 • Execution of communications instructions (CIP)
SD Memory Card service • Access from FTP client 5
• SD Memory Card operations from the Sysmac Studio
• Execution of SD Memory Card instructions

5-6-4 Processing Performed in and Execution Timing of the System Services


Self-diagnosis • Hardware error detection

*1 An NX1P2 CPU Unit does 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.

Execution Timing of the System Services


For the NX701 CPU Units, the system services are executed at the required time without being
affected by the tasks and tag data link service. It is designed to always secure sufficient time for sys-
tem service execution.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-79


5 Designing Tasks

 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
priority of 17 or higher is temporarily interrupted, an Insufficient System Service Time Error occurs
and user program execution stops.
You can set the time for execution of the system services in the System Service Monitoring Settings
on the Sysmac Studio.

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

Task period

Priority-17
periodic task Interrupted.
Low

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.

 System Service Monitoring Settings


The System Service Monitoring Settings are used to monitor whether sufficient system service exe-
cution time can be secured with NJ-series CPU Units. If the execution of all tasks cannot be com-
pleted within the system service execution interval, execution is monitored to see if at least the ratio
of execution that is set for the System Service Execution Time Ratio is completed. You can set the
System Service Monitoring Settings in the Basic Settings Display of the Operation Settings Tab
Page on the Sysmac Studio.

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.

5-80 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Precautions for Correct Use


• For NJ-series CPU Units, set the System Service Monitoring Settings to the minimum values
that are required to meet the response performance of the system services so that sufficient
time can be allocated to the system services and task execution. The System Service Monitor-
ing Settings are used to monitor whether the specified system service execution time can be
obtained. System services will not necessarily be executed for the specified time.
• For NJ-series CPU Units, design the tasks so that sufficient time can be allocated to execution
of the system services. Refer to 5-11 Task Design Methods and I/O Response Times for the
setting procedures for tasks.
• To increase the system service execution time with an NJ-series CPU Unit, increase the task
period or take other steps to increase the unused time between task execution.

5-6 Services Other Than Tasks


• With an NJ-series CPU Unit, if the time that is specified in the System Service Monitoring Set-
tings cannot be allocated to the system service execution time even if execution of tasks with
an execution priority of 17 or higher is interrupted, an Insufficient System Service Time Error
occurs and user program execution stops.
• With an NJ-series CPU Unit, if sufficient system service execution time cannot be allocated
and execution of tasks with an execution priority of 17 or higher is interrupted, a Task Period
Exceeded error will occur for the tasks that are interrupted. Design the tasks so that the execu-
tion of tasks with an execution priority of 17 or higher is completed within the task periods even
if the execution time of the system services satisfies the System Service Monitoring Settings.

5-6-4 Processing Performed in and Execution Timing of the System Services

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-81


5 Designing Tasks

5-7 Assignment and Settings Related to


Tasks
This section describes the assignment and settings related to tasks.

5-7-1 Assigning I/O Refreshing to Tasks


I/O refreshing of the EtherCAT slaves, NX Units on the CPU Unit, I/O built in the CPU Unit, Option
Boards in the CPU Unit, and the CJ-series Units is assigned to the tasks.
Tasks to which assignment is possible and unit of assignment are different depending on the target for
I/O refreshing. Unit of assignment refers to a target or a group of targets for I/O refreshing assigned to
one task. For example, when the unit of assignment is Slave Terminal, you can assign I/O refreshing to
only one task even if more than one NX Unit is connected to a Communications Coupler Unit.
If you want to perform input and output operations in tasks to which I/O refreshing is not assigned, refer
to Input and Output Operations in Tasks to Which I/O Refreshing Is Not Assigned on page 5-84.
The following table shows the relationship among the target for I/O refreshing, the assignable task, and
the unit of assignment.

Unit of assign-
I/O refreshing target Assignable task
ment
Communications Coupler Unit with an NX-series Safety Primary periodic task or priority-5 By Slave Termi-
Control Unit on the Slave Terminal and priority-16 periodic nal
tasks*1*2*3
Communications Coupler Unit with an NX Unit assigned to Primary periodic task or priority-5
an axis on the Slave Terminal periodic task*3
Communications Coupler Unit without an NX Unit assigned Primary periodic task or priority-5
to an axis on the Slave Terminal and priority-16 periodic tasks*2*3
EtherCAT slaves to which axes are assigned Primary periodic task or priority-5 By slave
periodic task*2*3
Other EtherCAT slaves Primary periodic task or priority-5
and priority-16 periodic tasks*2*3
NX Units on the CPU Unit and I/O built in the CPU Unit*4 Primary periodic task ---

CJ-series Basic I/O Units*5 Primary periodic task and priority- By Unit
16 periodic task
CJ-series Special I/O Units*5
CJ-series CPU Bus Units*5

*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 use the primary periodic task only with the NX1P2 CPU Units.
*4 You can use NX Units on the CPU Unit and I/O built in the CPU Unit only with the NX1P2 CPU Units.
*5 You can use various CJ-series Units only with NJ-series CPU Units.

5-82 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Precautions for Safe Use


If two different function modules are used together, such as when you use CJ-series Basic Units
and EtherCAT slaves, take suitable measures in the user program and external controls to
ensure that safety is maintained in the controlled system if one of the function modules stops.
The relevant outputs will behave according to the slave or Unit specifications if a partial fault level
error occurs in one of the function modules.

5-7 Assignment and Settings Related to Tasks


Refer to 12-1-3 Non-fatal Errors in the CPU Unit for details on partial fault level Controller errors.

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 pri-
mary periodic task and assign I/O refreshing for CJ-series Units to the priority-16 periodic task.

Sysmac Studio Setting Procedure


For the slaves and Units that are not assigned to axes, set the tasks in which to perform I/O refreshing
in I/O Control Task Settings under Configurations and Setup - Task Settings of the Sysmac Studio.
Refer to I/O Control Task Settings on page 4-9 for details.
5

5-7-1 Assigning I/O Refreshing to Tasks


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.

Timing of I/O Refreshing


The table below shows when I/O is refreshed for EtherCAT slaves, NX Units on the CPU Unit, I/O built
in the CPU Unit, Option Boards in the CPU Unit, and CJ-series Units.

I/O refreshing target I/O refreshing task Period of I/O refreshing


EtherCAT slaves Primary periodic task Task period of the primary periodic task
Priority-5 periodic task*1 Task period of the priority-5 periodic task
Priority-16 periodic task Task period of the primary periodic task*2
NX Units on the CPU Primary periodic task Task period of the primary periodic task
Unit*3
I/O built in the CPU Primary periodic task Task period of the primary periodic task
Unit*4
CJ-series Units*5 Primary periodic task Task period of the primary periodic task
Priority-16 periodic task Task period of the priority-16 periodic task
*1 You can use the priority-5 periodic task only with the NX701 CPU Units.
*2 EtherCAT communications is executed during I/O refreshing in the primary periodic task. If the priority-16 peri-
odic task is used to control EtherCAT slaves, the data refresh period during I/O refreshing will be the task period
of the priority-16 periodic task.
*3 You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.
*4 You can use the built-in I/O only with the NX1P2 CPU Units.
*5 You can use CJ-series Units only with NJ-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-83


5 Designing Tasks

 Priorities in Process Data Communications


EtherCAT process data communications is executed during I/O refreshing. With an NX701 CPU
Unit, you can perform process data communications in the primary periodic task and the priority-5
periodic task.
When process data communications is executed in the primary periodic task or the priority-5 peri-
odic task, process data communications in the primary periodic task is prioritized. Therefore, the I/O
refresh time of the priority-5 task is longer even if the process data communications cycle and pro-
cess data size of two tasks are the same.

Accessing I/O from the User Program


You use device variables to access I/O ports from the user program. Access the device variables
from a program in the task that is set in the I/O Control Task Settings.

Input and Output Operations in Tasks to Which I/O Refreshing Is Not


Assigned
If you attempt to output data directly from a task to which I/O refreshing is not assigned, an error will
occur when you check the program on the Sysmac Studio. For example, if the processes for NX Units
are assigned to different tasks on the Slave Terminal, data can be output only from the task to which I/O
refreshing is assigned. In this case, you need to create the program to pass the data from the task to
which I/O refreshing is not assigned to the task to which I/O refreshing is assigned and output data from
the task to which I/O refreshing is assigned.
The following sample programming shows how to pass the data from the task to which I/O refreshing is
not assigned to the task to which I/O refreshing is assigned and output data from the task to which I/O
refreshing is assigned.
In this sample programming, the external data input processing is performed in a task to which I/O
refreshing is not assigned. Usually, this kind of processing causes a warning to occur when you check
the program on the Sysmac Studio. However, the execution of processing is possible.

 Unit Configuration
A Slave Terminal is used. The following table shows the Unit configuration of the Slave Terminal.

Model number Product name


NX-ECC201 EtherCAT Coupler Unit
NX-ID3317 DC Input Unit
NX-OD3256 Transistor Output Unit

 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

5-84 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 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.

5-7 Assignment and Settings Related to Tasks


The following figure shows the timing chart.

TRUE
ComIn
FALSE
1s
TRUE
OutA1
FALSE
2s
OutA2 TRUE
FALSE
3s
OutB1 TRUE
FALSE
4s
OutB2 TRUE
FALSE

 Task Processing 5
The primary periodic task and priority-16 periodic task are used. The I/O refreshing is assigned to
the primary periodic task.

5-7-1 Assigning I/O Refreshing to Tasks


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-85


5 Designing Tasks

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

(1) (2) (5) (6) (8) (9) (10)

Task period

Priority-16 IO Pausing IO Pausing


periodic task
(3) (4) (7)

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
OutB1 and OutB2 are also the initial values.
(3) ComIn is input during I/O refreshing in the periodic task.
(4) The calculation is performed during the user program execution in the periodic task.
If the primary periodic task is executed while the periodic task execution is in progress, the
periodic task is paused. Depending on the timing of processing in the periodic task, the
assignment of the values to tmp_OutB1 and tmp_OutB2 may be performed before or after
the pause of the periodic task.
(5) OutA1, OutA2, OutB1 and OutB2 are output during I/O refreshing in the primary periodic
task.
Also, ComIn is input again.
(6) The calculation is performed during the user program execution in the primary periodic task
and the values are assigned to OutA1 and OutA2.
Also, the values of tmp_OutB1 and tmp_OutB2 are assigned to OutB1 and OutB2. If the
values are assigned to tmp_OutB1 and tmp_OutB2 in step (4), the calculation results of the
periodic task are reflected in OutB1 and OutB2. If the values are not assigned to
tmp_OutB1 and tmp_OutB2 in step (4), the values of tmp_OutB1 and tmp_OutB2 are the
initial values. Therefore, the values of OutB1 and OutB2 are also the initial values.
(7) The calculation is performed during the user program execution in the periodic task that fol-
lows step (4).
If the values are not assigned to tmp_OutB1 and tmp_OutB2 in step (4), they are assigned
here.
(8) OutA1, OutA2, OutB1 and OutB2 are output during I/O refreshing in the primary periodic
task.
If the values are assigned to tmp_OutB1 and tmp_OutB2 in step (4), the calculation results
of the periodic task are output as OutB1 and OutB2.
If the values are assigned to tmp_OutB1 and tmp_OutB2 in step (7), the initial values of
OutB1 and OutB2 are output.
(9) The calculation is performed during the user program execution in the primary periodic task
and the values are assigned to OutA1 and OutA2.
Also, the values of tmp_OutB1 and tmp_OutB2 are assigned to OutB1 and OutB2. If the
values are assigned to tmp_OutB1 and tmp_OutB2 in step (7), the calculation results of the
periodic task are reflected in OutB1 and OutB2.

5-86 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

(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

5-7 Assignment and Settings Related to Tasks


accessed by the primary periodic task. Refer to 5-8-1 Ensuring Concurrency of Variable Values
between Tasks for details on task exclusive controls.

 Global Variable Table


The global variables are shown below.
Global variable table
Data Initial
Name AT specification Comment
type value
ComIn BOOL FALSE ECAT://node#[1,1]/Input Bit 00 Common input value
OutA1 BOOL FALSE ECAT://node#[1,2]/Output Bit 00 Output value A1
OutA2 BOOL FALSE ECAT://node#[1,2]/Output Bit 01 Output value A2
OutB1 BOOL FALSE ECAT://node#[1,2]/Output Bit 02 Output value B1
OutB2 BOOL FALSE ECAT://node#[1,2]/Output Bit 03 Output value B2
tmp_OutB1 BOOL FALSE Temporary variable for B1
tmp_OutB2 BOOL FALSE Temporary variable for B2 5
 Ladder Diagram for Primary Periodic Task

5-7-1 Assigning I/O Refreshing to Tasks


The ladder diagram for the primary periodic task is shown below.
Internal variable table
Data
Name
type
A1_Wait TON
A2_Wait TON

External variable table

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-87


5 Designing Tasks

Algorithm

Input of ComIn, calculations and outputs and output of OutA1 and OutA2
A1_Wait
ComIn OutA1
TON
In Q

T#1s PT ET

A2_Wait
TON OutA2
In Q

T#2s PT ET

Assignment of the values tmp_OutB1 and tmp_OutB2 to OutB1 and OutB2, and output of OutB1 and OutB2
P_On
Lock
En ENO

USINT#1 Index

tmp_OutB1 OutB1

tmp_OutB2 OutB2

Unlock
En ENO

USINT#1 Index

 Ladder Diagram for Periodic Task


The ladder diagram for the periodic task is shown below.
Internal variable table

Data
Name
type
B1_Wait TON
B2_Wait TON

External variable table

Data
Name Comment
type
ComIn BOOL Common input value
tmp_OutB1 BOOL Temporary variable for B1
tmp_OutB2 BOOL Temporary variable for B2

5-88 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Algorithm for periodic task

Input of ComIn and calculations of tmp_OutB1 and tmp_OutB2


P_On
Lock
En ENO

USINT#1 Index

5-7 Assignment and Settings Related to Tasks


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
5

5-7-1 Assigning I/O Refreshing to Tasks

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-89


5 Designing Tasks

5-7-2 Assigning Tasks to Programs


You assign the programs to execute to tasks. (You can assign up to 128 programs to one task.) Also,
you set the operation of the programs at the start of operation.

Order of Program Execution


The order of execution of the programs in a task is set with the Sysmac Studio.

Initial Status for Programs at the Start of Operation


Set the operation of the programs at the start of operation. The Initial Status at the start of operation
is used to set whether to execute the program when the task to which the program is assigned is
executed for the first time after the operating mode of the CPU Unit is changed from PROGRAM
mode to RUN mode. You have a setting option between Run or Stop.
If the Initial Status is Stop, when enabling the execution of the specified program with the PrgStart
instruction, it is executed from the next time the timing for executing the program occurs. If the Initial
Status is Run, when disabling the execution of the specified program with the PrgStop instruction, it
is disabled from the next time the timing for executing the program occurs.

 Sysmac Studio Setting Procedure


Assign programs to tasks, set the order of program execution within the task, and set the Initial Sta-
tus for each program in Program Assignment Settings under Configurations and Setup – Task
Settings of the Sysmac Studio.
Refer to Program Assignment Settings on page 4-9 for details.

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.

POUs That You Can Assign to Tasks


From 0 to 128 programs can be assigned to one task.
You can assign only program POUs. You cannot assign function block instances or functions directly
to tasks. You cannot assign the same program to more than one task.

5-90 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-7-3 Parameters for Primary Periodic Task and Periodic Tasks


The parameters for primary periodic task and periodic tasks are given below.

 Parameters for Primary Periodic Tasks


Changes
Update

5-7 Assignment and Settings Related to Tasks


Parameter Setting range Default in RUN
timing
mode
Task Type Specify the primary periodic task. --- When Not
Execution priority Always 4. --- down- allowed.
loaded to
Task Name Text string Primary- CPU Unit
Task
Period/ Task period*1 • NX701 CPU Units 1 ms*3
Execu- 125 µs, 250 µs to 8 ms (in 250-µs
tion Con- increments)
ditions
• NX1P2 CPU Units
2 ms to 8 ms (in 250-µs increments)
• NJ-series CPU Units
500 µs*2, 1 ms, 2 ms, or 4 ms
Task Period Exceeded Detec- Specify whether to detect an error if Detect.
tion the task execution time exceeds the
specified task period. 5
• Detect (a minor fault level Controller
error is generated).

5-7-3 Parameters for Primary Periodic Task and Periodic Tasks


• Do not detect (an observation is
recorded in event log).
Refer to Task Period Exceeded on
page 5-104 for details.
Task Timeout Detection Time Set the time to detect timeouts if task 5
execution does not end, e.g., if there is
an infinite loop. Set a multiple of the
task period.
1 to 5
Refer to Task Execution Timeout on
page 5-105 for details.
Variable Access Time [%] Set the percentage of the task period 3%
to assign to variable access.
1% to 50%
Refer to Settings for Variable Access
Time on page 5-102 for details.

*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 an NX1P2- CPU Unit and an NJ101- CPU Unit, the default of the primary periodic task is 2
ms.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-91


5 Designing Tasks

 Parameters for Priority-5 Periodic Task

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.
ority loaded to
CPU Unit
Task Name Text string Periodic
Task0
Period/ Task period*2 • NX701 CPU Units 2 ms
Execution 125 µs, 250 µs to 100 ms (in 250-µs
Conditions increments)
Task Period Exceeded The same as for the primary periodic task. The same
Detection as for the
Task Timeout Detection primary
Time periodic
Variable Access Time [%] task.
*1 You can use the priority-5 periodic task only with the NX701 CPU Units.
*2 The process data communications cycle 2 in the EtherCAT settings will be the same as this period.

 Parameters for Priority-16, Priority-17, and Priority-18 Periodic Tasks

Change
Update s in
Parameter Setting range Default
timing RUN
mode
Task Type You can set any of the following. --- When Not
down- allowed.
Priority-16 periodic task*1
loaded to
Priority-17 periodic task CPU Unit
Priority-18 periodic task
Execution Automatically set to 16, 17, or 18. ---
priority
Task Name Text string Periodic-
Task0
Period/ Task period • NX701 CPU Units 10 ms
Execution Refer to 5-3-1 Specifications of Tasks for
Conditions NX701 CPU Units.
• NX1P2 CPU Units
Refer to 5-4-1 Specifications of Tasks for
NX1P2 CPU Units.
• NJ-series CPU Units
Refer to 5-5-1 Specifications of Tasks for
NJ-series Controllers.
Task Period Exceeded The same as for the primary periodic task. The same
Detection as for the
Task Timeout Detection primary
Time periodic
Variable Access Time [%] task.

*1 You cannot use the priority-16 periodic task with the NX1P2 CPU Units.

5-92 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Event Task Parameters

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.

5-7 Assignment and Settings Related to Tasks


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

 Sysmac Studio Setting Procedure


Add and set the tasks in the Task Settings under Configurations and Setup on the Sysmac Stu-
dio.
5
Refer to Task Settings on page 4-7 for details.

5-7-3 Parameters for Primary Periodic Task and Periodic Tasks

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-93


5 Designing Tasks

5-8 Ensuring Concurrency of Variable


Values
This section describes how to ensure concurrency of variable values between tasks and provides an
overview of variable access from outside the Controller.

5-8-1 Ensuring Concurrency of Variable Values between Tasks


If more than one task reads or writes the same global variable, you can use either of the following
two methods to ensure the concurrency of the value of the global variable between the tasks.
Method 1: Write the global variable from only one task and read the variable from the other tasks.
Use the settings for exclusive control of variables in tasks.
Method 2: With this method, you can write the global variable from more than one task. Use the task
exclusive control instructions.

Method 1: Settings for Exclusive Control of Variables in Tasks

 Introduction
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
tasks that access the variable.
A single task is set to read and write the value of a specified global variable. That task is called the
refreshing task. Tasks that only read the value of the global variable are also specified. These tasks
are called accessing tasks. This ensures the concurrency of the value of the global variable.

Accessing
Read only
task: Task B
Read/write
Refreshing
Global variable
task: Task A
Refreshing task is specified.
Refreshing task: Task A
Accessing
Read only
task: Task C

 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.

Refreshing task Accessing task

Program Program
Read/write Read only
External variable GVar1 Global variable GVar1 External variable GVar1

The most recent value of the


variable at the end of refreshing
task execution is read at the start
of accessing task execution.

5-94 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 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

5-8 Ensuring Concurrency of Variable Values


Refreshing Refreshing Refreshing
task: Task A task: Task A task: Task A

Write Write Write


Global variable Value of Global variable Value of variable Global variable Value of variable
variable is read. is not read. is not read.

Accessing task: Accessing task: Accessing task:


Task B Task B Task B

Task period of task B

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.
5

5-8-1 Ensuring Concurrency of Variable Values between Tasks

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-95


5 Designing Tasks

Precautions for Correct Use


If you are using the ActEventTask instruction between two tasks, you must keep in mind when
the global variables are accessed, and when they are refreshed. For example, in the following
diagram, the value of the GVarA global variable that is accessed from the event task is the value
that was current at the end of task period 1. Therefore, even if the periodic task in task period 2
writes the value of GVarA, that value will not be reflected in the event task. The value that the
event task writes to the GVarB global variable is not passed to the periodic task until the start of
task period 3. Even if the periodic task in task period 2 accesses the value of GVarB, the value
that the event task writes will not be accessed.
Execution
priority Event task
(refreshing task)
High
A value of 123 A value of 654
is read. is written.
GVarA GVarB
The value of GVarA is passed The value of GVarB is passed to
123 654
to the event task at this point. the periodic task at this point.

Task period 1 Task period 2 Task period 3

Execution of
ActEventTask

Periodic task Periodic task Periodic task


(accessing task) (accessing task) (accessing task)
A value of
123 is
written. A value of 987 A value of 567 A value of A value of 654 is read.
Low is written. is written. 987 is read.
GVarA GVarB GVarA GVarB GVarB
123 987 567 987 654

The value that is written The value that the event task
here is not reflected in writes cannot be accessed.
the event task.

Because of this, do not use exclusive control of variables in tasks to pass the values of global
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.

Precautions for Correct Use


Do not write the value of a variable for which concurrency is required from any task that is not the
refreshing task, e.g., do not write the value from the accessing task. If you read or write the value
of a variable for which a refreshing task is set from any task that is not a refreshing or accessing
task, the concurrency of the global variable may be lost. If you write such a program, a warning is
given when the program is checked.

5-96 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

5-8 Ensuring Concurrency of Variable Values


 Sysmac Studio Setting Procedure
Set the global variables for which to specify refreshing tasks, and set the accessing tasks in the Set-
tings for Exclusive Control of Variables in Tasks on the Task Settings Tab Page on the Sysmac Stu-
dio.
For details, refer to Settings for Exclusive Control of Variables in Tasks on page 4-10.

Method 2: Task Exclusive Control Instructions


Use the task exclusive control instructions (i.e., the Lock and Unlock instructions) when it is neces-
sary to write the value of a global variable from more than one task while maintaining concurrency in
the value of the variable. The task exclusive control instructions create a lock region from one Lock
instruction to the next Unlock instruction. If a lock region in one task is being executed, the lock
regions with the same lock number in other tasks are not executed. If you place the instructions that
write to the global variable in lock regions, the concurrency of the value is maintained even if you
write the value of the variable from more than one task. 5
Refer to information on the Lock and Unlock instructions in the NJ/NX-series Instructions Reference
Manual (Cat. No. W502) for details.

5-8-1 Ensuring Concurrency of Variable Values between Tasks


Example:
In this example, task A and task B both have lock region 1. The priority of task B is higher than the
priority of task A. If the execution condition for task B is met during execution of lock region 1 in task
A, execution of task A is paused during lock region 1 and task B is executed. However, in this case,
lock region 1 in task A is not completed, so task B is paused before it processes lock region 1. When
task B is paused, execution of lock region 1 in task A is started again.

Task A

Program
Executed.
Lock instruction Global variable
Refreshed. Higher priority

Task B
Lock region 1
Executed. Executed.
Program
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-97


5 Designing Tasks

Task A

Program

Lock instruction

Task B
Lock region 1
Program

Lock instruction
Unlock instruction

Executed.
Lock region 1
Refreshed.

Global variable
Unlock instruction

Precautions for Correct Use


• Do not make the locked regions any longer than necessary. If the lock regions are too long, the
task execution period may be exceeded.
• Always use the Lock and Unlock instructions in a pair in the same section of the same POU.

Example of Accessing the Same Global Variable Between Tasks


This section describes how to request processing to another task with multiple global variables.
The following sample programming uses one global variable gReq as an exclusive flag for processing to
perform exclusive control in the user program. Even in this case, exclusive control of variables in tasks
is required for the access logic to the gPar1, gPar2, and gReq global variables that are used between
tasks.

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

Name Data type Comment


gReq BOOL Request flag
gPar1 ULINT Parameter 1
gPar2 DATA_AND_TIME Parameter 2

5-98 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Task That Makes Processing Requests (MainTask)


• Internal Variables

Name Data type Comment


ReqTrg BOOL Request trigger
cCnt ULINT 100-ms counter value
cTime DATA_AND_TIME Current time

5-8 Ensuring Concurrency of Variable Values


• ST Program
cCnt:=Get100msCnt(); (* Get the 100-ms counter value. *)
cTime:=GetTime(); (* Get the current time. *)

Lock(1); (* Start an exclusive lock between tasks. *)


IF ReqTrg=TRUE AND gReq=FALSE THEN (* Access the exclusive flag. *)
gPar1:=cCnt; (* Set the parameter to process in SubTask. *)
gPar2:=cTime; (* Set the parameter to process in SubTask. *)
gReq:=TRUE;
ReqTrg:=FALSE;
END_IF;
Unlock(1); (* Stop an exclusive lock between tasks. *) 5

 Task That Receives Processing Requests (SubTask)

5-8-1 Ensuring Concurrency of Variable Values between Tasks


• Internal Variables

Name Data type Comment


ReqBusy BOOL ---
UserDefFB_ins UserDefFB User-defined function block instance that exe-
cutes processing

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-99


5 Designing Tasks

5-8-2 Variable Access from Outside the Controller


A variable access from outside the Controller is executed during the system service. The system
service has a lower execution priority than tasks. This means, if multiple variables are accessed
from outside the Controller, refreshing all variable values may not be completed in a task period. If
refreshed variables and not-refreshed variables are mixed in the user program, the Controller may
perform unintended operation.
To avoid this, make the variable access from outside the Controller be executed during the system
common processing 2 of the task. By making this, multiple variable values can be securely
refreshed in the same task period.

 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

Primary period Primary period

Primary IO UPG MC IO UPG MC


periodic task
System common
processing 1
System System common
processing 2 SS
services

Variable access 1 from Variable access 2 from


outside the Controller outside the Controller

 NJ-series CPU Unit

Primary period Primary period

Primary IO UPG MC IO UPG MC


periodic task
System common
processing 1
System System common
processing 2 SS Pausing SS
services

Variable access 1 from Variable access 2 from


outside the Controller outside the Controller

 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

Primary IO UPG MC IO UPG MC


periodic task
System common
processing 1
System System common
services processing 2

Variable access 1 from Variable access 2 from


outside the Controller outside the Controller

This section particularly describes how to execute the variable access from outside the Controller
during the system common processing 2 of the task.

5-100 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Methods to Access Variables From Outside the Controller


There are the following four methods to access variables from outside the Controller.
• Sysmac Studio
• NA/NS-series PT
• EtherNet/IP tag data links

5-8 Ensuring Concurrency of Variable Values


• CIP communications instruction from the host computer

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.

Tasks that Execute Variable Access during the System Common


Processing 2
The tasks that execute variable access from outside the Controller during the system common process-
ing 2 are predetermined as follows according to the variable types.

Variable Tasks that refresh values


Global variables specified in the settings for The refreshing task specified in Settings for Exclusive
exclusive control of variables in tasks Control of Variable in Tasks under Configurations and
Setup − Task Settings on the Sysmac Studio. 5
Device variables for EtherCAT slaves Tasks specified in I/O Control Task Settings under
Device variables for CJ-series Basic I/O Units Configurations and Setup − Task Settings on the Sysmac

5-8-2 Variable Access from Outside the Controller


Studio.
Device variables for CJ-series Special Units Primary periodic task
Variables with AT specifications in memory used
for CJ-series Units

Note You can use CJ-series Units only with NJ-series CPU Units.

Note You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

Settings for Executing Variable Access during the System Common


Processing 2
To access variables from outside the Controller during the system common processing 2, it is neces-
sary to make the following two settings on the Sysmac Studio.
• Settings for exclusive control of variables in tasks (when the target variables are the global variables)
• Settings for Variable Access Time

Settings for Exclusive Control of Variables in Tasks


If global variables are accessed from outside the Controller during the system common processing 2 of
the task, it is necessary to make setting for exclusive control of variables in tasks. The Exclusive Control
of Variables in Tasks refers to the function that specifies the task that can refresh the target global vari-
able. This function prevents the target variable from being updated by other tasks or by other methods
to access variables from outside the Controller.
For the details on the exclusive control of variables in tasks, refer to Settings for Exclusive Control of
Variables in Tasks on page 4-10.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-101


5 Designing Tasks

Precautions for Correct Use


When you use EtherNet/IP tag data links, always specify the same task as the refreshing task for
all tags (variables that have Network Publish attribute) in the same tag set. Otherwise, multiple
tags in a tag set may be refreshed in separate task periods.

Settings for Variable Access Time


When variable access from outside the Controller is executed during the system common processing 2
of the task, the task execution time may be longer. The user must set the upper limit of the processing
time for accessing variables on the Sysmac Studio. The Variable Access Time refers to the upper limit
of the processing time for accessing variables.

 Calculating Variable Access Time


Use the following equation for calculating the variable access time.
Variable access time [µs] = total size of variables [bytes] * a + number of variables * b + number of
accesses * c + d
The values of the constants a to d in above equation vary depending on the type of the CPU Unit.

Constant value [µs]


CPU Unit model
a b c d
NX701- 0.0005 0.033 2.67 7.22
NX1P2- 0.0040 0.240 3.27 25.21
NJ501- 0.0010 0.490*1 1.41 6.68
NJ301- 0.0015*2 0.560*3 2.15 7.52
NJ101- 0.0015 1.070 3.83 10.29

*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.

 Setting Variable Access Time


Set the variable access time in the Task Settings Display under Configurations and Setup − Task
Settings on the Sysmac Studio. The setting must be made for each task by entering the ratio to the
task period. The default value is 3%. For the details on the settings, refer to the Sysmac Studio Ver-
sion 1 Operation Manual (Cat. No. W504).

 Example of Variable Access Time Setting


The following is an example of variable access time setting.
In this example, it is assumed that there are the following three variable accesses from outside the
Controller to the task that operates in the NJ501- CPU Units.

Total size of vari-


Number of vari- Number of
Access No. Source of variable access ables to access
ables to access accesses
[bytes]
1 EtherNet/IP tag data link 600 8 1
2 EtherNet/IP tag data link 200 4 1
3 CIP communications instruction 1,000 1 1

5-102 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

5-8 Ensuring Concurrency of Variable Values


Access No. Variable Access Time [µs]
1 12.61
2 10.25
3 9.58

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]
5
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

5-8-2 Variable Access from Outside the Controller


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-103


5 Designing Tasks

5-9 Errors Related to Tasks


This section describes the following errors.
• Task Period Exceeded
• Motion Control Period Exceeded
• Task Execution Timeout
• I/O Refreshing Timeout Error
• Insufficient System Service Time Error

Task Period Exceeded


A Task Period Exceeded error occurs if the task execution time exceeds the specified task period.
This is a minor fault level Controller error. Operation continues even when this error occurs.
It can occur for the primary periodic task and periodic tasks.
You can also disable the Task Period Exceeded errors with a setting. Use the Task Period Exceeded
Detection setting in the Task Settings of the Sysmac Studio. The default setting is to detect the error.

Task period Task period Task period Task period

Primary
periodic task
IO UPG MC IO IO IO UPG MC
UPG MC

Task Period Exceeded


occurred.

Error name Error level Correction


Task Period Exceeded Minor fault Review the task settings and programs and download the
project again.
Reset the error from the Sysmac Studio.

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 NX1P2 CPU Units.
*3 You can use the built-in I/O only with the NX1P2 CPU Units.

5-104 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Precautions for Correct Use


If the Task Period Exceeded error occurs, shorten the programs to fit in the task period or
increase the setting of the task period.

Motion Control Period Exceeded


A Motion Control Period Exceeded error occurs if the motion control processing (MC) is not completed
within the primary period (i.e., the motion control period) twice or more in a row. A partial fault level Con-
troller error will occur in the Motion Control Function Module. A Task Period Exceeded error will occur at
the same time.

5-9 Errors Related to Tasks


Error name Error level Correction
Motion Control Partial fault Reduce the amount of processing in the programs or increase the
Period Exceeded control period within the range that does not adversely affect opera-
tion.

Task Execution Timeout


A Task Execution Timeout error occurs if task processing is not completed within the specified Task
Execution Timeout Time.
5
This is a major fault level Controller error. Execution of the user program stops when the error occurs.
This error also occurs when normal task operation is not possible due to errors in program logic, such
as infinite loops.

Timeout Detection Time

Primary period Primary period Primary period Primary period

Primary
periodic task IO IO
UPG

Infinite loop, etc. Task Execution Timeout occurred.

Error name Error level Correction


Task Execution Major fault Review the task settings and download the user program again.
Timeout The power supply must be cycled or the CPU Unit reset.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-105


5 Designing Tasks

I/O Refreshing Timeout Error


An I/O Refreshing Timeout Error occurs when I/O refreshing for the primary periodic task or a prior-
ity-16 periodic task is not completed within the period twice or more in a row.
This is a major fault level Controller error. Execution of the user program stops when the error
occurs.

Primary period Primary period Primary period Primary period

Primary M M
IO UPG C IO UPG C
periodic task

I/O Refreshing Timeout Error occurred twice or more.

Error name Error level Correction


I/O Refreshing Major fault Review the task settings and download the project again.
Timeout Error The power supply must be cycled or the CPU Unit reset.

Insufficient System Service Time Error


With an NJ-series CPU Unit, an Insufficient System Service Time Error occurs if the system service
execution time that is specified in the System Service Monitoring Settings cannot be obtained.
This is a major fault level Controller error. Execution of the user program stops when the error
occurs.

Error name Error level Correction


Insufficient Sys- Major fault Review the task settings and the system service monitoring set-
tem Service Time tings and download the project again.
Error The power supply must be cycled or the CPU Unit reset.

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.

5-106 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-10 Monitoring Task Execution Status

5-10 Monitoring Task Execution Status and Task Execution Times


and Task Execution Times
You can use online operations from the Sysmac Studio to monitor the task execution status and task
execution times.

Monitoring Task Execution Status


You can monitor the execution status of the programs in all of the tasks (started/stopped) from the
Sysmac Studio.

 Sysmac Studio Operation


Place the Sysmac Studio online with the CPU Unit and select Configurations and Setup − Task
Settings. Click the Task Execution Status Monitor Button to display the following window.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-107


5 Designing Tasks

Task Execution Time Monitor


You can monitor the execution time of each task from the Sysmac Studio.

 Values You Can Monitor from the Sysmac Studio


The display depends on whether you connect to the physical Controller or to the Simulator.

Connected to the Controller

Connected to the Simulator

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 number
of I/O points for CJ-series Unit, and built-in EtherNet/IP are displayed for NJ-series CPU Units.
The above information are not displayed for NX-series CPU Units because the system services
are executed at the required time without being affected by the tasks.

5-108 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

Built-in EtherNet/IP Dialog Box for Simulator Connection

5-10 Monitoring Task Execution Status and Task Execution Times


The parameters are listed in the following table.

Port or Unit that is


Parameter Description Set values Default
used
CPU Unit Built-in Eth- Number of con- This is the number of tag data 0 to 32 0
erNet/IP Port nections link connections.
Minimum RPI This is the lowest packet interval 1 ms to 10 s in ---
(RPI) that is set for all of the tag 1-ms incre-
data link connections. ments
CJ-series EtherNet/IP Number of tags This is the number of tags in the 0 to 256 0
Unit (CJ1W-EIP21)*1 tag data links.
*1 Entries are made on the Expanded number of I/O points for CJ-series Unit Dialog Box.

You can monitor the following items.


5
Connected Connected
Monitor item Description to the Con- to the Sim-
troller ulator
Task execu- Min. The minimum value of the task execution time. Displayed. Not dis-
tion time*1 played.
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-109


5 Designing Tasks

*3 This interval is the time required to execute only the task itself. It is the same as the task execution time for
the primary periodic task. For periodic tasks, this is the task execution time minus the time to execute other
tasks and the time for system services that were executed between the point that the execution condition is
met until execution is completed.
Task period (fixed)

Task execution time (varies)

Real processing time of task (varies) Real processing time of task (varies)

I/O refreshing Control processing

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.

Precautions for Correct Use


The above values when connected to the Simulator of the Sysmac Studio may contain more
error in comparison to the times when connected to the physical Controller. Use them as guide-
lines. Always confirm operation while connected to the physical Controller to study the designs
and before starting actual system operation.

Meaning of the Task Execution Time and the Real Processing Time
of the Task
The Task Execution Time and Real Processing Time of Tasks that are displayed in the Monitor View for
the execution time of tasks are described in the following table. The Real Processing Time of Tasks
shows only the time the Simulator was connected.

Displayed time Meaning


Task execution This is the time from when the task period starts until task processing ends. However,
time this includes the time when the periodic task is interrupted for execution of tasks with
higher execution priorities.
Real processing This is the time from when the task period starts until task processing ends. However,
time of task this does not include the time when the periodic task is interrupted for execution of
tasks with higher execution priorities.

Execution
priority Task period of primary periodic task
High

Primary
periodic task
a

Task period of periodic task

Periodic task Interrupted. Interrupted. Interrupted. Interrupted.

c d
Low b

a: Task execution time of primary periodic task


b: Task execution time of periodic task
c+d: Real processing time of periodic tasks (only when the Simulator is connected).

5-110 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-11 Task Design Methods and I/O


Response Times

5-11 Task Design Methods and I/O Response Times


This section provides guidelines for designing tasks, information on estimating task execution times,
information on confirming system service monitoring settings, an example of task designing, and infor-
mation on I/O response times.
The primary periodic task and periodic tasks of an NJ/NX-series Controller operate according to the
specified task periods. If the actual execution time exceeds the task period, an error occurs.
This section uses an example that consists of one primary periodic task to describe estimation and
appraisal methods.

Precautions for Safe Use


The task execution times in the physical Controller depends on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors. Before starting actual operation, you
must test performance under all foreseeable conditions on the actual system and make sure that
the task periods are not exceeded and that suitable communications performance is achieved.

5-11-1 Checking the Task Execution Time


5-11-1 Checking the Task Execution Time
Always design your system so that the average and maximum task execution times that are esti-
mated with the methods that are described in this section sufficiently fit within the specified task peri-
ods.

 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 NX1P2 System and
A-4 Calculating 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 maxi-
mum value on paper.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-111


5 Designing Tasks

 Estimating with the Simulator on the Sysmac Studio


Use the Task Execution Time Monitor of the Simulator on the Sysmac Studio to estimate the aver-
age and maximum task execution times. Use the following procedure to check operation on the Sim-
ulator.

1 Create the Unit and slave configurations, create the global variables and device variables, and
create the axes (to create the Axis Variables).

2 Create the programs to check.

3 Set up the tasks and build the project.

4 Start the Simulator in Execution Time Estimation Mode.

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.
• The average and maximum values of the task execution time
• The average and maximum values of the real processing times of the tasks
• Bar graph that shows the system common processing time, I/O refreshing time, user program exe-
cution time, and motion control time
• CPU usage
Note Only the primary periodic task is displayed for an NX-series CPU Unit.

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.

5-112 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Calculating Times on the Physical Controller


You can check the following values in the Task Execution Time Monitor when you are connected to
the physical Controller.
• The minimum, average, and maximum values of the task execution time
• Set period

5-11 Task Design Methods and I/O Response Times


• Number of times a task is executed (Task Execution Count)
• Number of times the task period was exceeded (Task Period Exceeded Count)
• Task execution time ratio

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.

NX-series CPU Units


(Average value of task execution time + (Average value of task execution time − Minimum value of
task execution time)) × 1.2 + 25 µs

NJ-series CPU Units


• Task period of 500 µs: Average value of task execution time + (Average value of task execution
time − Minimum value of task execution time) + 100 µs 5
• Task period of 1, 2, or 4 ms: Average value of task execution time + (Average value of task execu-
tion time − Minimum value of task execution time) + 120 µs

5-11-1 Checking the Task Execution Time


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.

CPU Unit model Guideline for task execution time ratio


NJ501- 90% or less
NJ301- 80% or less
NJ101- 70% or less

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.

Precautions for Correct Use


NX-series CPU Units are designed to always secure sufficient time for system service execution.
Therefore, the task execution time ratio is not displayed.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-113


5 Designing Tasks

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.

5-11-2 Examples of Task Design


This section provides the design procedure for a project that consists of only the primary periodic
task. In any actual application or for specific conditions, you need to consider any elements for which
the design procedure must be changed. This example is therefore for reference only.

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.
Place the Sysmac Studio online with the physical Controller and use Task Execution Time Mon-
itor to check the task execution times.

 If only the primary periodic task is too large to fit within the specified task period,
consider separating it into periodic tasks as follows.
• For the NX701 CPU Units, among processes required for device control, assign those which
require the high-speed control to the primary periodic task and other processes to the priority-5
periodic task.
• To reduce the task execution time, use the Enable Program (PrgStart) and Disable Program
(PrgStop) instructions to execute the program assigned to the primary periodic task only when
necessary.
• If the primary periodic task will still not fit within the specified task period after these measures,
among the processes of primary periodic task, assign those which do not require the high-speed
or high-accuracy control to the priority-16 periodic task or the priority-17 periodic task.
However, if variables such as the Axis Variables are accessed between the primary periodic task
and the priority-16 periodic task, the task execution time for the primary periodic task may be lon-
ger. For details, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No.
W507).
• If the primary periodic task will still not fit within the specified task period even after you take all of
these measures, change the task period for the primary periodic task.

 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.

5-114 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

5-11-3 System Input and Output Response Times


The times that are required for the system to produce an output after it receives an input are described
in this section.
The I/O response times depend on various conditions.

5-11 Task Design Methods and I/O Response Times


The input response times and output response times between external devices and the slaves and
Units must be added to the system I/O response times.

Sequence Control with Basic I/O Units


I/O refreshing between Basic I/O Units and external devices is performed in the task to which I/O
refreshing is assigned. The I/O response times that include EtherCAT communications times are given
below.
The I/O response times that include EtherCAT communications times are given below.

 Performing Control with the Programs in the Primary Periodic Task


The Controller makes a response in the following I/O response time.

Minimum I/O response time = Primary period

Example: Controlling Unit A and Unit B with the Primary Periodic Task 5
Unit A Unit B

5-11-3 System Input and Output Response Times


Primary period (t)

Primary IO UPG
M
IO UPG
M
IO UPG
M
periodic task C C C

Task period 1 (e.g., t × 3)

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.

Maximum I/O response time = Primary task period × 2

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-115


5 Designing Tasks

 Performing Control with the Programs in the Priority-16 Periodic Task


The Controller makes a response in the following I/O response time.

Minimum I/O response time = Priority-16 periodic task period

Example: Controlling Unit A and Unit B with the Priority-16 Periodic Task

Unit A Unit B

IN OUT

Primary period

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Task period

Priority-16 IO UPG IO 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.

Maximum I/O response time = Priority-16 periodic task period × 2

Sequence Control with EtherCAT Slaves


For EtherCAT slaves, EtherCAT communications with external devices is performed for I/O refreshing in
the primary periodic task.
The I/O response times that include EtherCAT communications times are given below.

 Performing Control with the Programs in the Primary Periodic Task


The Controller makes a response in the following I/O response time.

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

Task period 1 (e.g., t × 3)

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

5-116 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Performing Control with the Programs in the Priority-5 Periodic Task


When you perform control with the user program in the priority-5 periodic task, the NX701 CPU Unit
makes a response in the following I/O response time.

Maximum I/O response time = Priority-5 periodic task period (= process data communications cycle 2)

5-11 Task Design Methods and I/O Response Times


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
5
 Performing Control with the Programs in the Priority-16 Periodic Task

5-11-3 System Input and Output Response Times


The Controller makes a response in the following I/O response time.

I/O response time = Priority-16 periodic task period

Example: Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Priority-16 Peri-
odic Task
Slave A Slave B
IN
OUT
Process data
communications cycle
= Primary period (t)

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Task period

Priority-16 IO UPG IO 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 = Priority-16 periodic task period × 2

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-117


5 Designing Tasks

Sequence Control with NX Units on the CPU Unit


For NX Units on the NX1P2 CPU Unit, data exchange with external devices is performed for I/O refresh-
ing in the primary periodic task.

For NX Units on the CPU Unit, the following describes both of the I/O response times for the CPU Unit
inside and I/O response times that include NX Unit processing times.
The I/O response times for the CPU Unit inside are given below.

 Performing Control with the Programs in the Primary Periodic Task


The Controller makes a response in the following I/O response time.

Minimum I/O response time = Primary period

Example: Controlling Input Unit A and Output Unit B with the Primary Periodic Task

Unit A Unit B

Primary period (t)

Primary
MC

MC

MC

IO UPG IO UPG IO 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.

Maximum I/O response time = Primary period × 2

 Performing Control with the Programs in the Priority-17 Periodic Task


The Controller makes a response in the following I/O response time.

I/O response time = Priority-17 periodic task period

Example: Controlling Input Unit A and Output Unit B with the Priority-17 Periodic Task
Unit A Unit B
IN
OUT
Primary period (t)

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Task period

Priority-17 UPG 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.

Maximum I/O response time = Priority-17 periodic task period × 2

5-118 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

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.

5-11 Task Design Methods and I/O Response Times


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.

The elements in the formulas are as follows:

Tnx-InProc : Input data processing time of the NX Unit


Tnx-OutProc : Output data processing time of the NX Unit
Tnx-Indelay : Input delay time of the NX Unit
Tnx-Outdelay : Output delay time of the NX Unit

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.

5
 Synchronous I/O Refreshing
With synchronous I/O refreshing, when there is more than one NX Unit that is connected to the CPU

5-11-3 System Input and Output Response Times


Unit, the inputs are read or the outputs are updated simultaneously for all NX Units that support syn-
chronous I/O refreshing. 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 sup-
port synchronous 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
Tnx-Indelay Tnx-InProc
Signals from output
terminals on NX
Output Unit B
Tnx-OutProc

Primary period (t) Tnx-Outdelay

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


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.

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-31 for information on the NX Unit processing time.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-119


5 Designing Tasks

 Time Stamp Refreshing


The I/O response time for time stamp refreshing is the specific time required to produce the output
after the input changed time. You specify the time in the user program. Specify a time that has a suf-
ficient leeway to ensure that the output is produced at the expected time.
The minimum specified time for which the expected output is produced is defined as the maximum
I/O response time for time stamp refreshing. It is described in the following.

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
Tnx-Indelay Tnx-InProc
Signals from output
terminals on NX
Output Unit B
Tnx-OutProc

Primary period (t) Tnx-Outdelay

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


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.

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-31 for information on the NX Unit processing time.

5-120 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 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.

5-11 Task Design Methods and I/O Response Times


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

Primary period (t) Tnx-Outdelay

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

Note: The above diagram shows only one input and one output.

However, the I/O response time may be as follows depending on the timing of the input from the Unit 5
and the timing of the output to the Unit.

5-11-3 System Input and Output Response Times


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-31 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-121


5 Designing Tasks

Performing Motion Control with Motion Control Instructions


Motion control instructions access the Servo Drive and encoder input slaves to which axes are
assigned.
For the NX1P2 CPU Units, motion control instructions can be used in the primary periodic task.
The motion control instructions are processed in the motion control processing (MC) section of the
primary periodic task.
For NJ-series CPU Units, motion control instructions can be used in the primary periodic task and in
a priority-16 periodic task.
In either case, the motion control instructions are processed in the motion control processing (MC)
section of the primary periodic task.
For the NX701 CPU Units, motion control instructions can be used in the primary periodic task, in
the priority-16 periodic task, and in the priority-5 periodic task.
The motion control instructions included in the primary periodic task and in a priority-16 periodic
task are executed in the motion control processing (MC) section of the primary periodic task.
The motion control instructions included in a priority-5 periodic task are executed in the motion con-
trol processing (MC) section of the priority-5 periodic task.
The I/O response times that include EtherCAT communications times are given below.

 Programming Motion Control Instructions in the Primary Periodic Task


The motion control instructions are processed in the next motion control processing (MC) section of
the primary periodic task. The results of processing are output to the EtherCAT slave or NX Unit to
which the axis is assigned during the I/O refresh period in the next primary periodic task.
The Controller makes a response in the following I/O response time.

I/O response time = Primary period (= process data communications cycle)

Slave A Servo A

IN Execution command
Process data
communications cycle
= Primary period (t) Primary period (t)

IO UPG MC IO UPG MC IO UPG MC


Primary periodic
task FB

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.

Task period 1 (e.g., t × 3)

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

5-122 NJ/NX-series CPU Unit Software User’s Manual (W501)


5 Designing Tasks

 Programming Motion Control Instructions in the Priority-5 Periodic Task


The motion control instructions are processed in the immediate motion control processing (MC) sec-
tion in the priority-5 periodic task. The results of processing are output to the EtherCAT slave to
which the axis is assigned during the I/O refresh period in the next priority-5 periodic task.
The Controller makes a response in the following I/O response time.

5-11 Task Design Methods and I/O Response Times


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

Priority-5 IO UPG MC IO UPG MC IO UPG MC


FB
periodic task

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 5

 Programming Motion Control Instructions in the Priority-16 Periodic Task

5-11-3 System Input and Output Response Times


The motion control instructions are processed in the next motion control processing (MC) section of
the primary periodic task after the priority-16 periodic task. The results of processing are output to
the EtherCAT slave to which the axis is assigned during the I/O refresh period in the next primary
periodic task.
The Controller responds in the following I/O response time regardless of the execution timing of the
motion control instructions.

Minimum I/O response time = Priority-16 periodic task period +


Primary period (= process data communications cycle)

Slave A Servo A

IN
Execution command

Process data
communications cycle
= Primary period (t)

Primary IO UPG MC IO UPG MC IO UPG MC IO UPG MC


periodic task

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.

Task period (e.g., t × 2) Task period (e.g., t × 2)

Priority-16 UPG
UPG
periodic task FB FB

Motion control instructions executed. Motion control instructions executed.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 5-123


5 Designing Tasks

Maximum I/O response time = Priority-16 periodic task period +


Primary period (= process data communications cycle) × 2

 Simultaneous Execution of More Than One Axis


If more than one axis is controlled in the same task period by the programs in the same task, they
can be started at the same time.

Motion control
instructions
Axis A

Motion control Start commands


are output at the
Axis B instructions same time.

Motion control
Axis C instructions

Additional Information

You can access the values of Axis Variables in the tasks other than those for axis control.
For detailed usage and precautions, refer to the NJ/NX-series CPU Unit Motion Control User’s
Manual (Cat. No. W507).

5-124 NJ/NX-series CPU Unit Software User’s Manual (W501)


Programming
This section describes programming, including the programming languages, and the
variables and instructions that are used in 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
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-56
6-3-9 Changes to Variables for Status Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-64
6-3-10 Function Block Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-79
6-3-11 Monitoring Variable Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-79
6-3-12 Restrictions on Variable Names and Other Program-related Names . . . . . . 6-80
6-4 Constants (Literals) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-82
6-4-1 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-82
6-4-2 Notation for Different Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-82
6-5 Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-87
6-5-1 Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-87
6-5-2 Ladder Diagram Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-87
6-5-3 Structured Text Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-93

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-1


6 Programming

6-6 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-130


6-6-1 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-130
6-6-2 Basic Understanding of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-130
6-6-3 Instruction Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-133
6-7 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-139
6-7-1 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-139
6-7-2 Namespace Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-140
6-7-3 Procedure for Using Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-143
6-8 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-144
6-8-1 Introduction to Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-144
6-8-2 Specifications of Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-145
6-8-3 Library Object Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-146
6-8-4 Procedure to Use Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-147
6-9 Programming Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-148
6-9-1 Array Specifications for Input Variables, Output Variables, In-Out
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-148
6-9-2 Structure Variables for Input Variables, Output Variables, In-Out
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-148
6-9-3 Master Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-149

6-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-1 Overview of Programming Procedures


This section provides an overview of programming procedures.
The shaded steps in the overall procedure that is shown below are related to programming.

Step 1. Software Design


Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

6-1 Overview of Programming Procedures


Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-3


6 Programming

POU (Program Organization Unit) Design Reference


 Determine which processes to put into which POUs and design 6-2 POUs (Pro-
the POUs. gram Organiza-
tion Units)
Note Functions cannot contain function block instructions or function blocks.
 Determine which languages, such as ladder diagrams, inline 6-5 Program-
ST, and ST, to use to create each process. ming Lan-
guages
Note Inline ST is structured text that is written as an element of a ladder diagram.

Variable Design Reference


 Design the user-defined variables that you need to create. 6-3-1 Variables
6-3-2 Types of
Variables

 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.

6-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-2 POUs (Program Organization Units)


The user program that runs on an NJ/NX-series CPU Unit is made from a combination of POUs (pro-
gram organization units).
This section describes the configuration and specifications of POUs.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on creating POUs
in the Sysmac Studio.

6-2-1 What Are POUs?

6-2 POUs (Program Organization Units)


A POU (program organization unit) is a unit that is defined in the IEC 61131-3 user program execution
model. A POU includes a local variable table and an algorithm (i.e., a series of code or logic). It is the
basic unit used to build the user program.
You combine POUs to build a complete user program.
There are three types of POUs, as described below.
• Programs
A program corresponds to a main routine. It is the main type of POU that is used for algorithms.
You can place any instruction, function, or function block in the algorithm of a program.
• Function Blocks (FBs)
A function block can output different values even with the same inputs. Function blocks are executed
when they are called from a program or another function block.
• Functions (FUNs)
A function always outputs the same values for the same inputs. Functions are executed when they
are called from a program, another function, or a function block. 6
The POUs consists of a combination of these three types of POUs. You can create many POUs.
You assign the programs to tasks to execute them.

6-2-1 What Are POUs?

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-5


6 Programming

6-2-2 Overview of the Three Types of POUs

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.

Function Blocks (FBs)


 Executing Function Blocks and Execution Conditions
• You can call function blocks from programs or other function blocks to execute them.
• Function blocks are always executed.
• If you want a function block to execute only when a condition is met, you must define an input vari-
able that sets the execution condition.

 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.

6-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-2-3 Differences between Programs, Functions, and Function Blocks


Item POU type Programs Function blocks Functions
Executed upon execu- Called from a pro- Called from a pro-
Execution method tion of assigned task. gram or another func- gram, function, or
tion block. function block.
Any instructions Supported. Supported. Not supported.
User-defined functions Supported. Supported. Supported.
Algorithm
User-defined function Supported. Supported. Not supported.
blocks
Executed each period. Executed each period. Specify the execution

6-2 POUs (Program Organization Units)


Execution condition Specify the execution condition with the EN
condition with an input input.
variable.

The hierarchical relationships between programs, functions, and function blocks are shown in the fol-
lowing figure.

Task

Program 1

Program 2

Functions Function blocks


6

Function blocks

6-2-3 Differences between Programs, Functions, and Function Blocks


Functions Functions

6-2-4 Details on Programs

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

You cannot call programs from other POUs.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-7


6 Programming

Program Execution Conditions


Programs are executed when the task they are assigned to is executed.

 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.

 Related System-defined Variables


All programs have the following system-defined variables in the local variables.
Variable Data
Meaning Function Read/write
name type
P_First_Run- First RUN This flag is TRUE for only one task period after the BOOL Read
Mode Period Flag operating mode of the CPU Unit is changed from
PROGRAM mode to RUN mode if execution of the
program is in progress.
This flag remains FALSE if execution of the pro-
gram is not in progress.
Use this flag to perform initial processing when the
CPU Unit begins operation.
P_First_Run*1 First Program This flag is TRUE for one task period after execu- BOOL R
Period Flag tion of the program starts.*2
Use this flag to perform initial processing when exe-
cution of a program starts.
P_PRGER Instruction This flag changes to and remains TRUE when an BOOL Read/write
Error Flag instruction error occurs in the program or in a func-
tion/function block called from the program.
After this flag changes to TRUE, it stays TRUE until
the user program changes it back to FALSE.
P_CY Carry Flag This flag is updated by some instructions. BOOL Read

*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.

6-2-5 Details on Function Blocks

Procedure to Create Function Blocks


A function block consists of a function block definition that is made in advance and instances that are
used in the actual programs. Create function blocks in the following order.

1 Create the function block definition.


Create the algorithm.

2 Placing an Instance of the Function Block Definition in a Program


Call the function block definition from a program or another function block.
You can call the same function block definition from more than one program or function block.
After you place an instance of a function block definition in a program or in another function
block, you can manipulate and execute it as an independent entity.

6-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Structure of Function Blocks


In a ladder diagram, function blocks are represented as rectangular boxes as shown below. Refer to
Calling Function Blocks from ST on page 6-10 for details about how to express function blocks in ST.
Function blocks consist of the following parts.
• Function Block in Ladder Diagram:

Instance name
Function block name or instruction name
In-out variable
MyFB_instance Output variable
TRIG MyFB OUT
In Q

6-2 POUs (Program Organization Units)


InQ InQ
SET RESULT
SetValue Result

Input parameter Input variable Output variable Output parameter

Algorithm

• Function Block Settings


When you create an instance of a function block definition, make the following settings.

Settings of a function block instance in a program

Instance name
6
Function block name

6-2-5 Details on Function Blocks


Local Variable Table

Input parameters Output parameters


Input In-out Output
variables variables variables
Internal variables

Algorithm
• Written as a ladder diagram or in ST.
• You can use any instructions,
user-defined functions, and user-
defined function blocks.

Created in the Function Definition

 Function Block Name or Instruction Name


This is the function block name or instruction name assigned in the function block definition when
the function block is created.

 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-9


6 Programming

 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.

 Local Variable Table


The local variable table is used to define input variables, output variables, in-out variables, internal
variables, and external variables.
Refer to Variable Designations for Function Blocks on page 6-11 for details.

 Parameters
Input Parameters to Input Variables
An input parameter passes a value to an input variable in a function block when function block exe-
cution begins. An input parameter can be either a variable or a constant.

Output Parameters from Output Variables


An output parameter receives a value from an output variable in a function block when function block
execution is completed. A variable is given as the parameter.

In-Out Parameters Shared between In-Out Variables


The value of the in-out parameter changes within the function block. The same variable is used for
both the input and output.

Additional Information

You can omit input and output parameters. Refer to information on operation when parameters
are omitted in Operation When Parameters Are Omitted on page 6-23 for details.

Calling Function Blocks from ST


The following example shows how to call function blocks from ST.
instance_name(input_variable_1:=input_parameter_1, ... input_variable_N:=input_parameter_N,in-out-
_variable_1:=in-out_parameter_1, ... in-out_variable_N:=in-out_parameter_N,output_variable_1=>out-
put_parameter_1, ... output_variable_N=>output_parameter_N);
You can also omit input variable names and other variable names, and give only the parameters. (If you
do, the parameters must be given in the order that they are given in the function block definition.) Also,
the number of parameters must match the number of input variables and other variables in the function
block definition.

TON_instance
a TON c
In Q

b PT ET d

Function Blocks Expressed in ST:

Instance name

TON_instance(In:=a, PT:=b, Q=>c, ET=>d);


TON_instance(In:=a, PT:=b, Q=>c); (*The ET output is omitted here.*)
TON_instance(a,b,c,d); (*Input and output variables are omitted here.*)

6-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Refer to Function Block Calls in ST Language Statement on page 6-117 for details.

Variable Designations for Function Blocks


Instance Name

Function block definition name


Value is assigned. or instruction name Value is assigned.

Input parameter Input Internal Output Output parameter


Variable assignment variable variables variable Variable assignment itself is passed.
itself is passed.

6-2 POUs (Program Organization Units)


In-out parameter In-out variable In-Out variable In-out parameter

The specifications for variables in function blocks are given below.


Variables Number Specification
Input variables*1 1 to 64 Input variables are used as input arguments within the function block. They can-
not be changed inside the function block.
• When the function block is executed, the input variables are set to the values of
the input parameters.
• You can specify either constants or variables for input parameters.
• Omitting Input Parameters:
Refer to information on operation when parameters are omitted in Operation
When Parameters Are Omitted on page 6-23.
• You can specify to detect when the variable changes to TRUE or changes to 6
FALSE.
• You can access and change the values from outside the function block. Access

6-2-5 Details on Function Blocks


these values using the following format: InstanceName.InputVariableName.*2
Output vari- 1 to 64 Output variables are used as output arguments from the function block.
ables*3 • The output parameters are set to the values of the output variables at the end
of function block execution.
• You cannot specify a constant or a variable with constant attribute for an output
parameter.
• You can omit output parameter connections. If you omit an output parameter,
the value of the output variable is not assigned to any parameter.
• You can access the values of output variables from outside of the function
block. Access these values with the following format: InstanceName.Output-
VariableName. However, you cannot write values directly to an output variable.
In-out variables 0 to 64 In-out variables are used as inputs to and outputs from the function block. They
can be changed inside the function block.
• The value of an in-out parameter is passed to an in-out variable and the value
of the in-out variable is then passed to the in-out parameter.
• You cannot specify a constant or a variable with constant attribute for an in-out
parameter.
• If you change the value of an in-out variable within a function block, the value of
the in-out parameter changes at that time.
• You cannot omit in-out parameters.
Internal vari- No limit Internal variables are used for temporary storage within a function block.
ables • The values of internal variables are retained regardless of whether the function
block is executed.
• Internal variables can have Retain attributes.
• You cannot access the values of internal variables from outside of the function
block.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-11


6 Programming

Variables Number Specification


External vari- No limit External variables are used to access global variables.
ables
EN 0 An EN variable cannot be used in a function block. (This applies to both user-
defined function blocks and FB instructions.)
ENO 0 or 1 Generally, this is a BOOL output variable that is set to TRUE for a normal end,
and to FALSE for an error end.
• You can also omit it for some FB instructions.
• Refer to ENO on page 6-20 for details.

*1 In the Sysmac Studio version 1.01 or lower, at least one BOOL input variable is required when you use function
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.

6-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Function Block Definitions and Instances


A function block consists of a function block definition that is made in advance and instances that are
then used in the actual programs. All instances of a function block are based on the function block defi-
nition.
A function block definition consists of an algorithm and a local variable table.

 Function Block Instance


When you place an instance of a function block definition in a program or another function block, the
function block definition is treated as a part of that program or function block.
Function block definitions that are called from a program or another function block are called
instances.

6-2 POUs (Program Organization Units)


Every instance of a function block has an identifier known as an instance name associated with it,
and every instance uses memory.
You can create instances of a function block definition to process different I/O data in the same way.

Program POU

Instance name FB1_1


Function block definition name FB1

Variable Memory area Memory area


declarations reserved.

Algorithm Memory for


instance
FB1_1 6
Memory for
instance

6-2-5 Details on Function Blocks


FB1_2

Instance name FB1_2


Function block definition name FB1

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 oper-
ate as a completely separate instance.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-13


6 Programming

Array Specifications for Instances


Array specifications can be made for instances. You can indirectly specify an array element number
with a variable to execute multiple instances with one instance name. Furthermore, you can switch
input sources and output destinations and effectively execute multiple instances with a single
instance name if you use an array specification for the input parameter and output parameter and
specify the element numbers with the same variable.
Example:

Not Using an Array to Specify Instances Using an Array to Specify Instances


timer0
FOR
TON
IN[0] OUT[0] EN ENO
In Q
UINT#0 Initval Index i
PT[0] PT ET UINT#4 Endval
UINT#1 Stepval
timer1 Here, array variables are
timer[i]
TON used to specify instances of
IN[1] OUT[1] TON the function block definition
In Q IN[i] OUT[i] TON and all input parameters
In Q and output parameters. All of
PT[1] PT ET the element numbers are
PT[i] PT ET incremented to execute five
instances in succession.

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

6-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Execution Conditions for Function Blocks


Function blocks do not have an EN input like functions. They are executed each period.

Processes That Require Constant Data Monitoring


Case Algorithm in FB ENO Operations other than ENO
Normal opera- Executed. Normal end TRUE Output parameters: Values are updated
tion according to the internal algorithm.
In-out parameters: Values are updated
according to the internal algorithm.
Error end FALSE Output parameters: Retained
In-out parameters: Values are updated

6-2 POUs (Program Organization Units)


according to the internal algorithm.
Inside a mas- Executed when the state of User-specified One of the above, depending on the value
ter control the power flow input is of ENO.
region FALSE.

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

6-2-5 Details on Function Blocks


Specifies detecting a change to TRUE.

You can specify falling edges too.

Instance

Variable A FB
A
X

Instance X
Specifies detecting a change to FALSE.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-15


6 Programming

Accessing Variables in a Function Block from Outside the Function


Block
You can access the input and output variables of a function block from outside the function block. Vari-
ables are written as follows:
InstanceName.VariableName
Example: To Access Output Variable B of Function Block Instance FB1_Instance
FB1_Instance.B
You can access the input and output variables for a function block only within the program that contains
the function block. However, you cannot access these variables from within other function block
instances even if they are in the same program. You cannot access them from other programs.

Program P1

FB1_Instance
FB1

A B Input and Output Variables for FB1


• Access is possible only from within program P1.
Can be accessed. • Access is not possible from program P2.
• Access is not possible from within FB2.
FB1_Instance.B

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

6-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-2-6 Details on Functions

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:

Function name or instruction name

EN input

6-2 POUs (Program Organization Units)


ENO output
MyFUN
EN ENO
Return value
Para1 In1 ret_val

Para2 In2 Out1 Output1

Input parameters Input variables Output variable Output parameter

 Function Name or Instruction Name


This is the function name or instruction name assigned in the function definition when the function is 6
defined.

 Instance Name

6-2-6 Details on Functions


Functions do not have instance names.

 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

Local variable table


EN
Output parameter
Input parameter Output
Input In-out
variable variable variable
(return value)
Internal variables

Algorithm

FUN instruction

User-defined
function

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-17


6 Programming

 Local Variable Table


A local variable table defines the input variables, output variables, in-out variables, internal variables,
and external variables.
Refer to Variable Designations for Functions on page 6-19 for details.

 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.

Output Parameters from Output Variables


An output parameter receives a value from an output variable in a function when function execution
is completed. A variable is given as the parameter.

In-Out Parameters Shared between In-Out Variables


The value of the in-out parameter changes within the function. The same variable is used for both
the input and output.

Expressing Functions in ST
The following example shows how to call functions from ST.
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,output_-
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

Para_MAX := MAX(In1:=Para1, In2:=Para2);


Para_MAX := MAX(Para1, Para2); (*The input variables are omitted here.*)

Refer to Function Calls on page 6-120 for details.

6-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Variable Designations for Functions

Function name
name or
or instruction
instructionname
name Value is assigned.

Return value Return value parameter


Value is assigned.
Value is assigned.

Input Internal
Input parameter Output Output parameter
variable variables
Variable assignment variable Variable assignment
itself is passed. itself is passed.

6-2 POUs (Program Organization Units)


In-out parameter In-out variable In-out variable In-out parameter

The specifications for variables in functions are given below.


Variables Number Specification
Input variables 0 to 64 Input variables are used as input arguments within the function. They cannot be
changed inside the function.
• When the function is executed, the input variables are set to the values of the
input parameters.
• You can specify either constants or variables for input parameters.
• Omitting Input Parameters:
Refer to information on operation when parameters are omitted in Operation
When Parameters Are Omitted on page 6-23.
• Unlike function blocks, you cannot specify to detect changes to TRUE or
FALSE.
6
• You cannot access the values of input variables from outside of the function.
• Some of the instructions provided by OMRON can have varying numbers of

6-2-6 Details on Functions


input variables, but you cannot make a user-created function that has a vary-
ing number of input variables.
Output variables 0 to 64 Output variables are used as output arguments from the function.
• The output parameters are set to the values of the output variables at the end
of function execution.
• You cannot specify a constant or a variable with constant attribute for an out-
put parameter.
• At least one BOOL output variable (including ENO and the return value) is
required.
• You can omit output parameter connections.
If you omit an output parameter, the value of the output variable is not
assigned to any parameter.
• You cannot access the values of output variables from outside of the function.
• The values of the output variables of user-defined functions must always be
set in the algorithms of the functions. If the output variables are not set in the
algorithms of the functions, the values of the output variables are undefined.
In-out variables 0 to 64 In-out variables are used as inputs to and outputs from the function. They can be
changed inside the function.
• In-out parameters (variable designations) are directly passed to or received
from the in-out variables.
• You cannot specify a constant or a variable with constant attribute for an in-out
parameter.
• If you change the value of an in-out variable within a function, the value of the
in-out parameter changes at that time.
• You cannot omit in-out parameters.
• You cannot access the values of in-out variables from outside of the function.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-19


6 Programming

Variables Number Specification


Internal vari- No limit Internal variables are used for temporary storage within a function.
ables • The value is not retained after execution is completed.
• You cannot access the values of internal variables from outside of the function.
External vari- No limit External variables access global variables.
ables
EN 1 This is a BOOL input variable used to execute the function.
• The function is executed when EN is TRUE. The value of EN in the function is
always TRUE.
• You must have one EN variable. (This applies to both user-defined functions
and FUN instructions).
ENO 0 or 1 Generally, this is a BOOL output variable that is set to TRUE for a normal end,
and to FALSE for an error end.
• You can omit the ENO variable from user-defined functions.
• Refer to ENO on page 6-20 for details.
Return value 1 The return value is the value that is returned to the calling instruction. It rep-
resents the results of the process after the algorithm in the function is executed.
• Each function must have one return value.
• You can specify enumerations of all basic data types. You cannot specify an
array, structure, or union.
• The return values of user-defined functions must always be set in the algo-
rithms of the functions. If return values are not set in the algorithms of the
functions, the return values are undefined.
• Refer to Return Values, below, for details.

Refer to 6-3-4 Attributes of Variables for details on setting variable attributes.

Additional Information

You can register global variables as external variables in a function variable table to access
global variables. We recommend that you create your functions so that they produce output 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.

6-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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

Not using a return MyFUN2(In1:=vari-


value MyFUN2 able_i1,In2:=variable_i2,
EN OutEQ=>variable_q1,

6-2 POUs (Program Organization Units)


OutNE=>variable_q4 );
Variable i1
In1

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.

6-2-6 Details on Functions


For example, the return value of a function called MyFUN is MyFUN.

MyFUN Definition of MyFUN


EN ENO
IF IN>100
Variable i Variable q MyFUN:=100;
IN
ELSE
MyFUN:=IN;
END_IF;

Execution Conditions for Functions


A function is executed when EN is TRUE. The function stops processing when EN changes to FALSE.
Input variables Algorithm in FUN ENO Operations other than ENO
EN = TRUE Executed. Normal end TRUE Output parameters: Values are updated according to
the internal algorithm.
In-out parameters: Values are updated according to
the internal algorithm.
Error end FALSE Output parameters: Values are retained.
In-out parameters: Values are updated according to
the internal algorithm.
EN = FALSE Not executed. FALSE Output parameters and in-out parameters: Values
are retained.
Inside a master Not executed. FALSE Output parameters and in-out parameters: Values
control region are retained.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-21


6 Programming

Example:

BOOL variable A Algorithm within function


in MyFUN
EN ENO MyFUN
P_On

BOOL variable B

in

Function
execution

ENO You can change ENO with the


algorithm in the function.

BOOL variable A

BOOL variable B

6-2-7 Operation That Applies to Both Functions and Function Blocks

Using or Omitting EN and ENO


The following table shows when you can use and when you can omit EN and ENO in functions and
function blocks.
POU EN ENO
FB User-defined Cannot be used. Can be used or omitted.
functions A building error occurs if you try to define You define ENO as an output variable in
EN in the variable table from the Sysmac the Sysmac Studio.
Studio.
Instruction All FB instructions do not use EN. Some instructions use ENO, and others
do not.
FUN User-defined Required. Can be used or omitted.
functions When you create a function, the Sysmac You define ENO as an output variable in
Studio automatically adds EN to the vari- the Sysmac Studio.
able table by default.
Instruction All FUN instructions use EN. Some instructions use ENO, and others
do not.

6-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Operation When Parameters Are Omitted


You can omit both input and output parameters.
Operation when omitted
Parameters omitted in FB FUN
• When the first time the instance is executed, the • EN is operated when its
initial value is used. value is TRUE.
Input parameters to input
variables • Thereafter, the function block is executed with the • For other input parame-
previous value (if the input variable is omitted, the ters, the initial value is
initial value is always used). used for operation.
Can be omitted. You can omit the output
Output parameters from You can access the results of the operation outside parameter. If it is omitted,

6-2 POUs (Program Organization Units)


output variables of the instruction by using InstanceName.OutputVari- there is no way to retrieve
ableName.* the result of the operation.

In-out parameters to/from Cannot be omitted. Cannot be omitted.


in-out variables

* 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

6-2-7 Operation That Applies to Both Functions and Function Blocks


FBinstance.Done

Can be specified by using InstanceName.Done.

Operation for Parameter Errors


The following operation occurs when there is an error in an input parameter, output parameter, or in-out
parameter.
 Errors in Input Parameters
If an error is detected in an input parameter, the function or function block is not executed and ENO
is FALSE. The power flow output is also FALSE, but all other values are retained.
Example:

Function
EN ENO
FALSE

x[i] IN1

x[10] IN2 OUT2 abc Retained. Variable Table


Variable name Array Data type
Example when variable i is outside the x [ 1 .. 10 ] INT
range of the elements in array variable x

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-23


6 Programming

 Errors in Output Parameters


If an error is detected in an output parameter, all values after that parameter are not output but their
values are retained.
Example:

Function
EN ENO
Example when variable i is outside the
range of the elements in array variable x
IN1 OUT1 x[9]

IN2 OUT2 x[i]

OUT3 x[10] Retained.


Not output.

 Errors in In-Out Parameters


If an error is detected in an in-out parameter, the function or function block is not executed and ENO
is FALSE. The power flow output is also FALSE, but all other values are retained.

Function
OFF
EN ENO

x[i] x[i]
INOUT-- --INOUT

xyz Retained.
X

Example when variable i is outside the


range of the elements in array variable 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.

6-2-8 POU Restrictions


This section describes the restrictions in the creation of POUs.

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.

Passing Multiple Arguments


If you need to pass multiple arguments to a function or function block, use an array specification or
structure to pass the required data.
This will make your program simpler. However, be aware that if you use an in-out variable, the data
passed to the function block or function as a parameter is written and the original data is not retained.

6-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Additional Information

Specifying an Array Variable or Structure Variable as a Parameter


You can also specify an array variable or a structure variable as an input or output parameter.
However, it will take longer to pass and receive data for these data types in comparison to a vari-
able with a basic data type (depending on the size). Therefore, when handling array variables or
structure variables in a function block, we recommend that you design them in such a way that
these variables are passed to and received from in-out variables.
Example 1: Specifying an Array

Program Variable Table


Variable name Data type

6-2 POUs (Program Organization Units)


x ARRAY[0..199] OF INT

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

6-2-8 POU Restrictions


Program Variable Table
Variable name Data type
x MyStructure

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)

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-25


6 Programming

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.

POU Called POUs Nesting depth


Function blocks Functions and function blocks 8 levels max.
Functions Functions 16 levels max.*1
*1 A CPU Unit with unit version 1.03 or later and Sysmac Studio version 1.04 or higher are required. For other
versions, the limit is 8 levels.

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.

Program FB1 FB7 FB8 FUN15


FB1 FB2 FB8 FUN9 FUN16

Level 1 Level 2 Level 8 Level 9 Level 16

You cannot call a function You cannot call a function


block at level 9. at level 17.

Example 2: From a program, you can call functions to a depth of 16 levels.

Program FUN1 FUN15


FUN1 FUN2 FUN16

Level 1 Level 2 Level 16

You cannot call a


function at level 17.

6-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-3 Variables
In the NJ/NX-series System, variables are used to exchange I/O information with external devices, to
perform data calculations, and to perform other processes. This section describes variable designations
in detail.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on setting variables
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 memory
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-56 for details.
* You can use CJ-series Units only with NJ-series CPU Units.

6-3-2 Types of Variables


Variables are broadly classified into the following three types.
6

 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-5 System-defined Variables for details.
Refer to 2-3-1 Types of Variables for details on the different types of variables.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-27


6 Programming

6-3-3 Types of User-defined Variables in Respect to POUs


There are six types of user-defined variables as defined according to their function in a POU.
POU type
Type of user-defined variable
Programs FB FUN
Internal variables Supported. Supported. Supported.
Input variables Not supported. Supported. Supported.
Local variables
Output variables Not supported. Supported. Supported.
In-out variables Not supported. Supported. Supported.
Global variables Supported (see note). Supported (see note). Supported (see note).
External variables Supported. Supported. Supported.

* 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 vari-
able 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-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-3-4 Attributes of Variables


You can set the following attributes for variables.

Variable Attributes According to Variable Type


 Attributes of Variables
Attribute Description Specification Default
The variable name is used to identify the
Variable Name
variable.
The data type defines the format of the BOOL
Data Type
data that is stored in the variable.
If you want to handle a specific address • Not specified. Not specified.
AT Specification for a CJ-series Unit as a variable, specify • Specify.
the address to assign to that variable.*1
Specify whether to retain the value of the • Retain: Value speci- Non-retain: Reset
variable in the following cases. fied on the left is to initial value
• When power is turned ON after a retained if there is a
power interruption Battery.
Retain • Non-retain: Changes
• When the CPU Unit changes to RUN

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 do values.) 6
not specify the Retain attribute.
Initial Value • When power turned ON

6-3-4 Attributes of Variables


• When operating mode changes
• When a major fault level Controller
error occurs
If the initial value is not set, the value is
not retained.
If you set the Constant attribute, you can Specify making the
set the initial value of the variable when it value a constant or not
Constant
is downloaded, but you cannot overwrite a constant.
the value afterwards.
This attribute allows you to use CIP com- • Do not publish Do not publish
munications and data links to read/write • Publish Only
Network Publish variables from outside of the Controller. • Input
• Output
An Edge attribute allows you to detect • None None
when the input parameter of a function • Change to TRUE
Edge block changes to TRUE or changes to • Change to FALSE
FALSE. This can be used only on BOOL
input variables.
*1 You can use CJ-series Units only with NJ-series CPU Units.

Additional Information

Exclusive Control between Tasks


You can restrict writing to global variables to a single task to prevent changes to the values of
global variables during processing. Specify this as a task setting, not as a variable attribute.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-29


6 Programming

 Attributes Supported by Each Type of Variable


Variable Data AT Spec- Initial Network
Type of variable Retain Constant Edge
Name Type ification Value Publish
Sup- Sup- Sup- Sup- Sup- Sup- Sup- Not sup-
Global variables
ported. ported. ported. ported. ported. ported. ported. ported.
Internal Sup- Sup- Sup- Sup- Sup- Sup- Not sup- Not sup-
variables ported. ported ported ported ported ported ported. ported.
Programs
External Not sup- Not sup- Not sup- Not sup- Not sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
Internal Sup- Sup- Sup- Sup- Sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
Input vari- Sup- Sup- Not sup- Sup- Sup- Sup- Not sup- Sup-
able ported. ported. ported. ported. ported. ported. ported. ported.
Function Output Sup- Sup- Not sup- Sup- Not sup- Not sup- Not sup- Not sup-
blocks variables ported. ported. ported. ported. ported. ported. ported. ported.
In-out Sup- Sup- Not sup- Not sup- Not sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
External Not sup- Not sup- Not sup- Not sup- Not sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
Internal Sup- Sup- Not sup- Not sup- Sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
Input vari- Sup- Sup- Not sup- Not sup- Sup- Sup- Not sup- Not sup-
ables ported. ported. ported. ported. ported. ported. ported. ported.
Output Sup- Sup- Not sup- Not sup- Not sup- Not sup- Not sup- Not sup-
Functions
variable ported. ported. ported. ported. ported. ported. ported. ported.
In-out Sup- Sup- Not sup- Not sup- Not sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.
External Not sup- Not sup- Not sup- Not sup- Not sup- Sup- Not sup- Not sup-
variables ported. ported. ported. ported. ported. ported. ported. ported.

6-3-5 Data Types


The Data Type attribute defines the type of data and range of data that is expressed by a variable.
The amount of memory that is allocated when you declare a variable depends on the data type of that
variable. The more memory allocated, the larger the range of values that the variable can express.
The data types for the input, output, and in-out variables of instructions depend on the instruction. Set
the data types of input, output, and in-out parameters for the instruction arguments according to the
data types of the input, output, and in-out variables for that instruction.

Basic Data Types and Derivative Data Types


There are two kinds of data types: basic data types, which have predefined specifications, and deriva-
tive data types, which are defined according to user specifications.

 Basic Data Types


The different kinds of basic data types are listed below.
Classification Definition
Boolean A data type with a value of either TRUE or FALSE.
Bit string A data type that represents a value as a bit string.
Integer A data type that represents an integer value.
Real number A data type that represents a real number.
A data type that represents a time duration (days, hours, minutes, seconds, and
Duration
milliseconds).

6-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

6-3-5 Data Types


UDINT 32 bits 4 bytes UDINT#0 to +4294967295
64 bits 8 bytes ULINT#0 to
ULINT
+18446744073709551615
32 bits 4 bytes REAL#−3.402823e+38 to REAL#3.14
−1.175495e-38 LREAL#3.14
REAL 0 3.14
1.175495e-38 to 3.402823e+38 −3.14
+∞ /−∞ 1.0E+6
Real numbers 64 bits 8 bytes LREAL#−1.79769313486231e 1.234e4
+308 to −2.22507385850721e-308
0
LREAL
2.22507385850721e-308 to
1.79769313486231e+308
+∞ /−∞
64 bits 8 bytes T#-9223372036854.775808ms T#12d3h3s
(T#- T#3s56ms
106751d_23h_47m_16s_854.7758
08ms) to TIME#6d_10m
T#+9223372036854.775807ms TIME#16d_5h_3m_4s
Durations*1*2 TIME
(T#+106751d_23h_47m_16s_854. T#12d3.5h
775807ms) T#10.12s
T#61m5s (Equivalent to T#1h1m5s)
TIME#25h_3m
64 bits 8 bytes D#1970-01-01 to D#2106-02-06 Add “DATE#”, “date#”, “D#”, or “d#” to the
(January 1, 1970 to February 6, beginning of the string and express the
Date DATE 2106) date in the yyyy-mm-dd format.
Example:
d#1994-09-23

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-31


6 Programming

Classification Data type Data size Alignment Range of values Notation


64 bits 8 bytes TOD#00:00:00.000000000 to Add “TIME_OF_DAY#”, “time_of_day#”,
TOD#23:59:59.999999999 “TOD#”, or “tod #” to the beginning of the
TIME_OF (00:00:0.000000000 to string and express the time of day in the
Time of day*2 _DAY 23:59:59.999999999) hh-mm-ss format.
Example:
tod#12:16:28.12
64 bits 8 bytes DT#1970-01-01- Add “DT#” or “dt#” to the beginning of the
00:00:00.000000000 to DT#2106- string and express the date and time in the
Date and DATE_
02-06-23:59:59.999999999 (Janu- yyyy-mm-dd-hh:mm:ss format.
AND_
time*2 TIME
ary 1, 1970 00:00:0.000000000 to Example:
February 6, 2106, dt#1994-09-23-12:16:28.12
23:59.999999999 seconds.)
(Number of 1 byte The character code is UTF-8. Enclose the string in single-byte single
single-byte 0 to 1,986 bytes (1,985 single-byte quotation marks (‘).
characters alphanumeric characters plus the Example:
Text strings STRING plus 1) × 8 final NULL character, for Japanese, ‘OMRON’‘PLC’
bits*3 this is approximately equal to 0 to
661 characters)*4
The default size is 256 bytes.

*1 Use the NanoSecToTime and TimeToNanoSec instructions to convert between durations and integer data. Refer to the
NJ/NX-series Instructions Reference Manual (Cat. No. W502) for detailed 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-85 for a list of the escape characters.

Precautions for Correct Use


The total amount of memory required by all variables is not equal to the total of the data sizes of
each of those variables. This is because the first position where data is stored in memory is auto-
matically set to a multiple of the alignment value for that data type. This results in some empty
space in memory between data types. For example, even if the data types are the same, the
overall memory space required depends on the order of data types, as shown below.
Example:
DWORD -> DWORD -> WORD: Requires a total of DWORD -> WORD -> DWORD: Requires a total of
10 bytes. 12 bytes.
Byte Byte
First byte First byte
First byte+1 First byte+1
DWORD data DWORD data
First byte+2 First byte+2
First byte+3 First byte+3
The beginning of the The beginning of the
First byte+4 data type is a First byte+4 data type is a multiple
WORD data
First byte+5 multiple of four. First byte+5 of two.
DWORD data
First byte+6 First byte+6
Not used.
First byte+7 First byte+7
The beginning of the
First byte+8 data type is a First byte+8 The beginning of the
WORD data data type is a multiple of
First byte+9 multiple of two. First byte+9
DWORD data four, i.e., first byte + 8.
First byte+10
First byte+11

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-9 Variable Memory Allocation Methods for details.

6-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

IF (INT_TO_WORD (a) AND WORD#16#0001) = WORD#16#0001 THEN


a = a+1;
END_IF;

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

6-3-5 Data Types


depending on the situation.
Enumerations This data type uses one item from a prepared name list as its value.

Refer to 6-3-6 Derivative Data Types for details.

 Specifications for Data Types


The following array specifications and range specifications are possible for all data types.
Type Description
Array specification An array is a group of elements with the same data type. You specify the number
(subscript) of the element from the first element to specify the element. You can
specify arrays for both basic data types and derivative data types.
Range specification You can specify a specific range for a data type in advance.
You can specify a range for any integer basic data type.

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 definition
name is registered as a data type in the local variable table.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-33


6 Programming

Restrictions on Using Data Types


A list of the data types that you cannot use in different POUs is given below.
Unusable data types
POU type Type of variable
Basic data types Derivative data types
Programs Internal variables None
Global variables None
FUN Input variables, output variables, and in-out None Unions
variables
Internal variables None
Return values None A structure or union
FB Input variables, output variables, and in-out None Unions
variables
Internal variables None

6-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Bit String, Real Number, and Text String Data Formats


This section describes the data formats for bit string data, real number data, and text string data.

 Bit String Data Format


Bit 0 is the least significant bit of a bit string variable. Bit values are represented by values of either 1
or 0. However, you can also represent the value of a single bit as a BOOL variable where 1 equals
TRUE and 0 equals FALSE.
Bit 7 Bit 0
One-bit extraction
BYTE#16#3B 0 0 1 1 1 0 1 1 TRUE

 Real Numbers (REAL and LREAL Data)


REAL and LREAL data have a real number data format. This section describes how to express real
numbers and how to perform data processing with real number data types.
Data Size
REAL data is 32 bits, while LREAL data is 64 bits.

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)

6-3-5 Data Types


This floating-point format follows the IEEE 754 standard. The formats are given below.
Sign Exponent Mantissa
REAL data (32 bits) s e f
31 30 23 22 0
Sign Exponent Mantissa
LREAL data (64 bits) s e f
63 62 52 51 0
Example: Expressing −86.625 as REAL Data

1 This is a negative number, so s =1.

2 86.625 in binary is 1010110.101.

3 Normalizing this value gives us 1.010110101 × 26.

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-35


6 Programming

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

REAL −3.402823e+38 REAL +3.402823e+38


LREAL −1.79769313486231e+308 LREAL +1.79769313486231e+308

−∞ 0 +∞

REAL −1.175495e−38 REAL +1.175495e−38


LREAL −2.22507385850721e−308 LREAL +2.22507385850721e−308

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

Data type name Special values Sign s Exponent e Mantissa f


LREAL +∞ 0 2047 0

−∞ 1 2047 0
+0 0 0 0
−0 1 0 0
Nonnumeric --- 2047 Not 0

6-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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 num-
bers 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 man-
tissa f ≠ 0 is a subnormal number and its value is expressed as shown below.
• REAL Data
Number = (−1)s2−126(f × 2−23)
• LREAL Data
Number = (−1)s2−1022(f × 2−52)
Example: Expressing 0.75 × 2−127 as REAL Data

1 This is a positive number, so s = 0.

2 0.75 in binary is 0.11.

3 From (0.11)2 × 2−127 = 2−126(f × 2−23) we can see that f = (0.11)2 × 222.

4 From the above expression, f = 01100000000000000000000.


Therefore, you can express 0.75 × 2−127 as shown in the following figure.

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.

6-3-5 Data Types


Data Processing
The floating-point format expresses only an approximate value. Therefore, there may be a difference
between the floating-point number and its true value. There is also a limited number of effective dig-
its for these values. Therefore, the following actions are taken when you perform calculations with
the floating-point format.

Precautions for Correct Use


Generally, calculation results for real number data may be different if the hardware such as a pro-
cessor is different. Confirm the calculation results for real number data when you reuse pro-
grams and libraries with the different model number of the CPU Unit.

Rounding
If the real value exceeds the effective digits of the mantissa, the value is rounded off according to the
following rules.
• The result of the calculation will be the closest value to the value that can be expressed as a 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-37


6 Programming

Precautions for Correct Use


When you determine if two values are equal, consider the true values and error.
A real number is expressed in the floating-point decimal format. Because of this, there is a slight
error from the actual value. When you try to determine if two values are equal, this error may
cause unintended results. For example, if you compare 0.1 + 0.2 with 0.3 using boolv := (0.1 +
0.2 = 0.3);, the BOOL variable boolv will not be TRUE. It will be FALSE. To prevent this situation,
do not use the EQ, =, NE, or <> instruction to determine if two real numbers are equal. Instead,
use the value comparison instructions and determine if the absolute value of the difference
between the two values is within a sufficiently small range. For example, the following program-
ming can be used to check to see if the sum of REAL variables real_a and real_b is equal to 0.3.
If the value of boolv is TRUE, the two values are considered to be equal.
boolv := (ABS((real_a + real_b) - 0.3) < 0.000001); // Here, an allowable error
// of 0.000001 is used.

Overflows and Underflows


An overflow occurs when the absolute value of the true value is larger than the maximum value that
can be expressed in the floating-point format. An underflow occurs when the absolute value of the
true value is smaller than the minimum value that can be expressed in the floating-point format.
• If an overflow occurs and the true value is positive, the result of the calculation is positive infinity. If
the true value is negative, the result of the calculation is negative infinity.
• If an underflow occurs and the true value is positive, the result of the calculation is positive zero. If
the true value is negative, the result of the calculation is negative zero.

Special Value Calculations


Calculations that involve special values (i.e., positive infinity, negative infinity, +0, −0, and nonnu-
meric data) are performed according to the following rules.
• Addition of positive and negative infinity results in nonnumeric data.
• Subtraction of two infinite values of the same sign results in nonnumeric data.
• Multiplication of +0 or −0 with infinity results in nonnumeric data.
• Division of +0 by itself, −0 by itself, or infinity by itself results in nonnumeric data.
• Addition of positive and negative zero results in positive zero.
• Subtracting +0 from itself or −0 from itself results in +0.
• Any arithmetic that involves nonnumeric data results in nonnumeric data.
• Comparison instructions (such as for the Cmp instruction) treat +0 and −0 as equal.
• If you compare nonnumeric data with anything else, the result is always not equal.

 Text String Data Format


All STRING variables are terminated with a NULL character (character code BYTE#16#00).

6-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Converting Data Types


When you use a variable of a different data type, the data type is automatically converted in some
cases. You can also perform the conversion yourself with a data type conversion instruction.

Data Type Conversion


All variables must have data types. Programs must operate properly according to these data types.
For example, the left and right sides of an assignment expression should normally use the same
data type. In some cases, however, it may be necessary to assign data of a different data type to a
variable in order to program something successfully.
Example:

var3 := var1; Assigning a value to a variable of a different data type

var1 is a variable of data type INT.


var3 is a variable of data type REAL.

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

6-3-5 Data Types


Additional Information

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-39


6 Programming

6-3-6 Derivative Data Types


A derivative data type has a configuration that is based on one of the basic data types. The following is
a list of the derivative data types.
• Structures
• Unions
• Enumerations
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names for restrictions on
the number of characters in data type names and other restrictions when you create a derivative data
type.

Additional Information

NJ/NX-series Controllers come with three different types of system-defined derivative data
types.
• System-defined variables that are structures
• Structures used for input, output, and in-out variables for instructions
• Structures for Special Unit expansion memory (You must register these in the Unit Editor to
use them.)

Structures
A structure is a derivative data type that groups together data with the same or different variable types.
You can easily change data and add new data if you place your data into a structure.
For example, you can define a “Box” structure that has three members (Width, Height, and Depth) in
order to organize and group your data.
You can then use this structure data type to add a variable called Box1. You can then use it to access
the different levels of the data by placing a period after the variable name followed by the name of the
data you want to access. For example, Box1.Width or Box1.Height.
If you need to create a new variable to store more box data, you can perform the same steps to add a
new variable called Box2 to the variable table.

Height of Box1 Height of Box2 Height of Box3


Structure Variable Box1 Structure Variable Box2 Structure Variable Box3

Member Member Member

Height Height Height

Width Width Width

Depth Depth Depth

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

6-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Expressing Structure Variables and Structure Variable Members

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

Specifying the Structure


The structure represents all members that make up the structure. A structure is expressed by the
name of the structure variable. In the example above, you would write 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.

Data Type Table

6-3 Variables
Name Member Data type
RGB red INT
green INT
blue INT
ITEM ItemNo INT
Color RGB
6

6-3-6 Derivative Data Types


2 Specify the member name and the structure data type from above as the data type and register
the variable in the variable table.
Variables
Desk red
green Data type RGB
blue

Variable Table Chairs[0] ItemNo


Variable name Data type Color red
green Data type ITEM
Desk RGB
blue
Chairs ARRAY[0..1]OF ITEM
Chairs[1] ItemNo
Color red
green Data type ITEM
blue

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-41


6 Programming

 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- NX1P2-: 1 MB
able NJ501-: 4 MB
NJ301-: 2 MB
NJ101-: 2 MB

Data Types of Structure Members


Classification Data type Usage
Basic data types Boolean, bit string, integer, real, duration, date, time of day, date Supported.
and time, or text string data
Array of Boolean, bit string, integer, real, duration, date, time of Supported.
day, date and time, or text string data
Derivative data types Arrays (see note), unions, and enumerations Supported.

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.

 Arrays and Structures


You can set an array in which the elements are structures. You can also set a structure in which the
members are arrays.

 Specifying Structure Member Offsets


When you specify an offset for a member, you can set the memory configuration of the members as
required for each structure data type. This allows you to align the memory configuration of the mem-
bers of the structure data type when you use tag data links with CJ-series CPU Units or with other
external devices.
You can select NJ, CJ, or User as the offset type for structure members. If you select NJ, the mem-
ory configuration that is optimum for the NJ/NX-series is automatically used. Refer to A-9 Variable
Memory Allocation Methods for details on the memory configuration of NJ/NX-series Controllers.
Refer to A-9-2 Important Case Examples for examples of tag data lings with CJ-series CPU Units.

6-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

The meanings of the offset type are as follows:

Offset type Meaning


NJ The memory configuration that is optimum for the NJ/NX-series Controllers is
automatically used and operating speed is maximized.
CJ The memory configuration for CJ-series PLCs is automatically used. This
allows you to use the same memory configuration as a CJ-series CPU Unit.
User You can set the memory offsets for each member. This allows you to use the
same memory configuration as external devices other than CJ-series CPU
Units.

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.

Sysmac Studio version


Unit version of CPU Unit
1.01 or lower 1.02 1.03 or higher
1.01 or later Not possible. Possible.* Possible.
1.00 Not possible. Not possible. Not possible.

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:

6-3-6 Derivative Data Types


Range of
Offset Meaning Unit
values
Byte offset The byte offset is the offset of a member from the start of the Byte *1
structure. Bytes offsets are used for all basic data types and
derivative data types.
Bit offset The bit offset is the offset of a member from the start of the byte Bit 0 to 63
position that is specified with the byte offset.
*1 For NX-series CPU Units, the range of values is 0 to 8191. For NJ-series CPU Units, the range of values is 0
to 1023.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-43


6 Programming

Example:
This example shows the memory configuration when the following settings are made with the Struc-
ture Editor.

Name Data type Offset type Byte offset Bit offset


StrA STRUCT User
VarA DINT 0 0
VarB INT 4 0
VarC DINT 6 0

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

Offsets That You Can Set


Even if you set the memory offset type to User, the offsets cannot be changed for some data types.
The following table shows when offsets can be set.

Classification Data type Byte offsets Bit offsets


Boolean BOOL Can be set. Can be set.
Bit strings BYTE, WORD, DWORD, LWORD Can be set. Fixed.
Integers SINT, INT, DINT, LINT, USINT, UINT, Can be set. Fixed.
UDINT, ULINT
Real numbers REAL, LREAL Can be set. Fixed.
Durations TIME Can be set. Fixed.
Dates DATE Can be set. Fixed.
Times of day TIME_OF_DAY Can be set. Fixed.
Dates and Times DATE_AND_TIME Can be set. Fixed.
Text strings STRING Can be set. Fixed.
Arrays Can be set. Can be set only for
BOOL elements.
Structures Can be set. Fixed.
Unions Can be set. Fixed.
Enumerations Can be set. Fixed.
POU instances Fixed. Fixed.

6-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Restrictions in Specifying Member Offsets


The following restrictions apply to setting member offsets. If you specify member offsets for a struc-
ture, the same restrictions apply to structures that are members of that structure.
• If you set the memory offset type to User for a structure, you must set offsets for all members of
the structure.
• You cannot set initial values for members of structures for which offsets are set. The default initial
value for each data type is used. Refer to When the Initial Value Specification Is Left Blank on
page 6-61.
• The memory size that is required for the structure is determined by the sizes of the members, the
alignment values of the data types, and the memory configuration.

Errors in Specifying Member Offsets


The following error can occur when setting member offsets.

Error name Meaning Offset type Correction


Offset Out of Range Error A value that is out of range was User Change the value of the
specified for an offset. offset to a suitable
value.
Offset Not Set Error There is a member for which User Set offsets for all mem-
the offsets are not set. bers.

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

 Instructions That Take a Structure as a Parameter

6-3-6 Derivative Data Types


Some instructions pass structure variables as parameters. To do so, specify the structure variable as
the input parameter.
Example: Passing a Member of a Structure Variable to the MOVE Instruction and Passing a Struc-
ture Variable to the MOVE Instruction

Data Type Table


Name Member Data type
RGB red UINT
green UINT
blue UINT
Variable Table
Variable name Data type
Color1 RGB

■Specifying Just One Member of a Structure


MOVE
EN ENO Transferring only the red member of the Color1 RGB structure to x.
Color1.red In Out x

■Specifying the Entire Structure


MOVE
EN ENO
Transferring all members of the Color1 RGB structure to x.
Color1 In Out x

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-45


6 Programming

Passing Values to System-defined Structure Input Variables for Certain


Instructions
Some instructions take a predefined structure variable as an input variable.
Example: The Port input variable for the Serial Communications Instructions (which specifies the tar-
get port) is a structure with a data type name of _sPORT. When you use one of these
instructions, follow the procedure provided below to create a user-defined structure vari-
able and specify that variable for the input parameter to the instruction.

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 vari-
ables, or a WORD variable.

 Expressing Unions and Union Members

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

Name Member Data type


My Union data WORD
bit ARRAY [0..15] OF BOOL

Variable Table

Variable name Data type


Output My Union

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.

Specifying the Union


The union represents all members that make up the union. Unions are expressed by the name of the
union variable. In the example above, you would write Output.

6-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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.

Data Type Definitions


Name Member Data type BoolData BoolData BoolData BoolData
[15] [8] [7] [0]
OUT16ACCESS BoolData ARRAY[0..15] of BOOL
ByteData ByteData
ByteData ARRAY[0..1] of BYTE
[1] [0]
WordData WORD
WordData
Variable name Data type
Output OUT16ACCESS

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 * * * * * * * * * * *

6-3-6 Derivative Data Types


ByteData Bit 04 of ByteData[1] is TRUE No change
WordData Bit 11 of WordData is TRUE

 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.

Data Types of Union Members

Classification Data type Usage


Boolean and bit strings Supported.
Basic data types BOOL and bit string data array specifications Supported.
Other basic data types Not supported.
Array specification for structures, unions, and Not supported.
Derivative data types
enumerations
POU instances Not supported.

 Restrictions
• The initial values for unions are always zero.
• You cannot move unions.
• You cannot specify unions for parameters to POUs.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-47


6 Programming

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 fol-
lows: 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

6-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Notation to Use an Enumerator as a Function Block or Function Parameter


There are the following two notations that you can use to specify an enumerator for a function or
function block parameter.
Enumerator Only
For a function or function block for which the parameter specifies an enumerator, you can just spec-
ify the enumerator.
Example: Passing an Enumerator to the BCDToBins_WORD Instruction

BinToBCDs_WORD
EN ENO
INT#1234 In BCDdata
_BCD1 Format

The Format input variable to the BinToBCDs_WORD is specified as an enumerator.


Therefore, it is necessary to specify only the enumerator.

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

The data type of the In input variable is not specified. 6


To pass an enumerator, use the Enumeration#Enumerator notation.

6-3-6 Derivative Data Types


Additional Information

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 instruc-
tion, the following notation can be used to pass the parameter to Format: _eBCD_FORMAT#
_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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-49


6 Programming

6-3-7 Array Specifications and Range Specifications for Data Types


You can specify the following attributes for variables with each data types.
• Array specifications
• Range specifications

Array Specifications (ARRAY[]OF)


Use an array specification for a data type that handles a group of data with the same attributes as a sin-
gle entity. You can use an array specification for the basic data types and derivative data types. Arrays
are useful when you want to handle multiple pieces of data together as you would, for example, coordi-
nate values for motion control.

 Expressing Arrays and Array Elements

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).

Specifying An Array (i.e., the Entire Array)


The array represents all elements that make up the array. Arrays are expressed by the name of the
array variable. In the above examples, the arrays are written as Mem and Data.

6-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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

Represents the data type of the array variable.

Represents the last number of the elements of the array.

Represents the first number of the elements of the array.


abc[0]
abc[1]
abc[2] Array

6-3 Variables
abc[3]
abc[4]

 Array Variable Specifications


Item Specification 6
Maximum number 65,535
of elements for an

6-3-7 Array Specifications and Range Specifications for Data Types


array variable
Element numbers 0 to 65535
The number for the first element in an array does not have to be 0.
Subscripts Constants: Integer value between 0 and 65535
Variables:
Classification Data type Usage
Integer SINT, INT, DINT, USINT, UINT, Supported.
or UDINT
LINT or ULINT Not sup-
Basic data type
ported.
Boolean, bit string, real, duration, date, time of Not sup-
day, date and time, or text string data ported.
Derivative data Structures, unions, and enumerations Not sup-
types ported.
Not sup-
POU instances
ported.
Arithmetic expressions: Arithmetic expressions can be specified only in ST.
Example: y:= x[a+b];
Maximum size of NX701-: 8 MB
one array variable NX1P2-: 1 MB
NJ501-: 4 MB
NJ301-: 2 MB
NJ101-: 2 MB

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-51


6 Programming

 Dimensions of Array Variables


You can regard the elements of a one-dimensional array as one-dimensional data lined up in a sin-
gle row. You can set two-dimensional and three-dimensional arrays in the same way. The array ele-
ments are expressed by adding the same number of subscripts to the array variable name as the
number of dimensions. Arrays can have a maximum of three dimensions.

Two-dimensional Array Specifications

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

Three-dimensional Array Specifications

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 )

 Arrays and Structures


You can set an array in which the elements are structures. You can also set a structure in which the
members are arrays.

Arrays with Structure Elements

Date Type Table Variables


abc[1].x
Data type Member Member
abc[1].y
Str x INT
y DINT
abc[4].x
Variable Table abc[4].y
Variable name Data type
abc ARRAY [1..4 ] OF Str

Structure with Array Members

Data Type Table Variables


abc[1].x[0]
Data type Member Data type
abc[1].x[1]
Str x ARRAY [0..1] OF INT
abc[1].y
y DINT
Variable Table abc[4].x[0]
Variable name Data type abc[4].x[1]
abc ARRAY [1..4 ] OF Str abc[4].y

6-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Instructions with an Array Parameter


Some instructions pass array variables as parameters. To do so, specify only the name of the array
variable as the input parameter.
Example: Passing a Single Array Element to the MOVE Instruction and Passing an Array to the
MOVE instruction
Specifying One Element in the Array
MOVE Variable Table
EN ENO
Variable name Data type
x[0] y[0] Moves INT variable x[0] to y[0]
In Out
x ARRAY [ 0 .. 199 ]OF INT
y ARRAY [ 0 .. 199 ]OF INT
Specifying the Array
MOVE
EN ENO
x In Out y Moves INT variable x[0..199] to y[0..199]

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

You cannot specify part of a multi-dimensional array as a parameter.

6-3 Variables
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
6
EN ENO
x[0,1] y[0,1]
In Out

6-3-7 Array Specifications and Range Specifications for Data Types


 Array Protection
The following errors occur if you attempt to access an element that exceeds the number of elements
in an array.

When the Subscript Is a Constant


An error is displayed when you input the variable or when you check the program on the Sysmac
Studio.

Variable Table MOVE


EN ENO
Variable name Data type
INT#255 In Out [11]
x ARRAY [1..10] OF INT

When the Subscript Is a Variable


When an output parameter is assigned to an output variable, the CPU Unit checks to see if the num-
ber of elements was exceeded after it executes the instruction. When a subscript variable exceeds
the range of the elements of the array variable, an instruction error occurs. Even if this error occurs,
the value of ENO will be TRUE because internal processing of the instruction ends normally.

Variable Table MOVE If the value of variable i exceeds 10,


EN ENO an instruction error occurs.
Variable name Data type
INT#255 In Out [i]
x ARRAY [1..10] OF INT

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-53


6 Programming

Range Specifications ((..))


Use the range specification to restrict the values of the following integer variables to specific ranges of
values.
Classification Data type
Integers SINT, INT, DINT, LINT, USINT, UINT, UDINT, and ULINT

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)

The end point of the range specification

The start point of the range specification

abc Range specification: Minimum 0 to maximum 100

 Specifications of Range Specifications


Item Specification
Data types that Integer type
you can specify

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
(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-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Precautions for Correct Use


Variables with range specifications are not checked for changes in variable values that result
from the execution of instructions in the user program. To check the range of values for a variable
that are set from execution of the user program, use instructions that perform range checks.

Variable Table
Variable name Data type
Variable x INT(10 .. 100)

ChkRange MOVE
EN EN ENO
Variable x
In Variable i In Out Variable x

Variable i
Val

You cannot perform any checks beforehand if you set data with arithmetic processing results. In
this case, check the range of values after arithmetic processing (e.g., ADD).

Variable Table

6-3 Variables
ADD Variable name Data type
EN ENO
Variable A INT(10 .. 100)
In1 Variable tmp

In2
6
ChkRange MOVE
EN EN ENO

6-3-7 Array Specifications and Range Specifications for Data Types


Variable tmp In Variable tmp In Out Variable A

Variable A Val

If the results of the arithmetic


processing are within the range, set
variable A to the value.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-55


6 Programming

6-3-8 Variable Attributes


This section describes the variable attributes other than the Data Type.

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-
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
If this attribute is not set, the variable is automatically assigned to an address in variable memory.

Precautions for Correct Use


You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

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
NJ501-: E0_0 to E18_32767
EM*2 NJ301-: E0_0 to E3_32767
NJ101-: E0_0 to E3_32767

*1 For the NX1P2-, the address is D0 to D15999.


*2 For the NX1P2-, the EM Area is not supported.

6-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

6-3 Variables
 Variables for Which You Can Set AT Specifications
AT specifications are made separately for each variable. Set them for all elements and members of
array, structure, and union variables.

 Attributes of Variables with AT Specifications 6


Specification Remarks

6-3-8 Variable Attributes


Name Supported.
Data Type Supported.
Supported. An error occurs if the setting of the Retain attribute does not
Retain agree with the attribute of the CJ-series Unit memory where the
address is assigned.
Supported. Set the initial value setting to None if you want to use the memory
Initial Value
value as it is.
Constant Supported. You cannot write to a constant with an instruction.
Network Publish Supported.
Not supported. (You can specify the Edge attribute only for function block input
Edge
variables.)

 Entering and Displaying AT Specifications


When you specify the AT Specification attribute, input the following in the Allocated Address Box of
the variable table in the Sysmac Studio. The following is displayed in the Allocated Address Box of
the variable table or the I/O Map.
Entries and displays in the AT
Type of variable Example
field.
User-defined variables with AT %[word_address] %D100
specifications to word addresses
User-defined variables with AT %[word_address].[bit_position] %W0.00
specifications to bit addresses

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-57


6 Programming

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*1 • 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
Boards*1
ber*2]/[I/O_port_name]
MC://_MC_AX[] MC://_MC_AX[1]
Axis Variables MC://_MC1_AX[]*3
MC://_MC2_AX[]*3
MC://_MC_GRP[] MC://_MC_GR[1]
Axes Group Variables MC://_MC1_GRP[]*3
MC://_MC1_GRP[]*3

*1 These system-defined variables are available only for the NX1P2 CPU Unit.
*2 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.
*3 These system-defined variables are available only for the NX701 CPU Unit.

Precautions for Correct Use

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

6-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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)

 Conditions Required to Enable the Retain Attribute


The CPU Unit must contain a Battery.

 Using Initial Values for Retain Variables


When you download the user program, select the Clear the present values of variables with Retain
attribute Check Box.

 Operation with and without the Retain Attribute


The following table shows when variable values are retained or not.
Values of variables

6-3 Variables
Case Retain attribute speci- Retain attribute not
fied specified
When power is turned ON after power interruption Retained. Not retained.
When the operating mode is changed
When a major fault level Controller error occurs
When the Clear the pres- 6
ent values of variables
When you download the with Retain attribute

6-3-8 Variable Attributes


user program Check Box is selected.
When the check box is Not retained.
not selected.

 Variables for Which You Can Specify the Retain Attribute


AT specifications are made separately for each variable. Set them for all elements and members of
array, structure, and union variables.

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 initial-
ize 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-59


6 Programming

 Types of Variables That Can Have Initial Values


You can set initial values for only some types of variables. A list is provided below.
Type of variable Initial Value
Global variables Supported.
Internal variables
Input variables
Output variables
Return values of functions Not supported.
In-out variables
External variables

 Enabling an Initial Value


You can specify whether a variable has an initial value when you create the variable.
Initial Value Specified
Initial value Initial value
Or
(Blank) 3.14

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
Basic data type variables aaa Supported.
Arrays bbb Supported.
Array variables
Elements bbb[2] Not supported.
Structures ddd Supported.
Structure variables
Members ddd.xxx Not supported.
Unions eee Not supported (initial values are always 0).
Union variables
Members eee.word Initial values are always 0.
Enumerated variables ccc Supported.
POU instances instance Not 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.

 When Initial Values Are Set


The initial value is assigned to the variable at the following times.
• When power is turned ON
• When the operating mode changes from PROGRAM to RUN mode or from RUN to PROGRAM
mode
• When you select the Clear the present value of variables with Retain attribute Check Box, and
download the user program
• When a major fault level Controller error occurs

6-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 When the Initial Value Specification Is Left Blank


The following initial values are used for variables for which the initial value specification is left blank.
Data type Default initial value
BOOL, BYTE, WORD, DWORD, 0
Boolean and bit strings
and LWORD
SINT, INT, DINT, LINT, USINT, 0
Integers
UINT, UDINT, and ULINT
Real numbers REAL and LREAL 0.0
TIME T#0S
Durations, dates, times of day, DATE D#1970-01-01
and dates and times TIME_OF_DAY TOD#00:00:00
DATE_AND_TIME DT#1970-01-01-00:00:00
Text strings STRING ‘ ‘(blank character)

 Initial Value of Array Variables


Data type Initial value specifications
• You can specify an initial value for each element.
Array specifications • To specify initial values, you must specify a value or leave the specification

6-3 Variables
blank for each element.

 Initial Values for Derivative Data Types


You do not specify an initial value for the data type itself. You set an initial value for each individual
variable.
Data type Initial value specifications
6
• You can specify an initial value for each member.

6-3-8 Variable Attributes


Structures • To specify initial values, you must specify a value or leave the specification
blank for each element.
Unions • Initial values cannot be specified. Always zero.
Enumerations • Initial values can be specified.

 Variables That Do Not Apply Initial Values


For the following variables, initial values are not applied when the power is turned ON, and the val-
ues before the power interruption are retained.
• Variables with Retain attribute
• Variables with AT specifications (retained areas or DM, Holding, or EM Area specifications only)

Precautions for Correct Use


If the CPU Unit has no Battery, the above variables are also initialized.

Constant
If you specify the Constant attribute, the value of the variable cannot be written by any instructions, ST
operators, or CIP message communications. Setting the Constant attribute will prevent any program
from overwriting the variable. The values of variables with a Constant attribute cannot be written from
instructions after the initial 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-61


6 Programming

 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

 Range for Constant Attribute Specification


The Constant attribute is specified separately for each variable. Set them for all elements and mem-
bers of array, structure, and union variables.

Additional Information

You cannot write to variables with the Constant attribute from the user program.

Network Publish
The Network Publish attribute allows a variable to be read/written from external devices (other Control-
lers, host computers, etc.) through CIP message communications or tag data links. If this attribute is not
set, you can read/write the variable from the Controller that declared the variable and external devices
(other Controllers, host computers, etc.) cannot read/write that variable.
Variables that have been published to the network are called network variables.

 Network Publish Specifications


There are three specifications for publishing variables to the network: Publish Only, Input, and Out-
put. The specifications are given in the following table.
Network Publish Specifications
Do not publish You cannot access a variable with this attribute from external devices. However,
Support Software can still access the variable regardless of this setting.
Publish Publish Only You can access a variable with this attribute from external devices through CIP
communications. Tag data links are not possible for variables with this attribute
setting.
Input You can access a variable with this attribute from external devices through CIP
communications or a tag data link. For tag data links, this will be a variable for
data input (from another CPU Unit to the local CPU Unit).
Output You can access a variable with this attribute from external devices through CIP
communications or a tag data link. For tag data links, this will be a variable for
data output (from the local CPU Unit to another CPU Unit).

 Ranges for Published to the Network


The Network publish attribute is specified separately for each variable. Set them for all elements and
members of array, structure, and union variables.

6-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

6-3 Variables
Change to TRUE
Other FALSE
TRUE to FALSE TRUE
Change to FALSE
Other FALSE
--- Changes according to the input
None
parameter value.
6

6-3-8 Variable Attributes

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-63


6 Programming

6-3-9 Changes to Variables for Status Changes


This section describes the changes to the values of variables for status changes of the CPU Unit.

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.
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-
ory used
for CJ-
series Units
Device variables for • If initial values are set, the variables change to the initial values.
EtherCAT slaves*2 • If initial values are not set (None), the variables change to 16#00.*1
Device variables for • If initial values are set, the variables change to the initial values.
Non-retain
NX Units*2 • If initial values are not set (None), the variables change to 16#00.*1
Device variables for • If initial values are set, the variables change to the initial values.
built-in I/O*2 • If initial values are not set (None), the variables change to 16#00.*1
Device variables for • If initial values are set, the variables change to the initial values.
Option Boards*2 • If initial values are not set (None), the variables change to 16#00.*1
• If initial values are set, the variables • If initial values are set, the variables
Device variables for change to the initial values. change to the initial values.
CJ-series Units*2 • If initial values are not set (None), the • If initial values are not set (None), the
variables change to 16#00.*1 previous value is retained.
CIO and Work Area 16#00 The previous values are retained.
addresses in the
memory used for CJ-
series Units*2*3

6-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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),

6-3 Variables
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- 6
change to the ini- ues of the memory
tial values. addresses in the AT
• If initial values are specifications.

6-3-9 Changes to Variables for Status Changes


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 variables
for CJ-series Units
are assigned to
setup data in the
Holding, DM, and EM DM Area, the ini-
Area addresses in the tial values that are
memory used for CJ- set for the vari-
series Units*2 ables 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-61.
*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-67 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.
*4 Refer to Retain Condition on page 6-69 for the retain conditions.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-65


6 Programming

The values of variables in the CPU Unit will change as shown in the following table when a major fault
level Controller error occurs, or during online editing.

During online editing


Retain attribute When a major fault level
Type of variable Variable added to a POU Variable in a POU for
of variable Controller error occurs
for online editing. online editing.
• If initial values are set, • If initial values are set, No change
the variables change to the variables change to
User-defined vari-
the initial values. the initial values.
ables and device vari-
ables • If initial values are not • If initial values are not
Non-retain set, the variables set, the variables
change to 16#00. change to 16#00.
CIO and Work mem- 16#00 No change
ory areas for CJ-
series Units
No change (retains value • If initial values are set,
before error). the variables change to
User-defined vari- the initial values.
ables and device vari-
• If initial values are not
ables
Retain set, the variables
change to 16#00.
Holding, DM, and EM No change
memory areas for CJ-
series Units
Forced refreshing Cleared. No change
Others
status

Precautions for Correct Use


You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

6-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Device Output Hold Configurations


You can set the operations when the operating mode changes or when downloading according to the
setting of the _DeviceOutHoldCfg (Device Output Hold Configuration) system-defined variable.

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).

Device output hold configuration


Status
Disable (other than 16#A5A5) Enable (16#A5A5)
When the operating mode Variables are initialized. Values of variables are retained.
is changed
When downloaded I/O refreshing is stopped and variables I/O refreshing is executed and values of
are initialized after downloading. variables are retained after downloading.

 Device Outputs for Hold Configurations


The following gives the device outputs for device output hold configuration.

6-3 Variables
• Device variables for EtherCAT slaves
• Device variables for NX Units
• Device variables for built-in I/O
• Device variables for Option Boards
• Device variables for CJ-series Units (operating data)
• CIO and Work Area addresses in the memory used for CJ-series Units
6

 Conditions To Retain Device Outputs When Downloading

6-3-9 Changes to Variables for Status Changes


There are restrictions on the changeable items as the conditions to retain device outputs when
downloading. The following table gives the items for which device outputs can be retained even if
items are changed.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-67


6 Programming

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.

1 Change the user program only and download it.

2 Select the slave in the EtherCAT Tab Page.

3 Click the Edit Backup Parameter Settings Button in the Slave Parameter Settings Area on the
right of the network configuration.

4 Click the Transfer to Slave Button in the Edit Backup Parameter Settings Tab Page.

5 Right-click a Unit in the CPU and Expansion Racks Tab Page and select Edit Unit Operation
Settings.

6 Click the Transfer to Unit Button for the Unit operation settings.

If you execute Transfer to Slave or Transfer to Unit, the slave or Unit is restarted after the data is
transferred. In this case, device outputs of the slave or Unit are not retained. However, device outputs
are retained for the slave or Unit that the data is not transferred.

 Related System-defined Variables


The system-defined variables that are related to the operation when system-defined variables are
used to back up data are shown below. Refer to A-6 Specifications for Individual System-defined
Variables for details on system-defined variables.

Variable Meaning Function Data type R/W


_DeviceOutHoldCfg Device Output Hold It is 16#A5A5 if you retain the target device output WORD RW
Configuration when the operating mode is changed or when
downloaded.
In the case other than 16#A5A5, the target device
output is initialized when the operating mode is
changed or when downloaded.
_DeviceOutHoldStatus Device Output Hold It is TRUE if the target device output is retained BOOL R
Status when the operating mode is 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 target device output is
initialized and changes to FALSE.

6-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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-69 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-72 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.

6-3 Variables
• The data type name and data type size are the same.
• The Retain attribute is set to retain the value of the variable.

6
Values of Retain Variables After New Creations or Changes of POU Names
When you download a project that you created with the Sysmac Studio to a Controller, the Controller

6-3-9 Changes to Variables for Status Changes


treats it with a POU name that is different from the POU name displayed on the Sysmac Studio. Even if
the POU name is the same as the one displayed on the Sysmac Studio, the Controller may treat it as a
different POU.

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.

 Before an Operation with the Sysmac Studio


A project, named Poject_A, which was created with the Sysmac Studio is downloaded to a Control-
ler. The Poject_A contains POU_A in which a local variable VarA is contained.
Assume the POU that is displayed as POU_A on the Sysmac Studio is treated as POU_XXX on the
Controller. Also, assume the present value of the local variable VarA on the Controller is changed to
20.

On the Sysmac Studio Download On the Controller


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-69


6 Programming

 After Changing a POU Name


The POU name and the present value of the local variable VarA do not change on the Controller
even after you change the POU name from POU_A to POU_B on the Sysmac Studio and download
it.

On the Sysmac Studio Download On the Controller


Project name: Project_A Project name: Project_A
POU name: POU_B POU name: POU_XXX
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 20

 After Creating a New POU


When you create a new POU, POU_C, for a local variable on the Sysmac Studio and download it,
the Controller treats it as a new POU, POU_YYY, and as a new local variable VarA.
Therefore, the value of the new local variable VarA is the initial value, 0.

On the Sysmac Studio Download On the Controller


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
Initial value of VarA: 0 Present value of VarA: 0

 After Copying a POU Name


When you copy a POU, POU_A, to create a POU_A_copy on the Sysmac Studio and download it,
the Controller treats it as a new POU, POU_ZZZ, and as a new local variable VarA.
Therefore, the value of the new local variable VarA is the initial value, 0.

On the Sysmac Studio Download On the Controller


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_A_copy POU name: POU_ZZZ
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 0

6-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 When Copying an Exported Project File


The POU name and the present value of the local variable VarA do not change on the Controller
even after you copy the Project_A to create the Project_A_copy on the Sysmac Studio and down-
load it.

On the Sysmac Studio Download On the Controller


Project name: Project_A_copy Project name: Project_A_copy
POU name: POU_A POU name: POU_XXX
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 20

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.

On the Sysmac Studio Download On the Controller

6-3 Variables
Project name: Project_A_copy Project name: Project_A_copy
POU name: POU_A POU name: POU_XXX
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 20
Variable name: VarB Variable name: VarB
Initial value of VarB: 0 Present value of VarB: 50
6

6-3-9 Changes to Variables for Status Changes


 When Adding a POU of the Same Name to Another Project
When you create Project_B which has a POU, POU_A, that is the same name as the POU in the
Project_A on the Sysmac Studio and download it, the Controller treats it as a new POU, POU_YYY,
and as a new local variable VarA. Therefore, the value of the new local variable VarA is the initial
value, 0.

On the Sysmac Studio Download On the Controller


Project name: Project_B Project name: Project_B
POU name: POU_A POU name: POU_YYY
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 0

 When Copying a POU from Another Project to Original Project


When you create Project_B on the Sysmac Studio, copy and past POU_A from the Project_A to Pro-
ject_B, and download it, the Controller treats it as a new POU, POU_YYY, and as a new local vari-
able VarA. Therefore, the value of the new local variable VarA is the initial value, 0.

On the Sysmac Studio Download On the Controller


Project name: Project_B Project name: Project_B
POU name: POU_A POU name: POU_YYY
Variable name: VarA Variable name: VarA
Initial value of VarA: 0 Present value of VarA: 0

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-71


6 Programming

Variable Values When Data Types of Retained Variables Are Changed


This section describes how the Controller treats the variable values when the data types of variables
with a Retain attribute are changed on the Sysmac Studio and the present values of variables with a
Retain attribute are restored, transferred, or downloaded.

 Operation and Variable Values


There are two patterns in the way how the variables with a Retain attribute are treated. The table
below shows the relationship between the operations and treatment patterns.

Treatment pattern of vari-


Operation
able value
• Restoring with Sysmac Studio Controller backups Pattern 1
• Restoring with SD Memory Card backups
• Automatic transfer from SD Memory Cards
• Program transfer from SD Memory Card
• Restoring with variable and memory backup functions on the Sysmac Stu- Pattern 2
dio
• 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-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Changes in Basic Data Types


Assume the variables before changes on the Sysmac Studio are defined as in below.

Variable name Data type AT specification


ABC INT ---
DEF INT %D100

Assume the Retain attribute of each variable is set to retain, and the following present values are
given.

Variable/memory Present value


ABC 10
DEF 20

Assume the following present values are given for the memory used for CJ-series Units, DM100 and
DM101.

Variable/memory Present value

6-3 Variables
D100 20
D101 50

The relationship between changes in the data types and how the controller treats the variables are
given below. 6
Change description Pattern 1 Pattern 2

6-3-9 Changes to Variables for Status Changes


No change The variable value is retained.
ABC = 10
DEF = 20
Changing the variable name The variable value will be the initial value.
from ABC to GHI GHI = Initial value
Changing the data type of the The variable value will be the initial value.
variable ABC from INT to ABC = Initial value
DINT
Changing the Retain attribute The variable value will be the initial value.*1
of the variable ABC to Non-
ABC = Initial value
retain
Changing the AT specifica- The variable value will be the value of the AT specification.
tion of the variable DEF from DEF = 50
D100 to D101
Deleting the AT specification The variable value will be the initial value.
of the variable DEF DEF = Initial value

*1 The variable value will be the initial value when the Retain attribute of the variable is changed from Non-
retain to Retain.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-73


6 Programming

 Changes in a Structure
Assume the structure before changes on the Sysmac Studio is defined as in below.

Data type of the


Data type name Member
member
STR_1 x INT
y INT

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.

Member Present value


ABC.x 100
ABC.y -200

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.

Change description Pattern 1 Pattern 2


No change The member value is retained.
ABC.x = 100
ABC.y = -200
Changing the variable name The member value will be the initial value.
from ABC to DEF DEF.x = Initial value
DEF.y = Initial value
Changing the member x to x1 The member value is retained. The value of the changed member
ABC.x1 = 100 will be the initial value.
ABC.y = -200 ABC.x1 = Initial value
ABC.y = -200
Changing the data type of the The member value is retained.
member x from INT to ABC.x = WORD#16#0064 (= 100)
WORD*1 ABC.y = -200
(Same data size)
Changing the data type of the The member value is retained. The absolute value and sign will change
member y from INT to UINT*1 because the changed member is directly assigned.
(Same data size. Changing ABC.x = 100
from signed to unsigned) ABC.y = 65336
Changing the data type of the The member value will be the initial The member value is retained. The sign
member y from INT to DINT*1 value. of the changed member is expanded
ABC.x = Initial value while the absolute value and sign do not
(Expanding data size)
change.
ABC.y = Initial value
ABC.x = 100
ABC.y = -200
Changing the data type of the The member value will be the initial The member value is retained. The sign
member y from INT to value. of the changed member is expanded
UDINT*1 ABC.x = Initial value and the absolute value and sign change.
(Expanding data size, and ABC.y = Initial value ABC.x = 100
changing from signed to ABC.y = 4294967096
unsigned)

6-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Change description Pattern 1 Pattern 2


Changing the data type of the The member value will be the initial The value of the member whose data
member y from INT to SINT*1 value. size is decreased will be the initial
ABC.x = Initial value value.
(Decreasing data size)
ABC.y = Initial value ABC.x = 100
ABC.y = Initial value
Changing the member x to y The member value is retained incor- The member value is retained.
and the member y to x rectly. ABC.y = -200
ABC.y = 100 ABC.x = 100
ABC.x = -200
Adding the member z of INT The member value will be the initial The value of the existing member is
after the member y value.* 2 retained. The value of the added
member will be the initial value.
ABC.x = Initial value
ABC.x = 100
ABC.y = Initial value
ABC.y = -200
ABC.z = Initial value
ABC.z = Initial value
Adding the member z of INT The member value will be the initial The value of the existing member is
between the member x and value.* 2 retained. The value of the added
the member y member will be the initial value.
ABC.x = Initial value
ABC.x = 100

6-3 Variables
ABC.z = Initial value
ABC.z = Initial value
ABC.y = Initial value
ABC.y = -200
Changing the number of array The member value will be the initial The value of the existing member is
elements for the member x value.* 2 retained. The value of the member
from 1 to 3 whose number of array elements was
ABC.x[0] = Initial value
changed will be retained from the 6
ABC.x[1] = Initial value top, and the value of the expanded
ABC.x[2] = Initial value member will be the initial value.
ABC.y = Initial value ABC.x[0] = 100

6-3-9 Changes to Variables for Status Changes


ABC.x[1] = Initial value
ABC.x[2] = Initial value
ABC.y = -200

*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-123 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-75


6 Programming

 Changes in a Union
Assume the union before changes on the Sysmac Studio is defined as in below.

Data type of the


Data type name Member
member
UNI_1 x WORD
y DWORD

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.

Member Present value


ABC WORD#16#0100

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.

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
Changing the data type of the The member value is retained.
member x from WORD to BYTE *1 ABC = WORD#16#0100
(Same data size as union)
Changing the data type of the The member value will be the initial The member value is retained.
member x from WORD to value. ABC = WORD#16#0100
LWORD*1 ABC = Initial value
(Expanding data size as union)
Changing the data type of the The member value will be the initial value.
member y from DWORD to ABC = Initial value
BYTE*1
(Decreasing data size as union)
Changing the member x to y and The member value is retained.
the member y to x ABC = WORD#16#0100
Adding the member z of BYTE The member value is retained.
after the member y ABC = WORD#16#0100
(Same data size as union)
Adding the member z of LWORD The member value will be the initial The member value is retained.
after the member y value. ABC = WORD#16#0100
(Expanding data size as union) ABC = Initial value
Adding the member z of BYTE The member value will be the initial value.
after the member y, and deleting ABC = Initial value
the member y.
(Decreasing data size as union)

*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-123 for details on
implicit casting.

6-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Changes in Array Variables


Assume the array variables before changes on the Sysmac Studio are defined as in below.

Variable name Data type


ABC ARRAY[1..3] OF INT

Assume the Retain attribute of the variable ABC is set to retain, and the elements have the following
present values.

Member Present value


ABC[1] 100
ABC[2] 200
ABC[3] 300

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 element value is retained.
ABC[1] = 100
ABC[2] = 200
ABC[3] = 300 6
Changing the variable name The element value will be the initial value.
from ABC to DEF

6-3-9 Changes to Variables for Status Changes


DEF[1] = Initial value
DEF[2] = Initial value
DEF[3] = Initial value
Changing the data type of the The element value will be the initial value.
element from INT to UINT*1 ABC[1] = Initial value
(Same data size) ABC[2] = Initial value
ABC[3] = Initial value
Changing the data type of the The element value will be the initial value.
element from INT to DINT*1 ABC[1] = Initial value
(Expanding data size) ABC[2] = Initial value
ABC[3] = Initial value
Changing the data type of the The element value will be the initial value.
element from INT to SINT*1 ABC[1] = Initial value
(Decreasing data size) ABC[2] = Initial value
ABC[3] = Initial value
Changing the last number of The element value will be the initial The values of the existing element
the array element from 3 to value. numbers are retained. The values of
4*2 ABC[1] = Initial value the new element numbers will be the
initial values.
(Expanding the number of ABC[2] = Initial value
elements from 3 to 4) ABC[1] = 100
ABC[3] = Initial value
ABC[2] = 200
ABC[4] = Initial value
ABC[3] = 300
ABC[4] = Initial value

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-77


6 Programming

Change description Pattern 1 Pattern 2


Changing the first number of The element value will be the initial The values of the existing element
the array element from 1 to value. numbers are retained. The values of
0*2 ABC[0] = Initial value the new element numbers will be the
initial values.
(Expanding the number of ABC[1] = Initial value
elements from 3 to 4) ABC[0] = Initial value
ABC[2] = Initial value
ABC[1] = 100
ABC[3] = Initial value
ABC[2] = 200
ABC[3] = 300
Changing the last number of The element value will be the initial The values of the existing element
the array element from 3 to value. numbers are retained.
2*2 ABC[1] = Initial value ABC[1] = 100
(Decreasing the number of ABC[2] = Initial value ABC[2] = 200
elements from 3 to 2)
Changing the first number of The element value will be the initial The values of the existing element
the array element from 1 to value. numbers are retained.
2*2 ABC[2] = Initial value ABC[2] = 200
(Decreasing the number of ABC[3] = Initial value ABC[3] = 300
elements from 3 to 2)
Changing the first number of If the number of elements is the The values of the existing element
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

*1 Implicit casting applies for changes in data types. Refer to Implicit Casts on page 6-123 for details on
implicit casting.
*2 The result will be the same for basic and derivative data types.
*3 If the number of elements is expanded or decreased, all values of the elements will be the initial values.

 Changes in an Enumeration
Assume the enumeration before changes on the Sysmac Studio are defined as in below.

Data type name Enumerator Value


ENU_1 x 1
y 2

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.

Member Present value


ABC 1 ( = x)

The relationship between changes in the data types and how the controller treats the variables are
given below.

6-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Change description Pattern 1 Pattern 2


No change The variable value is retained.
ABC = 1 ( = x)
Changing the variable name The variable value will be the initial value.
from ABC to DEF ABC = Initial value
Adding the enumerator z The variable value is retained.
whose value is 3 after the ABC = 1 ( = x)
enumerator y
Deleting the enumerator x The variable value is retained even if the enumerator does not exist.
ABC = 1
Changing the value of the The variable value is retained even after the enumerator value is changed.
enumerator x from 1 to 5 ABC = 1

6-3-10 Function Block Instances


Function block instances are added to and displayed in the local variable table as a data type.

6-3 Variables
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.
6

6-3-10 Function Block Instances


6-3-11 Monitoring Variable Values
You can monitor the value of variables from a Watch Tab Page on the Sysmac Studio.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-79


6 Programming

6-3-12 Restrictions on Variable Names and Other Program-related Names


The following is a list of restrictions on program-related names.

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
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
Device names • Any text string that consists of 127 bytes
an identifier and has a prefix or
Section names Case
postfix which contains more
than one extended empty space sensitive.
Axis names character (i.e., multi-byte spaces Not case
or any other empty Unicode sensitive.
Axes group names
space characters)
Cam table names

* 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-80 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Names That Must Be Unique


The following names must be unique. An error is detected during the program check if they are not.
• Global variable names in the same CPU Unit
• Variable names in the same POU
• Section names in the same POU
• Member names in the same union or structure
• Enumerators in the same enumeration
• Local variable names and global variable names
• POU names and data type names
• Data type names and variable names
• Enumerators of an enumeration and enumerators of another enumeration
• Enumerators and variable names

6-3 Variables
6

6-3-12 Restrictions on Variable Names and Other Program-related Names

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-81


6 Programming

6-4 Constants (Literals)


This section describes constants in detail.

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,

6-4-2 Notation for Different Data Types


This section gives the notation for constants with different data types. A building error will occur if you
use any other notation for a constant.

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#1 or BOOL#0 BOOL#TRUE, and 1.
BOOL#TRUE or BOOL#FALSE All of the following are equivalent: FALSE, BOOL#0,
BOOL#FALSE, and 0.
1 or 0*1
*1 Sysmac Studio version 1.03 or higher is required to use 1 and 0. A building error will occur if you use 1 or 0 on
Sysmac Studio version 1.02 or lower.

Bit Strings
You can use any of the following data type names for bit string data: BYTE, WORD, DWORD, and
LWORD. You can use any of the following bases: 2, 8, 10, and 16. The notations and notation examples
are given in the following table.

Notation Notation example


{data_type_name}#{base}#{numeric_value} WORD#16#0064

{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.

6-82 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

Notation Notation example


{data_type_name}#{base}#{numeric_value} INT#10#−1
{base}#{numeric_value}*1 10#−1
{data_type_name}#{numeric_value}*2 INT#−1
{numeric_value}*1, *2 −1
*1 Sysmac Studio version 1.03 or higher is required to omit the data type name. A building error will occur if you
omit the data type name on Sysmac Studio version 1.02 or lower.
*2 A base of 10 (i.e., a decimal number) is assumed.

Real Numbers

6-4 Constants (Literals)


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.

Notation Notation example


{data_type_name}#{base}#{numeric_value} LREAL#10#−3.14
{base}#{numeric_value}*1 10#−3.14
{data_type_name}#{numeric_value}*2 LREAL#−3.14
{numeric_value}*1, *2 −3.14
*1 Sysmac Studio version 1.03 or higher is required to omit the data type name. A building error will occur if you 6
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.

6-4-2 Notation for Different Data Types


Durations
You can use any of the following data type names for durations: TIME and T. The notations and notation
examples are given in the following table.

Notation Notation example


TIME#{day}d{hour}h{minutes}m{seconds}s{milliseconds}ms TIME#61m5s
T#{day}d{hour}h{minutes}m{seconds}s{milliseconds}ms T#61m5s

The following rules apply to duration data constants.


• It is not necessary to give all of the following: days, hours, minutes, seconds, and milliseconds. You
must give at least one of them.
• You can use decimal points, such as in TIME#12d3.5h.
• You can give times that exceed the valid time ranges. For example, T#-61m5s expresses the same
duration as T#-1h1m5s.
• All numeric values are interpreted as decimal values. A building error will occur if any number that is
not a decimal number is used.
• You can change the order of the duration units. For example, T#1h2d expresses the same duration as
T#2d1h.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-83


6 Programming

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.

Notation Notation example


DATE#{year}-{month}-{day} DATE#2010-1-10
D#{year}-{month}-{day} D#2010-1-10

The following rules apply to date data constants.


• You can add one or more zeroes to the beginning of the year, month, or day. For example,
DATE#2010-01-10 expresses the same date as D#2010-1-10.
• A building error will occur if a valid date range is exceeded. For example, D#2010-01-35 causes an
error.
• All numeric values are interpreted as decimal values. A building error will occur if any number that is
not a decimal number is used.

Times of Day
You can use any of the following data type names for time of day data: TIME_OF_DAY and TOD. The
notations and notation examples are given in the following table.

Notation Notation example


TIME_OF_DAY#{hour}:{minutes}:{seconds} TIME_OF_DAY#23:59:59.999999999

TOD#{hour}:{minutes}:{seconds} TOD#23:59:59.999999999

The following rules apply to time of day data constants.


• You can add one or more zeroes to the beginning of the hour, minutes, or seconds. For example,
TOD#23:01:01 expresses the same time of day as TOD#23:1:1.
• A building error will occur if a valid time range is exceeded. For example, TOD#24:00:00 causes an
error.
• All numeric values are interpreted as decimal values. A building error will occur if any number that is
not a decimal number is used.

Dates and Times


You can use any of the following data type names for date and time data: DATE_AND_TIME and DT.
The notations and notation examples are given in the following table.

Notation Notation example


DATE_AND_TIME#{year}-{month}-{day}:{hour}:{minutes}:{sec- DATE_AND_TIME#2010-10-10-23:59:59.123
onds}
DT#{year}-{month}-{day}:{hour}:{minutes}:{seconds} DT#2010-10-10-23:59:59.123

The following rules apply to date and time data constants.


• You can add one or more zeroes to the beginning of the year, month, day, hour, minutes, or seconds.
For example, DT#2010-01-10-23:01:01 expresses the same date and time as DT#2010-1-10-23:1:1.
• A building error will occur if a valid date and time range is exceeded. For example, DT#2010-01-35-
00:00:00 or DT#2010-01-30-24:00:00 causes an error.
• All numeric values are interpreted as decimal values. A building error will occur if any number that is
not a decimal number is used.

6-84 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

Notation Notation example


'{String}' 'This is a string'
STRING#'{String}'*1 STRING#'This is a string'
*1 Sysmac Studio version 1.08 or higher is required to use “STRING.”

The following rules apply to text string data constants.


• You can also specify a string with 0 characters. To do so, the notation is ’’.
• As in the following example, a building error will occur if you specify any strings that span across mul-
tiple lines.
strVar := 'ABC

6-4 Constants (Literals)


DEF'
• If you want to insert tabs, line break codes, or other special characters, you can use a dollar sign ($)
as an escape character before them. The escape character names and meanings are given in the fol-
lowing table.

Escape character Name Meaning


$$ Single-byte dollar Single-byte dollar sign ($: character code 0x24)
sign
$' Single-byte single Single-byte single quotation mark (': character code 0x27)
quotation mark 6
$" Single-byte double Single-byte double quotation mark (”: character code 0x22)
quotation mark

6-4-2 Notation for Different Data Types


$L or $l Line feed Moves the cursor to the next line.
LF control character (line feed: character code 0x0A)
$N or $n New line Moves the cursor to the next line.
NL control character (new line: character code 0x0A)
$P or $p Form feed Moves the cursor to the next page.
FF control character (form feed: character code 0x0C)
$R or $r Carriage return Moves the cursor to the start of the line.
CR control character (carriage return: character code 0x0D)
$T or $t Horizontal tab Indicates a tab.
Tab character (character code 0x09)
$(character_code) Direct character Specify the character code with two hexadecimal digits. The
code specification range of the character codes is 00 to FF.
For example, “$L” is the same as “$0A”.
For characters of two bytes or more, add $ for each byte.
• You can also directly designate character codes. To do so, add $ to the front of the character code.
Give the character code with two hexadecimal digits. For example, the character code for a line break
($L) is 0x0A, so $0A is given.
• If you designate the character codes directly for characters of two bytes or more, add $ for each byte.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-85


6 Programming

Enumerated Data Types


For enumerated data, the enumeration data type name and enumerator are given. The notations and
notation examples are given in the following table.

Notation Notation example


{enumeration_data_type_name}#{enumerator} _eDAYOFWEEK#_WED

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 enu-
merator as _eBCD_FORMAT#_BCD0 or omit the enumeration data type name and give only
_BCD0.

6-86 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-5 Programming Languages


This section describes the programming languages in detail. Refer to the Sysmac Studio Version 1
Operation Manual (Cat. No. W504) for details on entering programs with the Sysmac Studio.

6-5-1 Programming Languages


The languages used to express the algorithms in a POU (program, function, or function block) are
called the programming languages.
There are two different programming languages that you can use for an NJ/NX-series Controller: ladder
diagram language (LD) and ST (structured text) language.

6-5-2 Ladder Diagram Language

6-5 Programming Languages


The ladder diagram language (LD) is a graphical programming language that is written in a form that
appears similar to electrical circuits. Each object for processing, including functions and function blocks,
is represented as a diagram. Those objects are connected together with lines to build the algorithm.
Algorithms that are written in the ladder diagram language are called ladder diagrams.

General Structure of the Ladder Diagram Language


A ladder diagram consists of left and right bus bars, connecting lines, ladder diagram structure ele-
ments (e.g., inputs and outputs), functions, and function blocks.* 6
* Only Jump instructions and Label instructions are expressed with symbols that indicate the jumps and labels.
Algorithms are made of multiple rungs connected together. A rung is a connection of all configuration

6-5-1 Programming Languages


elements between the left bus bar and the right bus bar. A program rung consists of logic blocks that
begin with an LD/LD NOT instruction that indicates a logical start.

Function or function block


Input Connecting line Output
Left bus bar Right bus bar

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-87


6 Programming

 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 Manual (Cat.
No. W502).

 Output
Outputs are placed along the connecting line to receive the power flow and operate accordingly. An
output writes the TRUE or FALSE value to a variable. There are different types of outputs. For
detailed specifications on outputs, refer to the NJ/NX-series Instructions Reference Manual (Cat.
No. W502).

 Functions and Function Blocks


Functions and function blocks are placed along the connecting line to receive the power flow and
operate accordingly. For detailed instruction specifications, refer to the NJ/NX-series Instructions
Reference Manual (Cat. No. W502).

Order of Execution for Ladder Diagrams


Inputs, outputs, functions, and function blocks are executed when they receive the power flow. The
order of execution for a ladder diagram is from top to bottom. Elements at the same level are executed
from left to right.

Ladder Diagram Completion


A ladder diagram is executed in order from top to bottom. When the execution reaches the very bottom,
the process is completed. However, the process will also end if an END or RETURN instruction is
encountered at any point during the process. No processes after those instructions are executed.

Controlling Execution of Ladder Diagrams


Ladder diagrams are generally executed from top to bottom, but you can use execution control instruc-
tions to change the execution order. In the following example, when the value of program input a
changes to TRUE, execution will move to the point labeled ‘ExceptionProcessing.’

Input a

Label: ExceptionProcessing

Input b Input c

Label: ExceptionProcessing
Input d Input e

6-88 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Connecting Functions and Function Blocks in a Ladder Diagram


 Connection Configurations
You use the following two types of connections for functions or function blocks.
1) Power Flow Input and Output
In a ladder diagram, the line that connects an input variable of a function or function block and the
left bus bar indicates a BOOL input and the line that connects an output variable to the right bus bar
indicates a BOOL output.
Example:
Inputs are connected in the power flow that connects to the left bus bar. Outputs are connected in
the power flow that connects to the right bus bar.

6-5 Programming Languages


x1 FB y2

IN1 OUT1

x2 IN2 OUT2 y2

2) Parameter Inputs and Parameter Outputs


In a ladder diagram, parameter inputs and outputs are specified when the input and output variables
of a function or function block are not connected to the left and right bus bars. 6

6-5-2 Ladder Diagram Language


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.

 Number of BOOL Variables


At least one BOOL variable each is required for the input and the output (such as EN and ENO) of a
function or function block.
Example:

BOOL variable BOOL variable


MyFB
(BOOL) (BOOL)
IN Q
(INT)
Val_In

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-89


6 Programming

 Connections Based on the BOOL Variable Positions


The top BOOL variables are connected to the left and right bus bars. In other words, they become
the power flow input and power flow output.
Top BOOL
variable MyFB
(BOOL) (INT) Top BOOL variable
IN Val_Out
(INT) (BOOL)
Power flow Val_In Q

Power flow
There is only one power flow input and one power flow output for each function or function block. All
other BOOL variables that are not at the top are for parameter inputs and parameter outputs.

MyFB
(BOOL) (INT)
IN1 Val_Out
BOOL variable BOOL variable that is not
(INT) (BOOL)
that is not at the at the top
Val_In Q1
top
(BOOL) (BOOL)
a b
IN2 Q2
Parameter output
Parameter input
You cannot connect multiple BOOL variables to the left bus bar or the right bus bar as shown below.

RS
(BOOL) (BOOL)
NG Set Q1
(BOOL)
Reset1

MyFB
(BOOL) (INT)
IN Val_Out
(INT) (BOOL)
Val_In Q1
(BOOL)
NG
Q2

You do not have to connect an OUT instruction to the right bus bar. You can connect the function or
function block directly.

MyFB
(BOOL) (BOOL)
OK
IN Q
(INT)
Val_In

A LD instruction is not necessarily required. You can also connect directly to the left bus bar.

OK MyFB
(BOOL) (BOOL)
IN Q
(INT)
Val_In

6-90 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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)

6-5 Programming Languages


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

6
You can branch the power flow output.
Example:

6-5-2 Ladder Diagram Language


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-91


6 Programming

Restriction
• You cannot create closed loops or intersect connecting lines.
Example:

FB1 FB2
EN ENO EN ENO

IN1 OUT1 IN OUT

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.
NOT input

FB

(BOOL) (BOOL)
IN Q

TRUE→FALSE
FALSE→TRUE

Inline ST
 Introduction
Inline ST is a ladder diagram programming element in which you can write ST language code in a
box called an inline ST box (a blank text input area) within a ladder diagram. This allows you to eas-
ily code numeric data processing and text string processing within ladder diagrams. The connecting
line to an inline ST box becomes its execution condition. The ST code inside of the box is executed
based on that connecting line. Refer to the following figure.

Execution Condition for Inline ST Inline ST

Inline ST box

i1 i2
taiseki := 4.0 * 3.14 * radius *radius * radius / 3.0;

Enter the ST language code here.

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.

 Restrictions for Inline ST


You can write ST language code in inline ST boxes.

6-92 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Execution Conditions for Inline ST


The execution conditions for inline ST are shown in the following table.
Status Operation
TRUE execution condition Operation follows the execution condition. You can use the execution condi-
tion at any point in the power flow (e.g., you can connect the inline ST
directly to the left bus bar). To specify a change to TRUE or a change to
FALSE, specify it for an input in the execution condition.
FALSE execution condition Nothing is done.
Resetting in a master control Nothing is done.
region

 Scope of Variables in Inline ST


The scope of variables that you can access from inline ST is the same as the POU of the ladder dia-
gram that contains the inline ST.

6-5 Programming Languages


 Restrictions for Inline ST
Item Description
Number of inline ST boxes per rung 1

6-5-3 Structured Text Language


The ST (structured text) language is a high-level language code for industrial controls (mainly PLCs)
defined by the IEC 61131-3 standard. The standard control statements, operators, and functions make
the ST language ideal for mathematical processing that is difficult to write in ladder diagrams. The fea- 6
tures of ST are described below.
• Loop constructs and control constructs such as IF THEN ELSE are provided.

6-5-3 Structured Text Language


• You can write programs like high-level languages such as C, and you can include comments to make
the program easy to read.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-93


6 Programming

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:

Assignment Variables Operators Constant Return value of function


keyword
Comment

A:= B + 100 * ABC (10, 20) ; (*Assign A to B + 100 * ABC (10, 20)*)

Expression

Example of an IF Construct:

IF keyword IF keyword

IF D = E + 100 * DEF(10,20) THEN

Expression
G := H ; (*TRUE if D and E+100*DEF(10,20) are equal, otherwise FALSE*)

Statement IF keyword

END_IF ;

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.

6-94 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

• The two methods to insert comments are described below.


Comment notation Examples Remarks
Enclose the comment in sin- (* Commenting out multiple lines This type of comment can span over
gle-byte parenthesis and IF ErrCode = 3 THEN multiple lines. Comments cannot be
asterisks, for example, nested.
Value := 1000;
“(*This is a comment*)”.
END_IF;
down to here. *)
Begin the comment with two // Comment You can comment out only single
forward slashes (//) and end // A := SIN(X)^2; lines.
it with a carriage return.

 Spaces, Carriage Returns, and Tabs


• You can place any number of spaces, carriage returns, and tabs in your code at any location. This
allows you to add spaces or tabs before statements and carriage returns between operators/key-
words and expressions in order to make your code easier to read.

6-5 Programming Languages


• Always enter a token separator, such as a space, carriage return, or tab, between operators/key-
words and variables.
Example: The square boxes indicate where you must insert a token separator, such as a space,
carriage return, or tab.
IF  A>0  THEN  X:=10;
ELSE 
X:=0;
END_IF;

 Lowercase/Uppercase, Single-byte/double-byte Characters 6


• Operators, keywords, and variable names are not case sensitive.

6-5-3 Structured Text Language


• Operators, keywords, and variable names must always be in single-byte characters. A syntax
error will occur if you input double-byte characters.

 Variables and Prohibited Characters


Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names for restrictions
on variable names.

 Text Strings
Refer to 6-3-12 Restrictions on Variable Names and Other Program-related Names for restrictions
on text strings.

ST Keywords and Operators


 Statement Keywords
Keyword Meaning Example
:= Assignment d := 10;
Calling functions and FBname(para1 := 10, para2 := 20);
function blocks Refer to Function Block Calls on page 6-117.
RETURN Return
IF If IF d < e THEN f := 1;
ELSIF d = e THEN f :=2;
ELSE f := 3;
END_IF;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-95


6 Programming

Keyword Meaning Example


CASE Case CASE f OF
1: g :=11;
2: g :=12;
ELSE g :=0;
END_CASE;
FOR For FOR i: = 100 TO 1 BY -1 DO
Val[ i ] := i;
END_FOR;
WHILE While WHILE Val < MaxVal DO
Val := Val + 1;
END_WHILE;
REPEAT Repeat REPEAT
Val := Val + 1;
UNTIL( Val > 4 )
END_REPEAT;
EXIT Exit the loop. FOR i := 1 TO 100 DO
FOR j := 1 TO 10 DO
IF Val[ i, j ]>100 THEN EXIT;
END_IF;
END_FOR;
END_FOR;
; Empty statement Val[ i ] := i
; (* Empty statement *)

WHILE(Var <>0) DO
; (* Empty statement *)
END_WHILE;
(* Text *) Comments (* Commenting out multiple lines
IF MyFun (ErrorCode) = 3
THEN ReturnValue := GetDetail();
END_IF;
down to here. *)
//Text Comment A := SIN( X ) ^ 2 + COS ( Y ) ^2 + 10;
// A := SIN( X ) ^ 2 + COS ( Y ) ^2 + 5;

6-96 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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.

1. The operation in 2. The multiplication 3. The subtraction


parentheses (priority (priority of 5) is (priority of 6) is
of 1) is performed. performed. performed.

(1+2)−3*4 3−3*4 3−12 −9

Operation Operator Notation example and evaluated value Priority


Parentheses () (1+2)*(3+4) 1
Value: 21

6-5 Programming Languages


Function/function FUN1( FUN2( Var2A, Var2B), Var1B) 2
block call When function and function block calls are nested, the func-
tion or function block at the lower level is called first. In the
above example, FUN2 is executed first, and then FUN1 is
executed.
Sign +, − +100 3
−100
NOT NOT NOT TRUE
Value: FALSE
Exponent ** -2**2 4
Value: 4 6
A minus sign is given priority over an exponent operator.
Therefore, -2**2 in the above example is the same as (-

6-5-3 Structured Text Language


2)**2, so the value is 4.

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

17 MOD (−6)
Value: 5

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-97


6 Programming

Operation Operator Notation example and evaluated value Priority


Addition + 100+200 6
Value: 300
Subtraction − 100-200
Value: −100
Comparison <, >, <=, >= 100<200 7
If the comparison result is TRUE, the value is set to TRUE.
Otherwise, the value is set to FALSE. In the above exam-
ple, 100 is less than 200, so the value is TRUE.
Matches = 100=200 8
If the two values match, the value is set to TRUE. Other-
wise, the value is set to FALSE. In the above example, 100
does not equal 200, so the value is FALSE.
Does not match <> 100<>200
If the two values do not match, the value is set to TRUE.
Otherwise, the value is set to FALSE. In the above exam-
ple, 100 does not equal 200, so the value is TRUE.
Logical AND AND,& Applies 1-bit AND logic to all bits. 9
The results of 1-bit AND logic are as follows:
0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
1 AND 1 = 1

0101 AND 1100


Value: 0100
Logical exclusive XOR Applies 1-bit exclusive OR logic to all bits. 10
OR The results of 1-bit exclusive OR logic are as follows:
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0

0101 XOR 1100


Value: 1001
Logical OR OR Applies 1-bit OR logic to all bits. 11
The results of 1-bit OR logic are as follows:
0 OR 0 = 0
0 OR 1 = 1
1 OR 0 = 1
1 OR 1 = 1

0101 OR 1100
Value: 1101

Precautions for Correct Use


The intended operation may not occur if a function is nested under itself. Always separate the
functions into different statements as shown below.
Example of incorrect notation: out := MyFunc( In1:=x1, In2:=MyFunc( In1:=x2, In2:=x3 ) );
Example of correct notation: tmp := MyFunc( In1:=x2, In2:=x3 );
out := MyFunc( In1:=x1, In2:=tmp );

6-98 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Precautions for Correct Use


The order of priority for operators is sometimes different for different standards and manufactur-
ers. Special attention is necessary for the priority of exponent operators. We therefore recom-
mend that you use parentheses to ensure that calculations are performed in the intended order.
Example: For X:= -2**3**4; we recommend that you use the following expression:
X:= ((-2)**3)**4;.

Additional Information

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.

6-5 Programming Languages


 Data Types for Operator Operands
If all the operands for an operator have the same data type, any data type given as “Supported” in
the following table can be set as operands. However, if an operand with a different data type is set
for the operator, an implicit cast is required. Refer to Implicit Casts on page 6-123 for details on
implicit casting.
Argu- Compar- Posi-
Assign- Numeric Modulo- Equality Logic
ment Power ison tive/neg-
ment opera- division opera- opera-
setting operator opera- ative
operator tors operator tors tors
operator tors signs
Data type
+ <
NOT 6
AND
:= − <= = +
:= MOD ** &
=> * => <> −
OR

6-5-3 Structured Text Language


/ >
XOR
Boolean OK OK --- --- --- --- OK OK ---
Bit string OK OK --- --- --- --- OK OK ---
Integer OK OK OK OK OK*1 OK OK --- OK
Real number OK OK OK --- OK OK OK --- OK
Duration OK OK --- --- --- --- --- --- OK
Date OK OK --- --- --- --- --- --- ---
Time of day OK OK --- --- --- --- --- --- ---
Date and OK OK --- --- --- --- --- --- ---
time
Text string OK OK --- --- --- ---*2 ---*2 --- ---
Enumeration OK OK --- --- --- --- OK --- ---
Structure OK OK --- --- --- --- --- --- ---
parent
Array parent OK OK --- --- --- --- --- --- ---
OK: Possible
---: A building error will occur.

*1 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_** (Inte-
ger 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-99


6 Programming

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>;
<variable>:=<variable>;
<variable>:=<constant>;

Application:
Use this statement to assign a value to a variable. For example, use it to set initial values or to store
the results of a calculation.

Description:
This statement assigns (or stores) the <expression_value> to the <variable>.

Example:
Example 1: The following statement assigns the result of the expression X+1 to variable A.
A:=X+1;

Example 2: The following statement assigns the value of variable B to variable A.


A:=B;

Example 3: The following statement assigns a value of 10 to variable A.


A:=10;

Precautions:
• Either the source data type must match the destination data type, or the combination of data types
must allow implicit casting. A building error will occur if you do not use this notation.
• If the value that is assigned is STRING data, make the size of the destination STRING variable
larger than that of the source string. Otherwise, an error will occur.
• For STRING variables, assignment is allowed if the size of left-hand variable is greater than the
size of the text string stored in right-hand variable.
Example:
Assignment is allowed in the following case.
• Variable Table:
Variable
Data type Size
name
Var1 STRING 10
Var2 STRING 20
• User Program:
Var2 :='ABC';

6-100 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

6-5 Programming Languages


Inline ST
The POU that contains inline ST with a RETURN statement is ended.

Reserved Words:
RETURN

Statement Structure:

RETURN;

Application: 6
Use this statement to force the current program, function, or function block to end.

6-5-3 Structured Text Language


 IF with One Condition

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;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-101


6 Programming

Process Flow Diagram:

Condition FALSE
expression

TRUE

Statement 1 Statement 2

Application:
Use this construct to perform one of two processes depending on evaluation of a condition (condi-
tion expression).

Description:
If <condition_expression> is TRUE, <statement_1> is executed.
If <condition_expression> is FALSE, <statement_2> is executed.

Precautions:
• IF must always be used together with END_IF.
• Write a statement that evaluates to TRUE or FALSE (for example IF A>10) or a BOOL variable (for
example IF A) for the condition expression.
• You can write <statement_1> and <statement_2> on multiple lines. Separate statements with a
semicolon (;).
Example: Another IF Statement before <statement_1>

IF <condition_expression_1> THEN
IF <condition_expression_2> THEN
<statement_1>;
ELSE
<statement_2>;
END_IF;
END_IF;
Process Flow Diagram:

Condition FALSE
expression 1

TRUE

Condition FALSE
expression 2

TRUE

Statement 1 Statement 2

ELSE corresponds to the previous THEN statement, as shown above.


• You can execute more than one statement for both <statement_1> and <statement_2>. Separate
statements with a semicolon (;).

6-102 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

• 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

6-5 Programming Languages


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>0 AND B>1 THEN


6
X:=10;Y:=20;
ELSE

6-5-3 Structured Text Language


X:=0;Y:=0;
END_IF;
Example 3: A value of 10 is assigned to variable X when the BOOL variable A is TRUE. A value
of 0 is assigned to variable X when variable A is FALSE.

IF A THEN X:=10;
ELSE X:=0;
END_IF;

 IF with Multiple Conditions

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-103


6 Programming

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;

Process Flow Diagram:

Condition FALSE
expression 1

TRUE Condition FALSE


expression 2
Statement 1 Condition FALSE
TRUE
expression 3
Statement 2
TRUE

Statement 3
Statement m

6-104 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

6-5 Programming Languages


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.
6
Example:
A value of 10 is assigned to variable X when the statement A > 0 is TRUE.

6-5-3 Structured Text Language


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.

IF A>0 THEN X:=10;


ELSIF B=1 THEN X:=1;
ELSIF B=2 THEN X:=2;
ELSE X:=0;
END_IF;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-105


6 Programming

 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>;
·
·
·
<integer_expression_value_n>:<statement_n>;
ELSE<statement_m>;
END_CASE;

Process Flow Diagram:

Equal to Yes
value 1?

No

Yes
Equal to
value 2?

No

Yes
Equal to
value n?

No

Statement m Statement n Statement 2 Statement 1

6-106 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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 (;).

6-5 Programming Languages


• 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 6
X:=0; If none of the values is matched, a value of 0 is assigned to
the variable X.
END_CASE;

6-5-3 Structured Text Language


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;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-107


6 Programming

• Example for an Integer Expression

CASE (a1 + a2) OF


0:
X := 0;
1:
X := 1;
ELSE
X := 2;
END_CASE;
• Example of an Integer Enumeration Function Return Value

CASE FUN( ) OF
0: Branches depending on the return value of FUN( ).
X := 10;
1:
X := 11;
ELSE
X := 12;
END_CASE;

Data Types That You Can Use in CASE Constructs


Classification Data type <integer_expression>
Integers Supported.
Basic data types Boolean, bit string, real, duration, date, time Not supported.
of day, date and time, or text string data
Arrays Not supported.
Data type specifica-
Array specifications Supported for integers and enu-
tions Elements
merations only.
Structures Not supported.
Structures Supported for integers and enu-
Members
merations only.
Derivative data types Unions Not supported.
Unions Supported for integers and enu-
Members
merations only.
Enumerations Supported.

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

6-108 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Process Flow Diagram:

FOR variable = Initial value

TRUE
FOR variable >
end value?
Repeated
FALSE

Statement

FOR variable +
Increment/decrement value

6-5 Programming Languages


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: 6
A decision is made based on the evaluation of <initial_value>, <end_value>, and <increment/decre-
ment>.

6-5-3 Structured Text Language


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.

FOR i:=0 TO 100 DO


X[i]:=0;
END_FOR;
// Here, i is 101.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-109


6 Programming

• Do not write code that directly modifies the FOR variable inside the FOR construct. Unintended
operation may result.
Example:

FOR i:=0 TO 100 BY 1 DO


X[i]:=0;
i:=i+INT#5;
END_FOR;
• You can write any of the statements on multiple lines. Separate statements with a semicolon (;).
• You can omit BY<increment/decrement>. If it is omitted, the statement is executed with an incre-
ment value of 1.
• You can specify an integer (SINT, INT, DINT, LINT, USINT, UINT, UDINT, or ULINT) variable or
integer value for the <initial_value>,<end_value>, and <increment/decrement>. You can also
specify a function that returns an integer value.
Example 1: A value of 100 is assigned to array variable elements SP[n]. The FOR variable is
variable n, the initial value is 0, the end value is 50, and the increment is 5.

FOR n := 0 TO 50 BY 5 DO
SP[n] := 100;
END_FOR;

Example 2: The total of elements DATA[1] through DATA[50] of array variable elements DATA[n]
is calculated and the result is assigned to the variable SUM.

IF a THEN
FOR n := 0 TO 50 BY 1 DO
DATA[n]:= 1 ;
END_FOR;

FOR n := 0 TO 50 BY 1 DO
SUM:= SUM + DATA[n] ;
END_FOR;

a:=FALSE;
END_IF;

Example 3: The maximum and minimum values of elements DATA[1] through DATA[50] of array
variable elements DATA[n] are found. The maximum value is assigned to the MAX
variable, and the minimum value is 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;

6-110 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

• 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:

FOR i := 0 TO 100 BY 0 DO An infinite loop occurs and results in a Task


; Period Exceeded error.

6-5 Programming Languages


END_FOR;

• 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
6
<end_value> and <increment/decrement>.

6-5-3 Structured Text Language


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;

If an arithmetic expressions is specified for <end_value> or <increment/decrement> on the Sys-


mac Studio version 1.07 or lower, a building error will occur.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-111


6 Programming

Data Types That You Can Use in FOR Constructs


<FOR_variable>, <initial_value>,
Classification Data type <end_value>, and <increment
/decrement>*1
Boolean, bit string, real, duration, date, Not supported.
time of day, date and time, or text string
Basic data types
data
Integers Supported.
Arrays Not supported.
Data type specifica-
Array specifications Supported for integers and enumera-
tions Elements
tions only.*2
Structures Not supported.
Structures Supported for integers and enumera-
Members
tions only.*2
Derivative data types
Unions Not supported.
Unions
Members Not supported.
Enumerations Supported.*2
*1 You must use the same data type for the <FOR_variable>, <end_value> and <increment/decrement>. Other-
wise, an error occurs when the program is built on the Sysmac Studio.
*2 You cannot use enumerations for <FOR_variable>, <end_value> and <increment/decrement>.

 WHILE

Overview:
This construct repeatedly executes the specified statements as long as a condition expression is
TRUE.

Reserved Words:
WHILE, DO, END_WHILE

Construct Structure:
WHILE <condition_expression> DO
<statement>;
END_WHILE;

Process Flow Diagram:

Repeated
Condition FALSE
expression

TRUE

Statement

End

6-112 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

6-5 Programming Languages


• 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 condi-
tion 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. 6
A := 0;
WHILE A <= 1000 DO

6-5-3 Structured Text Language


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;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-113


6 Programming

 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>;
UNTIL <condition_expression>
END_REPEAT;

Process Flow Diagram:

Statement
Repeated

Condition FALSE
expression

TRUE

End

Application:
Use this type of repeat construct when you do not know how many times to repeat a process (i.e.,
when you do not know how many times based on the condition) and you want to repeat a process
for as long as a certain condition is met after processing. Use this type of repeat construct to deter-
mine repeat execution based on the result of the execution of a process (post-evaluation repeat con-
struct).

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 condi-
tion expressions instead of an actual expression.

6-114 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

6-5 Programming Languages


intVar := intVar + INT#1;
UNTIL intVar = INT#0
END_REPEAT;

6-5-3 Structured Text Language

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-115


6 Programming

 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

Construct Structure (e.g., in an IF Construct):


FOR (WHILE, REPEAT) <statement>
·
·
·
IF <condition_expression> THEN EXIT;
END_IF;
·
·
·
END_FOR (WHILE, REPEAT);

Application:
Use EXIT to end a repeating process before the end condition is met.

Description (e.g., in an IF Construct):


If the <condition_expression> is TRUE, the repeat construct (FOR construct, WHILE construct, or
REPEAT construct) is ended and all code inside the repeat construct after the EXIT statement is
ignored.
Note 1 You can also specify a BOOL variable instead of an expression for the condition expressions.
2 Even if the <condition_expression> is TRUE before <statement> is executed, <statement> is executed.

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;

6-116 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 Function Block Calls

Overview:
This statement calls a function block.

Reserved Words: None

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:

6-5 Programming Languages


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 6
A C

6-5-3 Structured Text Language


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-117


6 Programming

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

x2 B

• 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
Notation 1
ChangeFixToFloat(Execute:=Exe,Data32_1:=FixPointData1, Data32_2:=FixPointData2,
NoOfDigit_1:=FixPointPos1,
NoOfDigit_2:=FixPointPos2,OK=>Done,Double_1=>RealData1,
Double_2=>RealData2);

Notation 2
ChangeFixToFloat(Exe, FixPointData1, FixPointData2, FixPointPos1, FixPointPos2,
Done, RealData1, RealData2);
• Ladder Diagram Expression

ChangeFixToFloat
Exe ConvData32ToDouble Done
Execute OK

FixPointData1 Data32_1 Double_1 RealData1


FixPointData2 Data32_2 Double_2 RealData2
FixPointPos1 NoOfDigit_1
FixPointPos2 NoOfDigit_2

6-118 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

• Function Block Definition


Function block name: ConvData32ToDouble
Function Block 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 OK BOOL
Double_1 LREAL
Double_2 LREAL

• Program Variables
Variable name Data type Comments
ChangeFixToFloat ConvData32ToDouble Convert from fixed-point to

6-5 Programming Languages


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
6
RealData2 LREAL Floating-point data 2

6-5-3 Structured Text Language


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.

Variables for Notation pattern


POU type the called Omission
Parameters included Examples
POU
FB Given (notation All parameters given instance(x:=a,y:=b,z:=c); OK
method 1) More than one parameter given instance(x:=a,y:=b);
One parameter given instance(y:=b);
No parameters given instance(x:=); ---
Given (notation All parameters given instance(a,b,c); OK
method 2) All parameters not given instance();
Only the first parameter given instance(a); ---
One parameter given instance(a, , );
More than one parameter given instance(a,b);
OK: Possible (initial used), ---: A building error will occur.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-119


6 Programming

 Function Calls

Overview:
This statement calls a function.

Reserved Words: None

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:
IF (x0=TRUE) THEN
y1 := MyFUN(A:=x1, B:=x2, C=>y2);
END_IF;
• Ladder Diagram Expression

MyFUN
x0
EN ENO
x1 y1
A
x2 y2
B C

MyFUN: Function name


x0: Specifies whether to call the function.
A and B: Input variable names of the called function
x1 and x2: Input parameters of the called function
C: Output variable name of the called function
y1: Storage location for the return value from the called function
y2: Output parameters of the called function
• You can give the arguments in any order.
• You can omit the input variable names and input parameter names. If they are omitted, the input
variables are assigned their initial values.
• You can omit EN as well. If it is omitted, EN is assigned a value of TRUE.

6-120 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

MyFUN: Function name

6-5 Programming Languages


x0: Specifies whether to call the function.
A and B: Input variable names of the called function
x1 and x2: Input parameters of the called function
C: Output variable name of the called function
y1: Storage location for the return value from the called function
y2: Output parameters of the called function

• 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.
6
Example:
• Programming

6-5-3 Structured Text Language


• 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);

• Ladder Diagram Expression

P_On ConvData32ToDouble
EN

FixPointData1 Data32_1 Double_1 RealData1


FixPointData2 Data32_2 Double_2 RealData2
FixPointPos1 NoOfDigit_1
FixPointPos2 NoOfDigit_2

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-121


6 Programming

• 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
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
RealData LREAL Floating-point data 1
RealData LREAL Floating-point data 2

Application:
This statement calls a function.

Omitting Parameters
When you call a function, you can omit parameters that are not required. The following table shows
when you can omit parameters.

Variables for Notation pattern


Omis-
POU type the called
Parameters included Example sion
POU
FUN Given (notation All parameters given FUN(x:=a,y:=b,z:=c); OK
method 1) More than one parameter given FUN(x:=a,y:=b);
One parameter given FUN(y:=b);
No parameters given FUN(x:=); ---
Given (notation All parameters given FUN(a,b,c) OK
method 2) No parameters given FUN();
Only the first parameter given FUN(a); ---
One parameter given FUN(a, , );
More than one parameter given FUN(a,b);
OK: Possible (initial used), ---: A building error will occur.

6-122 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Precautions for the ST Language


Observe the following precautions when you use the ST language in the user program.

 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

6-5 Programming Languages


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
6
INT#1:
def:=INT#10;

6-5-3 Structured Text Language


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-123


6 Programming

Rank Data type


14 LWORD

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.

USINT UINT UDINT ULINT

SINT INT DINT LINT

REAL LREAL

When you assign the value, the sign and absolute value of the number do not change.

When you assign the value, the sign and absolute value of the number may change.
Example: intVar := -1; (* intVar := 16#FFFF *)
uintVar := 1;
uintVar := intVar; (* uintVar:= 16#FFFF, or −1 was
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
data types. For example, SINT->USINT->UINT->UDINT->ULINT are all connected, so you can write
an assignment such as ULINT:=SINT.

Precautions for Correct Use


Observe the following precautions when casting UDINT to ULINT data, DINT to LINT data, or
DINT to LREAL data.
All of these are casts from 32-bit data to 64-bit data. If the result of the calculation of the right
side of the assignment statement exceeds the range of 32-bit data, the correct value may not be
assigned.

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;

6-124 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Casting Rules in Expressions in Statements


The implicit cast rules for right-hand arithmetic expressions in assignment statements and for
assigning the value of the right-hand side to the left-hand side also apply to expressions in state-
ments.
Example:
CASE (A+B+C) OF
Result1:
to
ResultN:
to
END_CASE;

 Order of Execution of Functions


The order of execution of functions is not defined for functions in expressions. The order of execution
of functions depends on the unit version of the CPU Unit, the version of the Sysmac Studio, and the

6-5 Programming Languages


notation. Precaution is required in cases where the results of an expression may depend on the
order of execution of the functions, such as in the following cases.
• Expressions that contain more than one function that access the same global variable
• Expressions that contain a function and a variable whose value is changed by that function

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. There-
fore, it is possible that the functions are executed in the following order: FUN2, FUN3, and then
FUN1. 6
result := FUN1() + FUN2() * FUN3();

6-5-3 Structured Text Language


If all three of the functions in the above expression access and write the same global variable, the
value of the result variable may change depending on the order of execution of the functions.
To ensure that the three functions are always executed in the same order, the expression is broken
up. The following notation is used to execute the functions in the following order: FUN2, FUN3, and
then FUN1.
tmp2 := FUN2();
tmp3 := FUN3();
result := FUN1() + tmp2 * tmp3;

Expressions That Contain a Function and a Variable Whose Value Is Changed


by That Function
The following expression contains a function and a variable whose value is changed by that function.
result := varA + FUN4(out => varA);
In the above expression, the first element on the right side, variable varA, is not necessarily evalu-
ated before FUN4 is executed. Therefore, the value of the result variable may change depending on
the order of varA evaluation and FUN4 execution.
To ensure that varA evaluation and FUN4 execution always occur in the same order, the expression
is broken up. The following notation is used to evaluate varA first and then execute FUN4.
tmp := varA;
result := tmp + FUN4(out => varA);
The following notation is used to execute FUN4 first and then evaluate varA.
tmp := FUN4(out => varA);
result := varA + tmp;

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-125


6 Programming

 Calculation Precision of Expressions with Constants without Data Type


Specifications
The calculation precision of an expression that contains a constant without a data type specification
is automatically determined by the data types of the variables and constants that are given in the
expression and destination.

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.

Expression Calculation Precision


The calculation precision of an expression is either 32-bit integer, 64-bit integer, or long real preci-
sion depending of the data types of the variables and constants given in the expression and destina-
tion. The following rules apply to the calculation precision of an expression.

START

Real number constant or Yes


variable in expression or
destination?

No

Constant or variable greater Yes


than 32 bits in expression or
destination?

No

Calculation Calculation Calculation


performed with performed with performed
32-bit integer 64-bit integer with long real
precision. precision. precision.

END

6-126 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Example: realv := 2 + 3 * 4; // The data type of the realv variable is REAL.


The realv variable is a real number, so the calculation is performed with long real precision. The
calculation result is 14.0.

realv := 2 + 3.0 * 4; // The data type of the realv variable is REAL.


The 3.0 constant and the realv variable are real numbers, so the calculation is performed with
long real precision. The calculation result is 14.0.

lintv := 2 + 3 * 4; // The data type of the lintv variable is LINT.


There is no constant or variable that is a real number, but the lintv variable exceeds 32 bits, so
the calculation is performed with 64-bit integer precision. The calculation result is 14.

intv := 2 + 3 * 4; // The data type of the intv variable is INT.


There is no constant or variable that is a real number and there is no constant that exceeds 32
bits, so the calculation is performed with 32-bit integer precision. The calculation result is 14.

6-5 Programming Languages


However, the calculation precision of division is determined only by the divisor and dividend. The
rules for determining the calculation precision are the same as those in the previous flowchart.

Example: realv := 2 / 3 * 4; // The data type of the realv variable is REAL.


Dividing 2 by 3 does not include an integer that exceeds 32 bits for the divisor or dividend, so the
calculation is performed with 32-bit integer precision. The calculation result is 0.
In the next step, the realv variable is a real number, so the calculation of 0 * 4 is performed with
long real precision. The calculation result is 0.0.

Precautions for Correct Use


6
The calculation precision of an expression that contains a constant without a data type specifica-
tion is automatically determined by the notation of the constant and the data types of the vari-

6-5-3 Structured Text Language


ables that are given in the expression. Therefore, calculations may be performed with unintended
precision. We recommend that you specify the data type for real numbers, such as REAL#1.0.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-127


6 Programming

Differences between ST and Ladder Diagrams


The differences between ST and ladder diagrams are described below.

Item Ladder diagram ST (including inline ST)


Input differ-  Change to TRUE  Change to TRUE
entiation • Method 1
• Method 1
start do
R_TRIG_instance (Clk:=start, Q=>do);
----|↑|----------- * R_TRIG_instance is an instance of the
R_TRIG instruction.
• Method 2
R_TRIG_instance
R_TRIG

start Clk Q do

• Method 3
Up

start In do

 Change to FALSE  Change to FALSE


• Method 1
• Method 1
start do
F_TRIG_instance (Clk:=start, Q=>do);
----|↓|----------- * F_TRIG_instance is an instance of the
F_TRIG instruction.
• Method 2
F_TRIG_instance
F_TRIG

start Clk Q do

• Method 3
Down

start In do

Instruction  Upward Differentiation  Upward Differentiation


differentia- There is no equivalent in ST. You must create it
tion start @Inst in logic.
Example:
• Method 1
R_TRIG_instance (Clk:=start, Q=>do);
IF (do = TRUE) THEN Inst();
END_IF;
• Method 2
IF (start = TRUE) THEN
IF (pre_start = FALSE) THEN Inst();
END_IF;
END_IF;
pre_start:=start;// Update previous value.

6-128 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Item Ladder diagram ST (including inline ST)


Instructions With the TON instruction, multiple cycles are You must declare two instances, one for
that last required from the start of instruction execution execution and one to reset, as shown below.
multiple to the end and the instruction is reset when the IF (start = TRUE) THEN
task periods power flow is FALSE. Therefore, you need to TON_instance(In:=TRUE, omitted);
declare only one instance to both execute the // Start timer.
instruction and reset it.
ELSE
TON_instance(In:=FALSE, omitted);
TON_instance
// Reset timer.
start TON END_IF;
In Q
PT ET

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-

6-5 Programming Languages


sal Func
emergency
specifica- IF (NOT emergency) THEN
tions EN ENO
Func();
END_IF;

Multi-stage IF(start=TRUE) THEN


connections start Func1 Func2( in := Func1());
EN ENO
tmp END_IF;

Func2
EN ENO
6
tmp in

6-5-3 Structured Text Language


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

Program You can create sections. You cannot create sections.


divisions

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-129


6 Programming

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.

Ladder diagram structure elements (inputs and outputs)

FB instructions

Instructions

FUN instructions

ST language statements

Programs, user-defined functions, and user-defined function blocks consist of these instructions.

6-6-2 Basic Understanding of Instructions


The fundamental specifications of the instructions follow the specifications of functions and function
blocks.
This section describes specifications that are unique to instructions.

Ladder Diagram Structure Elements (Inputs and Outputs)


 Locations
Instructions for ladder diagram inputs and outputs have certain positions where they can be placed,
as shown below.

Classification Locations Diagram


Input Logical start Connected directly to the left bus bar
instructions or is at the beginning of an instruction
block.

Intermediate Between a logical start and the output


instructions instruction.

Output instructions Connected directly to the right bus


bar.

6-130 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

 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.

Change to The instruction reads input status, makes


TRUE (↑) Variable A comparisons, tests bits, or performs other
types of processing every task period
and outputs the power flow when result
Variable A changes from FALSE to TRUE.

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

Change to The instruction reads input status or per-


FALSE (↓) Variable A forms other types of processing every
task period and outputs the power flow
when result changes from TRUE to
Variable A
FALSE. The output power flow changes
Output to FALSE in the next task period (after it
is TRUE for one task period).

6-6 Instructions
1 task period 1 task period
Time Chart

Function Block Instructions


 Execution Conditions
6
The operation of the execution condition for an FB instruction depends on the instruction.
A specific input variable for the execution condition is defined for each instruction.

6-6-2 Basic Understanding of Instructions


Examples: Execute specifies a change to TRUE or a change to FALSE in the execution condition.
Enable causes the instruction to be executed each task period according to the current
execution condition.
Function block instructions are unconditionally executed for as long as the POU that called them is
executed.

 Instruction Options
Instruction options cannot be specified.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-131


6 Programming

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.

Instruction Options Symbol


Differentiation Change to @ This option creates an upwardly differentiated instruc-
option TRUE tion.
The instruction is executed only once when EN
changes to TRUE.
To add an instruction option, add one of the option symbols listed in the table above before the
instruction.
Example:

@ MAX
EN ENO
In1
In2

Information That Applies to Both FB Instructions and FUN


Instructions
 Condition Flags
System-defined variables that are assigned values that represent the result of instruction processing
are called Condition Flags. The only Condition Flag for an NJ/NX-series Controller is the Carry Flag
(P_CY).
The Carry Flag serves the following purposes.
• It shows whether the result of processing an instruction exceeds the range that can be expressed
by the data type of the output variable.
• It shows whether an overflow occurred in a bit shift instruction for bit string data. For details, refer
to the NJ/NX-series Instructions Reference Manual (Cat. No. W502).

6-132 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-6-3 Instruction Errors


Instruction errors refer to the errors that occur when an instruction is executed. This section describes
when an instruction error occurs, which error is detected as an instruction error, and what operation fol-
low an instruction error, etc.

Timing When Instruction Errors Occur


The timing when instruction errors occur can be divided into the following three cases. Detectable
errors and operations following to the errors differ by the timing when instruction errors occur.
• When the values of input parameters or in-out parameters are checked before instruction execution.
• When internal processing is performed during instruction execution.
• When the values of output parameters are checked after instruction execution.

Errors Detected As Instruction Errors


The followings are the errors detected as instruction errors. Different errors are detected depending on
the timing when instruction errors occur.

6-6 Instructions
 Errors detected before or after instruction execution
The followings are the errors detected before or after instruction execution.
• Reading or writing an array variable from or to an element beyond the array range.
• Assigning a string that is longer than the defined byte length to a STRING variable.
• Assigning a string that does not end with a NULL character to a STRING variable. 6
• Dividing an integer variable by 0.

6-6-3 Instruction Errors


 Errors detected during instruction execution
Errors detected during instruction execution differ by instruction. For details on errors detected in
each instruction, refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502).

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-133


6 Programming

Operation for Instruction Errors


The operation for the following elements differ depending on whether an instruction error occurs or not:
output variable ENO, output variable Error, output variable ErrorID, system-defined variable P_PRGER,
and events. The details on the operations are described below.

 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.

Value when an instruction error occurs


Output Data Before During After
Meaning
variable type instruction instruction instruction
execution*1 execution execution*2
ENO BOOL TRUE : Normal end FALSE FALSE TRUE
FALSE : Error end, Execution in prog-
ress, or Not executed
Error BOOL TRUE : Error End FALSE TRUE FALSE
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-
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
instruction execution.

 System-defined variable P_PRGER


The system-defined variable P_PRGER is a flag that indicates the occurrence of an instruction error.
If an instruction error occurs, the value will change to TRUE regardless of when the error occurred.
When the instruction ends normally, the value will be retained.
For the details on P_PRGER, refer to Instruction Error Flag on page 6-137.

 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-138.

Version Information
A CPU Unit with unit version 1.02 is required to create events for instruction errors.

6-134 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Output Parameters in Ladder Diagrams


The following table shows the values of output parameters when an instruction, user-defined function,
or user-defined function block that is created in a ladder diagram ends normally or has an instruction
error.

Condition Type of output parameter Value of output parameter


Normal end Power flow output Values are updated according to the
BOOL parameter output internal algorithm.
Parameter output other than BOOL
Instruction error Power flow output Set to FALSE.
BOOL parameter output The previous values are retained.
Parameter output other than BOOL

6-6 Instructions
6

6-6-3 Instruction Errors

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-135


6 Programming

Operation When a Syntax Error Occurs in a POU Written in ST


 Errors in Assignment Statements
When an error occurs in an assignment statement written in ST, that line is not executed.

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.

 Errors in IF Constructs
If a syntax error occurs in ST, perform error processing for the syntax error.
When the value of (c+d), below, is zero, the lines between the IF and END_IF are not executed.

POU"AA"
5 IF a = b / (c + d) THEN
6 x := 1;
7 ELSE
8 x := 2;
9 END_IF;
10 y := 10;
: : The user must include a safety
IF P_PRGER = TRUE THEN processing for possible errors.
x:= initial_value; (*Processing when an error occurs*)
y:= initial_value;
END_IF;

 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.

 Operation for Structure Errors


The P_PRGER Flag changes TRUE and the following occurs.

Syntax Error location Operation


Assignment The line is not executed.
statement

6-136 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Syntax Error location Operation


IF condition No statements between IF and END_IF are executed.
expression
CASE condition No statements between CASE and END_CASE are executed.
expression
Control con- FOR condition No statements between FOR and END_FOR are executed.
structs expression
WHILE condition No statements between WHILE and END_WHILE are executed.
expression
REPEAT condi- No statements between REPEAT and END_REPEAT are executed.
tion expression

Instruction Error Flag


When an instruction error occurs in a ladder algorithm or when a syntax/function error occurs in an ST
algorithm, the P_PRGER (Instruction Error Flag) system-defined variable changes to TRUE. The
P_PRGER flag is a local variable for the program. This flag changes to TRUE when an instruction error
occurs in the program, and remains TRUE during the next task period.

Read
Variable Data
Meaning Function Range of values Initial value /writ
name type

6-6 Instructions
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 6
changes to TRUE, it remains TRUE until the operating mode is changed or the flag is overwritten by a
program.

6-6-3 Instruction Errors


Example:

User Program

P_PRGER
Initial process
R

If the flag is ON, you


Algorithm (instructions) know that the
Normal process #1
instruction error has
to be inside this
range.
P_PRGER
Error processing
Normal process #2 for normal
process #1 Example: Initial values
set for variables

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-137


6 Programming

Events for Instruction Errors


When an instruction error occurs, an event is created for it. Refer to 8-7 Event Logs for the procedure to
check events. For information on the events that are created, refer to the NJ/NX-series Instructions Ref-
erence Manual (Cat. No. W502).

Precautions for Correct Use


• To create events for instruction errors, you must select Use for Event Log Settings − Instruction
Error Output on the Sysmac Studio. Refer to 4-2-2 Controller Setup and to the Sysmac Studio
Version 1 Operation Manual (Cat. No. W504-E1-04 or later) for information on the Controller
Setup.
• If you change the user program after an instruction error occurs, the information in the event
log may no longer be correct.
• If an instruction with an error is executed repeatedly, an instruction error or event is created
each time the instruction is executed. This may cause the event log to exceed the maximum
number of events. If this occurs, older events are overwritten.

Version Information
• A CPU Unit with unit version 1.02 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

• 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 instruc-
tions, refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No.
W508).
• Events for motion control instruction are created even if you select Do not use for Event Log
Settings − Instruction Error Output in the Controller Setup on the Sysmac Studio.

6-138 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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.

6-7 Namespaces
Features of Namespaces
Namespaces provide the following features.

 Preventing Duplicated Names 6


As long as different namespaces are used, you can use the same name for a function block or other
entity more than once. For example, assume that several systems must be programmed, and that a

6-7-1 Namespaces
different programmer will program each of them. Here, it would be likely that the same names would
be used for different function block definitions or other entities. If you did not use namespaces, you
would have to create naming rules to prevent the duplication of names. However, if you set a differ-
ent namespace for each system, programming would be possible without worrying about duplicating
names with other systems.

Not Using Namespaces Using Namespaces


Programmer for Programmer for
system A system B Programmer for Programmer for
system A system B
Namespace: None Namespace: None
Namespace: System_A Namespace: System_B
FB: Read_recipe FB: Read_recipe
FB: Read_recipe FB: Read_recipe

FB: System_A_Read_recipe FB: System_B_Read_recipe


The same names can be used.
All names must be unique, so naming rules must be followed.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-139


6 Programming

6-7-2 Namespace Specifications


This section describes what namespaces can be used for, namespace notation, and namespace decla-
rations.

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,
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

 Fully Qualified Names and Short Names


The fully qualified name of an entity is the name that includes the name of the namespace. The
short name of an entity is the name that does not include the name of the namespace.
In the algorithm in a POU definition, you can use the short name of any POU definition that has the
same namespace as the POU definition of the algorithm.
Example:
System_A\Read_recipe

Name of Short name


namespace
Fully qualified name

 Restrictions on Namespace Notation


• You can use the same characters as you can for variable names. For details, refer to 6-3-12
Restrictions on Variable Names and Other Program-related Names.
• The following table gives the limits to the number of characters in the names of namespaces.

Character
Name Maximum size
encoding
Names of name- 93 bytes UTF-8
spaces
Short names 127 bytes

6-140 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Precautions for Correct Use


• An error will occur when you build the program if the short name of a variable is also used in
the name of the namespace.
System_A\Process_A\Read_recipe\Process_A

Not The short name is used in the name of the namespace.


allowed.

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 Process_A is in
the same namespace.
POU Definitions

6-7 Namespaces
System_A\Read_recipe\Process_A

System_A\Read_recipe\Process_B

Notation in the Algorithm of the


System_A\Read_recipe\Process_B Function Block Definition

Process_A 6

6-7-2 Namespace Specifications


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-141


6 Programming

 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.

Namespace Entity Short name


System_A Function block definition Lifter
System_B Function block definition Read_recipe
System_C Function block definition Calculate_upper_limit

The following notation is used in the namespace


declaration for the Lifter function block definition.
System_C

Notation for the Algorithm of the Lifter Function Block


Definition
• When Namespace Is Not Declared
The System_B namespace of the Read_recipe function
block definition is not declared, so you must give the fully
qualified name.
\\System_B\Read_recipe

• When Namespace Is Declared


The System_C namespace of the Calculate_upper_limit
function block definition is declared, so you can give the
short name.

Calculate_upper_limit

 Restrictions of Declarations
• You can use short names only in the algorithm of a POU definition.

6-142 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

Precautions for Correct Use


• An error is detected during the program check in the following cases.
• If a namespace that does not exist is declared
• If you declare more than one namespace for one POU definition, and a POU definition, data
type, or other entity with the same name exists in two or more namespaces
• An error will occur when you build the program if the same name is used as follows for different
POU definitions or data types.
• If the same name is used for the namespace of a POU definition and at a higher level in the
namespace
• If the same name is used in a declared namespace
• If the same name is used without a namespace

Namespace Entity Short name


Not
System_A\Lifter Function block definition Process_A allowed. The name is used in the namespace of the POU definition.
System_A Function block definition Process_A Not
allowed.
The name is used at a higher level than the namespace
of the POU definition.
System_B Function block definition Process_B
Not
Process_A allowed. The name is used in a declared namespace.

6-7 Namespaces
Not
None Function block definition Process_A allowed. The name is used without a namespace.

The following notation is used in the namespace


declaration for the Process_A function block definition.
System_B

6
Additional Information

You cannot set a namespace for a program name. However, you can declare namespaces for

6-7-3 Procedure for Using Namespaces


objects that are used in the algorithm of the program.

6-7-3 Procedure for Using Namespaces


Use the Sysmac Studio to set the namespaces and then declare them. Perform steps 1 and 2 when you
create data types or when you create function definitions, function block definitions, or other objects.
Declare a namespace with step 3 to use an object for which a namespace is set.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-143


6 Programming

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.

6-8-1 Introduction to Libraries


A library contains POU definitions and data types in a form that allows you to reuse them as objects in
programming. The objects in a library are called library objects.
The NJ/NX-series CPU Units allow you to create and use libraries.

The following figure illustrates the use of library objects. Here, program A uses FUN:A1 and FB:B1 from
the objects in the library, and program B uses Type:C1 and FB:B1.

Library
Sysmac Studio
Library objects

Create library. FUN:A1 FB:B1

FUN:A2 FB:B2

Type:C1 FB:B3

Type:C2

Reuse objects.

FUN:A1 Type:C1

FB:B1 FB:B1

Program A Program B

6-144 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-8-2 Specifications of Libraries


This section describes the library settings and synchronization.

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.

6-8 Libraries
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.
6

6-8-2 Specifications of Libraries


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.

 Selecting Library Objects


You can select the objects to include in a library.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-145


6 Programming

6-8-3 Library Object Specifications


This section describes the library objects that can be created and the settings for the library objects.

Applicable Library Objects


You can handle the following entities as library objects.

Library objects Details


POU definitions Functions and function blocks
Data types* Structure data types, union data types, and enumeration
data types

* Data types are always included in the library object selections on the Sysmac Studio.

Library Object Settings


You can set the following for each library object.

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.
Update date* The date that the object library was last updated.
Comment A comment on the library object. (optional)

* These items can be set only for functions and function blocks. They are set in the POU definition properties on
the Sysmac Studio.

6-146 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

6-8-4 Procedure to Use Libraries


Use the following procedures to create and use libraries.

Procedure to Create Libraries


Create a project to use as the library. Use the following procedure to create and save a library.

1 Create a library project.


When you create the project, select a library project as the project type in the Project Window.

2 Create library objects.


In the library project, create the required POU definitions and data types, and then check them
to make sure that they operate correctly.

3 Set the properties of the library.


Set the properties of the library project, including selecting the library objects, hiding/displaying
source code, and attached files.

4 Save the project as a library file.

6-8 Libraries
Save the project in a library file in the Create Library File Dialog Box.

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 6
library project.
• You can create data that cannot be used as library objects in a library project. However, you

6-8-4 Procedure to Use Libraries


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.

Procedure to Use Libraries


You can read objects that are created in libraries into a project to use them in the user program. Use the
following procedure to use libraries.

1 Specify the library.


Specify the library file to access in the Library Reference Dialog Box of the project in which to
use the library objects.

2 Use the library objects in programming.


Use the library objects from the library that you read in the project. Use the library objects in the
same way as any other functions, function block definitions, or data types.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-147


6 Programming

6-9 Programming Precautions


This section describes precautions for developing a user program.

6-9-1 Array Specifications for Input Variables, Output Variables, In-Out


Variables
Some instructions handle array variables.
Example:

Data Type Table


Variable name Data type
data ARRAY[0..4] OF INT

SetBlock
EN ENO
INT#0 In Out
data[0] AryOut data[0]
UINT#5 Size

6-9-2 Structure Variables for Input Variables, Output Variables, In-Out


Variables
Some instructions have structure variables for input, output, or in-out variables.
Example:

SerialRcv_instance
Operating SerialRcv
Execute Done
InPort Port Busy
UINT#13 Size Error
DstDat
RecvDat[0] RecvDat[0]
ErrorID
ErrorIDEx
RcvSize RecvSize

6-148 NJ/NX-series CPU Unit Software User’s Manual (W501)


6 Programming

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

Execution Inline ST: Sets values in the Inport structure variable.


condition
1 InPort.UnitNo :=_CBU_No00; // Serial Communications Unit with unit number 0
2 InPort.PhysicPortNo :=USINT#2; // Serial port 2

SerialRcv_instance
SerialRcv
Execute Done

6-9 Programming Precautions


InPort Port Busy
UINT#13 Size Error
DstDat
RecvDat[0] RecvDat[0]
ErrorID
ErrorIDEx
RcvSize RecvSize

6-9-3 Master Control

Introduction 6
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-

6-9-3 Master Control


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.

Master Control Programming Languages


You can use master control in ladder diagrams.
You cannot use master control with ST. You also cannot use master control for inline ST inside a ladder
diagram.
Example:
Inside a Master Control Region:

Ladder diagram algorithm The ladder diagram is reset by the master


Programs control.
User-defined For example, the output variables from OUT
function block instructions change to FALSE.

Inline ST Nothing is done.

Ladder diagram algorithm The ladder diagram is reset by the master


control.
For example, the output variables from OUT
instructions change to FALSE.

Operation of Instructions That Are Reset in a Master Control Region


Refer to information on the MC and MCR instructions in the NJ/NX-series Instructions Reference Man-
ual (Cat. No. W502) for the operation of other instructions in the master control region when master
control is reset.

NJ/NX-series CPU Unit Software User’s Manual (W501) 6-149


6 Programming

6-150 NJ/NX-series CPU Unit Software User’s Manual (W501)


Checking Operation and Actual Operation
This section describes the items and procedures for checking the operation of an
NJ/NX-series Controller, including offline debugging procedures.

7-1 Overview of Steps in Checking Operation and Actual Operation . . . . . . . 7-2


7-2 Offline Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7-2-1 Features of Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7-2-2 Simulation Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
7-2-3 Setting Up Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
7-3 Checking Operation on the Actual System and Actual Operation . . . . . . 7-8
7-3-1 Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
7-3-2 Downloading the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9 7
7-3-3 Checking I/O Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
7-3-4 MC Test Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
7-3-5 Checking the Operation of the User Program . . . . . . . . . . . . . . . . . . . . . . . . 7-10
7-3-6 Starting Actual Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10

NJ/NX-series CPU Unit Software User’s Manual (W501) 7-1


7 Checking Operation and Actual Operation

7-1 Overview of Steps in Checking


Operation and Actual Operation
The shaded steps in the overall procedure that is shown below are related to the checking operation
and actual operation. In Step 2-4. Offline Debugging, a simulation is used to check operation without
going online with the Controller. In Step 5. Checking Operation and Starting Operation on the Actual
System, you go online with the Controller to check the operation of the physical Controller. When check-
ing operation is completed, you start actual operation.
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for the overall procedure.

Step 1. Software Design


Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System

7-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


7 Checking Operation and Actual Operation

7-2 Offline Debugging


This section describes how to use simulation to debug operation offline. You can simulate the operation
of an NJ/NX-series Controller on a computer to check the operation of the user program with only the
computer. There are also debugging operations that can be used during simulation that are not sup-
ported on the physical Controller. This makes user program development and debugging more efficient.

7-2-1 Features of Simulation


In the following way, simulation is more effective than going online with the Controller to debug opera-
tion.
• You can use breakpoints, step execution, pausing, and other functions to check program logic.
• You can select only specific programs to simulate to check only those programs.
• You can change the simulation execution speed to check operation at a slower speed than for actual
operation.
• You can use the Task Execution Time Monitor to estimate the task execution times.
• You can use debugging programs to manipulate inputs from outside the Controller.

7-2 Offline Debugging


7-2-2 Simulation Execution
You can do the following for simulations.
• Start and stop the Simulator.
• Check the logic of programs.
• Estimate task execution times.
• Use online debugging functions.
7

Starting and Stopping the Simulator

7-2-1 Features of Simulation


You perform simulations by starting the Simulator from the Simulation Pane of the Sysmac Studio. After
you complete checking operation with the simulation, you stop the Simulator. The following procedure
shows how to start and stop simulations.

1 Select Simulation Pane from the View Menu of the Sysmac Studio.
The Simulation Pane is displayed on the lower right of the window.

Execute Button Stop Button

Simulation Pane

NJ/NX-series CPU Unit Software User’s Manual (W501) 7-3


7 Checking Operation and Actual Operation

2 Click the Execute Button in the Simulation Pane.


The user program is transferred to the Simulator and the simulation starts. When a simulation
starts, the Editors and other parts of the Sysmac Studio window will enter the same state as
when the Sysmac Studio is online with the Controller.

3 After you complete checking operation, click the Stop Button in the Simulation Pane to stop the
Simulator.

Checking the Logic of Programs


You can use simulation debugging to stop the operation of the Simulator or to execute a program one
step at a time to check the validity of the program logic. You can perform the following operations with
the buttons in the Simulation Pane.
Operation Description of operation
Breakpoints Use a breakpoint to specify a location in a program and pause program execu-
tion at that location.
Step execution Use step execution to execute one line of an ST program or one instruction in
a ladder diagram program and then pause the Simulator.
Continuous step execution Use continuous step execution to continually perform step execution at a
specified interval.
Pausing Use pausing to pause execution of the simulation.
Step-in execution Use step-in execution to perform step execution of source code inside a func-
tion or function block.
Step-out execution Use step-out execution to execute the current function or function block to the
end.
One-period execution Use one-period execution to execute the current task for one period. Execu-
tion pauses at the beginning of the program in the next period.
Conditional breakpoints Use conditional breakpoints to pause the execution of a program at a break-
point when the specified stopping condition is met.

Estimating Task Execution Times


If you execute the Simulator in Execution Time Estimation Mode, the estimated task execution time
from when task execution starts until it stops is displayed on the Task Execution Time Monitor Display.
The average and maximum estimated task execution times are displayed. Refer toTask Execution Time-
out on page 5-105 for the Task Execution Time Monitor Display.

Precautions for Correct Use


• Select the relevant hardware revision in the Unit that the hardware revision is displayed.
• The estimated task execution times are not necessarily the same as the actual task execution
times on the physical Controller. Depending on the user program, I/O configuration, and
whether communications are used, the execution times on the physical control may exceed
the estimated maximum value. Use them only as guidelines in task design. Always confirm the
task execution times while connected to the physical Controller to study the designs and
before starting actual system operation.

7-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


7 Checking Operation and Actual Operation

Online Debugging Functions


With the Simulator, you can use some of the functions for debugging that are supported when you are
online with the Controller. The following table shows the differences between online debugging with the
Controller or offline debugging with the Simulator. Refer to the Sysmac Studio Version 1 Operation
Manual (Cat. No. W504) for details on the differences in debugging operations for the Controller and for
the Simulator.
Debugging function Controller Simulator
Monitoring Supported. Supported.
Monitoring in a Watch Tab Page Supported. Supported.
Monitoring in the I/O Map Supported. Supported.
Differential monitoring Supported. Supported.
Controlling BOOL variables Supported. Supported.
Forced Refreshing (TRUE/FALSE/Cancel) Supported. Supported.
Changing present values of data Supported. Supported.
Clearing all memory Supported. Not supported.
Cross-reference pop-ups Supported. Supported.
Online editing Supported. Supported.
Monitoring Controller status Supported. Not supported.

7-2 Offline Debugging


Monitoring task execution status Supported. Supported.
Monitoring axis status (MC Monitor Table) Supported. Supported.
Changing the operating mode Supported. Not supported.
Resetting the Controller Supported. Not supported.
Data tracing Supported. Supported.
Setting triggers Supported. Supported.
Setting variables to sample Supported. Supported.
Starting and stopping tracing Supported. Supported.
7
Displaying trace results Supported. Supported.

7-2-2 Simulation Execution


Exporting trace results Supported. Supported.
Creating 3D equipment models Supported. Supported.
Displaying digital and analog charts Supported. Supported.
Displaying 3D axis paths Supported. Supported.
Monitoring task execution times Supported. Supported.
Estimating execution processing times Not supported. Supported.
Debugging with program simulations Not supported. Supported.
Setting simulation programs Not supported. Supported.
Changing the simulation speed Not supported. Supported.
Setting breakpoints Not supported. Supported.
Step execution Not supported. Supported.
Troubleshooting Supported. Supported.
Monitoring error information Supported. Supported.
Displaying error logs Supported. Supported.
Setting event tables Supported. Supported.
Monitoring user memory usage Supported. Supported.
Clock Information Settings Supported. Not supported.
Releasing access rights Supported. Not supported.

NJ/NX-series CPU Unit Software User’s Manual (W501) 7-5


7 Checking Operation and Actual Operation

7-2-3 Setting Up Simulations


You set the following for simulations.
• Setting simulation programs
• Setting debug programs
• Setting the simulation speed

Setting Simulation Programs


You can set the task or programs to simulate. You can choose to simulate some or all of the programs in
the user program. The following procedure shows how to set the simulation programs.

1 Display the Simulation Pane.


Check boxes are displayed to the left of the programs that are listed under Tasks in the Multiv-
iew Explorer project to designate programs for simulation.

2 Select the check boxes for the tasks or programs to simulate.

Setting Debug Programs


A debugging program is used to check operation with offline debugging. The debugging program con-
tains instructions to perform virtual input processing on inputs received from outside of the Controller,
force user-defined errors, and perform other such debugging tasks. You can execute debugging pro-
grams only on the Simulator.
The following procedure shows how to create debugging programs.

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.

3 Assign the debugging program to a task.

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-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


7 Checking Operation and Actual Operation

Setting the Simulation Speed


You can use the Simulation Speed Slider in the Simulation Pane to change the simulation speed from
0.1x to 1x. You can change simulation speed while a simulation is in progress or when it is stopped. Use
this to display the execution of the Simulator more slowly than for actual operation.

7-2 Offline Debugging


7

7-2-3 Setting Up Simulations

NJ/NX-series CPU Unit Software User’s Manual (W501) 7-7


7 Checking Operation and Actual Operation

7-3 Checking Operation on the Actual


System and Actual Operation
This section describes the procedures from checking operation on the actual system to starting actual
operation.

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 and an 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.

Step 2. Checking Operation on the Controller Reference


1. In PROGRAM mode, check the I/O wiring by performing forced-refreshing 7-3-3 Checking I/O Wiring
with user-specified values from the I/O Map or Ladder Editor. NJ/NX-series CPU Unit
2. For motion control, use the MC Test Run operations to perform the following: Motion Control User’s
check the wiring, jog to check the motor rotation directions, perform relative Manual (Cat. No. W507)
positioning to check the travel distances (e.g., for electronic gear settings), 7-3-5 Checking the Opera-
and check homing operation. tion of the User Program
3. Change the Controller to RUN mode and check the operation of the user pro-
gram.

Step 3. Starting Actual Controller Operation Reference


1. Confirm that operation is performed as designed and then start actual opera- ---
tion.

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.

7-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


7 Checking Operation and Actual Operation

7-3-2 Downloading the Project


Use the following procedure to download the project from the Sysmac Studio to the physical Controller.

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.

7-3 Checking Operation on the Actual System and Actual Operation


Click the Transfer to Controller Button.

7-3-3 Checking I/O Wiring


Check the I/O wiring by using forced refreshing from the Watch Tab Page of the Sysmac Studio. You
can write values to I/O for Units or slaves to check the results to test the I/O wiring. Refer to 8-6-1
Forced Refreshing for information on forced refreshing.

7-3-4 MC Test Run


The MC Test Run function is used mainly to perform the following operations from the Sysmac Studio
without a user program.
• Checking wiring: You can monitor Servo Drive connector I/O signals and Servo Drive status.
• Checking the operation and direction of the motor: You can turn ON the Servo and jog axes.
• Checking electronic gear settings: You can perform relative positioning, and check and change travel
distances.
• Checking homing: You can check the homing operation.
Connect online to the Controller from the Sysmac Studio and perform the MC Test Run on the MC Test
Run Tab Page.
For details, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).
7
Use the following procedure.

1 After you complete the necessary wiring, connect the Sysmac Studio online to the Controller.

7-3-2 Downloading the Project


2 Create axes, assign the axes, and set the following axis parameters.
Axis parameter settings required for an MC Test Run: Unit of Display, Command Pulses Per
Motor Rotation, Travel Distance Per Motor Rotation, Maximum Velocity, Maximum Jog Velocity,
Maximum Acceleration Rate, Maximum Deceleration Rate, Software Limit Function Selection,
Software Limits, and Count Mode

3 Open the MC Test Run Tab Page and perform the following.
Example:
• 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

NJ/NX-series CPU Unit Software User’s Manual (W501) 7-9


7 Checking Operation and Actual Operation

7-3-5 Checking the Operation of the User Program


To check the operation of the user program on the actual system, change the operating mode of the
CPU Unit to RUN mode. You can use the following to check operation.
• Checking the operation of the user program
• Correcting the user program with online editing
• Checking the operation of the user program with data tracing

Checking the Operation of the User Program


You can perform the following to check the operation of the user program.

1 Monitor the execution status of the user program.

2 Check the operation by changing the status of program inputs and program outputs, and the val-
ues of variables.

 Monitoring the Execution Status of the User Program


You can monitor the TRUE/FALSE status of program inputs and outputs and the present values of
variables in the Controller. You can monitor the status on the Ladder Editor, Watch Tab Page, or I/O
Map of the Sysmac Studio.

 Checking the Operation by Changing the Status of Program Inputs and


Program Outputs, and the Values of Variables
You can change the TRUE/FALSE status of program inputs and outputs and the present values of
variables in the user program to see if the user program operates as designed. Use forced refresh-
ing to change the status of program inputs and program outputs. Use one of the methods to change
the present values of variables. Refer to 8-6-1 Forced Refreshing and 8-6-2 Changing Present Val-
ues for details.

Correcting the User Program with Online Editing


You can use online editing to correct a user program that you determined needs to be corrected while
checking operation. You can use online editing to change a user program without stopping the opera-
tion of the CPU Unit. Refer to 8-6-3 Online Editing for details.

Checking Operation with Data Tracing


You can use data tracing to check when program inputs and program outputs are changed to TRUE or
FALSE and to check changes in the values of variables. Refer to 8-6-4 Data Tracing for details.

7-3-6 Starting Actual Operation


Change the operating mode to RUN mode to start actual operation. Check the user program, data, and
parameter settings sufficiently for proper execution before you use them for actual operation.

7-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


CPU Unit Functions
This section describes the functionality provided by the CPU Unit.

8-1 Data Management, Clock, and Operating Functions . . . . . . . . . . . . . . . . . 8-3


8-1-1 Clearing All Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8-1-2 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8-1-3 RUN Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8-2 Management Functions for NX Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8-2-1 NX Bus Function Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8-2-2 Mounting Settings of NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . . 8-12
8-2-3 Restarting NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
8-2-4 Checking Wiring for NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . 8-16
8-2-5 Fail-soft Operation for NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . 8-17
8-2-6 Monitoring Total Power-ON Time for NX Units on the CPU Unit . . . . . . . . . . 8-21
8-3 Management Functions for CJ-series Units . . . . . . . . . . . . . . . . . . . . . . . 8-22
8
8-3-1 Basic I/O Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22
8-3-2 Special Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-23
8-4 SD Memory Card Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
8-4-1 SD Memory Card Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25
8-4-2 Specifications of Supported SD Memory Cards, Folders, and Files . . . . . . . 8-26
8-4-3 SD Memory Card Operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
8-4-4 FTP Client Communications Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
8-4-5 FTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8-4-6 File Operations from the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8-4-7 SD Memory Card Life Expiration Detection . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8-4-8 List of System-defined Variables Related to SD Memory Cards . . . . . . . . . . 8-30
8-4-9 SD Memory Card Self-diagnostic Functions . . . . . . . . . . . . . . . . . . . . . . . . . 8-31
8-4-10 Exclusive Control of File Access in SD Memory Cards . . . . . . . . . . . . . . . . . 8-33
8-5 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-34
8-5-1 Authentication of User Program Execution IDs . . . . . . . . . . . . . . . . . . . . . . . 8-35
8-5-2 User Program Transfer with No Restoration Information . . . . . . . . . . . . . . . . 8-38
8-5-3 Overall Project File Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
8-5-4 Data Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-40
8-5-5 Operation Authority Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-42
8-5-6 CPU Unit Write Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-44
8-5-7 CPU Unit Names and Serial IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-45

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-1


8 CPU Unit Functions

8-6 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-47


8-6-1 Forced Refreshing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-47
8-6-2 Changing Present Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-52
8-6-3 Online Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-54
8-6-4 Data Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-56
8-6-5 Differential Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-62
8-7 Event Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-67
8-7-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-67
8-7-2 Detailed Information on Event Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-69
8-7-3 Controller Events (Controller Errors and Information) . . . . . . . . . . . . . . . . . . . 8-74
8-7-4 User-defined Events (User-defined Errors and Information) . . . . . . . . . . . . . . 8-76
8-8 Changing Event Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-83
8-8-1 Applications of Changing Event Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-83
8-8-2 Events for Which the Event Level Can Be Changed . . . . . . . . . . . . . . . . . . . . 8-83
8-8-3 Procedure to Change an Event Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-84

8-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-1 Data Management, Clock, and


Operating Functions
This section describes the data management, clock, and operating functions.

8-1-1 Clearing All Memory


You can initialize the user program, Controller Configurations and Setup, variables, and absolute
encoder home offset in the CPU Unit to the defaults from the Sysmac Studio. This is called the Clear All
Memory operation.

8-1 Data Management, Clock, and Operating Functions


Precautions for Correct Use
• The Clear All Memory operation can be performed only in PROGRAM mode.
• You cannot execute the Clear All Memory operation when write protection of the CPU Unit is
set in the security functions.
• Do not turn OFF the power supply to the Controller during the Clear All Memory operation.

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.

 Operations from the Sysmac Studio


Connect the Sysmac Studio to the CPU Unit online, and select Clear All Memory from the Control-
ler Menu.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.

8-1-2 Clock
8
Introduction

8-1-1 Clearing All Memory


A clock (RTC) is built into the CPU Unit. The clock data from this clock is used for timestamps in the
event logs and for the time and date of files that are created on the SD Memory Card.
The following functions are supported.
• Reading/writing the clock from the Sysmac Studio
• Reading/writing the clock with instructions
• Reading the clock from system-defined variables (Writing is not possible.)
• Correcting the clock from an NTP Server

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-3


8 CPU Unit Functions

• Reading/writing the clock from the Sysmac Studio


• Reading/writing the clock with instructions
• Correcting the clock from an NTP server

CPU Unit
Clock data

• Event logs
• Time and date of files that are
created on SD Memory Card

Battery backup

Battery
CJ1W-BAT01

Precautions for Correct Use


• The clock data is retained by the Battery when the power is turned OFF. The clock data is not
correct when the power is turned ON. You can reset the clock data from an NTP server over an
EtherNet/IP network after the power is turned ON.
• The clock data is retained by a built-in capacitor when the battery-free operation is used in the
NX1P2 CPU Unit. When the power of the device is turned OFF if the retention time in the built-
in capacitor exceeded, the clock data are initialized. If you use the clock data in the event log
and other functions, specify the clock data when you turn ON the power supply every time.

 Clock Data Range


• NX-series CPU Units:1970-01-01 to 2069-12-31 (January 1, 1970 to December 31, 2069).
• NJ-series CPU Units:1970-01-01 to 2106-02-06 (January 1, 1970 to February 6, 2106).

 Setting the Time Zone and the Local Time


Before you use the CPU Unit for the first time, set the time zone and local time in the clock data. You
can set the time zone and local time from the Sysmac Studio in the Controller Clock Dialog Box.
The clock data that is read by the EtherCAT slaves and CJ-series CPU Units from the CPU Unit and
the clock data that is set are the local times in the time zone.

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.

Setting the Clock Data


Use one of the following methods.

 Changing Clock Data from the Sysmac Studio


You can use the Sysmac Studio to synchronize the clock data of the built-in clock with the clock on
the computer.

 Changing Clock Data with Instructions


You can use the SetTime instruction to set the clock data.

8-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

 Changing the Clock Data from an NTP Server


You can use an NTP server on EtherNet/IP to set the clock data.

Correcting the Clock from an NTP Server


 Application
In a network system, the clock data must be shared by the entire system. NTP is supported to
enable easy time synchronization.

 Specifications
An NTP client is provided.
Refer to the NJ/NX-series Built-in EtherNet/IP User’s Manual (Cat. No. W506) for details.

8-1 Data Management, Clock, and Operating Functions


Reading the Clock Data
If the clock data is incorrect, the incorrect value is read.

 Reading the Clock Data from Instructions


You can use the GetTime instruction to read the clock data from the user program.

 Reading the Clock from System-defined Variables (Writing Is Not Possible)


You can use the following system-defined variable to read the clock data.
_CurrentTime (System Time)

 Sysmac Studio Procedure


You can select Controller Clock from the Controller Menu of the Sysmac Studio to display the clock
data.

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.

Related System-defined Variables


Variable name Meaning Description Data type R/W
_CurrentTime System Time This variable contains the CPU Unit’s inter- DATE_AND_TIME R
nal clock data.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-5


8 CPU Unit Functions

8-1-3 RUN Output

Introduction
The RUN output on NX-PA9001, NX-PD7001, or NJ-P3001 Power Supply Unit is ON while the CPU
Unit is operating.

Power Supply Unit CPU Unit

RUN
output

The RUN output operates as shown in the following table.


Status Operation
During RUN mode ON
Startup state OFF
(until RUN mode is entered according to the Startup Mode setting).
During PROGRAM mode
When a major fault level Controller error occurs

The ratings of the RUN output on NX-PA9001, NX-PD7001, or NJ-P3001 Power Supply Unit are as
follows:
Item Description
Contact form SPST-NO
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.

Precautions for Safe Use


It takes up to approximately 10 to 20 s to enter RUN mode after the power is turned ON. The out-
puts during this time behave according to the slave or Unit specifications. Use the RUN output on
the Power Supply Unit, for example, to implement fail-safe circuits so that external devices do not
operate incorrectly.

8-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-2 Management Functions for NX Units


This section describes the management functions used for NX Units on the NX1P2 CPU Unit.
You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.

8-2-1 NX Bus Function Module


The NX Bus Function Module performs processing such as a management of event logging, manage-
ment of status, and I/O refreshing for the NX Units that are connected to the NX bus of the CPU Unit as
a master of the NX bus (hereafter NX bus master).

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.

8-2 Management Functions for NX Units


There are two kinds of variables to access I/O data, device variables that are assigned to I/O ports and
system-defined variables for the NX Bus Function Module.

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.

Status of NX Units Managed by the NX Bus Function Module as the


NX Bus Master
For the status of NX Units managed by the NX Bus Function Module as the NX bus master, you can 8
use only device variables assigned to I/O ports to access, only system-defined variables to access, or
both of device variables and system-defined variables to access.

8-2-1 NX Bus Function Module


 A List of Status of NX Units Managed by the NX Bus Function Module as the
NX Bus Master

Name I/O port System-defined variable


NX Unit Registration Status NX Unit Registration Status _NXB_UnitRegTbl
NX Unit Message Enabled Status NX Unit Message Enabled Status _NXB_UnitMsgActiveTbl
NX Unit I/O Data Active Status NX Unit I/O Data Active Status _NXB_UnitIOActiveTbl
NX Unit Error Status NX Unit Error Status _NXB_UnitErrFlagTbl
Time Stamp of Synchronous Input Time Stamp of Synchronous Input ---
Time Stamp of Synchronous Output TimeStamp of Synchronous Output ---
NX Bus Function Module Error Status --- _NXB_ErrSta
NX Bus Function Module Master Error Status --- _NXB_MstrErrSta
NX Bus Function Module Unit Error Status --- _NXB_UnitErrStaTbl

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-7


8 CPU Unit Functions

 Descriptions of Status of NX Units Managed by the NX Bus Function Module


as the NX Bus Master

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.

Each bit is updated at the following times.


• If the Unit Configuration Information Is Registered:
The status changes to TRUE when the system is started.
The status changes to FALSE when the configuration information is cleared.
• If the Unit Configuration Information Is Automatically Created:
The status changes to TRUE when the configuration information is confirmed.
The status is always FALSE if the Unit configuration information is automati-
cally created.
NX Unit Message Enabled This status tells whether the NX Units can process message communications.
Status Each bit has the following meaning.
TRUE: Message communications possible.
FALSE: Message communications not possible.

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.

8-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Name Description
NX Unit Error Status This status tells whether an error exists on the NX Units.
Each bit has the following meaning.
TRUE: Error
FALSE: No error

Each bit is set to TRUE when the level of the error is as follows:
• Major fault
• Partial fault
• Minor fault
• Observation

The status is FALSE for NX Units that are set as unmounted Units.

Each bit is updated at the following times.


The status changes to TRUE when an error occurs.
The status changes to FALSE when the error is reset. Even if the cause of the
error has been removed, you must reset the error for the status to change to
FALSE.
Time Stamp of Synchronous This time stamp tells when a synchronous input occurred in the NX Unit that sup-

8-2 Management Functions for NX Units


Input ports synchronous I/O refreshing. The unit is ns.
Time Stamp of Synchronous This time stamp tells when a synchronous output occurred in the NX Unit that
Output supports synchronous I/O refreshing. The unit is ns.
NX Bus Function Module Gives the NX Bus Function Module error status. This status collects the NX Bus
Error Status Function Module Master Error Status and NX Bus Function Module Unit Error
Status for all NX Units.
NX Bus Function Module Gives the status of errors that are detected in the NX Bus Function Module of the
Master Error Status CPU Unit. Refer to A-5-8 Meanings of Error Status Bits on page A-110 for the
meanings of the error status bits.
NX Bus Function Module Gives the status of errors that are detected in the NX Unit on the CPU Unit. This
Unit Error Status status is given as an array of WORD data. The subscript of the array corresponds
to the NX Unit number. Refer to A-5-8 Meanings of Error Status Bits on page A-
110 for the meanings of the error status bits.

8
Refer to A-6-4 NX Bus Function Module, Category Name: _NXB on page A-140 for details on the
related system-defined variables.

8-2-1 NX Bus Function Module


 Update Timing of Status of NX Units Managed by the NX Bus Function
Module as the NX Bus Master

Name I/O port for an NX Unit System-defined variable


NX Unit Registration Status Not synchronized with task execution Not synchronized with task execution
NX Unit Message Enabled Status Not synchronized with task execution Not synchronized with task execution
NX Unit I/O Data Active Status Synchronized with primary periodic task Synchronized with primary periodic task
NX Unit Error Status Synchronized with primary periodic task Synchronized with primary periodic task
Time Stamp of Synchronous Input Synchronized with primary periodic task ---
Time Stamp of Synchronous Output Synchronized with primary periodic task ---
NX Bus Function Module Error Status --- Not synchronized with task execution
NX Bus Function Module Master Error --- Not synchronized with task execution
Status
NX Bus Function Module Unit Error Sta- --- Not synchronized with task execution
tus

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-9


8 CPU Unit Functions

I/O Data for Individual NX Units


I/O data are determined by the model number of the NX Unit and the functionality. You can use only
device variables that are assigned to an I/O port of an NX Unit to access I/O data.

Refer to the user’s manual for the specific NX Units for details on I/O data for individual NX Units.

Assigning Device Variables to I/O Ports


When you create the Unit configuration information on the Sysmac Studio, the status of NX Units man-
aged by the NX Bus Function Module as the NX bus master and I/O data for NX Units mounted on the
CPU Unit are automatically registered as I/O ports.
The variables that are assigned to I/O ports for status and I/O data are device variables.

 I/O Port Names


The status of NX Units managed by the NX Bus Function Module as the NX bus master is given as
the following six kinds of I/O port names for each NX Unit.

Data
Name I/O port name
type
NX Unit Registration Status Device name + NX Unit Registration Status BOOL
NX Unit Message Enabled Status Device name + NX Unit Message Enabled Status BOOL
NX Unit I/O Data Active Status Device name + NX Unit I/O Data Active Status BOOL
NX Unit Error Status Device name + NX Unit Error Status BOOL
Time Stamp of Synchronous Input Device name + Time Stamp of Synchronous Input ULINT
Time Stamp of Synchronous Output Device name + TimeStamp of Synchronous Output ULINT

Example for NX Unit Registration Status with a device name N1:


N1 NX Unit Registration Status
Example for Time Stamp of Synchronous Input with a device name N2:
N2 Time Stamp of Synchronous Input

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.

Example for a Digital Input Unit:


Input Bit 00
Example for an Analog Output Unit:
Ch1 Analog Output Value

 Registering Device Variables


You assign device variables to I/O ports in the I/O Map of the Sysmac Studio. The device variables
that you create are registered in the variable table.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on registering
device variables with the Sysmac Studio.

 Device Variable Attributes


Refer to Device Variable Attributes on page 3-12 for details on device variable attributes.

8-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Programming Sample Using Device Variables


The following describes a programming sample when using the NX Unit device variables.

 Testing the Validity of I/O Data for Individual NX Units


A sample programming that determines whether NX Unit (NX Unit number: 5) I/O data on the CPU
Unit is valid is given below. The NX Unit I/O Data Active Status and the NX Unit Error Status are
used.
The I/O data is manipulated in the NX Unit (NX Unit number: 5) if I/O data is valid.

Nx_Unit5_IOActive Nx_Unit5_Error
MemCopy1
MemCopy
EN ENO
In1[1] In Out
AryOut
AryOut1[1] AryOut1[1]
UINT#3 Size

8-2 Management Functions for NX Units


Nx_Unit5_IOActive: This is a device variable to indicate the NX Unit I/O Data Active Status with NX Unit number 5.
Nx_Unit5_Error: This is a device variable to indicate the NX Unit Error Status with NX Unit number 5.

 Testing Whether Individual NX Units Can Process Message Communications


A sample programming that confirms whether NX Unit (NX Unit number: 5) on the CPU Unit can
process message communications is given below. The NX Unit Message Enabled Status is used.
The Write NX Unit instruction is used to send a message to the NX Unit (NX Unit number: 5) if mes-
sage communications is enabled.

Nx_Unit5_MessageActive
NX_WriteObj1
NX_WriteObj
8
Execute Done
UnitProxy1 UnitProxy Busy
Obj1 Obj Error

8-2-1 NX Bus Function Module


TimeOut ErrorID
WriteDat1 WriteDat ErrorIDEx

Nx_Unit5_MessageActive: This is a device variable to indicate the NX Unit Message Enabled Status with NX
Unit number 5.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-11


8 CPU Unit Functions

8-2-2 Mounting Settings of NX Units on the CPU Unit


This section describes the mounting settings of NX Units on the CPU Unit.

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.

8-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Operating Specifications for NX Units That Are Set as Unmounted Units


The operating specifications for NX Units that are set as unmounted Units are given in the following
table.

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.

8-2 Management Functions for NX Units


Instructions Parameters cannot be read or written. An instruction
error will occur.
Clearing all memory Not applicable.
Reading/writing setting information through Not applicable.
backup/restore operations
Reading event logs Not applicable.
Notification of status information Not applicable.

NX Units that are set as unmounted Units are included in the calculations for total power consumption
and total Unit width when the Unit configuration is created on the Sysmac Studio.

Precautions for Safe Use


8
Check the user program, data, and parameter settings for proper execution before you use them
for actual operation.

8-2-2 Mounting Settings of NX Units on the CPU Unit


Precautions for Correct Use
When you mount an NX Unit that was set as an unmounted Unit, a Unit Configuration Verifica-
tion Error will occur.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-13


8 CPU Unit Functions

Setting NX Units as Unmounted Units


In the CPU and Expansion Racks Tab Page on the Sysmac Studio, select the target NX Unit and set the
NX Unit Mounting Setting to Disabled. The selected NX Unit is set as an unmounted Unit. After you
change the settings for any NX Units, always transfer the Unit configuration information to the CPU Unit.

8-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-2-3 Restarting NX Units on the CPU Unit


This section describes restarting an NX Unit on the NX1P2 CPU Unit. The restart function is used to
enable values that are set for the NX Unit without cycling the power supply to the Controller.

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.

Restarting NX Bus Function Module


All NX Units on the CPU Unit are restarted.

8-2 Management Functions for NX Units


Specify the NX Bus Function Module and then execute the restart. The restart of the NX Bus Function
Module does not affect the task execution of the CPU Unit. Also an error will not occur.

The methods for restarting are listed below.


• Sysmac Studio
• RestartNXUnit (Restart NX Unit) instruction

Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the RestartNX-
Unit instruction.

Restarting Individual NX Units


One specified NX Unit is restarted.
8
The methods for restarting an NX Unit are listed below.

8-2-3 Restarting NX Units on the CPU Unit


• Sysmac Studio
• RestartNXUnit (Restart NX 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-15


8 CPU Unit Functions

8-2-4 Checking Wiring for NX Units on the CPU Unit


This section describes how to check the wiring for NX Units on the NX1P2 CPU Unit.

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.

 How to Check the Wiring

Item to check Checking method


Checking inputs Place the Sysmac Studio online and you can monitor the present values of Unit I/O
ports in the I/O Map.
Checking outputs Place the Sysmac Studio online, and forced refreshing or set/reset Unit I/O ports in
the I/O Map.

Refer to 8-6-1 Forced Refreshing for information on forced refreshing.


Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for the operations on the Sys-
mac Studio.

Additional Information

• For Position Interface Units and other NX Units that are assigned to axes, use the MC Test
Run of the Sysmac Studio. Refer to the NJ/NX-series CPU Unit Motion Control User’s Manual
(Cat. No. W507) for details.
• Use the I/O checking of EtherCAT Slave Terminals to check the wiring of NX Units on the Eth-
erCAT Coupler Unit. Refer to the NX-series EtherCAT Coupler Unit User’s Manual (Cat. No.
W519) for details.

8-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-2-5 Fail-soft Operation for NX Units on the CPU Unit


This section describes the fail-soft operation for the NX bus Function Module of the NX1P2 CPU Unit.
Only an NX1P2 CPU Unit has the NX Bus Function Module.

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

8-2 Management Functions for NX Units


CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5
NX Unit NX Unit NX Unit NX Unit NX Unit

Error occurs.
End Cover

CPU Unit ♯1 ♯2 ♯3 ♯4 ♯5
8
NX Unit NX Unit NX Unit NX Unit NX Unit

8-2-5 Fail-soft Operation for NX Units on the CPU Unit

Start or continue I/O Stop or do not start I/O


refreshing for NX Units refreshing for NX Units that
that can operate normally. cannot operate normally.

Precautions for Safe Use


If you change the fail-soft operation setting, the output status when the error occurs may also
change. Confirm safety before you change the setting.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-17


8 CPU Unit Functions

Precautions for Correct Use


If you use fail-soft operation, write programming to determine whether Unit I/O data is valid.
Without such programming, the user program cannot distinguish between Units for which I/O
refreshing is continued and Units for which I/O refreshing is stopped.
To determine whether Unit I/O data is valid, use the variables to indicate the NX Unit I/O Data
Active Status and NX Unit Error Status from the NX Unit device variables.

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.

Operations for Errors


The following table describes the operation of the NX Bus Function Module when the NX Bus Function
Module is used with and without fail-soft operation.

Operation when an error occurs Operation when an error occurs during


Operating status
while starting normal operation
With fail-soft operation The NX Bus Function Module starts I/O The NX Bus Function Module continues
refreshing for the NX Units that can I/O refreshing for the NX Units that can
operate normally. operate normally.
It does not start I/O refreshing for the It stops I/O refreshing for the NX Units that
NX Units that cannot operate normally. cannot operate normally.
Without fail-soft opera- The NX Bus Function Module does not The NX Bus Function Module stops I/O
tion*1 start I/O refreshing for any of the NX refreshing for any of the NX Units.
Units.

*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.

8-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Setting Fail-soft Operation


 Using Fail-soft Operation
To enable fail-soft operation, select the CPU Unit in the CPU and Expansion Racks Tab Page on the
Sysmac Studio and set the Fail-soft Operation Setting to Fail-soft operation.
The default for the Fail-soft Operation Setting for the NX Bus Function Module is Fail-soft opera-
tion.

 Not Using Fail-soft Operation


To disable fail-soft operation, select the CPU Unit in the CPU and Expansion Racks Tab Page on the
Sysmac Studio and set the Fail-soft Operation Setting to Stop.

Precautions for Correct Use


• After you change the setting, always transfer the changed settings to the CPU Unit.
• Refer to 4-2-4 Unit Configuration and Unit Setup for NX1P2 CPU Units for information on the
Unit configurations and settings for the NX1P2 CPU Units.

8-2 Management Functions for NX Units


Errors to Which Fail-soft Operation Applies
The following errors are examples of the errors to which fail-soft operation applies.
• NX Bus Communications Error
• Registered NX Unit Not Mounted
• NX Unit Communications Timeout
• NX Unit Initialization Error
• NX Unit Startup Error
8
Even if you enable fail-soft operation, the NX Bus Function Module may not start I/O refreshing for any
of the NX Units when the CPU Unit is started, depending on the cause of the error.

8-2-5 Fail-soft Operation for NX Units on the CPU Unit


Refer to Errors to Which Fail-soft Operation Applies on page 8-19 for details on the operation for differ-
ent error causes.

Refer to 12-2-4 Error Descriptions 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-19


8 CPU Unit Functions

Errors to Which Fail-soft Operation Applies


Even if fail-soft operation is enabled, I/O refreshing may not start depending on the cause of the error
when the CPU Unit starts.
Examples are provided below.

Example of Unit configuration information


and actual configuration Operation when CPU Unit
Description of configuration
NX Unit numbers starts
1 2 3 4 5
Unit configura- A B C D E*1 The following models of Units ---
tion information are mounted after the CPU
Unit in the order given on the
left: A, B, C, D, and E.
Actual Case A B C --- --- Unit D is not mounted. I/O refreshing does not start
con- 1 for NX Unit numbers 1, 2, and
figura- 3 because fail-soft operation is
tion enabled.
Case A C D --- --- Unit B is not mounted. I/O refreshing does not start
2 for any of the NX Units.
Case A B D C --- Unit C and D are mounted in I/O refreshing does not start
3 reverse order. for any of the NX Units.
Case A B C D D An extra Unit D is mounted for I/O refreshing does not start
4 NX Unit number 5. for any of the NX Units.
Case A B C F --- Unit F is mounted for NX Unit I/O refreshing does not start
5 number 4, but it does not exist for any of the NX Units.
in the Unit configuration infor-
mation.
Case A B C D E Unit E is mounted for NX Unit I/O refreshing does not start
6 number 5 even though its NX for any of the NX Units.
Unit Mounting Setting is set to
Disable.

*1 Unit E has the NX Unit Mounting Setting set to Disable.

8-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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.

Specifications of Monitoring Total Power-ON Times


The specifications of monitoring the total power-ON times are given in the following table.
Item Specification
Display unit • When total power-ON time is less than 1 hour: Minutes
• When total power-ON time is 1 hour or longer: Hours
Update interval • When total power-ON time is less than 24 hours: 10 minutes
• When total power-ON time is 24 hours or longer: 1 hour
Measurement error 1 hour/month max.
Default setting 0 minutes

8-2 Management Functions for NX Units


Checking Total Power-ON Times
You can use the Sysmac Studio to check the total power-ON times of NX Units on the CPU Unit.
Or, you can use the following special instruction to check the total power-ON times.
• NX_ReadTotalPowerOnTime instruction

This section describes how to check the total power-ON times with the Sysmac Studio. Refer to the
NJ/NX-series Instructions Reference Manual (Cat. No. W502) for details on the NX_ReadTotalPow-
erOnTime instruction.

 Checking Total Power-ON Times with Sysmac Studio


You can use the Production Information on the Sysmac Studio to check.
8
1 Go online.

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 When Times Cannot Be Recorded


If the total power-ON time cannot be recorded because of a non-volatile memory hardware error, the
total power-ON time is displayed as Invalid record on the Sysmac Studio.

 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.

 Display When Reading the Time Failed


If reading the time failed, the total power-ON time is displayed as “---” on the Sysmac Studio.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-21


8 CPU Unit Functions

8-3 Management Functions for CJ-series


Units
This section describes the management functions used for Units in the Controller.
You can use CJ-series Units only with NJ-series CPU Units.

8-3-1 Basic I/O Units

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.

Pulses shorter than the input


response time are not detected.

Input from a
proximity sensor
or other device

Input bit

Input response time Input response time

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.

You must do either of the following to enable the settings.


• Cycle the power supply to the Controller.
• Reset the Controller (the entire CPU Unit) from the Sysmac Studio.

8-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Related System-defined Variables


The set values for the input response times of the Basic Input Units are output to the following system-
defined variable.
Variable name Meaning Description Data type R/W
_CJB_InRespTm Basic Input Unit Input Response Contains the response times of ARRAY[0..3, R
Times the Basic I/O Units in 0.1-ms 0..9]OF UINT
increments.

8-3-2 Special Units

Restarting Special Units


You can restart a Special Unit (Special I/O Unit or CPU Bus Unit) to enable values that are set for it. If
you restart a Special Unit, you do not have to cycle the power supply to the Controller. Execute the fol-

8-3 Management Functions for CJ-series Units


lowing ResetUnit (Restart Unit) instruction to restart Special Units.
Instruction
Instruction Description
name
Restart Unit ResetUnit Restarts the CPU Bus Unit or Special I/O Unit.

The ResetUnit instruction restarts a Special Unit


ResetUnit
across multiple task periods when execution condition
a b a changes to TRUE. If the restart ends normally, the
output variable Done (normal end) changes to TRUE
Execute Done
and variable b therefore changes to TRUE.
UnitNo Busy
Error

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

8-3-2 Special Units


• Editing from the I/O Map or Watch Tab Page
• Setting the user program

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-23


8 CPU Unit Functions

 Related System-defined Variables


Variable
Meaning Description Data type R/W
name
_CJB_C- CPU Bus Unit The corresponding variable is TRUE during initialization BOOL R
BU00InitSta Initializing of the CPU Bus Unit. The corresponding variable
to Flags changes to FALSE when the initialization is completed.
_CJB_C- The numbers in the variables indicate the unit numbers
BU15InitSta of the applicable Units.
_CJB_- Special I/O The corresponding variable is TRUE during initialization BOOL R
SIO00InitSta Unit Initializ- of the Special I/O Unit. The corresponding variable
to ing Flags changes to FALSE when the initialization is completed.
_CJB_- The numbers in the variables indicate the unit numbers
SIO95InitSta of the applicable Units.
_CJB_C- CPU Bus Unit The CPU Bus Unit is restarted when the corresponding BOOL RW
BU00Restart Restart Bits variable changes to TRUE. (It is changed to FALSE by
to the system after the CPU Bus Unit is restarted.) The
_CJB_C- numbers in the variables indicate the unit numbers of the
BU15Restart applicable Units. If you change the Restart Bit to TRUE
with an instruction, the restart process begins from
refresh processing in the next task period after the
instruction is executed.
_CJB_- Special I/O The Special I/O Unit is restarted when the corresponding BOOL RW
SIO00Restart Unit Restart variable changes to TRUE. (It is changed to FALSE by
to Bits the system after the Special I/O Unit is restarted.) The
_CJB_- numbers in the variable names indicate the unit numbers
SIO95Restart of the applicable Units. If you change the Restart Bit to
TRUE with an instruction, the restart process begins
from refresh processing in the next task period.

8-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-4 SD Memory Card Operations


This section describes the functions that you can use for SD Memory Cards.

8-4-1 SD Memory Card Operations


The NJ/NX-series CPU Unit supports the following functions for SD Memory Cards.

Sysmac Studio

Memory Card operation


CPU Unit instructions

SD Memory Card
Creating/reading files
from Sysmac Studio

8-4 SD Memory Card Operations


FTP client communications FTP server
instructions

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 and
FTP server
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

8-4-1 SD Memory Card Operations


and save standard document files on the computer.
SD Memory Card life expiration Notification of the expiration of the life of the SD Memory Card is provided
detection in a system-defined variable and event log.
SD Memory Card backup, auto- You use the SD Memory Card inserted in the CPU Unit to backup, restore,
matic transfer from SD Memory and verify user programs and data in the Controller. Refer to 9-2 SD Mem-
Card, and program transfer from ory Card Backups, 9-4 Automatic Transfers from SD Memory Cards, and
SD Memory Card*2 9-5 Program Transfer from SD Memory Card for details.
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use the
FTP client communications instructions.
*2 A CPU Unit with unit version 1.11 or later and Sysmac Studio version 1.15 or higher are required to use the
function.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-25


8 CPU Unit Functions

8-4-2 Specifications of Supported SD Memory Cards, Folders, and


Files

SD Memory Card Specifications


The NJ/NX-series Controllers support both SD cards and SDHC cards. However, operation was con-
firmed only for the OMRON SD Memory Card given in the following table. Correct operation may not be
possible if you use any other SD or SDHC 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.

Precautions for Correct Use


When you use the SD Memory Card that "MR" is displayed on the back side with an NX701-
 CPU Unit or an NJ501- CPU Unit, be sure to use the unit version as shown
below.
• NX701-: Version 1.14 or later
• NJ501-: Version 1.13 or later

8-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Folder and File Specifications


 Character Restrictions
Object Multibyte Maximum
Reserved Case sen-
named by Usable characters character size (without
words sitivity
user compatibility NULL)
Volume label 0 to 9, A to Z, and a to z, as CON, PRN, Not sup- Case 11 bytes
well as % - _ @ ! ‘ ( ) ~= # & + AUX, ported.*2 insensitive
^ [ ] { } , . ; and single-byte CLOCK$,
kana*1 NUL, COM0,
COM1,
Directory 0 to 9, A to Z, and a to z, as 65 bytes
COM2,
name well as $ % ’ - _ @ ! ‘ ( ) ~= #
COM3,
File name & + ^ [ ] { } , . ; and single-byte 65 bytes
COM4,
kana
COM5,
COM6,
COM7,
COM8,
COM9, LPT0,
LPT1, LPT2,
LPT3, LPT4,
LPT5, LPT6,
LPT7, LPT8,

8-4 SD Memory Card Operations


LPT9

*1 You cannot begin volume label names with a space.


*2 Even if the computer supports multibyte characters (e.g., for Japanese), you cannot use them in the CPU Unit.

 Subdirectory Levels
You can create up to 5 levels (example: f1/f2/f3/f4/f5/abc.txt)

 Maximum Number of Stored Files


The number of files that you can store on an SD Memory Card depends on the directory level in
which you store the files. The maximum number of files for each is given in the following table. How-
ever, the values in the table assume that 8.3 filename is used. If you use long file names, the maxi-
8
mum number of stored files is less than the value given in the following table.

8-4-2 Specifications of Supported SD Memory Cards, Folders, and Files


Maximum number of
Directory level Format
stored files
FAT16 511
Root directory
FAT32 65,533
Subdirectory FAT16, FAT32 65,533

 Maximum Size of One File


The maximum size of any one file is 2,147,483,647 bytes (2 GB −1 byte).

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-27


8 CPU Unit Functions

8-4-3 SD Memory Card Operation Instructions


You can perform various operations on the SD Memory Card by using the following instructions.
Instruction name Instruction Description
The FileReadVar instruction reads the contents of a binary file on the
Read Variable
FileReadVar SD Memory Card and writes it to the specified variable. You can
from File
specify array and structure variables.
The FileWriteVar instruction writes the value of a specified variable to
Write Variable to a binary file in the SD Memory Card. You can specify array and struc-
FileWriteVar
File ture variables. If the directory specified for the file name does not
exist, it is created.
Open File FileOpen The FileOpen instruction opens the specified file.
Close File FileClose The FileClose instruction closes the specified file.
The FileSeek instruction sets a file position indicator in the specified
Seek File FileSeek
file.
Read File FileRead The FileRead instruction reads the data from the specified file.
Write File FileWrite The FileWrite instruction writes data to the specified file.
The FileGets instruction reads a text string of one line from the speci-
Get Text String FileGets
fied file.
The FilePuts instruction writes a text string of one line to the specified
Put Text String FilePuts
file.
The FileRemove instruction deletes the specified file from the SD
Delete File FileRemove
Memory Card.
Change File The FileRename instruction changes the name of the specified file or
FileRename
Name directory.
Copy File FileCopy The FileCopy instruction copies the specified file to a different file.
Create Directory DirCreate The DirCreate instruction creates a directory in the SD Memory Card.
The DirRemove instruction deletes a directory from the SD Memory
Delete Directory DirRemove
Card.

8-4-4 FTP Client Communications Instructions


FTP client communications instructions are used to transfer files via FTP from an NJ/NX-series CPU
Unit to computers or Controllers at Ethernet nodes.
The files on the SD Memory Card are read and written when the following instructions are executed.

Instruction name Instruction Description


The FTPPutFile instruction uploads one or more files in the FTP
Put File onto FTP Server FTPPutFile
client’s SD Memory Card to the FTP server.
The FTPGetFile instruction downloads one or more files from the
Get File from FTP Server FTPGetFile
FTP server to the FTP client’s SD Memory Card.

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.

8-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-4-5 FTP Server


You can read and write files on the SD Memory Card via EtherNet/IP by sending FTP commands to the
built-in EtherNet/IP port from an FTP client.
Refer to the NJ/NX-series CPU Unit Built-in EtherNet/IP User’s Manual (Cat. No. W506) for details.

CPU Unit
FTP Client

FTP
commands

SD Memory Card Built-in EtherNet/IP port: FTP server


EtherNet/IP

File transfers

8-4 SD Memory Card Operations


8-4-6 File Operations from the Sysmac Studio
You can perform file operations from the Sysmac Studio for the SD Memory Card inserted in the CPU Unit.
In addition to Controller files, you can also store document files or other files on the SD Memory Card.

8-4-7 SD Memory Card Life Expiration Detection


You can determine the remaining life of the SD Memory Card before the Card becomes physically dete-
riorated.
You can determine the remaining life of the SD Memory Card with the following functions.
• System-defined variable _Card1Deteriorated (SD Memory Card Life Warning Flag) 8
• SD Memory Card Life Exceeded (Observation) record in the event log
The life of the SD Memory Card is checked when the power is turned ON and periodically while the SD

8-4-5 FTP Server


Memory Card is inserted.
When the end of the life of the SD Memory Card is detected, save the data on the SD Memory Card
and replace the SD Memory Card.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-29


8 CPU Unit Functions

8-4-8 List of System-defined Variables Related to SD Memory Cards


The following system-defined variables show the status of the SD Memory Card.
Data
Variable name Meaning Description
type
_Card1Ready SD Memory TRUE when the SD Memory Card is recognized. It is FALSE when BOOL
Card Ready an SD Memory Card is not recognized.
Flag TRUE: The Card can be used.
FALSE: The Card cannot be used.
_Card1Protect SD Memory TRUE when the SD Memory Card is write-protected. BOOL
Card Write TRUE: Write protected.
Protected
FALSE: Not write protected.
Flag
_Card1Err SD Memory TRUE when an unusable SD Memory Card is inserted or a format BOOL
Card Error error occurs.
Flag TRUE: There is an error
FALSE: There is no error
_Card1Access SD Memory TRUE during SD Memory Card access. BOOL
Card Access TRUE: Card is being accessed.
Flag*1 FALSE: Card is not being accessed.
_Card1Deterio- SD Memory TRUE when the end of the life of the SD Memory Card is detected. BOOL
rated Card Life TRUE: The end of the life of the Card is detected.
Warning Flag
FALSE: The end of the life of the Card was not detected.
_Card1Power- SD Memory TRUE when the power supply to the Controller was interrupted BOOL
Fail Card Power during access to the SD Memory Card.
Interruption TRUE: Power was interrupted during SD Memory Card access.
Flag*2 FALSE: Operation is normal.

*1 Precaution When Using SD Memory Card Access Flag (_Card1Access)


The SD Memory Card Access Flag is intended for use in notifying external devices. The status of access to the
SD Memory Card is not updated in realtime. Because of this, do not use the flag in the user program. Because
the status of access to the SD Memory Card is not shown in realtime, it may cause unexpected Controller
operation if you use it in the user program.
*2 Precautions When Using the SD Memory Card Power Interruption Flag ( _Card1PowerFail)
If the SD Memory Card Power Interruption Flag is TRUE, check to see if the correct file is in the SD Memory
Card and to see if the SD Memory Card operates properly. If the correct file is missing or the SD Memory Card
does not operate properly, download the correct file to the SD Memory Card again. Cycle the power supply to
the Controller or reset the Controller, and then see if the SD Memory Card operates properly. When you are
finished, change SD Memory Card Power Interruption Flag to FALSE. (_Card1PowerFail does not change to
FALSE automatically.)

Note Refer to 9-2 SD Memory Card Backups for the system-defined variables that are used with the SD Memory
Card backup function.

8-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Additional Information

SD Memory Card Recognition and Unmounting Timing Chart

SD Memory Card inserted. Card recognized. Power supply stopped with power switch.

System processing Recognition Recognition reset

_Card1Ready

_Card1Err

_Card1Access

SD PWR indicator Not lit. Lit. Lit. Not lit.

SD BUSY indicator Not lit. Flashing. Not lit. Not lit.

8-4-9 SD Memory Card Self-diagnostic Functions


You can perform self-diagnosis on the inserted SD Memory Card when the power supply is turned ON.
You can select whether to perform self-diagnosis when the power is turned ON in the Operation Set-
tings of the Controller Setup under the Configurations and Setup from the Sysmac Studio as shown

8-4 SD Memory Card Operations


below.
• File system check
• Check equivalent to CHKDSK
• Restoration attempt when check fails
Access Setting Set val-
Setting Description
point group ues
Operation SD Mem- Memory Sets whether to execute self-diagnosis (file system check Do not
Settings, ory Card Card and restoration) on the inserted SD Memory Card when check.
Operation Settings Diagnosis the power is turned ON. Check.
Settings at Startup
Tab, Basic *1
8
Settings

*1 Self-diagnosis is not executed if write protection is set on the SD Memory Card itself.

8-4-9 SD Memory Card Self-diagnostic Functions

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-31


8 CPU Unit Functions

 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.

Precautions for Correct Use


If the recovery function is activated at startup, time is required to enter RUN mode. During that
time, outputs will be OFF and external communications are not performed. Use the RUN output
on the Power Supply Unit, for example, to implement fail-safe circuits so that external devices do
not operate incorrectly.

Precautions for Safe Use


Never interrupt the power supply to the Controller during SD Memory Card access. That includes
when SD Memory Card self-diagnosis at startup is enabled. An attempt is made by the SD Mem-
ory Card restoration function to restore any corrupted files. If the restoration fails, these files may
be deleted automatically at startup.

8-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-4-10 Exclusive Control of File Access in SD Memory Cards


Access to files on the SD Memory Card is possible with the following methods.
(1) FTP server
(2) SD Memory Card operation instructions
(3) FTP client communications instructions
(4) File operations from the Sysmac Studio

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

8-4 SD Memory Card Operations


Reading Writing Reading Writing Reading Writing
Exclusive control is per- Exclusive Perform Exclusive Perform
Later access

Read- formed automatically, and control is exclusive control is exclusive


ing an error occurs for the not control. not control.
Instruc- instruction that is executed required. required.
tions later. Perform Perform
Writ-
exclusive exclusive
ing
control. control.
Exclusive Perform --- --- Exclusive
File Read- control is exclusive control is
operations ing not control. not
from the required. required.
Sysmac
8
Perform exclusive control. --- --- Perform
Studio Writ-
exclusive
ing
control.

8-4-10 Exclusive Control of File Access in SD Memory Cards


Exclusive Perform Exclusive Perform --- ---
Read- control is exclusive control is exclusive
ing not control. not control.
FTP server required. required.
Writ- Perform exclusive control. --- ---
ing

*1 The instructions include the SD Memory Card operation instructions and the FTP client communications
instructions.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-33


8 CPU Unit Functions

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.

Application Security function Outline of function Reference


Prevention of the theft Authentication of user This ensures that a user program cannot be 8-35
of assets program execution operated on another CPU Unit even if the user
IDs program is copied.
User program trans- You can transfer the user program to the CPU 8-38
fer with no restoration Unit without the source code. This prevents any-
information one from displaying the user program on another
computer even if they upload it.
Overall project file You can place a password on a project file to pro- 8-39
protection tect your assets.
Data protection* You can place protection on part of the data in a 8-40
project file to protect your assets.
Prevention of incor- Operation authority You can set operation authorities to restrict the 8-42
rect operation verification operations that can be performed on the CPU
Unit from the Sysmac Studio.
CPU Unit write protec- You can prevent rewriting data in the Controller 8-44
tion from the Sysmac Studio.
Prevention of incor- CPU Unit names You can check to see if the CPU Unit name and 8-45
rect connections serial ID on the computer and in the Controller
are the same to prevent going online with the
wrong Controller.

* A CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher are required.

8-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-5-1 Authentication of User Program Execution IDs

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

A user program execution ID


is registered in the CPU Unit.
CPU Unit

User program execution ID


Download

The CPU Unit can


User program User program execute the user
program only when
these two match.
User program
execution ID assigned
to user program.
User program execution ID User program execution ID

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.

8-5-1 Authentication of User Program Execution IDs


2 Assign the user program execution ID to the user program offline from the Sysmac Studio.

Precautions for Correct Use


After you assign a user program execution ID to a user program, you cannot change or delete
the ID. To use a different ID, read the project file without an ID that was backed up in step 1,
above, and assign another user program execution ID. To delete the ID, use the project file with-
out an ID that was backed up in step 1, above.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-35


8 CPU Unit Functions

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.

Precautions for Correct Use


After you assign a user program execution ID to the CPU Unit, you cannot read or delete the ID.
To delete the ID from the CPU Unit, perform the Clear All Memory operation on the CPU Unit.

 Operation When an ID Verification Error Occurs

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.

8-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

 Other Situations

To Delete the User Program Execution ID Assigned to the User Program:


Read the backed up project file in the Sysmac Studio.

To Delete the User Program Execution ID from the CPU Unit:


Connect the Sysmac Studio to the CPU Unit online and perform the Clear All Memory operation.

To Check the User Program Execution ID Assigned to the User Program:


For security, the user program execution ID that is assigned to the user program cannot be checked
from the Sysmac Studio. Read the backed up project file in the Sysmac Studio and set the user pro-
gram execution ID again.

To Check the User Program Execution ID in the CPU Unit:


For security, the user program execution ID that is set in the CPU Unit cannot be checked from the
Sysmac Studio. Perform the Clear All Memory operation and register the correct user program exe-
cution ID.

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

8-5-1 Authentication of User Program Execution IDs


None None
None A ID Verification Error Not possible.
A None
A B

Operation When the IDs Do Not Match


When the IDs do not match, an ID Verification Error (major fault level Controller error) occurs, and
the CPU Unit does not operate. However, to reset the error you must cycle the power supply to the
Controller or reset the Controller from the Sysmac Studio.

 User Program Execution ID Character Specifications


Usable characters Case sensitivity Maximum size (without NULL)
0 to 9, A to Z, and a to z Case sensitive 8 to 32 characters

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-37


8 CPU Unit Functions

8-5-2 User Program Transfer with No Restoration Information


You can transfer the user program to the CPU Unit without the source code. This prevents anyone from
displaying the user program on another computer even if they upload it.

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.

Normal Transfer User Program Transfer with No Restoration Information

Sysmac Studio Sysmac Studio

CPU Unit CPU Unit

User program User program


(for execution) (for execution)

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.

8-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-5-3 Overall Project File Protection


You can place a password on a project file to protect your assets.

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 pass-
word.

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.

8-5-3 Overall Project File Protection

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-39


8 CPU Unit Functions

8-5-4 Data Protection


You can place protection on part of the data in a project file to protect your assets.

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

Levels of Access Restrictions


You can select one of the following levels of access restrictions.
• Prohibiting copying, displaying, and changing the data
• Prohibiting displaying and changing the data
• Prohibiting changing the data
The following table shows the data access methods, restrictions for each restriction level, and the
length of time that protection is cleared.

Levels of access restrictions


Prohibiting
Prohibiting
copying, dis- Prohibiting Length of time that pro-
Data access operation displaying
playing and changing the tection is cleared
and changing
changing the data
the data
data
Displaying the data Restricted. Restricted. Not restricted. While the project is open
Printing the data Restricted. Restricted. Not restricted.
Changing the data Restricted. Restricted. Restricted.
Copying the data Restricted. Not restricted. Not restricted. Protection must be tem-
porarily cleared for each
operation
Displaying basic comparison Not restricted. Not restricted. Not restricted. This operation is not
results restricted.
Displaying detailed comparison Restricted. Restricted. Not restricted. While the project is open
results
Jumping from an event log or Restricted. Restricted. Not restricted.
cross-reference to the data
Registering objects in a library Restricted. Not restricted. Not restricted. Not possible to clear pro-
tection temporarily.

8-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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.

8-5-4 Data Protection

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-41


8 CPU Unit Functions

8-5-5 Operation Authority Verification

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.

8-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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.

 Examples of Online Operations for Operation Rights


Examples of the online operations that are allowed for each operation authority are given below.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details.
OK: Operation possible, VR: Verification required for each operation, NP: Operation not possible
Adminis- Main-
Status monitor (example) Designer Operator Observer
trator tainer
Monitoring errors for troubleshooting OK OK OK OK OK

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

8-5-5 Operation Authority Verification


Adminis- Main-
Controller operations (examples) Designer Operator Observer
trator tainer
RUN mode/PROGRAM mode OK OK VR NP NP
Online editing OK OK VR NP NP
Resetting the Controller OK OK NP NP NP
Resetting errors (troubleshooting) OK OK OK VR NP
Starting or restarting an MC Test Run OK OK VR NP NP
User program execution IDs for Controllers OK NP NP NP NP
CPU Unit write-protection OK OK OK NP NP

 Password Specifications
Item Description
Valid number of characters 8 to 32
Applicable characters Single-byte alphanumeric characters (case sensitive)

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-43


8 CPU Unit Functions

8-5-6 CPU Unit Write Protection


This function disables the ability to write data to CPU Units to protect user program assets and prevent
misuse.

 Controller Write Protection at Startup


This setting automatically enables write protection when you turn ON the power supply to the Controller.
Sysmac Studio

CPU Unit CPU Unit

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.

Access point Setting group Setting Description Set values


Operation Settings, Security Settings Write Protection at Sets whether to Do not use.
Operation Settings Startup enable write protec- Use.
Tab, Basic Settings tion.

 Setting and Removing Write Protection from the Sysmac Studio


In the Sysmac Studio, go online and select Security − CPU Unit Write Protection from the Control-
ler Menu to toggle write protection.
Sysmac Studio

CPU Unit

None
You can turn write
protection ON and
OFF.

When power is turned ON

Write protection Not


set? enabled.

Enabled

Changed from the


Writing disabled. Sysmac Studio. Writing enabled.

8-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-5-7 CPU Unit Names and Serial IDs

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

CPU Unit CPU Unit

CPU Unit CPU Unit


name: A name: B
A check is performed
to see if the CPU Unit
name matches for
online connections.

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

8-5-7 CPU Unit Names and Serial IDs


To change the name, right-click the Controller icon and select Rename.

2 When you first connect to the CPU Unit online, the Sysmac Studio prompts you to store the
CPU Unit name in the CPU Unit.

3 After that, when you connect to the CPU Unit online, the Sysmac Studio refers to the CPU Unit
name in the project and the CPU Unit name of the CPU Unit you connect to. A warning dialog
box is shown if they do not match, and you are asked whether to continue to connect.

Additional Information

You can name EtherNet/IP ports in the Network Configurator.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-45


8 CPU Unit Functions

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

1. When you connect online, the serial ID is


CPU Unit name: A obtained from the CPU Unit.
Serial ID

CPU Unit
CPU Unit

CPU Unit name: CPU Unit name:


A B
Serial ID Serial ID
2. A check is performed to
see if the CPU Unit name
and serial ID match for
online connections.

8-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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

8-6-1 Forced Refreshing

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

8-6-1 Forced Refreshing


CPU Unit

I/O port
(1) I/O port changed to Device variable
TRUE with forced
refreshing. FALSE
TRUE TRUE

(2) I/O port and device variable change to TRUE.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-47


8 CPU Unit Functions

 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

(2) The I/O port and the output to the external


device change to TRUE. The device variable
changes with the result of user program
execution.

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 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 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 memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

Number of Simultaneous I/O for Forced Refreshing


The number of variables that you can refresh with forced refreshing is listed below.
• CJ-series Units: 64 points total
• EtherCAT slaves: 64 points total
The number of external I/O points are given for the above limits. For example, if more than one variable
is assigned the same external I/O point as the AT specifications, it is counted as only one point.

8-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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

 Procedure for Forced Refreshing from Ladder Editor


1 Select Monitor from the Controller Menu. The monitor turns ON.

2 Double-click the ladder program, ladder function, or ladder function block under Programming
in the Multiview Explorer.

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 condition 8
changes accordingly.
A mark that indicates that the input or output has forced status is displayed as shown below.

8-6-1 Forced Refreshing

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

FALSE 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-49


8 CPU Unit Functions

Affect of Operating Modes and Power Interruptions


 Operating Modes for Forced Refreshing
You can execute forced refreshing in either PROGRAM mode or RUN mode. Forced refreshing is
not possible while there is a major fault level Controller error.

 Status of Forced Refreshing during Operating Mode Changes or Power


Interruptions
By default, the forced refreshing is cleared when the operating mode changes between RUN mode
and PROGRAM mode and when the power is interrupted.

Holding/Clearing Forced Refreshing


Forced refreshing is retained and cleared according to changes in the status of the CPU Unit as shown
below.
Change in status Forced refreshing status
When power is turned ON Cleared
When operating RUN to PROGRAM mode Cleared
mode changes PROGRAM to RUN mode
After downloading Cleared
When a major fault level Controller error occurs Cleared
During online editing Retained

Programming Precautions for Forced Refreshing


If forced refreshing is set in the user program, the status of variables for which forced refreshing is spec-
ified are overwritten by the user program. Therefore, the status that is specified for forced refreshing is
not maintained in the user program. However, refreshing to external devices uses the values that were
specified for forced refreshing, and not the status of the variables in the user program. If forced refresh-
ing is used in a program, the values of variables in the program may be different from the status of the
external outputs.
Example: When a Is Refreshed to TRUE with Forced Refreshing

TRUE for forced refreshing, but


When FALSE
FALSE in the program.

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

When There Is Another Input that is Controlled by the Forced Input

8-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

When FALSE TRUE for forced refreshing, but


FALSE in the program.
x
OFF a • a is FALSE in the program. Because of this, b is FALSE.
OFF • When the output is refreshed, information from forced
refreshing is reflected and the external output of a is
a TRUE.
OFF
b
OFF External output
of a: TRUE
a is FALSE in the program. As a result, b is FALSE.

Precautions for Safe Use


• Confirm that no adverse effect will occur in the system before you use forced refreshing.
• Forced refreshing ignores the results of user program execution and refreshes I/O with the
specified values. If forced refreshing is used for inputs for which I/O refreshing is not sup-
ported, the inputs will first take the specified values, but they will then be overwritten by the
user program.
Depending on the difference in the forced status, the control system may operate unexpectedly.

8-6 Debugging
8

8-6-1 Forced Refreshing

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-51


8 CPU Unit Functions

8-6-2 Changing Present Values

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

You can change the


values of variables
as required.

Precautions for Safe Use


Always confirm the safety of the system before you change the present value of a variable.

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.

 Changing the Values of Other Variables


You can change the present values of user-defined variables, system-defined variables, and device
variables as required. You can do this on a Watch Tab Page.

Precautions for Safe Use


Always confirm the safety of the system before you change the present value of a variable.

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-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Precautions on Changing the Status of Outputs Assigned to


External Devices by Changing Present Values
Observe the following precautions when you change the status of an output that is assigned to an I/O
port of a CJ-series Basic Output Unit or EtherCAT output slave by changing a present value.

 Changing Present Values in the I/O Map in RUN Mode


Any value of an I/O port that is changed in the I/O Map is then overwritten by the execution results of
the user program. The value that was specified by changing the present value is not output to the
external device. To change the value of an I/O port and output that value to an external device, use
forced refreshing.

 Changing Present Values in a Watch Tab Page in PROGRAM Mode


The value that was specified in a Watch Tab Page by changing the present value of a device vari-
able* that is defined as an external or local variable is not output to the external device. To output a
specified value to an external device, do one of the following:
• Use forced refreshing.
• Change the present value in a Watch Tab Page of a device variable* that is defined as a global
variable.
* The devices variables must be assigned to an I/O port of a CJ-series Basic Output Unit or EtherCAT output
slave. This also applies to a global variable with an AT specification to an output bit that is assigned to a CJ-
series Basic Output Unit.

 Precaution When Directly Writing to I/O Memory Addresses Assigned to


Output Bits for CJ-series Basic Output Units

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 memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.
8

8-6-2 Changing Present Values

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-53


8 CPU Unit Functions

8-6-3 Online Editing


This section introduces online editing. Refer to the Sysmac Studio Version 1 Operation Manual (Cat.
No. W504) for details.

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.

Sysmac Studio Operations


 Performing Online Editing
1 Select the item to edit online.

2 Select Online Edit from the Project Menu.

3 Make the required changes.

4 Select Online Edit − Transfer from the Project Menu.

5 Check the results.

6 The user program will begin operation after online editing.

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-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Precautions for Correct Use


• The differentiation status of differentiated instructions in a program that is edited online is ini-
tialized.
• When online editing changes are applied, the execution times of the tasks are extended. Set
the task period appropriately so that you do not cause a Task Period Exceeded error due to
online editing.
• If the power supply to the Controller is interrupted when online edits are being saved,* a major
fault level Controller error (User Program/Controller Configurations and Setup Transfer Error,
Incorrect User Program/Controller Configurations and Setup, or Non-volatile Memory
Restored or Formatted) occurs. If one of these errors occurs, download the user program
again.
• Do not execute the MC_SaveCamTable instruction while online edits are being saved.* Other-
wise the online edits may not be saved correctly.
* Online edits are saved from when you click the Yes Button in the confirmation dialog box until the Online
Editing Pane closes. However, with a CPU Unit with a unit version of 1.04 or later and Sysmac Studio ver-
sion 1.05 or higher, saving continues until the dialog box that indicates saving data to built-in non-volatile
memory (which is displayed after the confirmation dialog box) closes.

8-6 Debugging
8

8-6-3 Online Editing

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-55


8 CPU Unit Functions

8-6-4 Data Tracing


You can use data tracing to sample variables without any additional programming. You can read and
check the data from the Sysmac Studio, and save the data to a file. This is used to start up, operate,
and maintain devices.
This section introduces data tracing. Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No.
W504) for specific operating procedures.
The two tracing methods are described below.

 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.

When the maximum number of sampled


variables is reached, the trace stops
and the trace data is sent to the
Sysmac Studio and displayed.

 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-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Data Tracing Specifications


The following table gives the specifications of data tracing.
Item Description
Set a trigger condition to start sampling. Data from
Single triggered trace
before and after the condition is met is saved.
Types of data traces
Sample data is transferred to a computer as it is col-
Continuous tracing
lected and saved to a file.
Specify a task. The period of that task is set as the sam-
Period of specified task
pling period.*1
The time you enter is set as the sampling period. How-
Setting of timing of
Specified fixed interval ever, the time you enter is rounded off to an integer multi-
sampling
ple of the primary periodic task.
Trace sampling instruc- With this method, sampling is performed whenever the
tion TraceSamp instruction is executed in the user program.
NX701-: 192 variables
NX1P2-: 48 variables
Maximum number of
NJ501-: 192 variables
targets
NJ301-: 48 variables
Setting sampled data*2 NJ101-: 48 variables
Basic data types except for text strings
Arrays (specify the element)
Data types
Enumerations
Members of structures and unions
Maximum number of records 10,000 samples per variable

8-6 Debugging
The trigger position is set in respect to the overall trace
Setting trigger positions
time or quantity.
Basic data types except for times, durations, dates, and
text strings
Condition data types
Arrays (specify the element), structures (specify the
member), and unions (specify the member)
Tracing is started when one of the following conditions is
8
met.
BOOL: TRUE or FALSE

8-6-4 Data Tracing


Condition expression*3
Non-BOOL: Equals (=), Greater than (>), Greater than or
equal (≥), Less Than (<), Less than or equal (≤), Not
equal (≠)*4
Commands from Sys- Tracing starts when the Trigger TRUE Button is clicked.
Setting triggers mac Studio
Data Trace Trigger Tracing starts when the TraceTrig instruction is executed.
instruction
• If something other than the TraceSamp instruction is
used to set the timing of sampling, the trigger is evalu-
ated only once in the specified task period.
Evaluation timing
• If the TraceSamp instruction is used to set the timing of
sampling, the trigger is evaluated whenever the
instruction is executed.
A slider is used to set the percentage of sampling before
Delay and after the trigger condition is met.
(Example: 20%/80%)

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-57


8 CPU Unit Functions

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.

Stopping a trace • If stopping tracing is set as the operation to perform


when the maximum number of samples is reached,
tracing stops when the maximum number of samples
Continuous traces or maximum amount of time is reached.
• Tracing is stopped when the Stop Button is clicked on
the Sysmac Studio.
Maximum data storage You can set the maximum amount of time to save contin-
period uous trace data.
Maximum data storage You can set the maximum total size of all files saved
size during continuous tracing.
You can set the number of samples to save in each file
Data items per file
during a continuous trace.
Setting continuous You can specify the location to create files to save data
File save location
tracing during a continuous trace.
You can specify a prefix to automatically add to the
File name prefix
beginning of the file names.
You can specify the operation to perform when the stor-
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 variables
on the same graph.
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.
You can position a virtual composition model in 3D space
3D Motion Monitor Dis-
and display the composition motion based on the com-
play Mode
mand positions and actual positions of the motion axes.
You can save the trace results and all settings other than
Exporting trace data Exporting to CSV files
the trace number to a CSV file.
NX701-: 4 traces
Number of data traces that can be executed NX1P2-: 2 traces
NJ501-: 4 traces
simultaneously*5
NJ301-: 2 traces
NJ101-: 2 traces
You can display CSV format trace results on top of the
Importing trace data
current graph.
You can save the trace results in the project along with
Saving
the trace settings.
You can print graphs. The Sysmac Studio’s printing func-
Printing
tionality is used.

*1 For an NJ-series CPU Unit and NX701 CPU Unit, if you perform an internal variable with a data size of 64 bits
or more to the sampled data, specify the task that assigns the program in which the target internal variable is
defined. If the different task is specified, the concurrency of variable values may not be ensured.

8-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

*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 NX1P2, NJ301
and NJ101. These numbers are used to execute instructions and to access system-defined variables.

Data Trace Operation


Processing for data traces (sampling and trigger detection) are performed in System Common Process-
ing 1, between I/O refreshing and user program execution.
Example: If sampling is specified in the primary periodic task, data tracing is executed in System Com-
mon Processing 1, as shown in the following diagram.

Primary period Primary period


processing 1

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.

8-6 Debugging
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. 8
W508) are based on the task periods, so the display are not the same as those for data tracing.

8-6-4 Data Tracing

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-59


8 CPU Unit Functions

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
changes for output processing for I/O refreshing are changed in the same task period.

Example 2:
When the Button2 variable (assigned to an input signal from a pushbutton) changes to TRUE during
velocity control, the user program in this example decelerates axis 0 (MC_Axis000) to a stop.

The data trace operations and display of the execution results are given below.
1. In data trace processing in System Common Processing 1, TRUE is obtained for Button2.
2. STP_BSY is changed to TRUE in the user program and the Motion Control Function Module per-
forms deceleration processing.
3. In data trace processing in System Common Processing 1 in the next primary period, TRUE is
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.

8-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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

8-6 Debugging
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.
8

8-6-4 Data Tracing


Related System-defined Variables
Variable name
Meaning Description Data type R/W
Member
_PLC_TraceSta[0..3] * _sTRACE_STA R
.IsStart Trace Busy Flag TRUE when a trace starts. BOOL R
.IsComplete Trace Completed TRUE when a trace is completed. BOOL R
Flag Changes to FALSE when the next trace
starts.
.IsTrigger Trace Trigger TRUE when the trigger condition is met. BOOL R
Monitor Flag Changes to FALSE when the next trace
starts.
.ParamErr Trace Parameter Changes to TRUE when a trace starts if BOOL R
Error Flag there is an error in the trace settings.
FALSE when the settings are normal.

* These numbers correspond to the data trace numbers 0 to 3.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-61


8 CPU Unit Functions

8-6-5 Differential Monitoring


Differential monitoring reports the number of times the value of the specified BOOL variable matches
the specified condition. The specified condition is evaluated for a match in every task period of the pri-
mary periodic task (called the primary period). Differential monitoring provides a running total of the
number of times the condition is matched.

Sysmac Studio

CPU Unit

The number of times the


value of the BOOL variable
changes is reported.

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.

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.

8-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Specifications of Differential Monitoring


The specifications of differential monitoring are given in the following table.

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

Differential Monitoring Conditions

8-6 Debugging
The variables and the changes that you can monitor with differential monitoring are called differential
monitoring conditions. The specifications for the differential monitoring conditions are described below.

 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.
8
 Specified Variables
The data types of the variables that you can specify for differential monitoring are given below.

8-6-5 Differential Monitoring


• 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.

Type of variables Specification


System-defined variables Possible.*1
Semi-user-defined variables Possible.
User-defined vari- Global variables Possible.
ables Variables used in a program Possible.
Variables used in a function block Possible.*2
Variables used in a function Not possible.

*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-63


8 CPU Unit Functions

 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

Precautions for Correct Use


For example, we will assume the condition expression was set to a change to TRUE. Even if the
value of the specified variable is TRUE when differential monitoring is started, the status of the
value of the variable is not detected as a change to TRUE. The value of the variable must first
change to FALSE and then to TRUE to be considered as a change to TRUE.

When Conditions Are Evaluated and the Match Count


The condition for the specified variable is evaluated every primary period. The value of the variable
from the previous evaluation is compared with the value of the variable for the current evaluation. If
the value of the variable that matches the specified condition has changed, the count is incre-
mented.
• The number of times a condition match occurs is counted separately for each variable.
• The count values are reset to zero when differential monitoring is started.
• The count value for just one variable cannot be reset to zero.

Precautions for Correct Use


• 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.

Start Condition and Stop Condition


Use the Sysmac Studio to start differential monitoring.
Normally, use the Sysmac Studio to stop differential monitoring. Differential monitoring will stop
automatically at the following times.
• When a major fault level Controller error occurs
• When the user program is downloaded
• When the Clear All Memory operation is performed
• When an online connection to the Sysmac Studio is broken

8-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Procedure
Use the following procedures to control differential monitoring. Refer to the Sysmac Studio Version 1
Operation Manual (Cat. No. W504) for details.

1 Select Differential Monitor from the View Menu on the Sysmac Studio.

2 Right-click a variable that can be specified for differential monitoring and select Add Differential
Monitor.

3 Set the differential monitoring condition expression for each variable in the Differential Monitor
Window.

4 Execute the user program.


The number of times that the condition is met for each variable is displayed in the Differential
Monitor Window.

8-6 Debugging
8

8-6-5 Differential Monitoring


Precautions for Differential Monitoring
Observe the following precautions when you use differential monitoring.

 Loss of Communications with Sysmac Studio While Differential Monitoring Is


in Progress
Let’s assume that communications with the Sysmac Studio were cut off during differential monitoring
because the communications cable was disconnected or because the Sysmac Studio ended due to
an error. In such cases, the CPU Unit will continue execution of differential monitoring. To restart
execution of differential monitoring, you must resume communications with the Sysmac Studio and
stop differential monitoring.

 Simultaneous Execution of Differential Monitoring


You cannot run differential monitoring from more than one copy of the Sysmac Studio running on the
same computer or from the Sysmac Studio running on different computers.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-65


8 CPU Unit Functions

 Specifying Global Variables and External Variables


You can specify global variables or external variables (which specify global variables in POUs) for
differential monitoring. Keep in mind that the values of global variables and external variables are
updated at different times. A global variable is updated as soon as the value is written. An external
variable, however, is updated only when the CPU Unit executes the POU in which that external
variable is declared. The following figure shows this. In this example, the following two variables are
monitored.

Variable Type of variable POU that executes the read/write


GVar1 Global variable The P1 program that is assigned to the primary peri-
odic task
P2.GVar1 This is an external variable that is The P2 program that is assigned to the periodic task
declared in the P2 program and points
to GVar1.

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.

Refreshing task Accessing task


Program P1 Program P2
Read/write Reading
External variable GVar1 Global variable GVar1 External variable GVar1

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

Primary periodic task P1 P1 P1 P1 P1 P1 P1 P1


(refreshing task)
TRUE is FALSE is TRUE is FALSE is TRUE is FALSE is TRUE is FALSE is
written. written. written. written. written. written. written. written.
P1.GVar1 TRUE
(external FALSE
variable)

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-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-7 Event Logs


This section describes the event logs.

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

 NX-series CPU Units

You can check the current


Controller events and the event
log of past events.

Sysmac Studio NX-series CPU Unit NX Units NX Units

8-7 Event Logs


Event PLC Function Motion Control EtherCAT Master EtherNet/IP NX Bus Function
sources Module Function Module Function Module Function Module Module

User program Event logs


Or Create User-defined
Error (SetAlarm)
Event logs instruction

NS/NA-series PT Create User-defined


Information (SetInfo)
instruction 8

Battery

8-7-1 Introduction
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 NX1P2 CPU Unit.

Precautions for Correct Use


• Only the NX1P2 CPU Units have the NX Bus Function Module.
• You can only mount the NX Units on the NX1P2 CPU Units.
• Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-67


8 CPU Unit Functions

 NJ-series CPU Units

You can check the current


Controller events and the event
log of past events.

NJ/NX-series CPU Unit CJ-series


Units

Event PLC Function Motion Control EtherCAT Master EtherNet/IP Errors in


sources Module Function Module Function Module Function Module Special Units
Sysmac Studio

Or User program

Create User-defined
Error (SetAlarm)
Event logs instruction

NS/NA-series PT Create User-defined


Information (SetInfo)
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.

Precautions for Correct Use


• You can use CJ-series Units only with NJ-series CPU Units.
• Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

8-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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.

 System-defined Events (Controller Events)


The Controller automatically detects these events. Controller events include events for the function
modules in the CPU Unit, NX Units, NX-series Slave Terminals, EtherCAT slaves, and CJ-series
Units. The different types of system-defined events are as follows:
• Controller errors
• Controller information

 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.

8-7 Event Logs


8-7-2 Detailed Information on Event Logs

Event Sources
This information identifies where an event occurred in the Controller. The event sources are given 8
below for Controller events and user-defined events.

8-7-2 Detailed Information on Event Logs


 Sources of Controller Events
Controller events occur in the function modules in the CPU Unit.
For some function modules, there is more detailed information about the event source. This informa-
tion is called the detailed event source.
The following are Controller events.
Event source Source details
PLC Function Module Instruction, power supply, built-in I/O, Option Board, I/O
bus master or CJ-series Unit*1
NX Bus Function Module*1 Master or NX Unit
Motion Control Function Module Common, axis, or axes group
EtherCAT Master Function Module Communications port, EtherCAT master, or EtherCAT
slave
EtherNet/IP Function Module Communications port/communications port 1/communica-
tions port 2, CIP/CIP1/CIP2, FTP, NTP, or SNMP

*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 NX1P2 CPU Units have the NX Bus Function Module.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-69


8 CPU Unit Functions

 Sources of User-defined Events


User-defined events occur in the PLC 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 NX1P2 NJ501 NJ301 NJ101
Controller events System log 2,048 576 1,024 512 512
Access log 1,024 528 1,024 512 512
User-defined events User event log 1,024 512 1,024 512 512

Retaining Events during Power Interruptions


When the power is interrupted, the NJ-series CPU Unit and NX701 CPU Unit use a Battery to retain the
event logs, and the NX1P2 CPU Unit uses non-volatile memory to retain the event logs.

Precautions for Correct Use


For the CPU Unit that uses a Battery to retain the event logs, the event logs are not retained
when there is no Battery.
Periodically export event logs as required.

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.

8-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Event Levels
Each event has an event level that indicates its level. The event level depends on the type of event. Lev-
els 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.

The event levels are defined for user-defined events.

8-7 Event Logs


No. Level Type Meaning
1 High User fault Level 1 These event levels indicate a user-defined error in an
2 User fault Level 2 application. The user executes the SetAlarm (Create
User-defined Error) instruction to create the event.
3 User fault Level 3
4 User fault Level 4
5 User fault Level 5 8
6 User fault Level 6
7 User fault Level 7

8-7-2 Detailed Information on Event Logs


8 User fault Level 8
9 Low User Information These event levels indicate user-defined information
in an application. The user executes the SetInfo
(Create User-defined Information) instruction to cre-
ate the event.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-71


8 CPU Unit Functions

Displaying Event Logs


The Sysmac Studio or an HMI displays two event logs: the Controller event log and the user-defined
event log. The Controller logs include both the access log and the system log.
The Sysmac Studio can also display the error logs that are recorded in the CJ-series Units and Ether-
CAT slaves.
The events in these logs are displayed in tables on the Sysmac Studio. Select an event from the table to
display detailed information.

Additional Information

If an event occurs in the Controller that is not supported by the version of the Sysmac Studio or
an HMI, the source is displayed as “Unknown” and the event name is displayed as “Unknown
Event.” The event code and attached information are displayed correctly.

8-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Clearing Event Logs


 Clearing Event Logs from the Sysmac Studio or an HMI
You can clear the event logs from the Sysmac Studio or from an HMI. You can clear the Controller
event log and user-defined event log separately.

Precautions for Correct Use


• If you need to delete event log in the CPU Unit from the Sysmac Studio or an HMI, make sure
you do not need any of the event information before you delete the event log. You may have
overlooked some important information and observation level Controller events or user-
defined events. Always check for these before you delete an event log.
• Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for restrictions on clearing
an event log from the PT.

 Clearing Event Logs with the Clear All Memory Operation


When you perform the Clear All Memory operation for an NJ/NX-series CPU Unit from the Sysmac
Studio, you can select whether to clear the event logs.

Exporting Event Logs


You can use the Sysmac Studio or an HMI to export the displayed event log to a CSV file.

8-7 Event Logs


8

8-7-2 Detailed Information on Event Logs

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-73


8 CPU Unit Functions

8-7-3 Controller Events (Controller Errors and Information)

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 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.

 Controller Information
Controller information is system-defined notification information. This information does not indicate
errors. It represents information level Controller events. Examples include events other than errors,
such as turning the power ON and OFF, starting and stopping operation, connecting the Sysmac
Studio online, and downloading user programs.

8-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

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

8-7 Event Logs


8

8-7-3 Controller Events (Controller Errors and Information)

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-75


8 CPU Unit Functions

8-7-4 User-defined Events (User-defined Errors and Information)

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.

Event Setting Tables

Event code Event name Level Group Details


100 Failure X User fault level 1 Control A (001)

Instruction Event logs


Program

SetAlarm An event occurs.


User-defined events

System-defined Variables

User-defined error status

8-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Application Procedures
Use the following procedures.

 User-defined Errors
1. Register a user-defined error in the Event Setting Table.

2. Execute the Create User-defined Error (SetAlarm) instruction.


(Specify an event code that is defined in the Event Setting Table.)

3. A user-defined error occurs.

4. The corresponding system-defined variable _AlarmFlag (User-defined Error


Status) changes to TRUE. Execute any process for that condition.

5. Check the user-defined error in the event log with the Sysmac Studio, an
instruction, or an HMI.

8-7 Event Logs


 User-defined information
1. Register user-defined information in the Event Setting Table.

8
2. Execute the Create User-defined Information (SetInfo) instruction.

8-7-4 User-defined Events (User-defined Errors and Information)


3. Check the record in the event log.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-77


8 CPU Unit Functions

Setting the Event Setting Table


To create a user-defined error or user-defined information, register the user-defined error or user-
defined information in the Event Setting Table in the Sysmac Studio in advance.
The user events that you set here can be displayed on the Sysmac Studio or an HMI with the same
information.
You can register up to 5,120 events in the Event Setting Table.

Event Setting Table

Event Setting Table


Event code Event name Level Group Details

10001 Failure X User fault Level3 Control A (001)


Details
Description
Failure X occurred.
Correction
Perform safety checks and handle the problem
according to the cause code.

Programming Example

Detection condition Failure

SetAlarm
Normal end
EN ENO

Code OutVal
UINT#102

Var1 Info1

Var2 Info2

The following items are set in the Event Setting Table.

8-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

 Contents of the Event Setting Table


Item Description Values
Event Code You can specify a number to identify the User-defined error: 1 to 40,000
event according to the event level. User-defined information: 40,001 to
60,000
Event Name You can include a title for the event. 128 characters max.
Event Level You can specify the level of the event. User-defined error: User fault levels: 1 to
The level is indicated with a number. 8
The lower the number is, the higher the User-defined information: User informa-
level is. tion
Group You can specify a group name to repre- 32 characters max.
sent the location or type of the event. There are no restrictions on the charac-
You can use user-defined groupings for ters that can be used. Case sensitive.
the events. Reserved words: None
Details You can include a message that 1,024 characters max.
describes the event. The user can enter There are no restrictions on the charac-
any text string. The message is used ters that can be used. Case sensitive.
when the event is displayed on the Sys- Reserved words: None
mac Studio or an HMI.
Error details that are Refer to the additional information that is 128 characters max.
displayed on the HMI given below on displaying user mes- There are no restrictions on the charac-
when a major fault level sages on an HMI when a major fault ters that can be used.
Controller error occurs level Controller error occurs for more
Case sensitive. Reserved words: None
details.
Comment The comment is attached for each set of
table entries.

8-7 Event Logs


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.

8
Additional Information

8-7-4 User-defined Events (User-defined Errors and 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-79


8 CPU Unit Functions

 Event Levels and Event Codes


Range of corre-
Event classi- Event level cate-
Level sponding event Description
fication gory*
code
User-defined High User fault Level1 1 to 5000 Select from eight levels.
errors User fault Level2 5001 to 10000
User fault Level3 10001 to 15000
User fault Level4 15001 to 20000
User fault Level5 20001 to 25000
User fault Level6 25001 to 30000
User fault Level7 30001 to 35000
User fault Level8 35001 to 40000
Low
User-defined Lowest User Information 40001 to 60000 The event type is user-defined
Information information.

* User-defined error levels are separate from Controller error levels.

Precautions for Correct Use


If you update the Event Setting Table and transfer it to the CPU Unit, the event logs for user-
defined events still contain old information. This can result in inconsistencies with the new Event
Setting Table. Program operations with caution.

Related Instructions
There are instructions that you can use to create and check user-defined errors and to clear existing
user-defined errors.

 Creating and Clearing User-defined Errors


Use the following instructions to create and reset user-defined errors and to create user-defined infor-
mation. Up to 32 events per level can occur simultaneously, for a total of 256 possible simultaneous
events.
Instruction name Instruction Description
Create User-defined SetAlarm The SetAlarm instruction creates a user-defined error.
Error
Reset User-defined ResetAlarm The ResetAlarm instruction resets a user-defined error.
Error
Create User-defined SetInfo The SetInfo instruction records the specified user-defined informa-
Information tion in the event log.

 Checking for User-defined Errors


You can use the Get User-defined Error Status (GetAlarm) instruction to obtain the status of the cur-
rent user-defined errors and the highest priority event level and code of the current user-defined
errors.

8-80 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Example:

Event Setting Table

Event code Event name Level Group Details

10001 Failure X User fault Level3 Control A (001)


Details
Description
Failure X occurred.
Correction
Perform safety checks and handle the problem
according to the cause code.
Actual Programming

Detection condition Error


GetAlarm
EN

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

8-7 Event Logs


When a Low Battery Voltage error occurs, the event code (16#000B0000) is obtained and the fol-
lowing 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 8
power supply.

Example 2

8-7-4 User-defined Events (User-defined Errors and Information)


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

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-81


8 CPU Unit Functions

System-defined Variables Related to User-defined Errors


Variable Data
Meaning Description R/W
name type
_AlarmFlag User-defined The bit corresponding to the event level is TRUE while there WORD R
Error Status is a user-defined error. Bits 00 to 07 correspond to user
fault levels 1 to 8.

Records in Event Log


An event is recorded in the event log when you create user-defined information or a user-defined error,
or when you use the ResetAlarm instruction to reset an error. When this happens, the time, event code,
event level, and attached information 1 and 2 are recorded in the user-defined event log in the event
logs.

Reset User-defined Errors


User-defined errors are cleared when the power supply to the NJ/NX-series Controller is turned ON.
You can also clear errors with the Sysmac Studio, the Reset User-defined Error instruction (ResetA-
larm) and an HMI.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details.

8-82 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

8-8 Changing Event Levels


Errors, status changes, and user-defined events that occur in the NJ/NX-series Controller are all called
events. You can tell what type of event has occurred by viewing the display in Sysmac Studio, or by
checking the indicators on the front panel of the CPU Unit.
There are two types of events: Controller events that are defined in the system and user-defined events.
The Controller events are further classified into five event levels. Refer to Event Levels on page 8-71 for
details on event levels.
You can change the event levels that are assigned to some of the Controller events.

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.

8-8-1 Applications of Changing Event Levels


The lighting pattern for the indicators on the front panel of the CPU Unit is predefined according to the
event level that is assigned to each Controller event. You can change the event level for some events to

8-8 Changing Event Levels


change how the Controller operates when that event occurs.
For example, the ERROR indicator flashes for minor fault level events and stays unlit for observation
level events. You can change the lighting pattern of the ERROR indicator so that it goes out or flashes
for a given event.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for details on how the Controller
operates for different event levels.

8-8-2 Events for Which the Event Level Can Be Changed


8
Whether an event level can be changed depends on the specific event.

8-8-1 Applications of Changing 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-83


8 CPU Unit Functions

8-8-3 Procedure to Change an Event Level


1 Double-click Operation Settings under Configurations and Setup − Controller Setup in the
Sysmac Studio. Or right-click Operation Settings and select Edit from the menu.
The Basic Settings Display is displayed on the Operation Setting Tab Page in the Edit Pane.

2 Click the Event Level Settings Button.


A list of the events for which you can change the event level is displayed.

3 Change the levels of the required events in the Event Level column.

8-84 NJ/NX-series CPU Unit Software User’s Manual (W501)


8 CPU Unit Functions

Precautions for Correct Use


If you change an event level on the Sysmac Studio and download the event level setting to the
Controller when the event already exists on the Controller, the event will be reset when the down-
load is started. If the same event occurs again while the download is in progress, the Controller
will operate according to the previous event level. If the same event occurs after the download is
completed, the Controller will operate according to the new level.

8-8 Changing Event Levels


8

8-8-3 Procedure to Change an Event Level

NJ/NX-series CPU Unit Software User’s Manual (W501) 8-85


8 CPU Unit Functions

8-86 NJ/NX-series CPU Unit Software User’s Manual (W501)


Backup Functions
This section describes the backup functions for the settings in an NJ/NX-series Con-
troller. There are different types of backup functions that handle different data or differ-
ent storage locations. First an overall description of the backup functions is provided
followed by descriptions of the individual functions.

9-1 The Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3


9-1-1 Applications of Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
9-1-2 Examples of Operating Procedures for the Backup Functions . . . . . . . . . . . . 9-4
9-1-3 Data That Is Backed Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
9-1-4 Types of Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9-1-5 Relation Between the Different Types of Backup Functions and
Data Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
9-1-6 Applicable Range of the Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . .9-11
9-2 SD Memory Card Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9-2-1 Backup (Controller to SD Memory Card) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
9-2-2 Restore (SD Memory Card to Controller) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19
9-2-3 Verify (between Controller and SD Memory Card) . . . . . . . . . . . . . . . . . . . . 9-27
9-3 Disabling Backups to SD Memory Cards . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32 9
9-4 Automatic Transfers from SD Memory Cards . . . . . . . . . . . . . . . . . . . . . . 9-33
9-5 Program Transfer from SD Memory Card . . . . . . . . . . . . . . . . . . . . . . . . . 9-35
9-6 Sysmac Studio Controller Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-42
9-6-1 Backup (Controller to Computer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-43
9-6-2 Restore (Computer to Controller) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-44
9-6-3 Verify (between Controller and Computer) . . . . . . . . . . . . . . . . . . . . . . . . . . 9-46
9-7 Importing and Exporting Sysmac Studio Backup File Data . . . . . . . . . . . 9-47
9-8 Sysmac Studio Variable and Memory Backup Functions . . . . . . . . . . . . 9-48
9-8-1 Applicable Data for Sysmac Studio Variable and
Memory Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-48
9-8-2 Using Sysmac Studio Variable and Memory Backup Functions . . . . . . . . . . 9-48
9-8-3 Compatibility between CPU Unit Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-49
9-9 Backup Functions When EtherCAT Slaves Are Connected . . . . . . . . . . . 9-51
9-9-1 Backed Up EtherCAT Slave Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-51
9-9-2 Backup Support Depending on the Controller Status . . . . . . . . . . . . . . . . . . 9-51
9-9-3 Conditions for Restoring EtherCAT Slave Data . . . . . . . . . . . . . . . . . . . . . . . 9-52

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-1


9 Backup Functions

9-9-4 EtherCAT Slaves for Which You Can Back Up Data . . . . . . . . . . . . . . . . . . . . 9-53
9-10 Backup Functions When EtherCAT Slave Terminals Are Connected . . . 9-56
9-10-1 Backing Up Data in an EtherCAT Slave Terminal . . . . . . . . . . . . . . . . . . . . . . 9-56
9-10-2 Backup Support Depending on the EtherCAT Slave Terminal Status . . . . . . . 9-57
9-10-3 Conditions for Restoring EtherCAT Slave Terminal Data . . . . . . . . . . . . . . . . 9-57
9-11 Backup Functions When NX Units Are Connected . . . . . . . . . . . . . . . . . . 9-58
9-11-1 Backing Up Data in NX Units on the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . 9-58
9-11-2 Backup Support Depending on the Controller Status . . . . . . . . . . . . . . . . . . . 9-58
9-11-3 Conditions for Restoring NX Unit Data on the CPU Unit . . . . . . . . . . . . . . . . . 9-59
9-12 Backup Functions When CJ-series Units Are Connected . . . . . . . . . . . . . 9-60
9-12-1 Backed Up CJ-series Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-60
9-12-2 Backup Support Depending on the Controller Status . . . . . . . . . . . . . . . . . . . 9-60
9-12-3 Conditions for Restoring CJ-series Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . 9-60
9-13 Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-62
9-13-1 Types of Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-62
9-13-2 Specifications of a Backup File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
9-13-3 Specifications of a Restore Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-63
9-13-4 Specifications of an Automatic Transfer Command File . . . . . . . . . . . . . . . . . 9-66
9-13-5 Specifications of a Controller Verification Results File . . . . . . . . . . . . . . . . . . 9-69
9-13-6 Specifications of an EtherCAT Verification Results File . . . . . . . . . . . . . . . . . 9-70
9-13-7 Specifications of an EtherCAT Slave Terminal Verification Results File . . . . . 9-71
9-13-8 Specifications of an NX Unit Verification Results File . . . . . . . . . . . . . . . . . . . 9-72
9-13-9 Specifications of CJ-series Unit Verification Results File . . . . . . . . . . . . . . . . 9-73
9-14 Compatibility between Backup-related Files . . . . . . . . . . . . . . . . . . . . . . . 9-75
9-14-1 Compatibility between Backup Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-75
9-14-2 Compatibility between CPU Unit Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-76
9-14-3 Compatibility between Unit Versions of CPU Units . . . . . . . . . . . . . . . . . . . . . 9-77
9-15 Functions That Cannot Be Executed during Backup Functions . . . . . . . 9-78

9-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-1 The Backup Functions


The following three functions are supported for data backup for an NJ/NX-series Controller.

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.

The following items are described for the backup functions.

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

9-1 The Backup Functions


functions and data groups is described.
Applicable range of the backup functions The connected Units and slaves for which you can save data
with the backup functions are described.

Precautions for Safe Use


The performance may be different if the hardware revisions are different. Before you transfer the
user program, data, and parameter settings to the CPU Units with the different hardware revi-
sions, check them for proper execution and then use them for actual operation.
9
9-1-1 Applications of Backup Functions

9-1-1 Applications of Backup Functions


You can use the backup functions in the following instances.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-3


9 Backup Functions

9-1-2 Examples of Operating Procedures for the Backup Functions


You can use the backup functions to easily back up, restore, and verify Controller data.
This section provides the procedures to back up, restore, and verify data with an SD Memory Card by
using the DIP switch on the front panel of the CPU Unit.

Precautions for Correct Use


For the NX701 CPU Units, eight pins, pins 1 to 8, are provided on the DIP switch. Before you
use the backup functions, set all of pins 5 to 8 to OFF.

Backup Procedure
 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.

 Executing the Backup


3 Press the SD Memory Card power supply switch for 3 seconds.
The backup is started. The SD PWR indicator will flash, lighting for 3 seconds and going out for
0.5 seconds.
When the backup operation is completed, the SD PWR indicator will stop flashing and remain lit.

 Ending the Backup Procedure


4 Set all of pins 1 to 4 on the DIP switch on the CPU Unit to OFF.

5 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.

6 Remove the SD Memory Card.

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.

9-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

 Ending the Restoration Procedure


5 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.

6 Turn OFF the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.

 Starting Normal Operation


7 Remove the SD Memory Card.

8 Set all of pins 1 to 4 on the DIP switch on the CPU Unit to OFF.

9 Turn ON the power supply to the NJ/NX-series Controller and to the EtherCAT slaves.

Precautions for Correct Use


Restoring Data When EtherCAT Slaves Are Connected
• Always cycle the power supply to the NJ/NX-series Controller and the EtherCAT slaves after
you restore data when EtherCAT slaves are connected. If you start operation without cycling
the power supply, the Controller may perform unexpected operation.
• To verify the data after you restore data with EtherCAT slaves connected, first turn OFF the
power supply to the NJ/NX-series Controller and EtherCAT slaves, and then start in Safe
Mode before you perform the verification procedure. If you cycle the power supply normally,
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).

9-1 The Backup Functions


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.

 Verifying the Data


9
3 Press the SD Memory Card power supply switch for 3 seconds.
Data comparison is started. The SD PWR indicator will flash, lighting for 3 seconds and going
Functions
9-1-2 Examples of Operating Procedures for the Backup

out for 0.5 seconds.


If the verification operation is completed and the data is the same, the SD PWR indicator will
stop flashing and remain lit.
If the verification operation is completed and differences were found in the data, the SD PWR
indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.

 Ending the Verification Procedure


4 Press the SD Memory Card power supply switch to turn OFF the SD PWR indicator.

5 Remove the SD Memory Card.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-5


9 Backup Functions

9-1-3 Data That Is Backed Up


The following data is backed up. This section describes the backup functions based on the following
data groups for the backup data.

Data group Data items


User program and settings EtherCAT configuration (EtherCAT slave configuration and EtherCAT mas-
ter settings)
Unit Configuration and Unit Setup*1
I/O Map
Controller Setup (Operation Settings, Built-in EtherNet/IP Port Settings,
Built-in I/O Settings, and Option Board Settings)*2
Motion Control Setup
Cam Data Settings
Event Setup
Task Setup
Data Trace Settings
Tag Data Link Tables
Controller name
Operation authority verification
User program execution ID in user program
Built-in clock (time zone setting)
POUs
Data (data types and global variables)
Memory Settings for CJ-series Units*2
IP address of built-in EtherNet/IP Of the TCP/IP Settings in the Built-in EtherNet/IP Port Settings, setting
port*3 type, IP address, subnet mask, and default gateway
Present values of variables Values of variables with a Retain attribute*4
Present values of memory used for Values of the Holding, DM, and EM Areas in the memory for CJ-series
CJ-series Units Units*5
Units and slaves settings Backup parameters for EtherCAT slaves*5
Parameters in the CJ-series Units*5*7
NX Unit Settings
Absolute encoder home offset The set value to restore the actual position of a Servo Drive with an abso-
lute encoder

*1 For the NX Units on the NX1P2 CPU Unit, data of configuration information, Unit operation settings and Unit
application data is backed up.
*2 Data of Built-in I/O Settings, Option Board Settings, and Memory Settings for CJ-series Units is backed up only
for the NX1P2 CPU Units.
*3 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.
*4 Of the system-defined variables with a Retain attribute, some variables are not applicable for the data backup
function. Refer to A-6 Specifications for Individual System-defined Variables for details on the specifications for
individual system-defined variables.
*5 You can use memory for CJ-series Units and parameters in the CJ-series Units only with NJ-series CPU Units
and NX1P2 CPU Units. You can use parameters in the CJ-series Units only with NJ-series CPU Units.
*6 A part or all of the set parameters are not backed up for some EtherCAT slave models. For the details on the
target EtherCAT slaves for the data backup function, refer to 9-9-4 EtherCAT Slaves for Which You Can Back
Up Data.
*7 Refer to the CJ-series CJ2 CPU Unit Hardware User’s Manual (Cat. No. W472) for details on the data that is
backed up.

9-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Precautions for Safe Use


Precautions on the Absolute Encoder Home Offset
The absolute encoder home offsets are backed up with a Battery in the CPU Unit as absolute
encoder information. If any of the following conditions is met, clear the absolute encoder home
offsets from the list of data items to restore, and then restore the data. Then, define the absolute
encoder home again. If you do not define home, unintended operation of the controlled system
may occur.
• The Servomotor or Servo Drive was changed since the data was backed up.
• The absolute encoder was set up after the data was backed up.
• The absolute data for the absolute encoder was lost.

9-1 The Backup Functions


9
9-1-3 Data That Is Backed Up

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-7


9 Backup Functions

9-1-4 Types of Backup Functions


There are backup functions for the NJ/NX-series Controllers that save data to SD Memory Cards and
others that save data to a computer. Also, there are three methods used to execute the backup func-
tions: the CPU Unit front-panel DIP switches, system-defined variables, and the Sysmac Studio.

Functions That Save Data to SD Memory Cards


The SD Memory Card backup functions are used to back up, restore, and compare data on SD Memory
Cards. Related functions include disabling backups to SD Memory Cards, automatic transfers from SD
Memory Cards, and program transfer from SD Memory Card.

Operating method

Function name Description CPU Unit System- Reference


Sysmac
front-panel defined
Studio
DIP switch variables
SD Memory Backing The Controller data is    9-2-1 Backup
Card back- up data saved in a backup file (Controller to
ups on the SD Memory SD Memory
Card. Card)
Restor- The data in a backup   9-2-2 Restore
ing data file on the SD Memory (SD Memory
Card is transferred to Card to Control-
the Controller. ler)
Verifying The Controller data and    9-2-3 Verify
data the data in a backup file (between Con-
on the SD Memory troller and SD
Card are compared. Memory Card)
Disabling backups to SD You can disable back-  9-3 Disabling
Memory Cards ing up data to SD Mem- Backups to SD
ory Cards. Memory Cards
Automatic transfers from When the power supply  9-4 Automatic
SD Memory Cards is turned ON, the data Transfers from
in a backup file on the SD Memory
SD Memory Card is Cards
automatically trans-
ferred to the Controller.
After the data transfer,
the operating mode of
the CPU Unit will
change to the mode
that is specified in
Startup Mode setting.
Program transfer from With a system-defined  9-5 Program
SD Memory Card variable, you can trans- Transfer from
fer a program that is SD Memory
stored in the SD Mem- Card
ory Card to the Control-
ler.
After the transfer, the
operating mode of the
CPU Unit will change to
the mode that is speci-
fied in Startup Mode
setting.

9-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Functions That Save Data to the Computer


The Sysmac Studio Controller backup functions are used to back up, restore, and compare data on the
computer. Importing and exporting Sysmac Studio backup file data are used to save and read different
types of data between the Sysmac Studio projects and backup files on the computer without using a
Controller. The Sysmac Studio variable and memory backup functions are used to back up battery-
backup present values to the computer and restore them from the computer.

Operating method

Function name Description CPU Unit System- Reference


Sysmac
front-panel defined
Studio
DIP switch variables
Sysmac Stu- Backing The Controller data is  9-6-1
dio Control- up data saved in a backup file on Backup
ler backups the computer. (Controller to
Computer)
Restor- The data in a backup file  9-6-2
ing data on the computer is trans- Restore
ferred to the Controller. (Computer
to Controller)
Verifying The Controller data and the  9-6-3 Verify
data data in a backup file on the (between
computer are compared. Controller
and Com-
puter)
Importing Export- The data is exported from  9-7 Import-
and exporting ing data the project on the Sysmac ing and
Sysmac Stu- Studio to a backup file with- Exporting

9-1 The Backup Functions


dio backup out using a Controller. Sysmac Stu-
file data dio Backup
Import- The data in the backup file  File Data
ing data is imported into the Sys-
mac Studio project without
using a Controller.
Sysmac Stu- Backing You can back up the pres-  9-8 Sysmac
dio variable up data ent values of data that is Studio Vari-
and memory backed up by a battery to able and
backup func- an XML file on the com- Memory
tions puter. Backup
Functions
Restor- You can restore the pres-  9
ing data ent values of data that is
backed up by a battery
from the computer to the
9-1-4 Types of Backup Functions

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 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-9


9 Backup Functions

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.

9-1-5 Relation Between the Different Types of Backup Functions and


Data Groups
Different types of backup functions handle data for different data groups. The relation between the dif-
ferent types of backup functions and data groups is given in the following table.
(OK: Applicable, NA: Not applicable)
Data group
User program and
settings Present
IP values of Absolute
Type of backup function Present Units and
address memory encoder
values of slaves set-
of built-in used for home off-
variables tings
Ether- CJ-series sets
Net/IP Units*1
port*2
SD Memory Backing up OK OK OK*3 OK*4 OK OK
Card backups data
Restoring data OK OK OK*3 OK*4 OK OK
Verifying data OK*5 OK NA NA OK NA
Automatic transfers from SD OK OK OK*3 OK*4 NA NA
Memory Cards*6
Program transfer from SD Mem- OK OK OK*3 OK*4 NA NA
ory Card *7
Sysmac Studio Backing up OK OK OK*3 OK*4 OK*8 OK
Controller back- data
ups Restoring data OK OK OK
OK*3 OK*4 OK*8
Verifying data OK*5 OK NA NA OK*8 NA
Importing and Exporting OK*9 OK NA NA NA NA
exporting backup file
Sysmac Studio data
backup file data Importing OK NA NA OK NA
OK*9
backup file
data
Sysmac Studio Backing up and NA NA OK*3 OK*4 NA OK
variable and restoring data
memory backup
functions

*1 You can use memory for CJ-series Units only with NJ-series 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.

9-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

*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: Tag data link settings for the built-in EtherNet/IP port, operation authority
verification, and the 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.

9-1-6 Applicable Range of the Backup Functions


Different types of backup functions handle data for different Units or slaves. The applicable Units and
slaves for each backup function are given in the following table.
(OK: Applicable, NA: Not applicable)
Units/slaves
NJ/NX- NX Units CJ-series Units*3
Ether- Ether- Com-
Type of backup function series on the Units and
CAT Net/IP puter

9-1 The Backup Functions


CPU CPU Master Slaves
slaves*1 slaves and HMIs
Unit Unit*2 Units
SD Memory Card backups OK OK*4 OK OK NA NA NA
Automatic transfers from OK NA NA NA NA NA NA
SD Memory Cards
Program transfer from SD OK NA NA NA NA NA NA
Memory Card
Sysmac Studio Controller OK OK*4 OK OK NA NA NA
backups
Importing and exporting OK OK*5 OK NA NA NA NA
Sysmac Studio backup file 9
data
Sysmac Studio variable and OK NA NA NA NA NA NA
9-1-6 Applicable Range of the Backup Functions

memory backup functions


*1 EtherCAT Slave Terminals are included. If EtherCAT Slave Terminals are set for backup, the backup function
applies to both the EtherCAT Coupler Unit and the NX Units.
*2 You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.
*3 You can use CJ-series Units only with NJ-series CPU Units.
*4 This does not apply to Safety Control Units. Refer to the NX-series Safety Control Unit User’s Manual (Cat. No.
Z930) for information on importing and exporting settings for a Safety Control Unit.
*5 Only importing data is possible. Exporting is not possible.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-11


9 Backup Functions

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

EtherCAT EtherNet/IP slaves


NX Units
Coupler Unit

EtherCAT Slave Terminal

Applicable range for the SD Memory Card backup


functions and Sysmac Studio Controller backup functions.

Note You can use NX Units on the CPU Unit only with the NX1P2 CPU Unit.

Note You can use CJ-series Units and NJ-series Expansion Racks only with the NJ-series CPU Unit.

Version Information
A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required
to connect EtherCAT Slave Terminals.

9-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-2 SD Memory Card Backups


You can use SD Memory Cards to back up, restore, and verify Controller data.

SD Memory Card Controller

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

9-2 SD Memory Card Backups


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.
9
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

*1 You can specify a directory only on the SD Memory Card.


*2 Before you restore or verify data, save the backup file and restore command file in the root directory.
*3 This method is used to control the backup functions from an HMI. You can access the system-defined vari-
ables only for the restore from the user program.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-13


9 Backup Functions

*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.

9-2-1 Backup (Controller to SD Memory Card)


This operation is used to save data in the Controller to the SD Memory Card in the CPU Unit.

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
 Backing Up Data with the CPU Unit Front-panel DIP Switch

Processing stage Procedure


Start command The backup starts when the SD Memory Card power supply switch is pressed for 3 sec-
onds with the DIP switch pins set as follows: 1: OFF, 2: OFF, 3: ON, and 4: OFF.*1
Executing Immediately after Starting Backup*2
The SD PWR indicator will light, go out for 0.5 seconds, and then light again.

While Backing Up Data


The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
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.

9-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

 Backing Up Data with the _Card1BkupCmd (SD Memory Card Backup


Command) System-defined Variable

Processing stage Procedure


Start command The name of the directory where the files are saved is stored in the _Card1BkupCmd.Dir-
Name (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory.
The backup operation starts when you change the _Card1BkupCmd.ExecBkup (Execute
Backup Flag) system-defined variable to TRUE.
Cancel command You can cancel the backup operation.
The backup operation ends in an error if you change the _Card1BkupCmd.CancelBkup
(Cancel Backup Flag) system-defined variable to TRUE.
Executing The _Card1BkupSta.Active (Active Flag) system-defined variable changes to TRUE.
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will
change to TRUE.
Execution results Normal End:
The _Card1BkupSta.Done (Done Flag) system-defined variable changes to TRUE.
Error End:
The _Card1BkupSta.Err (Error Flag) system-defined variable changes to TRUE.

Note You cannot access these system-defined variables from the user program.

 Backing Up Data from the SD Memory Card Window on the Sysmac Studio

Processing stage Procedure

9-2 SD Memory Card Backups


Start command Click the SD Memory Card Backup Button on the SD Memory Card Window in the Sys-
mac Studio, specify the directory to save the backup file in, and execute the backup.
Executing The progress of the backup is displayed in the dialog box. The value of the _BackupBusy
(Backup Function Busy Flag) system-defined variable will change to TRUE.
Execution results A message will appear when the backup is completed. You will then be asked to confirm
whether to verify the backup data.

Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.

 Backing Up Data with Special Instruction

Processing stage Procedure 9


Start command Execute the BackupToMemoryCard instruction in the user program.
Executing The value of the Busy output variable from the BackupToMemoryCard instruction will
9-2-1 Backup (Controller to SD Memory Card)

change to TRUE.
The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will
change to TRUE.
Execution results Normal End:
The value of the Done output variable from the BackupToMemoryCard instruction changes
to TRUE.
Error End:
The value of the Error output variable from the BackupToMemoryCard instruction changes
to TRUE.
The error code is stored in the ErrorID output variable from the BackupToMemoryCard
instruction.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-15


9 Backup Functions

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.

Related System-defined Variables


The system-defined variables that are related to the operation when system-defined variables are used
to back up data are shown below. Refer to A-6 Specifications for Individual System-defined Variables
for details on system-defined variables.

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

Active* Active Flag TRUE when a backup is in progress. BOOL R

Err* Error Flag TRUE when processing a backup ended in BOOL R


an error.

_BackupBusy Backup Function TRUE when a backup, restoration, or verifi- BOOL R


Busy Flag cation is in progress.

* 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-10 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.

9-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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

Backup start Pre-execution


command checks cleared. Normal end

_Card1BkupCmd.ExecBkup TRUE
FALSE
_Card1BkupCmd.CancelBkup TRUE
FALSE

_Card1BkupSta.Done TRUE
FALSE
_Card1BkupSta.Active TRUE
FALSE
_Card1BkupSta.Err TRUE
FALSE
_BackupBusy TRUE
FALSE

 Operation When the Backup Cannot Start Because Another Backup Function
Is in Progress

9-2 SD Memory Card Backups


Backup start Pre-execution
command checks not cleared.
TRUE
_Card1BkupCmd.ExecBkup
FALSE
_Card1BkupCmd.CancelBkup TRUE
FALSE
_Card1BkupSta.Done TRUE
FALSE
TRUE
_Card1BkupSta.Active
FALSE
TRUE
_Card1BkupSta.Err
FALSE
_BackupBusy TRUE 9
FALSE
9-2-1 Backup (Controller to SD Memory Card)

 Operation When the Backup Fails After a Normal Start


Backup start Pre-execution Error occurred
command checks cleared. during backup.
TRUE
_Card1BkupCmd.ExecBkup
FALSE
TRUE
Card1BkupCmd.CancelBkup
FALSE

_Card1BkupSta.Done TRUE
FALSE
TRUE
_Card1BkupSta.Active
FALSE
TRUE
_Card1BkupSta.Err
FALSE
TRUE
_BackupBusy
FALSE

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-17


9 Backup Functions

 Operation When the Backup Is Canceled While the Backup Is in Progress


The time required to stop the backup operation after it is canceled depends on the progress of the
backup operation.

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

Processing Time and Backup File Size


The time that is required to back up the data depends on factors such as the CPU Unit, operating
mode, Unit configuration, and user program. The size of the backup file depends on factors such as the
Unit configuration and user program. Some guidelines for the backup time and backup file size are
given in the following table.

Con-
Connected Con- Number User pro-
Operat- nected Backup
NX Units or nected of user- gram mem- Backup time
CPU Unit ing Ether- file size
CJ-series Option defined ory size (s)
mode CAT (Mbytes)
Units Boards POUs (Mbytes)
slaves
NX701- PRO- *1 --- --- 113 7.13 Approx. 30 29.45
 GRAM
NX1P2- mode *2 *3 *4 15 0.35 Approx. 30 2.96

NJ501- *1 *5 --- 53 2.36 Approx. 50 20

NJ301- *6 --- 20 0.53 Approx. 30 9.85

NJ101- *2 --- 15 0.38 Approx. 30 9.94


*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.

9-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-2-2 Restore (SD Memory Card to Controller)


You can transfer the data in a backup file on the SD Memory Card in the CPU Unit to the Controller. You
can use the front-panel DIP switch on the CPU Unit or system-defined variables to perform this opera-
tion.
The transfer starts when the power supply is turned ON with the CPU Unit front-panel DIP switch. You
can specify the data to restore by the restore command file. You cannot specify the source directory for
backup-related files. The backup file to restore must be stored in the root directory on the SD Memory
Card.
With system-defined variables, you can specify the data to restore and source directory for backup-
related files, and give a command to start the transfer by a system-defined variable. You can specify
whether to use this function or not and set a password in the Controller Setup.You can use this function
to operate the CPU Unit with the data in a backup file on the SD Memory Card, by operating an HMI.

Processing Contents
The following describes the processing contents for restoring data with the CPU Unit front-panel DIP
switch and with system-defined variables.

 Restoring Data with the CPU Unit Front-panel DIP Switch


• The data in a backup file in the root directory on the SD Memory Card is transferred to the Controller.
• The data groups that are processed by the restoration operation in the RestoreCommand.ini file
(restore command file) that is stored in the root directory. Refer to 9-13-3 Specifications of a Restore
Command File for details on the restore command file.

9-2 SD Memory Card Backups


• If there is not a restore command file in the root directory of the SD Memory Card, all of the data from
the backup files in the root directory that can be transferred to the Controller will be transferred.
• After the operation is completed, the operating mode will change to PROGRAM mode. You cannot
start operation in this state. To start operation, turn OFF all DIP switch pins and then cycle the power
supply to the Controller or reset the Controller.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.
• While the data is being restored, the CPU Unit will be in startup state.
• If an error occurs in the checks that are performed before starting to restore the data, the previous
data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being restored, a User Pro-
gram/Controller Configurations and Setup Transfer Error (a major fault level Controller error) will 9
occur. If that occurs, the data in the Controller is not dependable. Use one of the following methods to
clear the error.
9-2-2 Restore (SD Memory Card to Controller)

• Perform the restore operation again.


• Clear all of memory and then download the project from the Sysmac Studio.
• If the configuration for Units and slaves in the backup file does not match the actual configuration
where data is restored, a Restore Execution Error will occur when you restore the data.
• The restore operation is possible even if the Option Board configuration in the backup file do not
match the actual configuration where data is restored. However, the Option Board does not operate.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No.
W579) for details.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be restored, the previous present values of those variables will be retained. However, the values of
any variables that do not meet the retain conditions are initialized. These are the retain conditions for
the variable:
• The variable name, data type name, and data type size must be the same before and after restor-
ing the data.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-19


9 Backup Functions

• For the NX1P2 CPU Unit, memory for CJ-series Units is generated by the settings 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 NX1P2 CPU Unit,
the previous present values in the DM and Holding Areas will be retained. However, when the DM
and Holding Areas are newly generated or the area is expanded, the values 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.

 Restoring Data with System-defined Variables

Precautions for Correct Use


• The data to be restored is the group of data specified with the system-defined variable. A
specification of the restore command file (RestoreCommand.ini) is not affected. Refer to
Related System-defined Variables on page 9-23 for details on the related system-defined vari-
ables.
• To prevent an unexpected restoration, set to enter the password every time before the restore
operation.
• Executing this function automatically resets the Controller. The outputs during the Controller
reset behave according to the slave and Unit specifications. Also, during the Controller reset,
variables in the Controller cannot be accessed from the outside.
• If a variable on the Controller that was accessed before the transfer is deleted by the resto-
ration, 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 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 restoring, transfer a backup file for which the above setting is set to
Use.
• You cannot execute other backup function while a restore operation is in progress.

• With the _Card1RestoreCmd (SD Memory Card Restore Command) system-defined variable, you
can transfer the data saved in the SD Memory Card that is mounted on the CPU Unit to the Control-
ler.
• The backup file to be restored is the file stored in the directory specified with the system-defined vari-
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.

9-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

• 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 NX1P2 CPU Unit,
the previous present values in the DM and Holding Areas will be retained. However, when the DM
and Holding Areas are newly generated or the area is expanded, the values in those areas will be the
initial values.
• The power is continued to supply even if the SD Memory Card power supply switch is pressed when
a restore operation is in progress.
• The SD Memory Card will remain mounted after completion of the restore operation.
• The write protection for the CPU Unit that is set in the Write Protection at Startup setting is used after
completion of the restore operation.

Procedure

9-2 SD Memory Card Backups


 Restoring Data with the CPU Unit Front-panel DIP Switch

Processing stage Procedure


Start command Turn ON the power supply to the Controller with the DIP switch set as follows: 1: OFF, 2:
OFF, 3: ON, and 4: ON.*1
Executing While Restoring Data
The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds. The
RUN indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds. The SD
BUSY indicator will flash irregularly.
Execution results Normal End:
9
The SD PWR indicator will light.
9-2-2 Restore (SD Memory Card to Controller)

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-21


9 Backup Functions

 Restoring Data with the _Card1RestoreCmd (SD Memory Card Restore


Command) System-defined Variable

Processing stage Procedure


Pre-start prepara- To use the restore by the system-defined variable, set to use the Restore by system-
tion defined variable in the Controller Setup.*1
Start command Specify the name of the directory where the backup files are saved in the _Card1Resto-
reCmd.DirName (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory.

Specify a password in the _Card1RestoreCmd.Password (Password) system-defined variable.*2

Change the _Card1RestoreCmdTargetIPAdr (IP Address Transfer Flag) system-defined vari-


able to TRUE to specify IP address of the built-in EtherNet/IP port as the restore target.*3

Change the _Card1RestoreCmdTargetVariable (Present Values of Variables with the


Retain Attribute Transfer Flag) system-defined variable to TRUE to specify the present val-
ues of variables with the Retain attribute as the restore target.

Change the _Card1RestoreCmdTargetMemory (Present Values of Memory Used for CJ-


series Units with the Retain Attribute Transfer Flag) system-defined variable to TRUE to
specify the present values of the memory used for CJ-series Units with the Retain attribute
as the restore target.

Change the _Card1RestoreCmdTargetUnitConfig (Unit and Slave Parameters Transfer


Flag) system-defined variable to TRUE to specify Units and slaves settings as the restore
target.

Change the _Card1RestoreCmdTargetAbsEncoder (Absolute Encoder Home Offset Trans-


fer Flag) system-defined variable to TRUE to specify the absolute encoder home offsets as
the restore target.

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.

The _Card1RestoreSta.Active (Active Flag) system-defined variable changes to TRUE.

While Restoring Data


The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
The RUN indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.

The Controller is automatically reset during the restore operation.


Execution results Normal End:
The SD PWR indicator will light.
The RUN indicator goes out.
The _Card1RestoreSta.Done (Done Flag) system-defined variable changes to TRUE.

Error End at Checks Performed Before Restore Start:


The SD PWR indicator will light.*4
RUN and ERR indicators are in the state before the restore starts.
The _Card1RestoreSta.Err (Error Flag) system-defined variable changes to TRUE.
The Controller is not reset for an error end at checks performed before restore start.

Error End at Pre-execution Check or during Execution:


The SD PWR indicator will light.* 4
The RUN indicator goes out.
The _Card1RestoreSta.Err (Error Flag) system-defined variable changes to TRUE.

9-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

*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.

Related System-defined Variables


The following table lists the related system-defined variables. Refer to A-6 Specifications for Individual
System-defined Variables for details on system-defined variables.

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.

9-2 SD Memory Card Backups


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

Active Active Flag TRUE when a restore operation is in progress. BOOL R 9


9-2-2 Restore (SD Memory Card to Controller)

Err Error Flag TRUE when a restore operation ended in an BOOL R


error.

Variable Name Meaning Function Data type R/W


_Card1RestoreCmd- User Program Change this variable to TRUE to set a user BOOL RW
TargetUserProgram and Settings program or setting for the restore by the sys-
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 RW
TargetIPAdr Transfer Flag IP address of the built-in EtherNet/IP port for
the restore by the system-defined variable as
the transfer target.
The IP address means setting type, IP
address, subnet mask, and default gateway.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-23


9 Backup Functions

Variable Name Meaning Function Data type R/W


_Card1RestoreCmd- Present Values Change this variable to TRUE to set the pres- BOOL RW
TargetVariable of Variables with ent values of variables with the Retain attri-
the Retain Attri- bute for the restore by the system-defined
bute Transfer variable as the transfer target.
Flag
_Card1RestoreCmd- Present Values Change this variable to TRUE to set the pres- BOOL RW
TargetMemory of Memory Used ent values of the memory used for CJ-series
for CJ-series Units with the Retain attribute for the restore
Units with the by the system-defined variable as the transfer
Retain Attribute target.
Transfer Flag
_Card1RestoreCmd- Unit and Slave Change this variable to TRUE to set the Unit BOOL RW
TargetUnitConfig Parameters and slave settings for the restore by the sys-
Transfer Flag tem-defined variable as the transfer target.
_Card1RestoreCmd- Absolute Change this variable to TRUE to set the abso- BOOL RW
TargetAbsEncoder Encoder Home lute encoder home offset for the restore by the
Offset Transfer system-defined variable as the transfer target.
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-10 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.

9-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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

9-2 SD Memory Card Backups


 Operation When the Restoration Cannot Start Because Another Backup
Function Is in Progress
Restore Checks before
start starting a restore
command was NG.
TRUE
_Card1RestoreCmd.Exec FALSE
Setting
_Card1RestoreCmd.Password Initial Setting Initial value
value
TRUE
_Card1RestoreSta.Done FALSE

TRUE 9
_Card1RestoreSta.Active FALSE
TRUE
_Card1RestoreSta.Err FALSE
9-2-2 Restore (SD Memory Card to Controller)

_BackupBusy TRUE
FALSE

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-25


9 Backup Functions

 Operation When the Restoration Fails After a Normal Start


Restore Checks before
start starting a
command restore was Controller Error occurred before
OK. reset or during execution.
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

Processing Time
The time that is required to restore the data depends on factors such as the CPU Unit, Unit configura-
tion, and user program. Guidelines for the restoration time are given in the following table.

Connected Connected NX Connected Number of User program


Restoration time
CPU Unit EtherCAT Units or CJ- Option user-defined memory size
(s)
slaves series Units Boards POUs (Mbytes)
NX701- *1 --- --- 113 7.13 Approx. 50
NX1P2- *2 *3 *4 15 0.35 Approx. 60
NJ501- *1 *5 --- 53 2.36 Approx. 100
NJ301- *6 --- 20 0.53 Approx. 70
NJ101- *2 --- 15 0.38 Approx. 70

*1 Thirty-two each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1611 Digital I/O Terminals, and GX-OD1611
Digital I/O Terminals.
*2 Two each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1600 Digital I/O Terminals, and GX-OD1611 Digital
I/O Terminals.
*3 One NX-PF0630 Additional I/O Power Supply Unit, three NX-ID5342 Digital Input Units, two NX-OD3153 Digital Output
Units, one NX-AD4608 Analog Input Unit, and one NX-DA3605 Analog Output Unit.
*4 Two NX1W-CIF01 Serial Communications Option Boards.
*5 Four CJ1W-SCU22 Serial Communications Units and one CJ1W-EIP21 EtherNet/IP Unit.
*6 Eight each of the following: R88D-KNA-ECT AC Servo Drives, GX-ID1611 Digital I/O Terminals, and
GX-OD1611 Digital I/O Terminals.

9-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-2-3 Verify (between Controller and SD Memory Card)

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.

9-2 SD Memory Card Backups


Procedure
 Verifying Data with the CPU Unit Front-panel DIP Switch

Processing stage Procedure


Start command The verification operation starts when the SD Memory Card power supply switch is pressed
for 3 seconds with the DIP switch pins set as follows: 1: OFF, 2: OFF, 3: OFF, and 4: OFF.*1
Executing Immediately after Starting Verification*2
The SD PWR indicator will light, go out for 0.5 seconds, and then light again.

While Verifying Data 9


The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
9-2-3 Verify (between Controller and SD Memory Card)

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 SD PWR indicator will light.

Normal End with Differences Found:


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.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-27


9 Backup Functions

 Verifying Data with the _Card1BkupCmd (SD Memory Card Backup


Command) System-defined Variable

Processing stage Procedure


Start command The name of the directory where the files are saved is stored in the _Card1BkupCmd.Dir-
Name (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory.

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.

Normal End with Differences Found:


The _Card1BkupSta.Done (Done Flag) system-defined variable changes to TRUE and the
_Card1BkupSta.VefyRslt (Verify Result Flag) system-defined variable changes to FALSE

Error End:
The _Card1BkupSta.Err (Error Flag) system-defined variable changes to TRUE.

Note You cannot access these system-defined variables from the user program.

 Verifying Data from the SD Memory Card Window on the Sysmac Studio

Processing stage Procedure


Start command Click the Compare SD Memory Card Backup Button on the SD Memory Card Window in
Sysmac Studio, specify the directory that contains the file to compare, and execute the ver-
ification.
Executing The progress of the verification is displayed in the dialog box. The value of the
_BackupBusy (Backup Function Busy Flag) system-defined variable will change to TRUE.

The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
Execution results The results of the verification are displayed in the dialog box.

Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for specific procedures.

9-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Related System-defined Variables


The system-defined variables that are related to the operation when system-defined variables are used
to restore data are shown below. Refer to A-6 Specifications for Individual System-defined Variables for
details on system-defined variables.

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

Active* Active Flag TRUE when a verification is in progress. BOOL R

9-2 SD Memory Card Backups


VefyRslt* Verify Result Flag TRUE if the data was the same. FALSE if differ- BOOL R
ences were found.

Err* Error Flag TRUE when processing a verification ended in BOOL R


an error.

_BackupBusy Backup Function TRUE when a backup, restoration, or verifica- BOOL R


Busy Flag tion is in progress.

* 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
9-2-3 Verify (between Controller and SD Memory Card)

information on mapping variables when you connect an NA-series PT to the NJ/NX-series


Controller.
• Refer to A-10 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-29


9 Backup Functions

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.

 Normal End with No Differences Found

Verification Pre-execution Normal end, no


start command checks cleared. differences found
TRUE
_Card1BkupCmd.ExecVefy
FALSE
Card1BkupCmd.CancelVefy TRUE
FALSE
TRUE
_Card1VefySta.Done
FALSE
TRUE
_Card1VefySta.Active
FALSE
_Card1VefySta.Rslt TRUE
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE

 Normal End with Differences Found

Verification Pre-execution Normal end,


start command checks cleared. differences found
_Card1BkupCmd.ExecVefy TRUE
FALSE
_Card1BkupCmd.CancelVefy TRUE
FALSE
_Card1VefySta.Done TRUE
FALSE
_Card1VefySta.Active TRUE
FALSE
_Card1VefySta.Rslt TRUE
FALSE

_Card1VefySta.Err TRUE
FALSE
_BackupBusy TRUE
FALSE

9-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

 Operation When the Verification Cannot Start Because Another Backup


Function Is in Progress
Verification Pre-execution
start command checks not cleared.
_Card1BkupCmd.ExecVefy TRUE
FALSE
TRUE
_Card1BkupCmd.CancelVefy
FALSE

_Card1VefySta.Done TRUE
FALSE
_Card1VefySta.Active TRUE
FALSE
TRUE
_Card1VefySta.Rslt
FALSE

_Card1VefySta.ErrTRUE
FALSE
_BackupBusy TRUE
FALSE

 Operation When the Verification Fails After a Normal Start

Verification Pre-execution Error occurred


start command checks cleared. during verification.
_Card1BkupCmd.ExecVefy TRUE
FALSE
_Card1BkupCmd.CancelVefy TRUE
FALSE

_Card1VefySta.Done TRUE
FALSE

9-2 SD Memory Card Backups


_Card1VefySta.Active TRUE
FALSE
_Card1VefySta.Rslt TRUE
FALSE
TRUE
_Card1VefySta.Err
FALSE
_BackupBusy TRUE
FALSE

 Operation When the Operation Is Canceled While Verification Is in Progress


The time required to stop the verification operation after it is canceled depends on the progress of
the verification operation. 9
Verification
canceled.
9-2-3 Verify (between Controller and SD Memory Card)

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-31


9 Backup Functions

9-3 Disabling Backups to SD Memory


Cards
You can disable the backup function from writing data to the SD Memory Card to protect your program-
ming assets.
The following three functions are applicable for disabling backup to SD Memory Card.
• Backups using the CPU Unit front-panel DIP switch
• Backups using system-defined variables
• Backups from the SD Memory Card Window on the Sysmac Studio
Backup function using the BackupToMemoryCard instruction is not applicable. This means that you can
backup data using the BackupToMemoryCard instruction even if the Prohibit data backup to the SD
Memory Card setting is set to be used.

Use the following procedure to set the Prohibit data backup to the SD Memory Card setting.
Select the Use Option for the Prohibit data backup to the SD Memory Card setting in the Basic Set-
tings Display of the Operation Settings Tab Page under Configurations and Setup − Controller
Setup on the Sysmac Studio.

Version Information
A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required
to use the BackupToMemoryCard instruction.

9-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-4 Automatic Transfers from SD


Memory Cards
This function automatically transfers the data in a backup file to the Controller when the power supply is
turned ON. The backup file must be stored in the /autoload directory on the SD Memory Card in the
CPU Unit. You can use this to operate the CPU Unit with the data in a backup file on the SD Memory
Card. The only way to perform this operation is to use the front-panel DIP switch on the CPU Unit.
SD Memory Card Controller
Set the DIP switch
pins to OFF, ON,
OFF, and OFF, and
then turn ON the
power. Data that is
/autoload
backed up

Backup file and automatic


transfer command file

The automatic transfer uses a backup file that is created with the backup function and an automatic

9-4 Automatic Transfers from SD Memory Cards


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.

Procedure Directory Execution timing


CPU Unit front-panel DIP /autoload directory on the SD Memory Card At startup
switch

Processing Contents 9
• 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-33


9 Backup Functions

• 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 NX1P2 CPU Unit, memory for CJ-series Units is generated by the settings 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 NX1P2 CPU Unit,
the previous present values in the DM and Holding Areas will be retained. However, the values in the
DM 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
 Transferring Data with the CPU Unit Front-panel DIP Switch

Processing stage Procedure


Start command Turn ON the power supply to the Controller with the DIP switch set as follows: 1: OFF, 2:
ON, 3: OFF, and 4: OFF.*1
Executing The transfer is in progress.
The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds. The
RUN indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds. The SD
BUSY indicator will flash irregularly.
Execution results Normal End:
The SD PWR indicator will light.
The operating mode that is set in the Startup Mode setting in the Controller Setup is used
after completion of the transfer.

Error End:
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.

9-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-5 Program Transfer from SD Memory


Card
With the _Card1PrgTransferCmd (SD Memory Card Program Transfer Command) system-defined vari-
able, you can transfer a program stored in the SD Memory Card that is mounted on the CPU Unit to the
Controller.
You can specify whether to use this function or not and set a password in the Controller Setup.
You can use this function to operate the CPU Unit with the program in a backup file on the SD Memory
Card, by operating an HMI.
SD Memory Card Controller

Set and execute with the


system-defined variable.
Target data

Backup file

9-5 Program Transfer from SD Memory Card


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.

Operating method Directory*1 Applicable operating modes


System-defined variable The directory that you specified in the system- RUN mode and PROGRAM
defined variable mode
9
*1 You can specify a directory only on the SD Memory Card.

Precautions for Correct Use


• When you use this function to transfer a program whose Startup Mode setting is set to RUN
mode, the operating mode changes to RUN after the transfer is completed regardless of the
status and setting before the transfer. Use this function after you confirm that system startup
does not cause any problem.
• To prevent an unexpected transfer of a program, set to enter the password every time before a
transfer.
• Executing this function automatically resets the Controller. The outputs during the Controller
reset behave according to the slave and Unit specifications. Also, during the Controller reset,
variables in the Controller cannot be accessed from the outside.
• When an EtherCAT slave is used or a motion control is executed, an error may occur on the
EtherCAT Master Function Module or Motion Control Function Module after the program trans-
fer is completed. If an error occurs, reset the error after the program transfer is completed.
Refer to sample programming for the ResetMCError instruction in the NJ/NX-series Instruc-
tions Reference Manual (Cat. No. W502) for details on resetting errors in the user program.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-35


9 Backup Functions

• 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
variable. Refer to Related System-defined Variables on page 9-38 for details on the related system-
defined variables.
• If the password set on the Password of the SD Memory Card Program Transfer Setting differs from
the password set in the _Card1PrgTransferCmd.Password system-defined variable, the SD Memory
Card Program Transfer Failed to Start error occurs.
• When the program transfer is started, the password set in _Card1PrgTransferCmd.Password sys-
tem-defined variable is initialized.
• The Controller is automatically reset during the program transfer. The outputs during the Controller
reset behave according to the slave and Unit specifications.
• After the Controller reset, the CPU Unit will be in startup state. Then when the program transfer is
completed, the CPU Unit will be in normal operation state and operate in the operating mode set in
the Startup Mode setting in the Controller Setup, which was transferred by the program transfer func-
tion. However, the CPU Unit will operate in PROGRAM mode when the CPU Unit front-panel DIP
switch is set to the Safe Mode.
• If an error occurs in the checks that are performed before starting the user program transfer or in the
pre-execution checks, the previous data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the program transfer is in progress, a User
Program/Controller Configurations and Setup Transfer Error (a major fault level Controller error) will
occur. If that occurs, the data in the Controller is not dependable. Use one of the following methods to
clear the error.
• Transfer the programs from the SD Memory Card again.
• Use the automatic transfer from SD Memory Card, or restore with SD Memory Card backup func-
tions.
• Clear all of memory and then download the project from the Sysmac Studio.
• All data items that are not specified for the program transfer will retain their present values.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be transferred, the previous present values of those variables will be retained. However, the values of
any variables that do not meet the retain conditions are initialized. These are the retain conditions for
the variable.
• The variable name, data type name, and data type size must be the same before and after trans-
ferring the data.
• For the NX1P2 CPU Unit, memory for CJ-series Units is generated by the settings in the Memory
Settings for CJ-series CPU Units in the backup file.

9-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

• If the present values of memory for CJ-series Units are not set to be restored in the NX1P2 CPU Unit,
the previous present values in the DM and Holding Areas will be retained. However, when the DM
and Holding Areas are newly generated or the area is expanded, the values in those areas will be the
initial values.
• The power is continued to supply even if the SD Memory Card power supply switch is pressed while
the program transfer is in progress.
• The SD Memory Card will remain mounted after completion of the program transfer operation.
• The write protection for the CPU Unit that is set in the Write Protection at Startup setting is used after
completion of the program transfer operation.

Operating Method
 _Card1PrgTransferCmd (SD Memory Card Program Transfer Command)
System-defined Variable

Processing stage Procedure


Pre-start prepara- To use the program transfer from the SD Memory Card, set to use the Program transfer by
tion system-defined variable in the Controller Setup.*1
Start command Specify the name of the directory where the backup files are saved in the _Card1PrgTrans-
ferCmd.DirName (Directory Name) system-defined variable.
Example: “dirA/dirB” specifies the dirB directory inside the dirA directory.

9-5 Program Transfer from SD Memory Card


Specify a password in the _Card1PrgTransferCmd.Password (Password) system-defined
variable.*2

Change the _Card1PrgTransferCmd.TargetIPAdr (IP Address Transfer Flag) system-


defined variable to TRUE to specify the built-in EtherNet/IP port settings as the transfer tar-
get.*3

Change the _Card1PrgTransferCmd.TargetVariable (Present Values of Variables with the


Retain Attribute Transfer Flag) system-defined variable to TRUE to specify the present val-
ues of variables with the Retain attribute as the transfer target.

Change the _Card1PrgTransferCmd.TargetMemory (Present Values of Memory Used for


CJ-series Units with the Retain Attribute Transfer Flag) system-defined variable to TRUE to
specify the present values of the memory used for CJ-series Units with the Retain attribute
as the transfer target.

Change the _Card1PrgTransferCmd.Exec (Execute Program Transfer Flag) system-


defined variable to TRUE to start the transfer operation. 9
Executing The _BackupBusy (Backup Function Busy Flag) system-defined variable changes to
TRUE.

The _Card1PrgTransferSta.Active (Active Flag) system-defined variable changes to TRUE.

During program transfer


The SD PWR indicator will flash, lighting for 3 seconds and going out for 0.5 seconds.
The SD BUSY indicator will flash irregularly.
The RUN indicator will flash, lighting for 0.5 seconds and going out for 0.5 seconds.

The Controller is automatically reset during the program transfer.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-37


9 Backup Functions

Processing stage Procedure


Execution results Normal End:
The SD PWR indicator will light.
The operating mode that is set in the Startup Mode setting in the Controller Setup is used
after completion of the transfer.
The _Card1PrgTransferSta.Done (Done Flag) system-defined variable changes to TRUE.

Error End at Checks Performed Before Transfer Start:


The SD PWR indicator will light.*4
RUN and ERR indicators are in the state before the transfer starts.
The _Card1PrgTransferSta.Err (Error Flag) system-defined variable changes to TRUE.
The Controller is not reset for an error end at checks performed before transfer start.

Error End at Pre-execution Check or during Execution:


The SD PWR indicator will light.*4
The RUN indicator goes out, the ERR indicator lights, and a major fault level Controller
error occurs.
The _Card1PrgTransferSta.Err (Error Flag) system-defined variable changes to TRUE.

*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.
*2 The password is initialized when transferring programs from the SD Memory Card is started. Specify a pass-
word every time you start a transfer.
If a password is not set on the Password of the SD Memory Card Program Transfer Setting on the Controller
Setup, the program transfer is started when the value of the _Card1PrgTransferCmd.Password system-
defined variable is the initial value. The transfer 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.

Related System-defined Variables


The following table lists the related system-defined variables. Refer to A-6 Specifications for Individual
System-defined Variables for details on system-defined variables.

Variable name
Meaning Function Data type R/W
Member name
_Card1PrgTransfer- SD Memory Card _sPRG- RW
Cmd Program Trans- TRANS-
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.

9-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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-

9-5 Program Transfer from SD Memory Card


fer Status FER_STA
Done Done Flag TRUE when a program transfer is completed. BOOL R

Active Active Flag TRUE when a program transfer is in progress. BOOL R

Err Error Flag TRUE when a program transfer ended in an BOOL R


error.

*1 The data in the user program and setting data groups is the target of settings. However, the IP address for
the built-in EtherNet/IP port is set with the IP Address Transfer Flag.

9
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-10 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-39


9 Backup Functions

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
_Card1PrgTransferSta.Err FALSE

_BackupBusy TRUE
FALSE

 Operation When the Program Transfer Cannot Be Started Because Another


Backup Function Is in Progress
Program
transfer Checks before
start starting a
command transfer was NG.
TRUE
_Card1PrgTransferCmd.Exec FALSE
Setting
_Card1PrgTransferCmd.Password Initial Setting Initial value
value
TRUE
_Card1PrgTransferSta.Done FALSE

TRUE
_Card1PrgTransferSta.Active FALSE
TRUE
_Card1PrgTransferSta.Err FALSE

_BackupBusy TRUE
FALSE

9-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

 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

9-5 Program Transfer from SD Memory Card


9

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-41


9 Backup Functions

9-6 Sysmac Studio Controller Backups


You can use Sysmac Studio to back up, restore, and verify Controller data from a computer.

Sysmac Studio Controller

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.

Function
File Backing Restor- Verifying
Contents
up data ing data data
Backup file 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 transfer 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 transfer.
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.

You can execute these functions in the following operating modes.


Processing Applicable operating modes
Backing up data RUN mode and PROGRAM mode
Restoring data PROGRAM mode
Verifying data RUN mode and PROGRAM mode

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.

9-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-6-1 Backup (Controller to Computer)


The Controller data is saved in the specified directory on the computer.

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.

Data group Backing up condition


User program and settings The CPU Unit must be selected.
IP address of built-in EtherNet/IP port*1 The CPU Unit must be selected.
Present values of variables The CPU Unit must be selected.
Present values of memory used for CJ- The CPU Unit must be selected.
series Units
Event logs The CPU Unit must be selected.
Units and slaves settings The NX Units on the CPU Unit*2, CJ-series Units*3 and EtherCAT
slaves must be selected.
Absolute encoder home offsets The CPU Unit must be selected.

9-6 Sysmac Studio Controller Backups


*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 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
9-6-1 Backup (Controller to Computer)

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.

3 Click the Execute Button on the Backup Confirmation Dialog Box.


The data is backed up and the backup file, restore command file, and automatic transfer com-
mand file are created.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-43


9 Backup Functions

9-6-2 Restore (Computer to Controller)

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.

Data group Restoring condition


User program and settings The CPU Unit must be selected.
IP address of built-in EtherNet/IP port*1 The IP address of built-in EtherNet/IP port must be selected.
Present values of variables The present values of variables that are specified for retention
with the Retain attribute must be selected.
Present values of memory used for CJ- The present values of memory used for CJ-series Units that are
series Units specified for retention with the Retain attribute must be selected.*2
Units and slaves settings The NX Units on the CPU Unit*3, CJ-series Units*2 and EtherCAT
slaves must be selected.
Absolute encoder home offsets The absolute encoder home offsets must be selected.

*1 A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are required.
*2 You can select the present values of variables that are specified for retention with the Retain attribute only for
NJ-series CPU Units and NX1P2 CPU Units.
*3 You can select NX Units on the CPU Unit only for the NX1P2 CPU Units.

• If an error occurs in the checks that are performed before starting to restore the data, the previous
data will be retained in the Controller.
• If the power supply to the Controller is interrupted while the data is being restored, a User 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.
• If the present values of variables that are set to be retained (with the Retain attribute) are not set to
be restored, the previous present values of those variables will be retained. However, the values of
any variables that do not meet the retain conditions are initialized. These are the retain conditions for
the variable:
• The variable name, data type name, and data type size must be the same before and after restor-
ing the data.
• The restore operation is possible even if the Option Board configuration in the backup file do not
match the actual configuration where data is restored. However, the Option Board does not operate.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No.
W579) for details.
• For the NX1P2 CPU Unit, memory for CJ-series Units is generated by the settings 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 NX1P2 CPU Unit,
the previous present values in the DM and Holding Areas will be retained. However, when the DM
and Holding Areas are newly generated or the area is expanded, the values in those areas will be the
initial values.
• Cycle the power supply to all of the EtherCAT slaves after you restore data.

9-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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.

3 Click the Execute Button on the Restoration Confirmation Dialog Box.


The restoration operation is executed.

9-6 Sysmac Studio Controller Backups


9
9-6-2 Restore (Computer to Controller)

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-45


9 Backup Functions

9-6-3 Verify (between Controller and Computer)

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.

Data group Verification condition


User program and settings The CPU Unit must be selected.
IP address of built-in EtherNet/IP port*1 The IP address of built-in EtherNet/IP port must be selected.
Units and slaves settings The NX Units on the CPU Unit*2, CJ-series Units*3 and EtherCAT
slaves must be selected.

*1 A CPU Unit with unit version 1.14 or later and Sysmac Studio version 1.18 or higher are required.
*2 You can select NX Units on the CPU Unit only for the NX1P2 CPU Units.
*3 You can select CJ-series Units only for NJ-series CPU Units.

• The results of the verification are displayed in the dialog box on the Sysmac Studio.
• The value of the _BackupBusy (Backup Function Busy Flag) system-defined variable will be TRUE
during the backup operation.

Procedure

1 Select Backup - Compare with Backup File from the Tools Menu on the Sysmac Studio.

2 Specify the folder that contains the backup file.

3 Click the Execute Button on the Comparison Confirmation Dialog Box.


The data is compared and the verification results files are created in the folder that contains the
backup file. The comparison results are also displayed in the Output Tab Page.

9-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-7 Importing and Exporting Sysmac


Studio Backup File Data

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 × ×

9-7 Importing and Exporting Sysmac Studio Backup File Data


exporting Sysmac backup file
Studio backup file data
data Importing OK OK OK OK ×
OK*4
backup file
data

*1 You can use memory for CJ-series Units only with NJ-series 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
9
• 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-47


9 Backup Functions

9-8 Sysmac Studio Variable and Memory


Backup Functions
You can back up the present values of the battery-backup memory in the CPU Unit to an XML file on
your computer or restore the battery-backup memory from a previously saved backup file.
This section describes the applicable data, operating procedures, and CPU Unit model compatibility for
the Sysmac Studio variable and memory backup functions.

Sysmac Studio

Select Backup − Backup Variables and


Memory or Backup − Restore Variables and
XML file Memory from the Tools Menu.

CPU Unit

Restoring
Present values of
battery-backup memory

Backup

Backup and Restore Targets:


Present values of retained variables
Present values in the DM, EM, and Holding Areas of memory used for CJ-series Units
Absolute encoder home offsets

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

Note You can use memory for CJ-series Units only with NJ-series CPU Units and NX1P2 CPU Units.

Version Information
With a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, you
can select specific variables to back up or restore the present values of variables with a Retain
attribute.

9-8-2 Using Sysmac Studio Variable and Memory Backup Functions


The Sysmac Studio procedure is as follows:
Place the Sysmac Studio online with the CPU Unit, and select either Backup − Backup Variables and
Memory or Backup − Restore Variables and Memory from the Tools Menu.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details.

9-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-8-3 Compatibility between CPU Unit Models


With the Sysmac Studio variable and memory backup functions, you can restore the data even if the
models of the CPU Units for backing up and restoring data are different.

Additional Information

Database Connection CPU Units, SECS/GEM CPU Units, and NJ Robotics CPU Units are not
compatible.
Refer to the relevant manuals for specific Units for details on the compatibility of these CPU
Units.

Version Information

9-8 Sysmac Studio Variable and Memory Backup Functions


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 of Variables with a Retain Attribute


There are no precautions for the present values of variables with a Retain attribute. You can restore the
data with no problems regardless of the models of the backup and restore CPU Units.

Present Values in the DM, EM, and Holding Areas of Memory Used
9
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
9-8-3 Compatibility between CPU Unit Models

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 for NJ-series CPU Units if the models of the backup and restore CPU
Units are different.

CPU Unit model


CPU Unit model to
where data was Precaution
restore to
backed up
NJ501-1300, NJ301-1200, For EM Area data, only data for banks E0 to E3 in the backup file
NJ501-1400, or NJ301-1100, is restored. The data for banks E4 to E18 in the backup file is
NJ501-1500 NJ101-1000, or ignored.
NJ101-9000
NJ301-1200, NJ501-1300, For EM Area data, only data for banks E0 to E3 in the backup file
NJ301-1100, NJ501-1400, or are restored. Banks E4 to E18 for the CJ-series Units retain their
NJ101-1000, or NJ501-1500 previous values.
NJ101-9000

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-49


9 Backup Functions

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

 If Area Data in the Backup File Is Less 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 No change
--- --- DM5 No change
--- --- DM6 No change
--- --- DM7 No change

Absolute Encoder Home Offsets


The following precautions are necessary for the absolute encoder home offsets if the models of the
backup and restore CPU Units are different. An example of the NJ-series CPU Unit is given in the fol-
lowing table.

CPU Unit model


CPU Unit model to
where data was Precaution
restore to
backed up
NJ501-1300, NJ301-1200, Regardless of the number of enabled axes in the backup CPU
NJ501-1400, or NJ301-1100, or Unit, the data for all axis in the backup file is restored in order for
NJ501-1500 NJ101-1000 the number of enabled axes in the restore CPU Unit. Any remain-
ing data in the backup file is ignored.
NJ301-1200, NJ501-1300, Regardless of the number of enabled axes in the backup CPU Unit,
NJ301-1100, or NJ501-1400, or the data for all axis in the backup file is restored in order for the
NJ101-1000 NJ501-1500 number of enabled axes in the restore CPU Unit. If the number of
enabled axes in the restore CPU Unit exceeds the number of
enabled axes for which there is data in the backup file, the remain-
ing data in the restore CPU Unit retains the previous values.

9-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-9 Backup Functions When EtherCAT


Slaves Are Connected
For EtherCAT slaves, you can use the SD Memory Card backup functions, the Sysmac Studio Control-
ler backup functions, and Sysmac Studio backup import function.
This section provides precautions for connected EtherCAT slaves for the data that is backed up,
backup support according to Controller status, restore conditions, and specific models of EtherCAT
slaves.

Additional Information

To use the backup functions for EtherCAT Slave Terminals, refer to 9-10 Backup Functions
When EtherCAT Slave Terminals Are Connected.

9-9 Backup Functions When EtherCAT Slaves Are Connected


9-9-1 Backed Up EtherCAT Slave Data
The data that is backed up for EtherCAT slaves is given in the following table.

Setting Data that is backed up


EtherCAT Master Settings The following data is backed up: Model name, Product name, Number of
Slaves, PDO Communications Cycle, Fail-soft Operation Setting, Wait Time
for Slave Startup, PDO communications timeout detection count, Revision
Check Method, and Serial Number Check Method.
EtherCAT Slaves Settings The following data is backed up: Device name, model name, product name,
revision, node address, enabled/disabled settings, serial number, PDO map
settings, enable distributed clock, reference clock, and setting parameter set-
tings.

9-9-2 Backup Support Depending on the Controller Status


The following table shows when backup, restore, and verify operations can be performed for EtherCAT
slaves based on the Controller status.
9
Execution
Controller status
Backing up data Restoring data Verifying data
9-9-1 Backed Up EtherCAT Slave 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

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-51


9 Backup Functions

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.
*5 This refers to the following errors: Network configuration mismatch with configuration when the backup was
performed (incorrect connection ports for slaves on branched networks are treated as a mismatch) and net-
work configuration information mismatch with actual network configuration (incorrect connection ports for
slaves on branched network are treated as a match).
*6 For a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, data for disabled
slaves is also covered by the backup functions. Data for disabled slaves is not backed up for other versions.

9-9-3 Conditions for Restoring EtherCAT Slave Data


The following conditions must be met before you can restore the backup data to the EtherCAT slaves.
• The backup files must contain the EtherCAT slave data.
• The Network Configuration Information must match the actual network configuration where data is
being restored.
• The revision values that are preset in the EtherCAT slaves must match. The conditions used to eval-
uate the match are based on the Revision Check Method in the backup file. Even if you set the Revi-
sion Check Method to not check revisions, the restoration operation cannot be performed if the set
revision is greater than the actual revision of the slave. You cannot change the revision values.
• The serial numbers must match if the Serial Number Verification setting in the backup file is set to
verify the serial numbers.
• The node addresses must match if the hardware switches are used to set the node address.

Precautions for Correct Use


• 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.

9-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-9-4 EtherCAT Slaves for Which You Can Back Up Data


You can back up data for the following EtherCAT slaves. Observe the precautions.

EtherCAT slaves Precautions


NX-ECC NX-series EtherCAT You cannot back up, restore, or compare data for Safety Control Units on Eth-
Coupler Unit erCAT Slave Terminals. Refer to the NX-series Safety Control Unit User’s
Manual (Cat. No. Z930) for information on importing and exporting settings for
a Safety Control Unit.
R88D-1SN-ECT AC Servo *1
Drives
R88D-KN-ECT AC Rotary *1*2
Servo Drives
R88D-KN-ECT-L AC Lin- *1*2
ear Servo Drives
3G3AX-MX2-ECT and 3G3AX- • When the unit version of the CPU Unit is 1.11 or later, the inverter parame-
RX-ECT Inverters ters are not included in the restore target. An EtherCAT Slave Restore
Operation Failed event (event code 10300000 hex) will not occur for Invert-

9-9 Backup Functions When EtherCAT Slaves Are Connected


ers.
• Refer to Procedure to Write Parameters for an 3G3AX-MX2-ECT or
3G3AX-RX-ECT Inverter on page 9-54 to write the parameters from the
Sysmac Studio to the Inverter.
If you execute verification without writing the parameters, the verification
result for the inverter will be Not matched in the EtherCAT slaves verifica-
tion result file.
• When the unit version of the CPU Unit is 1.10 or earlier, data is sometimes
not restored due to Inverter restrictions.
If an EtherCAT Slave Restore Operation Failed event (event code
10300000 hex) occurs when you try to restore the data, use the procedure
that is given below in Procedure to Write Parameters for an 3G3AX-MX2-
ECT or 3G3AX-RX-ECT Inverter on page 9-54 to transfer the parameters
from the Sysmac Studio to the Inverter.
Note that even if the restore operation for the Inverter fails, all other data
are restored including settings of Units and slaves, user program settings,
and present values of variables.
FH-3 and FH-1 The setup data for these Vision Sensors (such as the scene data and system
Vision Sensors data) is not backed up, restored, or verified.
To transfer the setup data to an external file or to the Vision Sensor, select
Sensor data − Save to file or Sensor data − Load from file from the Tools
Menu on the editing tab page for the Configurations and Setup of the Sysmac
Studio. 9
Refer to the Vision System FH/FZ5 series User’s Manual (Cat. No. Z340) for
details.
FQ-M-ECT and FQ- The setup data for these Vision Sensors (such as the scene data and system
9-9-4 EtherCAT Slaves for Which You Can Back Up Data

M-M-ECT Vision Sen- data) is not backed up, restored, or verified.


sors To transfer the setup data to an external file or to the Vision Sensor, select
Sensor data − Save to file or Sensor data − Load from file from the Tools
Menu on the editing tab page for the Configurations and Setup of the Sysmac
Studio.
For details, refer to the FQ-M-series Specialized Vision Sensor for Positioning
User’s Manual (Cat. No. Z314).
FZM1--ECT Vision Sen- The setup data for these Vision Sensors (such as the scene data and system
sors data) is not backed up, restored, or verified.
To save the setup data for the Vision Sensor to a USB memory device or to
write it to the Controller, use the software tool for the Vision Sensor.
Refer to the FZ3 Series Vision Sensor User’s Manual (Cat. No. Z290) for
details.
GX-D16, GX-D328, *1
and GX-OC1601 Digital I/O Ter-
minals

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-53


9 Backup Functions

EtherCAT slaves Precautions


GX-AD0471 and GX-DA0271 *1
Analog I/O Terminals
GX-EC0211 and GX-EC0241 ---
Encoder Input Terminals
GX-JC0 EtherCAT Junction There is no internal data that needs to be backed up.
Slaves
ZW-CE1T Confocal Fiber Type None of the settings are backed up, restored, or verified.
Displacement Sensors Refer to the Displacement Sensor ZW Series Confocal Fiber Type Displace-
ment Sensor Users Manual (Cat. No. Z332) for information on saving the set-
tings and loading them to the Controller.
E3NW-ECT and E3X-ECT Digi- The parameters in the Sensor are not backed up, restored, or verified.
tal Sensors
Slaves from other manufacturers • Data is backed up, restored, and verified only when it is correctly defined in
the ESI. To back up, restore, or verify data that is not defined in the ESI, use
the software tool for the slave.
• If backing up, restoring, or verifying data fails, contact the manufacturer of
the slave for the appropriate procedures.
*1 Cycle the power supply to a slave after you restore data. Cycle the power supply to a slave before you verify
the data after you restore it. The verification will fail if you do not cycle the power supply before you perform the
verification.
*2 If any of the following conditions applies, do not turn the Servo ON while the data is being backed up or
restored before you verify the data. If you turn the Servo ON while the data is being backed up or restored
before you verify the data, the parameters are updated before the verification operation and may cause differ-
ences in the verification results.
• When the Realtime Autotuning Mode Selection (3002 hex) is set to 1 to 4, or 6 (enabled).
• When the Adaptive Filter Selection (3200 hex) is set to 1 or 2 (enabled).

Procedure to Write Parameters for an 3G3AX-MX2-ECT or 3G3AX-


RX-ECT Inverter
When the unit version of the CPU Unit is 1.11 or later, the inverter parameters are not included in the
restore target.
When the unit version of the CPU Unit is 1.10 or earlier, an EtherCAT Slave Restore Operation Failed
event (event code 10300000 hex) will occur if you restore data while a 3G3AX-MX2-ECT or 3G3AX-
RX-ECT Inverter is connected. Use the follow procedure from the Sysmac Studio to write the backup
parameters to the Inverter. Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for
details.

1 Import the Inverter parameters from the backup file with the backup file import function of the
Sysmac Studio.
Display the Inverter parameters on the Inverter Parameters Tab Page for the Controller 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.

Precautions for Correct Use


If you use the Inverter Mode Selection parameter (parameter number b171) in a 3G3AX-MX2-
ECT Inverter, change the Inverter to the mode that was used when the backup data was created
before you write the parameters. After you change the mode setting, you must initialize the
Inverter to enable the change.

9-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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.

9-9 Backup Functions When EtherCAT Slaves Are Connected


9
9-9-4 EtherCAT Slaves for Which You Can Back Up Data

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-55


9 Backup Functions

9-10 Backup Functions When EtherCAT


Slave Terminals Are Connected
For EtherCAT Slave Terminals, you can use the SD Memory Card backup functions, the Sysmac Studio
Controller backup functions, and Sysmac Studio backup import function.
This section provides information on the data that is backed up, backup support according to Controller
status, and restore conditions when EtherCAT Slave Terminals are connected.

Precautions for Correct Use


You cannot back up, restore, or compare data for Safety Control Units on EtherCAT Slave Termi-
nals. Refer to the NX-series Safety Control Unit User’s Manual (Cat. No. Z930) for information
on importing and exporting settings for a Safety Control Unit.

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.

9-10-1 Backing Up Data in an EtherCAT Slave Terminal


The data that can be backed up for an EtherCAT Slave Terminal is different for the EtherCAT Coupler
Unit and the NX Units. The data that is backed up is given in the following table.
(OK: Applicable, NA: Not applicable)
Unit Data Backup Restore Compare
EtherCAT Coupler Unit Configuration information*1 OK OK OK
Unit operation settings OK OK OK
NX Units Configuration information*1 OK OK OK
Unit operation settings OK OK OK
Unit application data*2 OK OK OK
*1 The configuration information includes the Unit configuration information and I/O allocation information.
*2 This is the specific data for each NX Unit. Some NX Units do not have Unit application data.

Precautions for Correct Use


To restore backup data to an EtherCAT Slave Terminal that has an identical Unit configuration to
the EtherCAT Slave Terminal from which data was backed up, make sure that all hardware
switches are set to the same settings as when the backup was made. Backup data cannot be
restored if the hardware switches are set differently from those in the backup data. This will
cause a Restore Operation Failed to Start (EtherCAT Slave) observation event to occur.

9-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-10-2 Backup Support Depending on the EtherCAT Slave Terminal


Status
The following table shows when backup, restore, and compare operations can be performed for Ether-
CAT Slave Terminals based on the EtherCAT Slave Terminal status.

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

9-10 Backup Functions When EtherCAT Slave Terminals Are Connected


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.

9-10-3 Conditions for Restoring EtherCAT Slave Terminal Data


The following conditions must be met before you restore the backup data to the EtherCAT Slave Termi-
nals.
• The backup files must contain the data for the EtherCAT Coupler Unit and NX Unit.
• The original Unit Configuration in the backup must match the actual Unit configuration where data is
being restored.
• The serial number of the EtherCAT Coupler Unit from which the data was backed up and the serial
number of the EtherCAT Coupler Unit to which the data is restored must be the same. However, this
assumes that the setting of the Serial Number Check Method in the Unit operation settings of the
Communications Coupler Unit in the backup file is set to Setting = Actual device.
• The serial numbers of the NX Units from which the data was backed up and the serial numbers of the 9
NX Units to which the data is restored must be the same. However, this assumes that the setting of
the Serial Number Check Method in the Unit operation settings of the Communications Coupler Unit
in the backup file is set to Setting = Actual device.
Terminal Status
9-10-2 Backup Support Depending on the EtherCAT Slave

• The hardware switch settings of the EtherCAT Coupler Unit from which the data was backed and the
hardware switch settings of the EtherCAT Coupler Unit to which the data is restored must be the
same.
• The unit version setting of the EtherCAT Coupler Unit from which the data was backed up and the
unit version of the actual EtherCAT Coupler Unit to which the data is restored must be the same.
• The unit version settings of the NX Unit from which the data was backed up and the unit versions of
the actual NX Units to which the data is restored must be the same.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-57


9 Backup Functions

9-11 Backup Functions When NX Units


Are Connected
For NX Units on the CPU Unit, you can use the SD Memory Card backup functions and the Sysmac
Studio Controller backup functions.
This section provides information on the data that is backed up, backup support according to Controller
status, and restore conditions when NX Units are connected to the NX1P2 CPU Unit.

9-11-1 Backing Up Data in NX Units on the CPU Unit


The data that is backed up for NX Units on the CPU Unit is given in the following table.
(OK: Applicable, NA: Not applicable)
Unit Data Backup Restore Compare
NX Units Configuration information*1 OK OK OK
Unit operation settings OK OK OK
Unit application data*2 OK OK OK
*1 The configuration information includes the Unit configuration information and I/O allocation settings.
*2 This is the specific data for each NX Unit. Some NX Units do not have Unit application data.

9-11-2 Backup Support Depending on the Controller Status


The following table shows when backup, restore, and compare operations can be performed for NX
Units based on the Controller status.

Execution
Controller status Backing up
Restoring data Verifying data
data
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
During NX Bus Controller Error Not possible.*3 Not possible.*4 Possible.*5
During Unit Configuration Verification Error Not possible.*3 Possible. Possible.*5
The Unit configuration information does not agree with --- Not possible.*4 Possible.*5
the Unit configuration information in the backup data.
*1 The backup contains information saying that the Unit configuration information does not exist.
*2 After the data is restored, automatic Unit configuration status continues.
*3 An NX Unit Backup Failed event is recorded in the event log.
*4 An NX Unit Restore Operation Failed event is recorded in the event log.
*5 The verification results will show differences.

9-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-11-3 Conditions for Restoring NX Unit Data on the CPU Unit


The following conditions must be met before you restore the backup data to the NX Units on the CPU
Unit.
• The backup files must contain the data for the NX1P2 CPU Unit and NX Unit on the NX1P2 CPU
Unit.
• The original Unit Configuration in the backup must match the actual Unit configuration where data is
being restored.
• The serial numbers of the NX Units from which the data was backed up and the serial numbers of the
NX Units to which the data is restored must be the same. However, this assumes that the setting of
the Serial Number Check Method in the CPU Racks in the backup file is set to Setting = Actual
device.
• The unit version settings of the NX Unit from which the data was backed up and the unit versions of
the actual NX Units to which the data is restored must be the same.

9-11 Backup Functions When NX Units Are Connected


9
Unit
9-11-3 Conditions for Restoring NX Unit Data on the CPU

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-59


9 Backup Functions

9-12 Backup Functions When CJ-series


Units Are Connected
Data in CJ-series Units is covered by the SD Memory Card backup functions and Sysmac Studio Con-
troller backup functions. This section provides precautions for connected CJ-series Units for the data
that is backed up, backup support according to Controller status, and restore conditions.

Precautions for Correct Use


You can connect CJ-series Units only with NJ-series CPU Units.

9-12-1 Backed Up CJ-series Unit Data


The present values in memory used for CJ-series Units and the parameters in the CJ-series Units are
backed up. Some of this data is in the CJ-series Unit and some are in the CPU Unit. You do not need to
be aware of where the data is located because the backup, restoration, and verification operations will
automatically process this data.

9-12-2 Backup Support Depending on the Controller Status

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
Restarting the CJ-series Unit Not possible.*1 Possible. Possible.*3

*1 CJ-series Unit Backup Failed events are recorded in the event log.
*2 CJ-series Unit Restore Operation Failed events are recorded in the event log.
*3 The verification results will show differences.

9-12-3 Conditions for Restoring CJ-series Unit Data


The following conditions must be met before you can restore the backup data to the CJ-series Units.
• The backup files must contain the CJ-series Unit data.
• The Unit Configuration in the backup file must match the actual Unit Configuration where data is
being restored.
• Each CJ-series Unit must meet the conditions for that Unit. (Refer to the manuals for the CJ-series
Units for the specific conditions for each Unit.)

9-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Precautions for Correct Use


If you restore data using the SD Memory Card backup functions or the Sysmac Studio Controller
backup functions while CJ-series Units are connected, a CPU Unit Service Monitor Error will
occur. This means that servicing the CJ-series Units from the CPU Unit was not completed
within a specific amount of time. However, this is the result of the time that is required to restore
the data and it does not indicate an error. The following will occur at this time.
• For communications-related CJ-series Units, the MS indicator flashes red.
• For CJ-series Units with seven-segment indicator, the indicator displays “HE”.
• For CJ-series Units that have an ERH indicator, the ERH indicator lights.
• An event code of 00000002 hex is recorded in the Controller event logs to indicate a CPU Unit
Service Monitor Error or Refresh Timeout event.
• If a CJ-series CJ1W-CT021 High-speed Counter Unit is connected, an event code of
68010000 hex is recorded in the Controller event logs to indicate a Unit Error. The attached
information will be 0002 hex.

9-12 Backup Functions When CJ-series Units Are Connected


9
9-12-3 Conditions for Restoring CJ-series Unit Data

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-61


9 Backup Functions

9-13 Backup-related Files


This section describes the specifications of the backup-related files. These backup-related files apply to
all backup functions except for the Sysmac Studio variable and memory backup functions.

9-13-1 Types of Backup-related Files


There are four types of files that are related to backup functions: backup files, restore command files,
automatic transfer command files, and verification results files.

 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.

 Restore Command File


This file specifies the data groups to transfer by restoring data from a SD Memory Card. You can edit
this file with a text editor on a computer to specify the data groups to transfer. These files are cre-
ated when data is backed up.

 Automatic Transfer Command File


This file specifies the data groups to transfer by automatically transferring data from a SD Memory
Card. You can edit this file with a text editor on a computer to specify the data groups to transfer.
These files are created when data is backed up.

 Verification Results Files


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit.
There are four different verification results files, as described below. These files are created when
you perform a verification using the SD Memory Card backup function.

Verification results
Description
files
Controller verification This file contains the verification results for all backup data specified by the restore
results file command file.
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.
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 NX1P2 CPU Unit.
*2 You can use CJ-series Units only with NJ-series CPU Units.

9-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-13-2 Specifications of a Backup File


This section describes the file name, creation timing, and created directory for a backup file.

File Name
A different backup file name is given depending on the CPU Unit series.

File CPU Units File name


Backup file NX-series CPU Units NXBackup.dat
NJ-series CPU Units NJBackup.dat

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory CPU Unit front-panel DIP When backup is exe- Root directory on the SD Memory
Card backups switch cuted Card
System-defined variables When backup is exe- Directory on the SD Memory Card
cuted that you specified with the system-
defined variable
SD Memory Card Window in When backup is exe- Directory on the SD Memory Card
Sysmac Studio cuted that you specified with the Sysmac
Studio
Special instruction*1 When backup is exe- The directory on the SD Memory

9-13 Backup-related Files


cuted Card that you specified for the
input variable of the Backup-
ToMemoryCard instruction
Sysmac Studio Sysmac Studio Controller When backup is exe- Directory in the computer that you
Controller Backup Dialog Box cuted specified with the Sysmac Studio
backups
Importing and Sysmac Studio Backup File When data is Directory in the computer that you
exporting Sys- Export Dialog Box exported specified with the Sysmac Studio
mac Studio
backup file data
9
*1 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required. 9-13-2 Specifications of a Backup File

9-13-3 Specifications of a Restore Command File


This section describes the file name, creation timing, created directory, and data group specification
method for a restore command file.

File Name

File File name


Restore command file RestoreCommand.ini

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-63


9 Backup Functions

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory Card CPU Unit front-panel DIP When backup is executed Same directory as backup file
backups switch
System-defined variables When backup is executed Same directory as backup file
SD Memory Card Window in When backup is executed Same directory as backup file
Sysmac Studio
Sysmac Studio Sysmac Studio Controller When backup is executed Same directory as backup file
Controller backups Backup Dialog Box
Importing and Sysmac Studio Backup File When data is exported Same directory as backup file
exporting Sysmac Export Dialog Box
Studio backup file
data

9-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Specifying the Data Groups to Restore


The restore command file allows you to specify the data groups to restore. You can change the data
group specifications by editing the file with a text editor on a computer.
For example, if you change “Variable=yes” on line 8 in the file contents that are shown in the following
table to “Variable=no,” the present values of variables will not be restored.

File contents (defaults when the file is created) Description


[Restore]
; --- User Program and Configuration. --- User program and settings
; Always select "yes". This data group is always restored. Always
UserProgram=yes select

; --- IP Address of Built-in EtherNet/IP Port Settings. --- IP address of built-in EtherNet/IP port

; "yes":will be restored, "no":will not be restored yes/no: Restore/Do not restore.


IPAdr=yes
Present values of variables (only variables that are
set to be retained with the Retain attribute)
; --- Present values of variables (Retained variables only). ---
yes/no: Restore/Do not restore.
; "yes":will be restored, "no":will not be restored
Variable=yes
Present values of memory used for CJ-series Units
(only addresses that are set to be retained with the
; --- Present values of memory used for CJ-series Units (Holding, Retain attribute)
EM, and DM Area data). ---
yes/no: Restore/Do not restore.
; "yes":will be restored, "no":will not be restored
Memory=yes

Units and slaves settings


:---Unit/Slave Parameters.---

9-13 Backup-related Files


yes/no: Restore/Do not restore.
; "yes";will be restored."no";will not be restored
UnitConfig=yes

Absolute encoder home offset


; --- Absolute encoder home offset. ---
yes/no: Restore/Do not restore.
; "yes":will be restored, "no":will not be restored
AbsEncoder=yes

Note 1 The default file contents when the restore command file is created are given above. All of the data groups
that are listed in the file are set to be restored. 9
2 The restore command file lists the restorable data groups that were in the backup file when the backup file
was created. 9-13-3 Specifications of a Restore Command File

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-66 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.

Precautions for Correct Use


When you edit the restore command file, do not change anything in the file except for the “yes”
and “no” specifications for the selectable data groups. If you change anything else in the file, the
Controller may perform unexpected operation when you restore the data.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-65


9 Backup Functions

Compatibility between Restore Command Files


The following table shows the 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

Version 1.13 or earlier Restorable. Restorable.


IP Address of Built-in EtherNet/IP IP Address of Built-in EtherNet/IP
Port Settings is restored. Port Settings is restored.
Version 1.14 or later Not restorable. Restorable.
In the CPU Unit with unit version IP Address of Built-in EtherNet/IP
1.13 or earlier, because the entry Port Settings corresponds to “yes/no”
of IP Address of Built-in Ether- of “IPAdr”.
Net/IP Port Settings cannot be
interpreted, a Restore Operation
Failed to Start error in an observa-
tion level occurs. The error details
will be “0104 hex: The contents of
the restore command file are not
correct”.

9-13-4 Specifications of an Automatic Transfer Command File


This section describes the file name, creation timing, created directory, and data group specification
method for an automatic transfer command file.

File Name
File File name
Automatic transfer command file AutoloadCommand.ini

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory Card CPU Unit front-panel DIP When backup is exe- Same directory as backup file
backups switch cuted
System-defined variables When backup is exe- Same directory as backup file
cuted
SD Memory Card Window in When backup is exe- Same directory as backup file
Sysmac Studio cuted
Sysmac Studio Sysmac Studio Controller When backup is exe- Same directory as backup file
Controller backups Backup Dialog Box cuted
Importing and Sysmac Studio Backup File When data is exported Same directory as backup file
exporting Sysmac Export Dialog Box
Studio backup file
data

9-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

Specifying the Data Groups to Automatically Transfer


The automatic transfer command file allows you to specify the data groups to transfer automatically.
You can change the data group specifications by editing the file with a text editor on a computer. For
example, if you change “Variable=yes” on line 8 in the file contents that are shown in the following table
to “Variable=no,” the present values of variables will not be automatically transferred.

File contents (defaults when the file is created) Description


[Autoload]
; --- User Program and Configuration. --- User program and settings
; Always select "yes". This data group is always transferred. Always select
UserProgram=yes

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

; "yes":will be transferred, "no":will not be transferred yes/no: Transfer/Do not transfer.

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.

9-13 Backup-related Files


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-68 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.
9
Precautions for Correct Use
When you edit the automatic transfer command file, do not change anything in the file except for
File
9-13-4 Specifications of an Automatic Transfer Command

the “yes” and “no” specifications for the selectable data groups. If you change anything else in
the file, the Controller may perform unexpected operation when you automatically transfer the
data.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-67


9 Backup Functions

Compatibility between Automatic Transfer Files


The following table shows the 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”.

9-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-13-5 Specifications of a Controller Verification Results File


This section describes the file name, creation timing, created directory, and verification results confir-
mation method for a Controller verification results file.

File name
File File name
Controller Verification Results File VerifyResult.log

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory SD Memory Card Window in When verification is executed Same directory as backup file
Card backups Sysmac Studio
System-defined variables When verification is executed Same directory as backup file
CPU Unit front-panel DIP When verification is executed Same directory as backup file
switch

Note However, if the SD Memory Card is write-protected, the verification results files will not be created.

How to Check the Verification Results


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit for each data group. You can check the verification

9-13 Backup-related Files


results in the portion that gives the verification results for each data group. “Result=Matched” indicates
a data group for which no differences were found. “Result=Not matched” indicates a data group for
which differences were found. In the file shown below, the user program and configuration data
matched, and the Units and slave parameters did not match.

File contents Description


[UserProgram]
; --- User Program and Configuration. --- User program and settings
Result=Matched Matched: No differences were found, Not matched: Differ-
ences were found. 9
[UnitConfig]
; --- Unit/Slave Parameters. --- Units and slaves settings
File
9-13-5 Specifications of a Controller Verification Results

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-69


9 Backup Functions

9-13-6 Specifications of an EtherCAT Verification Results File


This section describes the file name, creation timing, created directory, and verification results confir-
mation method for an EtherCAT verification results file.

File Name
File File name
EtherCAT Verification Results File VerifyResult_ECAT.log

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory SD Memory Card Window in When verification is Same directory as backup file
Card backups Sysmac Studio executed
System-defined variables When verification is Same directory as backup file
executed
CPU Unit front-panel DIP When verification is Same directory as backup file
switch executed

Note However, if the SD Memory Card is write-protected, the verification results files will not be created.

How to Check the Verification Results


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit for each data group. You can check the verification
results in the portion that gives the verification results for each EtherCAT slave. “Result=Matched” indi-
cates a data group for which no differences were found. “Result=Not matched” indicates a data group
for which differences were found.
The following table gives an example of the verification results for the following file contents.
• Matched: EtherCAT slave called Master and EtherCAT Slave Terminal E022
• Not matched: EtherCAT slave E001

File contents Description


[Verification Results]
; --- EtherCAT Parameters. ---
: --- See the VerifyResult_ECAT_NX.log
about detail result if NX mark is included in
square brackets.
The slaves are indicated with the user-set device names. For an EtherCAT Slave
[Master] Terminal, “:NX” is added to the end of the device name.*1
Result=Matched
The verification results are given as follows:
[E001]
Result=Matched Same
Result=Not matched
Result=Not matched Different
Factor=Verification error

[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.

9-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-13-7 Specifications of an EtherCAT Slave Terminal Verification Results


File
This section describes the file name, creation timing, created directory, and verification results confir-
mation method for an EtherCAT Slave Terminal verification results file.

File Name
File File name
EtherCAT Slave Terminal verification results file VerifyResult_ECAT_NX.log

File Creation Timing and Created Directories


Operation Operating method Creation timing Created directory
SD Memory SD Memory Card Window in When verification is Same directory as backup file
Card backups Sysmac Studio executed
System-defined variables When verification is Same directory as backup file
executed
CPU Unit front-panel DIP When verification is Same directory as backup file
switch executed
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.

How to Check the Verification Results


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit for each data group.

9-13 Backup-related Files


You can check the verification results in the portion that gives the verification results for the EtherCAT
Coupler Units and NX Units.
“Result=Matched” indicates a data group for which no differences were found. “Result=Not matched”
indicates a data group for which differences were found.
The following table gives an example of the verification results for the following file contents.
• Matched: EtherCAT Coupler Unit E002, NX Unit N1, and NX Unit N2
• Not matched: EtherCAT Coupler Unit E005 and NX Unit N3

File contents Description


[Verification Results] The Units are indicated in the following format:
9
; --- NX Parameters. --- {Device name}:UnitNo.{Unit number}[blank]{Unit model}
Verification Results File
9-13-7 Specifications of an EtherCAT Slave Terminal

[E002:UnitNo.0 NX-ECC201] Device Name:


Result=Matched The device name set by the user.
Unit Number:
[N1:UnitNo.1 NX-AD2203]
Text string of decimal numbers. The value will be between 0 and 125.
Result=Matched
Unit Model:
[N2:UnitNo.2 NX-DA2203] Text string that identifies the Unit model.
Result=Matched Consecutive spaces at the end of the model number are deleted.

[N3:UnitNo.3 NX-TS3201] The verification results are given as follows:


Result=Not matched Result=Matched Same
Factor=Verification error Result=Not matched Different

[E005:UnitNo.0 NX-ECC201]
Result=Not matched
Factor=Verification error

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-71


9 Backup Functions

9-13-8 Specifications of an NX Unit Verification Results File


This section describes the file name, creation timing, created directory, and verification results confir-
mation method for an NX Unit verification results file.

Precautions for Correct Use


You can use NX Units on the CPU Unit only with the NX1P2 CPU Units.

File Name
File File name
NX Unit verification results file VerifyResult_NXUnit.log

File Creation Timing and Created Directories


Operation Operating method Creation timing Created directory
SD Memory SD Memory Card Window in When verification is Same directory as backup file
Card backups Sysmac Studio executed
System-defined variables When verification is Same directory as backup file
executed
CPU Unit front-panel DIP When verification is Same directory as backup file
switch executed
Note However, if the SD Memory Card is write-protected, the verification results files will not be created.

How to Check the Verification Results


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit for each data group.
You can check the verification results in the portion that gives the verification results for the NX Units.
“Result=Matched” indicates a data group for which no differences were found. “Result=Not matched”
indicates a data group for which differences were found.
The following table gives an example of the verification results for the following file contents.
• Matched: NX Unit N1
• Not matched: NX Unit N3
• Not verified: NX Unit N2

File contents Description


[Verification Results] The Units are indicated in the following format:
; --- NX Parameters. --- {Device name}:UnitNo.{Unit number}[blank]{Unit model}

[N1:UnitNo.1 NX-AD2203] Device Name:


Result=Matched The device name set by the user.
Unit Number:
[N2:UnitNo.2 NX-DA2203]
Text string of decimal numbers. The value will be between 0 and 125.
Result=Not verified
Unit Model:
[N3:UnitNo.3 NX-TS3201] Text string that identifies the Unit model.
Result=Not matched Consecutive spaces at the end of the model number are deleted.
Factor=Verification error
The verification results are given as follows:
Result=Matched Same
Result=Not matched Different
Result=Not verified No verification

9-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-13-9 Specifications of CJ-series Unit Verification Results File


This section describes the file name, creation timing, created directory, and verification results confir-
mation method for a CJ-series Unit verification results file.

Precautions for Correct Use


You can use CJ-series Units only with NJ-series CPU Units.

File name

File File name


CJ-series Unit Verification Results File VerifyResult_CJUnit.log

File Creation Timing and Created Directories

Function Procedure Creation timing Created directory


SD Memory SD Memory Card Window in When verification is Same directory as backup file
Card backups Sysmac Studio executed
System-defined variables When verification is Same directory as backup file
executed
CPU Unit front-panel DIP When verification is Same directory as backup file
switch executed

9-13 Backup-related Files


Note However, if the SD Memory Card is write-protected, the verification results files will not be created.

9
File
9-13-9 Specifications of CJ-series Unit Verification Results

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-73


9 Backup Functions

How to Check the Verification Results


The verification results files contain the results of comparing the Controller data and the data in a
backup file on the SD Memory Card in the CPU Unit for each data group. You can check the verification
results in the portion that gives the verification results for each CJ-series Unit. “Result=Matched” indi-
cates a data group for which no differences were found. “Result=Not matched” indicates a data group
for which differences were found. In the file shown below, CJ1W-CRM21 (MODE0) and CJ1W-EIP21
matched, and CJ1W-DRM21 and CJ1W-PRM21-DPV1 did not match.

File contents Description


[Verification Results] The Units are given in the following format:
; --- CJ Unit Parameters. --- Rack{Rack No.}[space]Slot{Slot No}:[space]{Unit
[Rack0 Slot0: CJ1W-CRM21(MODE0) UnitNo.10] model}[space]Unit No.{unit number}

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
95.

The match/no match results are given in the following


format:
Result=Matched: No differences were found.
Result=No matched: Differences were found.

Note The verification results are given only for the EtherCAT slaves that were compared.

9-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

9-14 Compatibility between Backup-


related Files
The files may not be compatible if you back up and restore data under different conditions.
The files may not be compatible in these three cases:
• When the function that was used to back up data is different from the function that was used to
restore it.
• When the model number of the CPU Unit where the data was backed up from does not match the
model number where data is being restored.
• When the unit versions of the CPU Unit, other Units, or slaves where the data was backed up from
do not match the unit versions where data is being restored.

In this context, the term “restore” is used collectively for these backup functions: restore, automatic
transfer, program transfer, and read (back up).

9-14 Compatibility between Backup-related Files


9-14-1 Compatibility between Backup Functions
The following table shows the file compatibility when the function used to back up the data is different
from the function used to restore it.
(C: Compatible, N: Not compatible.)
Function used to restore data
Restoring
Restoring Restoring
with Sysmac
with SD with Sysmac Importing
Studio vari-
Function used to back up Memory Automatic Studio Con- Sysmac Stu-
able and
data Card backup transfer and troller dio backup
memory
functions program backup func- file data
backup func-
(SD Memory transfer tions (com- (computer to
tions (com-
Card to Con- puter to project)
puter to
troller) Controller)
Controller)
Backing up with SD Memory C C C N C*1
Card backup functions (Con- 9
troller to SD Memory Card)
Backing up with Sysmac Stu- C C C N C*1
9-14-1 Compatibility between Backup Functions

dio Controller backup func-


tions (Controller to computer)
Backing up with Sysmac Stu- N N N C N
dio variables and memory data
backup functions (Controller to
computer)
Exporting from a Sysmac Stu- C*1 C*1 C*1 N C
dio backup file (project to com-
puter)

*1 The following data is not included.


• The built-in EtherNet/IP port name and built-in EtherNet/IP tag data link settings in the Controller Setup
• Words allocated to CPU Bus Units in the Unit Configuration
• Operation authority verification
• Data Trace Settings
• Time zone setting

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-75


9 Backup Functions

• Present values of variables


• Present values of memory used for CJ-series Units
• Absolute encoder home offsets

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.

9-14-2 Compatibility between CPU Unit Models


The following table shows the file compatibility when the CPU Unit model where the data was backed
up from is different from the group where the data is being restored.
(C: Compatible, N: Not compatible.)
CPU Unit model to restore to
NX1P2-
1140DT, NJ501-
CPU Unit model NX701- NX1P2- NX1P2- 1500, NJ301-
where data was 1700 1140DT1, 9024DT NJ501- 1200 NJ101- NJ101-
backed up or NX701- NX1P2- or NX1P2- 1400, or NJ301- 1000 9000
1600 1040DT, 9024DT1 or NJ501- 1100
or NX1P2- 1300
1040DT1
NX701-1700 or C N*1 N*1 N*1 N*1 N*1 N*1
NX701-1600
NX1P2-1140DT, N*1 C N*1 N*1 N*1 N*1 N*1
NX1P2-
1140DT1,NX1P2-
1040DT,
or NX1P2-1040DT1
NX1P2-9024DT N*1 N*1 C N*1 N*1 N*1 N*1
or NX1P2-9024DT1
NJ501-1500, NJ501- N*1 N*1 N*1 C N*1 N*1 N*1
1400, or NJ501-1300
NJ301-1200 or N*1 N*1 N*1 N*1 C N*1 N*1
NJ301-1100
NJ101-1000 N*1 N*1 N*1 N*1 N*1 C N
NJ101-9000 N*1 N*1 N*1 N*1 N*1 N C

*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, and NJ Robotics CPU Units are not
compatible.
Refer to the relevant manuals for specific Units for details on the compatibility of these CPU
Units.

9-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


9 Backup Functions

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.

9-14 Compatibility between Backup-related Files


*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.

9-14-3 Compatibility between Unit Versions of CPU Units


The following table shows the compatibility of backup files when the unit versions of the CPU Unit are
different between where the data was backed up and where it is being restored. You can restore data
without any restrictions if the unit versions are the same before and after the backup and restoration.
(R: Restored, x: Not restored)
Function used to restore data
Restoring with Sys-
Restoring with SD Restoring with Sys-
Unit version of mac Studio variable
Memory Card Automatic transfer mac Studio Con-
CPU Unit and memory
backup functions and program trans- troller backup
backup functions
(SD Memory Card fer functions (com-
to Controller) puter to Controller)
(computer to Con- 9
troller)
Version of CPU R R R R
9-14-3 Compatibility between Unit Versions of CPU Units

Unit where data is


being restored is
newer.
Unit version of × ×*1 × R
CPU Unit where
data is being
restored is older.

*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 9-77


9 Backup Functions

9-15 Functions That Cannot Be Executed


during Backup Functions
The following functions cannot be executed at the same time as any of the backup functions. Do not
execute any backup function while the CPU Unit is executing any of these functions. Also, do not exe-
cute any of these functions during execution of any of the backup functions.
• While a backup function is being performed
• Synchronization transfer from the computer to the Controller
• Execution of online editing
• Execution of Clear All Memory operation
• Time zone changes
• Execution of the Save Cam Table instruction (MC_SaveCamTable)
• Execution of CPU Unit name write operation
• Execution of transferring Slave Terminal parameters

9-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


10

Communications Setup
This section describes how to go online with the CPU Unit and how to connect to other
devices.

10-1 Communications System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2


10-1-1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
10-2 Connection with Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
10-2-1 Configurations That Allow Online Connections . . . . . . . . . . . . . . . . . . . . . . . 10-6
10-2-2 Configurations That Do Not Allow Online Connections . . . . . . . . . . . . . . . . . 10-7
10-3 Connection with Other Controllers or Slaves . . . . . . . . . . . . . . . . . . . . . . 10-9
10-3-1 Connection Configurations between Controllers . . . . . . . . . . . . . . . . . . . . . . 10-9
10-3-2 Connection Configuration between Controllers and Slaves . . . . . . . . . . . . . 10-12
10-4 Connection with HMIs or Serial Communications Devices . . . . . . . . . . 10-13
10-4-1 Connection with HMIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
10-4-2 Connection with Serial Communications Devices . . . . . . . . . . . . . . . . . . . . 10-14

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-1


10 Communications Setup

10-1 Communications System Overview


This section gives an overview of the communications systems that are supported by NJ/NX-series
Controllers.
The shaded steps in the overall procedure that is shown below are related to the communications sys-
tems.

Step 1. Software Design


Step 1-1 Designing I/O and Processing

Step 1-2 Designing Tasks

Step 1-3 Designing Programs

Step 2. Software Setups and Programming


Step 2-1 Slave and Unit Configurations

Step 2-2 Controller Setup

Step 2-3 Programming

Step 2-4 Offline Debugging

Step 3. Mounting and Setting Hardware

Step 4. Wiring

Step 5. Checking Operation and Starting Operation on the


Actual System
Refer to 1-3 Overall Operating Procedure for the NJ/NX-series Controller for details.

10-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

10-1 Communications System


10-1-1 Introduction
 NX701 System

Overview
You can use the NX701 System to build the communications system shown below.

HMI NX-series Controller NJ-series Controller

Sysmac Studio
NTP server
BOOTP server
10
DNS server
EtherNet/IP

10-1-1 Introduction
HMI CJ2 series

Sysmac Studio

NX-series Controller EtherNet/IP

Power Supply Unit CPU Unit NJ-series Controller EtherNet/IP slave

USB

Built-in EtherNet/IP port


EtherCAT
Built-in EtherCAT port

General-purpose slaves

Slave Terminal Servo Drives

Connection Connection method


Sysmac Studio connection Use USB or the built-in EtherNet/IP port.
Connections between Connections with NJ/NX-series Controller Use the built-in EtherNet/IP port.
Controllers or CJ2 CPU Unit
Connections between Connections to Servo Drives and general- Use the built-in EtherCAT port.
Controllers and slaves purpose slaves
Connections to HMIs Use the built-in EtherNet/IP port.
Connections to servers Connections to FTP servers, BOOTP Use the built-in EtherNet/IP port.
servers, DNS servers, or NTP servers

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-3


10 Communications Setup

 NX1P2 System
You can use the NX1P2 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
NX1P2
CPU Unit

Built-in EtherNet/IP port


NX-series
Communications Interface Unit

Built-in EtherCAT port Serial


Communications
Option Board Serial-communications devices

General-purpose components or OMRON components

EtherCAT

General-purpose slaves

Slave Terminal Servo Drives

Connection Connection method


Sysmac Studio connection Use the built-in EtherNet/IP port.
Connections between Connections with NJ/NX-series Controller Use the built-in EtherNet/IP port.
Controllers or CJ2 CPU Unit
Connections between Connections to Servo Drives and general- Use the built-in EtherCAT port.
Controllers and slaves purpose slaves
Connections to HMIs Use the built-in EtherNet/IP port.
Connections to servers Connections to FTP servers, BOOTP Use the built-in EtherNet/IP port.
servers, DNS servers, or NTP servers

10-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

10-1 Communications System


 NJ-series System
You can use the NJ-series System to build the communications system shown below.

Overview
HMI NJ-series Controller NJ-series Controller

Sysmac Studio

NTP server
BOOTP server
DNS server
EtherNet/IP EtherNet/IP

CJ2 Series
10
Example: Serial Communications Unit

Sysmac Studio
Example: EtherNet/IP Unit

10-1-1 Introduction
NJ-series Controller EtherNet/IP

Power Supply Unit CPU Unit NJ-series Controller


EtherNet/IP slave

USB

Example: CompoNet Master 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

OUT OUT

Built-in EtherCAT port CRT1 OD16


CRT1-OD16
REMOTE TERMINAL
OD16
CRT1-OD16
CRT1
REMOTE TERMINAL

Serial General-purpose
device with serial
Example: DeviceNet Unit communications
DeviceNet

EtherCAT

General-purpose slaves

Slave Terminal Servo Drives

Connection Connection method


Sysmac Studio connection Use USB or the built-in EtherNet/IP
port.
Connections between Controllers Connections with NJ/NX-series Use the built-in EtherNet/IP port or
Controller or CJ2 CPU Unit a port on an EtherNet/IP Unit*1
Connections between Controllers Connections to Servo Drives and Use the built-in EtherCAT port.
and slaves general-purpose slaves
I/O controls Mount a DeviceNet Unit and use
DeviceNet or mount a CompoNet
Master Unit and use CompoNet.
Connections to HMIs Use the built-in EtherNet/IP port or
a port on an EtherNet/IP Unit*1, *2
Connections for serial communications Mount a Serial Communications
Unit.
Connections to servers Connections to FTP servers*3, Use the built-in EtherNet/IP port or
BOOTP servers, DNS servers, or a port on an EtherNet/IP Unit*1
NTP servers
*1 Use an EtherNet/IP Unit with unit version 2.1 or later.
Also use a CPU Unit with unit version 1.01 or later and Sysmac Studio version 1.02 or higher. Refer to A-15 Version Informa-
tion for NJ-series Controllers for information on version upgrades.
*2 Connect an NA-series PT to the built-in EtherNet/IP port on the CPU Unit. To perform troubleshooting from an NS-series PT,
connect the PT to the built-in EtherNet/IP port on the CPU Unit.
*3 A CPU Unit with unit version 1.08 or later and Sysmac Studio version 1.09 or higher are required to use FTP servers.

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-5


10 Communications Setup

10-2 Connection with Sysmac Studio


This section describes the configurations for connecting the Sysmac Studio to an NJ/NX-series Controller.

10-2-1 Configurations That Allow Online Connections


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.

 Connecting with USB

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 and an NX1P2 CPU Unit because it does not provide a peripheral USB port.

 Connecting with EtherNet/IP


1:1 Connection 1:N Connections

Sysmac Studio Sysmac Studio

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, 1:1 connection is
supported only for port 1.

10-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

10-2 Connection with Sysmac


 Connecting to EtherNet/IP through USB
You can connect to the built-in EtherNet/IP port through a USB port of the NJ-series CPU Unit or
NX701 CPU Unit.

Studio
Sysmac Studio

USB 10
EtherNet/IP

10-2-2 Configurations That Do Not Allow Online Connections


• 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 An NX1P2 CPU Unit does not provide a peripheral USB port.

10-2-2 Configurations That Do Not Allow Online Connections


 Connection through an EtherNet/IP Unit
You cannot connect through a CJ1W-EIP21 EtherNet/IP Unit that is connected to an NJ-series CPU Unit.

Sysmac Studio

EtherNet/IP

CJ1W-EIP21
EtherNet/IP Unit

Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.

 Routing through CS/CJ-series EtherNet/IP Units/Ports


You cannot connect to an NJ/NX-series CPU Unit by routing through a CS/CJ-series Ethernet/IP
Unit or port (CS1W-EIP2, CJ1W-EIP21, CJ2 CPU Unit built-in EtherNet/IP port, or CJ2M CPU Unit
built-in EtherNet/IP port).

EtherNet/IP

CJ2 CPU Unit built-in EtherNet/IP port or EtherNet/IP Units

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-7


10 Communications Setup

 Routing through Networks Other Than EtherNet/IP, Such as DeviceNet


You cannot route through any networks other than EtherNet/IP networks. (For example, routing is
not possible for Controller Link networks and DeviceNet networks.)

Sysmac Studio

USB
DeviceNet network

DeviceNet Unit

Note You cannot connect a DeviceNet Unit with NX-series CPU Units.

10-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

10-3 Connection with Other


10-3 Connection with Other Controllers or

Controllers or Slaves
Slaves
This section shows the connection configurations that are used between Controllers and between Con-
trollers and slaves.
10
10-3-1 Connection Configurations between Controllers

10-3-1 Connection Configurations between Controllers


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.

 Tag Data Links


You can create tag data links between NJ/NX-series CPU Units on an EtherNet/IP network.

EtherNet/IP

 Message Communications
You can send CIP messages from the user program.

EtherNet/IP

CIP communications
instruction

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-9


10 Communications Setup

 Sending and Receiving Files


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.

FTP client application

Sending and Receiving Files

EtherNet/IP

FTP server

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

10-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

10-3 Connection with Other


 Updating Clock Information

Controllers or Slaves
You can obtain clock information from an NTP server to update the built-in clock.
NTP server

Clock information
EtherNet/IP

10
NTP client

10-3-1 Connection Configurations between Controllers


 Specifying Host Names
You can use the DNS client or set up your Hosts so that you can specify the IP address of the NTP
server or SNMP manager or the target destination of a socket instruction or CIP communications
instruction with a host name instead of an IP address.
Example: Setting Host Names on the DNS Server

DNS server

IP address EtherNet/IP
Host name

DNS client

 Obtaining an IP Address When the Power is Turned ON


You can obtain an IP address for the built-in EtherNet/IP port from the BOOTP server when the
power supply is turned ON.

BOOTP server

IP address
EtherNet/IP
BOOTP commands

BOOTP client

 Specifying an SNMP Agent


Built-in EtherNet/IP port internal status information is provided to network management software
that uses an SNMP manager.

SNMP manager

Administration
information
EtherNet/IP

SNMP messages

SNMP agent

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-11


10 Communications Setup

10-3-2 Connection Configuration between Controllers and Slaves

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.

EtherCAT

Slave Terminal General-purpose slave

Servo Drives

10-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


10 Communications Setup

Serial Communications Devices


10-4 Connection with HMIs or
10-4 Connection with HMIs or Serial
Communications Devices
This section shows the connection configurations used to connect HMIs and devices with serial com-
munications to the NJ/NX-series Controller.
10
10-4-1 Connection with HMIs

10-4-1 Connection with HMIs


 EtherNet/IP
You can use a built-in EtherNet/IP port or a CJ1W-EIP21 EtherNet/IP Unit to connect to an HMI.
HMI

EtherNet/IP

Built-in EtherNet/IP port CJ1W-EIP21


EtherNet/IP Unit

Note You cannot use a CJ1W-EIP21 EtherNet/IP Unit for NX-series CPU Units.

Connect an NA-series PT to the built-in EtherNet/IP port on the CPU Unit.


To perform troubleshooting from an NS-series PT, connect the PT to the built-in EtherNet/IP port on
the CPU Unit.

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.

High-speed Serial Communications Unit

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) 10-13


10 Communications Setup

10-4-2 Connection with Serial Communications Devices


 NX701 CPU Units
You cannot use a Serial Communications Unit or a Serial Communications Option Board to connect
to an NX701 CPU Unit.

 NX1P2 CPU Units


You can use a Serial Communications Option Board or an NX-series Communications Interface Unit
to connect to an NX1P2 CPU Unit.
Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No.
W579) for details on the Serial Communications Option Board and NX-series Communications Inter-
face Units User's Manual (Cat. No. W540) for details on the NX-series Communications Interface
Unit.

Serial Communications NX-series Communications


Option Board Interface Unit
Device with serial
communications

RS-232C or
RS-422A/485

 NJ-series CPU Units


You can use a Serial Communications Unit to connect to an NJ-series CPU Unit. 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.

High-speed Serial Communications Unit


Device with serial
communications

RS-232C or
RS-422A/485

10-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


Example of Actual Application 11
Procedures
This section describes the procedures that are used to actually operate an NJ-series
Controller.

11-1 Example Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2


11-1-1 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2
11-1-2 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2
11-2 Overview of the Example Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
11-2-1 Wiring and Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-3
11-2-2 Software Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-3
11-2-3 Software Settings from the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . .11-4
11-2-4 Programming with the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-8
11-2-5 Simulation with the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-9
11-2-6 Checking Operation and Starting Operation on the Actual System . . . . . . . . .11-9

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-1


11 Example of Actual Application Procedures

11-1 Example Application


This section describes an example application for an NJ-series Controller.

11-1-1 System Configuration


Unit name Qty Connected device
Power Supply Unit 1 ---
CPU Unit 1 ---
CJ-series Basic I/O Units 2 ---
CJ-series Analog Input Unit 1 Displacement Sensor
EtherCAT slaves Servo Drives (G5 EtherCAT) 2 ---
I/O Terminal 1 ---

Sysmac Studio

NJ-series Controller Analog Input Unit

Basic I/O Units


Power Supply Unit CPU Unit

USB

Displacement Sensor
Built-in EtherCAT port

EtherCAT

G5 EtherCAT

Positive limit input


Negative limit input
Immediate stop input General-purpose slaves
Home signal
External latch signal, etc.
Servo Drives Servo Drives

11-1-2 Operation
Interrupt feeding starts when the sensor signal changes to ON during velocity control.

Velocity Velocity control Interrupt feeding

Sensor turns ON. Time

The vertical position changes based on the analog input from the Displacement Sensor.

11-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


11 Example of Actual Application Procedures

11-2 Overview of the Example Procedure


11-2 Overview of the Example Procedure
This section describes examples of the actual operating procedures for an NJ-series Controller.

11-2-1 Wiring and Settings


Wire the Controller and make the hardware settings.

11-2-2 Software Design 11


Design the I/O, tasks, POUs, and variables.

11-2-1 Wiring and Settings


I/O Design
• Design the relationship between the external I/O and the Unit configuration.
• Determine the intervals at which to refresh external I/O.

Task and POU Design


Consider the following:
• What task configuration is required
• Which programs to assign to which tasks
• Which Units to assign to which tasks
• What processing to place in programs and what processing to place in function blocks and functions

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

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-3


11 Example of Actual Application Procedures

11-2-3 Software Settings from the Sysmac Studio


On the Sysmac Studio, you set the Unit and slave configurations, register global variables and device
variables, create axes (axis variables), and set the Controller Setup and Special Unit Setup.

Start the Sysmac Studio.


Create a project in Sysmac Studio.

Create the Unit Configuration.

1 Double-click CPU/Expansion Racks under Configurations and Setup.

2 Create the Unit configuration by dragging Units.

3 Select each Unit and make the required settings.

11-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


11 Example of Actual Application Procedures

11-2 Overview of the Example Procedure


Create the EtherCAT Slave Configuration.

1 Double-click EtherCAT under Configurations and Setup.

2 Create the slave configuration by dragging slaves.

11

11-2-3 Software Settings from the Sysmac Studio


3 Select the master and set the master parameters.

4 Select each slave and set the slave parameters.

Additional Information

At this point, you can use forced resetting from the I/O Map to check the wiring.

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-5


11 Example of Actual Application Procedures

Register the Global Variables and Device Variables.


 Registering Global Variables
1 Double-click Global Variables under Programming − Data.

2 Register the global variables in the global variable table.

 Registering Device Variables


1 Double-click I/O Map under Configurations and Setup.

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.

11-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


11 Example of Actual Application Procedures

11-2 Overview of the Example Procedure


Create Axes (Axis Variables)

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

11-2-3 Software Settings from the Sysmac Studio


• Set the Axis Use parameter to Used Axis.
• For an NX-series CPU Unit, set the Motion Control parameter to Primary periodic task.
• Set the Axis Type parameter to Servo Axis.
• Set the Input Device and Output Device parameters to the EtherCAT slaves that you regis-
tered in the slave configuration.
Set the other parameters, such as the Unit Conversion Settings and Operation Settings.

Set the Controller Setup and the Special Unit Setup.


 Initial Settings for the PLC Function Module:
The Controller Setup includes the Startup Mode and other parameters.

 Initial Settings for Special Units:


Unit Configuration and Setup: Set the initial settings of the Analog Input Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-7


11 Example of Actual Application Procedures

11-2-4 Programming with the Sysmac Studio


On the Sysmac Studio, create the programs, set the tasks, and build the project.

Write the Programs.

1 Right-click Programs under Programming − POU and select Add − Ladder or Add − ST from
the menu.

2 Double-click Section under the program that you registered.

3 Register the local variables for each program.

4 Enter the programs.

Create a program with the following instructions.


• Homing: MC_Home instruction
• Velocity control: MC_MoveVelocity instruction
• Interrupt feeding: MC_MoveFeed instruction
• Positioning: MC_Move instruction

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.

Set Up the Tasks.


Double-click Task Settings under Configurations and Setup.
• In the Task Settings, set the task period and execution condition for the primary periodic task from the
pulldown list.
• In the I/O Control Task Settings, select the task name to which to assign each Unit and slave.
• In the Program Assignment Settings, assign the programs to the primary periodic task or the priority-
16 periodic task.

11-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


11 Example of Actual Application Procedures

11-2 Overview of the Example Procedure


Build the Project.
Select Build from the Project Menu.

11-2-5 Simulation with the Sysmac Studio


Simulation is used to perform desktop debugging.
Check the task execution times and the real processing times of tasks. Review the task design as
required.

Starting the Simulator and Connecting to It 11


Select Run in Execution Time Estimation Mode from the Simulation Menu. Select the relevant hard-

11-2-5 Simulation with the Sysmac Studio


ware revision in the Unit that the hardware revision is displayed. The Simulator (i.e., the virtual Control-
ler) starts. An online connection is created automatically.

Checking the Task Execution Time on the Simulator


Double-click Task Settings under Configurations and Setup. Check to see if the task execution times
in the Task Execution Time Monitor exceed the task periods.

If necessary, review the task configuration, program assignments, and task periods.

Saving the Project


Select Save As from the File Menu.

11-2-6 Checking Operation and Starting Operation on the Actual System


Go online with the Controller, download the project, check the wiring and perform test operation before
you start actual operation.

Going Online

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-9


11 Example of Actual Application Procedures

1 Turn ON the power supply to NJ-series Controller.

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.

4 Select Online from the Controller Menu.

Downloading the Project with the Synchronize Menu


Select Synchronize from the Controller Menu and download the project to the Controller.
Note Use the Synchronize Menu of the Sysmac Studio to upload and download the project.

Checking Wiring
Check the wiring by performing forced-refreshing with user-specified values from the I/O Map or Ladder
Editor.

MC Test Run

1 Open the MC Test Run Tab Page.

2 Change the CPU Unit to PROGRAM mode.

3 Monitor input signals on the display to check the wiring.

4 Jog the axis from the display.

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.

11-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


11 Example of Actual Application Procedures

11-2 Overview of the Example Procedure


Homing
Homing: Execute the MC_Home instruction.

Actual Operation
Select Operation Mode − RUN Mode from the Controller Menu. If an error occurs, investigate the
cause and edit the user program.

11

11-2-6 Checking Operation and Starting Operation on the Actual System

NJ/NX-series CPU Unit Software User’s Manual (W501) 11-11


11 Example of Actual Application Procedures

11-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


Troubleshooting
12
This section describes the event codes, error confirmation methods, and corrections for
errors that can occur.

12-1 Operation after an Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2


12-1-1 Overview of NJ/NX-series Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
12-1-2 Fatal Errors in the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5
12-1-3 Non-fatal Errors in the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7
12-2 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16
12-2-1 Checking to See If the CPU Unit Is Operating . . . . . . . . . . . . . . . . . . . . . . . 12-16
12-2-2 Troubleshooting Flowchart for Non-fatal Errors . . . . . . . . . . . . . . . . . . . . . . 12-18
12-2-3 Error Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
12-2-4 Error Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-37
12-2-5 Troubleshooting Errors That Are Not in the CPU Unit . . . . . . . . . . . . . . . . . 12-99

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-1


12 Troubleshooting

12-1 Operation after an Error


This section describes the error status of the NJ/NX-series Controller and the operation that occurs
after an error is detected. Refer to 12-2 Troubleshooting for details on corrections for specific errors.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for all of the errors that may occur
in an NJ/NX-series Controller.

12-1-1 Overview of NJ/NX-series Status


You can check the operating status of the CPU Unit with the PWR/POWER, RUN, and ERROR indica-
tors on the front panels of the Power Supply Unit and CPU Unit.

 NX-series CPU Units


NX701 CPU Unit
Power Supply Unit CPU Unit
RUN
indicator
PWR RUN
ERROR

indicator BUSY
SHTDWN

ERROR SD PWR
SD BUSY
indicator
PORT1
L1 L1 EtherNet/IP
AC100-2 NET RUN
INPUT
NET ERR
L2/N L2/N
LINK/ACT

NX1P2 CPU Unit


CPU Unit

NX1P

POWER indicator IN + - COM 01 03 05 07 09 11


SW SETTING + - 00 02 04 06 08 10 12

PORT1 EtherNet/IP POWER


RUN indicator RUN
ERROR
BUSY
ERROR indicator SD PWR
SD BUSY
PORT1 EtherNet/IP
NET RUN

12-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

The following table shows the status of front-panel indicators, the status of user program execution, and
the ability to connect communications to the Sysmac Studio or an HMI during startup, during normal
operation, and when errors occur.

Power
Supply

12-1 Operation after an Error


CPU Unit User pro- Communications
Unit/CPU
CPU Unit operating status Unit gram execu- with Sysmac Stu-
tion status dio or an HMI
PWR/POW
RUN (green) ERROR (red)
ER (green)
Lit Flashing Not lit Stopped. Not possible.
(2-s intervals
Startup followed by
0.5-s inter-
vals)
Normal RUN mode Lit Lit Not lit Continues. Possible.
operation PROGRAM mode Lit Not lit Not lit Stopped. 12
Power Supply Not lit Not lit Not lit Stopped. Not possible.
Error*1

12-1-1 Overview of NJ/NX-series Status


CPU Unit Lit Not lit Not lit Stopped.
Reset*1*2/Hard-
ware Initialization
Error*1*3
Fatal error in Lit Not lit or Lit Stopped.
CPU Unit Flashing
CPU Unit Error*1 (2-s intervals
or 0.5-s inter-
vals)
Lit Flashing Not lit Stopped.
System Initializa- (2-s intervals)
tion Error*1 for 30 s or lon-
ger
Major fault*4 Lit Not lit Lit Stopped. Possible. (Commu-
nications can be
Lit Lit Flashing Continues.*5
Partial fault*4 connected from an
Non-fatal error (1-s intervals)
HMI if EtherNet/IP
in CPU Unit Lit Lit Flashing Continues. is operating nor-
Minor fault*4
(1-s intervals) mally.)
Observation*4 Lit Lit Not lit Continues.

*1 Refer to 12-1-2 Fatal Errors in the CPU Unit for information on individual errors.
*2 This error can occur for NX701 CPU Units. If the status of indicators shown above continues 30 seconds or longer, this
error exists.
*3 This error can occur for NX1P2 CPU Units. If the status of indicators shown above continues 30 seconds or longer, this
error exists.
*4 Refer to 12-1-3 Non-fatal Errors in the CPU Unit for information on individual errors.
*5 The function module where the error occurred stops.

Precautions for Correct Use


When an NX1P2 CPU Unit is used, a power shortage may occur at the CPU Rack depending on
the configuration of NX Units mounted to the CPU Unit. If one of the followings occurs, use the
Sysmac Studio to check if the power consumed by the Units on the CPU Rack exceeds the sup-
plied power.
• The CPU Unit is operating but the mounted NX Units do not operate.
• Power is supplied to the CPU Unit, but the CPU Unit does not turn ON.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-3


12 Troubleshooting

 NJ-series CPU Units


Power Supply Unit CPU Unit

RUN
indicator
PWR
indicator ERROR
indicator

The following table shows the status of front-panel indicators, the status of user program execution, and
the ability to connect communications to the Sysmac Studio or an HMI during startup, during normal
operation, and when errors occur.

Power Communica-
CPU Unit User pro-
Supply Unit tions with Sys-
CPU Unit operating status gram execu-
mac Studio or an
PWR (green) RUN (green) ERROR (red) tion status
HMI
Lit Flashing Not lit Stopped. Not possible.
Startup
(1-s intervals)
Normal RUN mode Lit Lit Not lit Continues. Possible.
operation PROGRAM mode Lit Not lit Not lit Stopped.
Power Supply Error*1 Not lit Not lit Not lit Stopped. Not possible.

CPU Unit Reset*1 Lit Not lit Not lit Stopped.


Fatal error
in CPU Incorrect Power Sup- Lit Flashing Lit Stopped.
Unit ply Unit Connected*1 (3-s intervals)
CPU Unit Watchdog Lit Not lit Lit Stopped.
Timer Error*1
Major fault*2 Lit Not lit Lit Stopped. Possible. (Com-
munications can
Lit Lit Flashing Continues.*3
Non-fatal Partial fault*2 be connected
(1-s intervals)
error in from an HMI if
CPU Unit Lit Lit Flashing Continues. EtherNet/IP is
Minor fault*2
(1-s intervals) operating nor-
Observation*2 Lit Lit Not lit Continues. mally.)

*1 Refer to 12-1-2 Fatal Errors in the CPU Unit for information on individual errors.
*2 Refer to 12-1-3 Non-fatal Errors in the CPU Unit for information on individual errors.
*3 The function module where the error occurred stops.

12-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

12-1-2 Fatal Errors in the CPU Unit

Types of Fatal Errors

12-1 Operation after an Error


This section describes the errors that cause the operation of the NJ/NX-series CPU Unit to stop.
The errors that can occur depend on the CPU Unit. Communications with the Sysmac Studio or an HMI
are not possible if there is a fatal error in the Controller.
(Yes: Error that can occur)

CPU Unit
Error name
NX701 NX1P2 NJ-series
Power Supply Error Yes Yes Yes
CPU Unit Reset Yes --- Yes
Hardware Initialization Error --- Yes --- 12
Incorrect Power Supply Unit Connected --- --- Yes

12-1-2 Fatal Errors in the CPU Unit


CPU Unit Error Yes Yes ---
CPU Unit Watchdog Timer Error --- --- Yes
System Initialization Error Yes Yes ---

The above errors are described in detail as follows.

 Power Supply Error


Power is not supplied, the voltage is outside of the allowed range, or the Power Supply Unit or
power supply section is faulty.

 CPU Unit Reset


The CPU Unit stopped operation because of a hardware error. For an NJ-series CPU Unit, this error
can also occur for reasons other than hardware failures, as given below.
• The power supply to an Expansion Rack is OFF.
• The I/O Connecting Cable is incorrectly installed.
• The IN and OUT connectors are reversed.
• The connectors are not mated properly.
• There is more than one I/O Control Unit on the CPU Rack or there is an I/O Control Unit on an
Expansion Rack.

 Hardware Initialization Error


This error can occur for an NX1P2 CPU Unit. It indicates a data error in minimum programs required
to initialize the hardware. Only the POWER indicator will be lit while the CPU Unit is starting, but if it
is lit for 30 seconds or longer, then this error occurs.

 Incorrect Power Supply Unit Connected


There is a CJ-series Power Supply Unit connected to the NJ-series CPU Unit. The operation of the
Controller is stopped.

 CPU Unit Watchdog Timer Error


This error can occur for an NJ-series CPU Unit. This error occurs when the watchdog timer times
out because a hardware failure or when temporary data corruption causes the CPU Unit to hang.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-5


12 Troubleshooting

 CPU Unit Error


This error can occur for an NX-series CPU Unit. It indicates that there is a hardware failure or that
the CPU is running out of control due to temporary data corruption.

 System Initialization Error


This error can occur for an NX-series CPU Unit. It indicates a hardware failure or data error. The
RUN indicator will flash at 2-second intervals while the CPU Unit is starting, but if it flashes for 30
seconds or longer, then this error occurs.

Checking for Fatal Errors


You can identify fatal errors based on the status of the PWR/POWER, RUN, and ERROR indicators, as
well as by the ability to connect communications to the Sysmac Studio.

 NX-series CPU Units

Indicator
Communications CPU Unit operating
PWR/POWER with Sysmac Studio status
RUN (green) ERROR (red)
(green)
Not lit Not lit Not lit Not possible.* Power Supply Error
Lit Not lit Not lit CPU Unit Reset/Hard-
ware Initialization Error
Lit Not lit or Flashing Lit CPU Unit Error
(2-s intervals or
0.5-s intervals)
Lit Flashing Not lit System Initialization
(2-s intervals) for Error
30 s or longer

* An online connection to the Sysmac Studio is necessary to differentiate between CPU Unit Resets/Hardware Ini-
tialization Errors, CPU Unit Errors, and non-fatal errors in the CPU Unit. Power Supply Errors and System Initial-
ization Errors can be differentiated with the indicators. There is no need to see if you can go online with the CPU
Unit from the Sysmac Studio.

 NJ-series CPU Units

Indicator Communications CPU Unit operating


PWR (green) RUN (green) ERROR (red) with Sysmac Studio status
Not lit Not lit Not lit Not possible.* Power Supply Error
Lit Not lit Not lit CPU Unit Reset
Lit Flashing Lit Incorrect Power Sup-
(3-s intervals) ply Unit Connected
Lit Not lit Lit CPU Unit Watchdog
Timer Error

* An online connection to the Sysmac Studio is necessary to differentiate between CPU Unit Resets, CPU Unit
Watchdog Timer Errors, and non-fatal errors in the CPU Unit. Power Supply Errors and Incorrect Power Supply
Unit Connected errors can be differentiated with the indicators. There is no need to see if you can go online with
the CPU Unit from the Sysmac Studio.

12-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

12-1-3 Non-fatal Errors in the CPU Unit

Event Levels

12-1 Operation after an Error


Non-fatal errors that occur are managed as Controller events in the NJ/NX-series Controller. Controller
events are classified into levels according to the degree of the effect that the events have on control.
When an event occurs, the Sysmac Studio or HMI will display the level. Refer to the NJ/NX-series Trou-
bleshooting Manual (Cat. No. W503) for details on Controller events.
• Major Fault Level
These errors prevent control operations for the entire Controller. If a major fault level error is
detected, user program execution is stopped immediately and the loads for all slaves (including
remote I/O) are turned OFF. With EtherCAT slaves, some NX Units, and some CJ-series Special
Units, you can set the slave settings or Unit settings to select whether outputs will go OFF or retain
their previous status. You cannot reset major fault level errors from the user program, the Sysmac
Studio or an HMI. To recover from a major fault level error, remove the cause of the error, and either 12
cycle the power supply to the Controller or reset the Controller from the Sysmac Studio.
• Partial Fault Level

12-1-3 Non-fatal Errors in the CPU Unit


These errors prevent control operations in a certain function module in the Controller. The NJ/NX-
series CPU Unit continues to execute the user program even after a partial fault level error occurs.
You can include error processing in the user program to safely stop any devices in operation. After
you remove the cause of the error, execute one of the following to return to normal status.
• Reset the error from the user program, the Sysmac Studio, or an HMI.
• Cycle the power supply.
• Reset the Controller from the Sysmac Studio.
• Minor Fault Level
These errors prevent part of the control operations in a certain function module in the Controller. The
troubleshooting for minor fault level errors is the same as the processing for partial fault level errors.
• Observations
These errors do not affect the control operations of the Controller. Observations serve as warnings to
the user so that the error does not develop into an error at a higher level.
• Information
Events that are classified as information do not indicate errors.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-7


12 Troubleshooting

 Operation for Each Level


The operation that is performed when an error occurs depends on the error level of the Controller
event.

Level of event
Controller infor-
Controller errors
mation
Partial fault
Item Major fault level Minor fault level Observation Information
level
These errors are These errors Errors that pre- Errors that do Information level
serious errors prevent all of the vent a portion of not affect control. events are not
that prevent con- control in a func- control in one of errors, but infor-
Definition trol operations tion module the function mation provided
for the entire other than PLC modules. to the user in the
Controller. Function Mod- event log.
ule.
• Non-volatile • Motion Con- • Positive Limit • Packet Dis- • Power Turned
Memory Data trol Period Input Detected carded Due to ON
Event examples (Only a Corrupted Exceeded (Motion Con- Full Receive • Power Inter-
few examples are pro- (PLC Func- (Motion Con- trol Function Buffer (Ether- rupted
vided here. tion) trol Function Module) Net/IP Func- • Memory All
Refer to the NJ/NX- Module) • Low Battery tion Module) Cleared
series Troubleshooting • Communica- Voltage (PLC
Manual (Cat. No. W503) tions Control- Function Mod-
for a complete list of ler Error ule)
errors.) (EtherCAT
Master Func-
tion Module)
PWR/POW Lit. Lit. Lit. Lit. Lit.
ER (green)
Front-
RUN Not lit. Lit. Lit. Lit. Lit.
panel indi-
(green)
cators*1
ERROR Lit. Flashes at 1-s Flashes at 1-s Not lit. Not lit.
(red) intervals. intervals.

12-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level of event
Controller infor-
Controller errors
mation
Partial fault
Item Major fault level Minor fault level Observation Information
level

12-1 Operation after an Error


RUN out- OFF ON ON ON ON
put on
Power
Supply
Unit
User pro- Stops. Continues.*2 Continues. Continues. Continues.
gram exe-
Operation cution
of NJ/NX- status
series CPU
Outputs Yes No No No No
Unit
turned OFF
Not possible. Depends on the Depends on the --- ---
12
Error reset nature of the nature of the
error. error.

12-1-3 Non-fatal Errors in the CPU Unit


Recorded. Recorded. Recorded. Recorded. Recorded.
Event logs (Some errors are
not recorded.)
Refer to I/O • Errors in Eth- Depends on the Depends on the Depends on the
Operation for erCAT Master user program. user program. user program.
Major Fault Function Mod-
Level Controller ule: Depends
Outputs from EtherCAT Errors on page on settings in
slaves and Basic Out- 12-11. the slave.
put Units • Errors in other
function mod-
ules: Depends
on user pro-
gram.
The error status is automatically displayed in the Con- These items are not displayed on
Sysmac Studio display
troller Status Pane. You can display detailed information the error display.
(while online)
in the Troubleshooting Dialog Box.

*1 If multiple Controller errors have occurred, the indicators show the error with the highest error level.
*2 Operation stops in the function module (NX Bus Function Module, Motion Control Function Module, EtherCAT Master
Function Module, or EtherNet/IP Function Module) in which the error occurred.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-9


12 Troubleshooting

 Operation in the Function Module Where an Error Event Occurred

Level of current event

Major fault level Partial fault level Minor fault level Observation
Function module
User program --- Operation continues.
PLC Function Module
execution stops.
--- I/O refreshing for NX Operation continues. If Operation continues.
bus communica- an NX Unit error occurs,
NX Bus Function Mod- tions stops. operation depends on
ule (NX Unit operation the fail-soft operation
depends on the NX settings.
Unit settings.)
--- All axes stop. (The • The affected axis/axes • Axis operation contin-
stop method group stops. (The stop ues.
depends on the method depends on • The motion control
Motion Control Func- error.) the settings.) instructions that are
tion Module • The motion control not related to axis
instructions that are operation are not exe-
related to axis opera- cuted.
tion are not executed.
--- EtherCAT communi- I/O refreshing for Ether- I/O refreshing for Ether-
cations stop. (The CAT communications CAT communications
slaves operate stops or continues continues.
according to the set- according to the fail-soft
EtherCAT Master Func-
tings in the slaves.) operation settings in the
tion Module
master. (If I/O refreshing
stops, the slaves operate
according to the settings
in the slaves.)
--- EtherNet/IP commu- Part of EtherNet/IP com- EtherNet/IP communica-
nications stop. (A munications stop. (A tions continue.
software connection software connection from
EtherNet/IP Function from the Sysmac the Sysmac Studio or an
Module Studio or an HMI is HMI is possible if the
not possible.) communications connec-
tion is not the cause of
the error.)

12-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

 I/O Operation for Major Fault Level Controller Errors


The following table gives the operation of the CPU Unit and the I/O devices.

Unit CPU Unit operation Unit or slave operation


NX Unit mounted to the CPU Unit *1 Input refreshing stops. Depends on the settings for the NX

12-1 Operation after an Error


Unit.
Built-in I/O *1 • Depends on the Load Rejection ---
Output Setting.
• Input refreshing stops.
Option Board *1 • Outputs turned OFF. Output val- Analog I/O Option Board
ues depend on the specifications • Output value: 0 V
of the Option Board.
• Input refreshing stops.
NX-series Slave Terminal The NX-series Slave Terminal Depends on the NX Unit settings.
moves to Safe-Operational state.
EtherCAT slave *2 The slave is placed in the Safe- Depends on the slave settings. *3 12
Operational state.
Servo Drive or NX Unit assigned to Updating the command values is All axes stop immediately.

12-1-3 Non-fatal Errors in the CPU Unit


an axis stopped.
CJ-series Basic I/O Unit *4 • The values of all outputs are • All outputs are turned OFF.
cleared to zero. • External inputs are refreshed.
• Input refreshing continues.
CJ-series Special Unit *4 Refreshing continues. Depends on the Unit operating
specifications.
Devices connected with EtherNet/IP • For the originators of tag data Depends on the specifications of
links, the variables and I/O mem- the connected devices.
ory addresses for input (con-
sume) tags are not refreshed.
• For the targets of tag data links,
operation depends on the set-
tings of the tags sets for the out-
put (produce) tags. *5

*1 This applies to an NX1P2 CPU Unit.


*2 Excluding Servo Drives assigned to an axis.
*3 Settings and setting methods depend on the slave. Refer to the manual for the slave. For a Servo Drive, oper-
ation depends on the setting of object 605E hex (Fault Reaction Option Code).
*4 This applies to an NJ-series CPU Unit.
*5 You can set whether to clear output or maintain the data from before the error occurred. Refer to the NJ/NX-
series CPU Unit Built-in EtherNet/IP Port User’s Manual (Cat. No. W506) for details.
The following table gives the operation of the CPU Unit and the I/O devices for the following errors
that occur for an NJ-series Unit.
• Unsupported Unit Detected
• I/O Bus Check Error
• End Cover Missing
• Incorrect Unit/Expansion Rack Connection
• Duplicate Unit Number
• Too Many I/O Points
• I/O Setting Check Error

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-11


12 Troubleshooting

Unit CPU Unit operation Unit or slave operation


EtherCAT Slave Terminal The EtherCAT Slave Terminal Depends on the NX Unit settings.
moves to Safe-Operational state.
EtherCAT slave *1 The slave is placed in the Safe- Depends on the slave settings. *2
Operational state.
Servo Drive or NX Unit assigned to Updating the command values is All axes stop immediately.
an axis stopped.
CJ-series Basic I/O Unit Refreshing is stopped. • All outputs are turned OFF.
• All inputs are turned OFF.
CJ-series Special Unit Refreshing is stopped. Depends on the Unit operating
specifications (the ERH indicator
lights).
Devices connected with EtherNet/IP • For the originators of tag data Depends on the specifications of
links, the variables and I/O mem- the connected devices.
ory addresses for input (con-
sume) tags are not refreshed.
• For the targets of tag data links,
operation depends on the set-
tings of the tags sets for the out-
put (produce) tags. *3

*1 Excluding Servo Drives assigned to an axis.


*2 Settings and setting methods depend on the slave. Refer to the manual for the slave. For a Servo Drive, oper-
ation depends on the setting of object 605E hex (Fault Reaction Option Code).
• You can set whether to clear output or maintain the data from before the error occurred. Refer to the
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (Cat. No. W506) for details.

Checking for Non-fatal Errors


Use the following methods to check for non-fatal errors.

Checking method What you can check


Checking the indicators You can use the indicators to confirm the Controller error level, the error status
of the EtherCAT Master Function Module, and the error status of the Ether-
Net/IP Function Module.
Checking with the trouble- You can check for current Controller errors, a log of past Controller errors, error
shooting function of Sysmac sources, error causes, and corrections. You can also check error logs from CJ-
Studio series Special Units.*1
Checking with the Trouble- You can check for current Controller errors, a log of past Controller errors, error
shooter of an HMI*2 sources, error causes, and corrections.
Checking with instructions that You can check the highest-level status and highest-level event code in the cur-
read function module error sta- rent Controller errors.
tus
Checking with system-defined You can check the current Controller error status for each function module.
variables

*1 Detailed information, such as error causes and corrections, is not displayed.


*2 To perform troubleshooting from an HMI, connect the HMI to the built-in EtherNet/IP port on the CPU Unit.
Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the applicable range
of the HMI Troubleshooter.
This section describes the above checking methods.

12-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Checking the Indicators


 Checking the Level of a Controller Error
You can use the PWR/POWER, RUN, and ERROR indicators to determine the level of an error. The

12-1 Operation after an Error


following table shows the relationship between the Controller’s indicators and the event level.

Indicator
Event level
PWR/POWER (green) RUN (green) ERROR (red)
Lit Not lit Lit Major fault level
Lit Lit Flashing (1-s intervals) Partial fault level
Minor fault level
Lit Lit Not lit Observation

 Checking the Status of EtherCAT and EtherNet/IP Ports 12


For the EtherCAT and EtherNet/IP ports, use the EtherCAT and EtherNet/IP NET ERR indicators to
determine whether an error that affects process data communications has occurred and whether a

12-1-3 Non-fatal Errors in the CPU Unit


minor fault level error or higher-level error has occurred. The indicator lets you check the status
given in the following table.

Indicator Indicated status


EtherCAT NET ERR EtherCAT Port Status

• Lit: An error for which normal status cannot be recovered through user
actions (i.e., errors for which you must replace the CPU Unit or contact your
OMRON representative) has occurred.
• Flashing: An error for which normal status can be recovered through user
actions has occurred.
• Not lit: An error that affects process data communications has not occurred.
EtherNet/IP NET ERR EtherNet/IP Port Status
• Lit: An error for which normal status cannot be recovered through user
actions (i.e., errors for which you must replace the CPU Unit or contact your
OMRON representative) has occurred.
• Flashing: An error for which normal status can be recovered through user
actions has occurred.
• Not lit: There is no minor fault level or higher-level error.

Checking with the Troubleshooting Function of Sysmac Studio


When an error occurs, you can connect the Sysmac Studio online to the Controller to check current
Controller errors and the log of past Controller errors.

 Current Errors
Open the Sysmac Studio’s Controller Error Tab Page to check the current error’s level, source,
source details, event name, event code, cause, and correction. Errors are not displayed for observa-
tions.

 Log of Past Errors


Open the Sysmac Studio’s Controller Event Log Tab Page to check the times, levels, sources,
source details, event names, event codes, details, attached information 1 to 4, actions, and correc-
tions for previous errors.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-13


12 Troubleshooting

Error logs from CJ-series Special Units are displayed on the Controller Event Log Tab Page.
Detailed information is not displayed. To check detailed information, use the event codes that are
displayed and refer to the error codes that are given in the manual for the relevant Unit. Refer to the
NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the relationship between error codes and
event codes.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for details on trouble-
shooting with the Sysmac Studio.

Checking with the Troubleshooter of an HMI


If you can connect communications between an HMI and the Controller when an error occurs, you can
check for current Controller errors and the log of past Controller errors.
To perform troubleshooting from an HMI, connect the HMI to the built-in EtherNet/IP port on the CPU
Unit.

Precautions for Correct Use


Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

 Current Errors
You can check the current error’s event name, event code, level, source, source details, details, and
attached information 1 to 4. Observations are not displayed as errors.

 Log of Past Errors


You can check the time of occurrence, level, source, source details, event name, event code,
details, attached information 1 to 4 for past errors.
Refer to the relevant HMI manual for information on the HMI Troubleshooter.

Checking with Instructions That Read Function Module Error Status


Instructions are provided that allow you to read the error status of each function module from the user
program. These instructions get the status and the event code of the error with the highest level.

Applicable function module Instruction name Instruction


PLC Function Module Get PLC Controller Error Status GetPLCError
Get I/O Bus Error Status GetCJBError
NX Bus Function Module Get NX Bus Error Status GetNXBError
Get NX Unit Error Status GetNXUnitError
Motion Control Function Module Get Motion Control Error Status GetMCError
EtherCAT Function Module Get EtherCAT Error Status GetECError
EtherNet/IP Function Module Get EtherNet/IP Error Status GetEIPError

For details on the instructions that get error status, refer to the NJ/NX-series Instructions Reference
Manual (Cat. No. W502).

12-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Checking with System-defined Variables

You can check the error status variables in the system-defined variables to determine the status of
errors in a Controller. You can read the error status variables from an external device by using commu-

12-1 Operation after an Error


nications. Refer to A-5 System-defined Variables for the system-defined variables.

12

12-1-3 Non-fatal Errors in the CPU Unit

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-15


12 Troubleshooting

12-2 Troubleshooting
This section provides basic error identification and troubleshooting flowcharts. Use them when an error
occurs in the NJ/NX-series Controller. This section also describes the software errors that are related to
the PLC Function Module and corrections for those errors.

12-2-1 Checking to See If the CPU Unit Is Operating


When an error occurs in the NJ/NX-series Controller, use the following flowchart to determine whether
the error is a fatal error or a non-fatal error.
Whenever possible, set the Sysmac Studio’s software connection method in the flowchart to a direct
USB connection if the CPU Unit has a USB (peripheral) port. If you use Ethernet, there are many rea-
sons that prevent a communications connection for the Sysmac Studio, so time is required to determine
if a fatal or non-fatal error has occurred. If a communications connection from the Sysmac Studio is not
possible, perform the troubleshooting procedure that is provided in the NJ/NX-series Troubleshooting
Manual (Cat. No. W503) before you assume that the error is a fatal error.

 NX-series CPU Units

Error occurs. A fatal error occurred in the CPU Unit.


Refer to the NJ/NX-series Troubleshooting
Manual (Cat. No. W503) for the correction.

PWR/POWER Not lit.


Power Supply Error
indicator (green)?

Lit.

Flashing (2-s intervals)


Flashing. Not lit. for 30 s or longer
ERROR indicator (red)? RUN indicator (green)? System Initialization Error

Lit. Not lit.

Communications Not possible.


CPU Unit Reset/
with Sysmac Hardware Initialization Error
Studio?
Flashing (at 2-s intervals
or 0.5-s intervals) Possible.
RUN indicator (green)? CPU Unit Error

Not lit.

Communications Not possible.


with Sysmac
Studio?

Possible.

A non-fatal error occurred. Refer to 12-2-2


A Troubleshooting Flowchart for Non-fatal Errors.

12-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

 NJ-series CPU Units

A fatal error occurred in the CPU Unit.


Error occurs.
Refer to the NJ/NX-series Trouble-
shooting Manual (Cat. No. W503) for
the correction.

Not lit.

12-2 Troubleshooting
PWR indicator (green)? Power Supply Error

Lit.

Not possible.
Flashing. Not lit. Communications
ERROR indicator (red)? with Sysmac CPU Unit Reset
Studio?

12
Lit. Possible.

12-2-1 Checking to See If the CPU Unit Is Operating


Flashing.
Incorrect Power Supply Unit
RUN indicator (green)?
Connected

Not lit.

Communications Not possible.


CPU Unit Watchdog
with Sysmac
Timer Error
Studio?

Possible.

A non-fatal error occurred. Refer to 12-2-2


A Troubleshooting Flowchart for Non-fatal Errors.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-17


12 Troubleshooting

12-2-2 Troubleshooting Flowchart for Non-fatal Errors


For a non-fatal error, use the Sysmac Studio or an HMI to troubleshoot the error with the following flow-
chart. You can use the indicators to check the following:
• Level
• Whether the error is in the EtherNet/IP port or the EtherCAT port
• If the source of the error is the EtherNet/IP port or the EtherCAT port, whether you can restore normal
status yourself

A Non-fatal error in CPU Unit


To immediately check the
specific error

To check error status with the indicators

Lit. Flashing.
ERROR indicator (red)?

Not lit. Partial fault level


or minor fault level

Check all of the following branches that correspond to the


status of the EtherNet/IP NET ERR and EtherCAT NET
ERR indicators.

EtherNet/IP NET ERR indicator is lit or flashing. Both indicators are not lit.

EtherCAT NET ERR indicator is


lit or flashing.

Flashing. EtherCAT NET ERR Flashing.


EtherNet/IP NET ERR
indicator (red)? indicator (red)?

Lit. Lit.

Major fault Observa- Error in the Error in the Error in the Error in the Error in PLC
EtherNet/IP port for EtherNet/IP port for EtherCAT port for EtherCAT port for Function Module or
level tion which you cannot which you can which you cannot which you can MC Function
restore normal status restore normal status restore normal restore normal Module
by yourself. by yourself. status by yourself. status by yourself.

Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the procedures to
check for errors and corrections with the Sysmac Studio or an HMI.

Precautions for Correct Use


Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the
applicable range of the HMI Troubleshooter.

12-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

12-2-3 Error Table


The software errors (i.e., events), NX bus errors (i.e., events), and Controller operation errors (i.e.,
events) that can occur in the PLC Function Module that involve software are given on the following
pages. Event levels are given in the tables as follows:
Maj: Major fault level

12-2 Troubleshooting
Prt: Partial fault level
Min: Minor fault level
Obs: Observation
Info: Information
A version in parentheses in the Event code column is the unit version of the CPU Unit when the event
occurs for only specific unit versions of the CPU Unit.
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for all NJ/NX-series event codes.
12

Errors Related to Tasks

12-2-3 Error Table


Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
60020000 hex Task Execu- Task execution • The timeout detection time set- √ page 12-38
tion Timeout exceeded the time- ting is too short.
out detection time. • The task period setting is too
short.
• A user program is too large.
• The number of times that pro-
cessing is repeated is larger
than expected.
• Task Priority Error
• Frequent Event Task Execution
60030000 hex I/O Refresh- Consecutive I/O • The task period setting is too √ page 12-39
ing Timeout refresh failures short.
Error occurred during the • Task Priority Error for Periodic
primary periodic Tasks and Event Tasks
task or periodic task
• There are too many Units and
period.
slaves that perform I/O refresh
in the task period.
• Frequent Event Task Execution
60040000 hex Insufficient The specified sys- • There was not sufficient time to √ page 12-40
System Ser- tem service execu- execute the tasks and tag data
vice Time tion time could not link service.
Error be obtained. • The system service execution
interval is too short or the sys-
tem service execution time ratio
is too long in the System Ser-
vice Monitoring Settings.
60010000 hex Task Period Task execution was • The task period setting is too √ page 12-41
Exceeded not completed short.
during the set task • A user program is too large.
period for the pri-
• The number of times that pro-
mary periodic task cessing is repeated is larger
or a periodic task.
than expected.
• Task Priority Error for Periodic
Tasks and Event Tasks
• Frequent Event Task Execution

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-19


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
60050000 hex Task Period Task execution was • The task period setting is too √ page 12-42
Exceeded not completed short.
during the set task • A user program is too large.
period for the pri- • The number of times that pro-
mary periodic task
cessing is repeated is larger
or fixed periodic
than expected.
task.
• Task Priority Error for Periodic
Tasks and Event Tasks
• Frequent Event Task Execution

Errors Related to the NX Bus

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
04100000 hex NX Bus Con- An error occurred in • An I/O communications error √ page 12-43
(Ver. 1.13 or troller Error the NX bus. occurred between the CPU Unit
later) and the NX Unit.
04110000 hex NX Bus A hardware error • A hardware error related to the √ page 12-43
(Ver. 1.13 or Hardware was detected in the NX bus was detected.
later) Error NX Bus Function
Module.

10600000 hex NX Bus An error was • An error was detected in the √ page 12-44
(Ver. 1.13 or Memory detected in the memory check for the internal
later) Check Error internal memory protection circuit.
check for the NX
Bus Function Mod-
ule.
10610000 hex Failed to Reading the NX • The NX Unit operation settings √ page 12-44
(Ver. 1.13 or Read NX Unit Unit operation set- are not saved normally in the
later) Operation tings failed. CPU Unit.
Settings Cycle the power
supply to the CPU
Unit to restore the
previous normally-
saved settings.
24D00000 hex Number of The number of • More than the maximum num- √ page 12-45
(Ver. 1.13 or Mountable mounted NX Units ber of NX Units are mounted on
later) NX Units exceeds the speci- the CPU Unit.
Exceeded fied value for the
CPU Unit.
24D20000 hex Total I/O Data The total size of I/O • The total size of I/O data in the √ page 12-45
(Ver. 1.13 or Size in NX data in the mounted mounted NX Units exceeds the
later) Units Exces- NX Units exceeds maximum specified value for
sive the maximum spec- the CPU Unit.
ified value for the
CPU Unit.
35900000 hex NX Unit Ver- There is a mounted • The unit version of an NX Unit √ page 12-46
(Ver. 1.13 or sion Not NX Unit with a unit mounted in the actual configu-
later) Matched version earlier than ration is earlier than that in the
that in the Unit con- Unit configuration information
figuration informa- registered in the CPU Unit.
tion registered in
the CPU Unit.

12-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
35910000 hex Unregistered There is a mounted • There is a mounted Unit that √ page 12-47
(Ver. 1.13 or NX Unit NX Unit that does does not exist in the Unit con-
later) Mounted not exist in the Unit figuration information registered
configuration infor- in the CPU Unit.
mation registered in • There is a mounted Unit in
the CPU Unit. which the NX Unit Mounting

12-2 Troubleshooting
If there are more Setting is set to Disabled.
than one NX Unit
relevant to this
event, only the NX
Unit that is nearest
to the CPU Unit is
registered with the
event.
359300000 NX Unit There is a mounted • There is no mounted NX Unit √ page 12-48
hex (Ver. 1.13 Serial Num- NX Unit with a with the serial number that you
or later) ber Mismatch serial number differ- set in the Unit configuration 12
ent from that in the information registered in the
Unit configuration CPU Unit.
information regis-

12-2-3 Error Table


tered in the CPU
Unit.
44440000 hex NX Bus A fatal error was • An error occurred in the soft- √ page 12-48
(Ver. 1.13 or Function Pro- detected in the NX ware.
later) cessing Error Bus Function Mod-
ule.
85540000 hex NX Bus I/O The I/O communi- • I/O refreshing was stopped √ page 12-49
(Ver. 1.13 or Communica- cations on the NX based on the Fail-soft Opera-
later) tions Stopped bus were stopped tion Setting.
Due to based on the Fail-
Another soft Operation Set-
Event ting because an
error that triggers
fail-soft operation
occurred.
35920000 hex Registered There is no • There is no mounted NX Unit √ page 12-49
(Ver. 1.13 or NX Unit Not mounted NX Unit that exists in the Unit configura-
later) Mounted that exists in the tion information registered in
Unit configuration the CPU Unit.
information regis- • The power supply to the Addi-
tered in the CPU tional NX Unit Power Supply
Unit. Unit is not turned ON.
If there are more
than one NX Unit
relevant to this
event, only the NX
Unit that is nearest
to the CPU Unit is
registered with the
event.
85500000 hex NX Bus Com- A communications • The NX bus connector contact √ page 12-50
(Ver. 1.13 or munications error that prevents is faulty due to vibration or
later) Error normal NX bus shock.
communications • Excessive noise is applied to
was detected. the NX bus connector.
If there are more • An NX Unit was removed.
than one NX Unit • An error occurred in an NX
relevant to this Unit.
event, only the NX
Unit that is nearest
to the CPU Unit is
registered with the
event.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-21


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
85510000 hex NX Unit An error occurred in • An NX Bus Communications √ page 12-50
(Ver. 1.13 or Communica- I/O data communi- Error has occurred.
later) tions Timeout cations with the NX • An error occurred in an NX
Units. Unit.
85520000 hex NX Unit Ini- Initializing an NX • Initialization with the Unit con- √ page 12-51
(Ver. 1.13 or tialization Unit failed. figuration information registered
later) Error in the CPU Unit failed.
• An NX Bus Communications
Error has occurred.
• The Channel Enable/Disable
Setting for all channels of the
Analog Unit are set to Disable.
• Initialization of an NX Unit
failed.
85530000 hex NX Unit Starting an NX Unit • A startup error occurred in an √ page 12-51
(Ver. 1.13 or Startup Error failed. NX Unit.
later)
103C0000 hex NX Unit The backup opera- • There is also another error √ page 12-52
(Ver. 1.13 or Backup tion for an NX Unit related to the NX Bus Function
later) Failed ended in an error. Module.
• An NX Bus Communications
Error has occurred.
• Backup data cannot be
received from an NX Unit.
103D0000 hex NX Unit The restore opera- • There is also another error √ page 12-53
(Ver. 1.13 or Restore tion for an NX Unit related to the NX Bus Function
later) Operation ended in an error. Module.
Failed • An NX Bus Communications
Error has occurred.
• The backup data cannot be
sent to an NX Unit.
• The Unit configuration in the
backup file does not agree with
the actual Unit configuration.
10620000 hex NX Unit Saving or reading • Data in the NX Unit event log √ page 12-53
(Ver. 1.13 or Event Log the NX Unit event area are invalid.
later) Save Error log failed.
Continuing to oper-
ate with this error
may result in no
event log saved at
CPU Unit power
OFF although it has
no effect on the
control function.
44450000 hex NX Bus Sys- This event pro- • This event provides internal √ page 12-54
(Ver. 1.13 or tem Informa- vides internal infor- information from the NX Bus
later) tion mation from the NX Function Module.
Bus Function Mod-
ule.
95800000 hex NX Bus An NX bus restart • An NX bus restart command √ page 12-54
(Ver. 1.13 or Restart Exe- was executed. was received.
later) cuted

12-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Errors Related to Controller Operation

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10200000 hex User Pro- The user program • The user program or Controller √ page 12-54
gram/Con- or Controller Con- Configurations and Setup are

12-2 Troubleshooting
troller figurations and not correct because the power
Configura- Setup were not supply to the Controller was
tions and transferred cor- interrupted during a download
Setup Trans- rectly. of the user program or the Con-
fer Error troller Configurations and
Setup.
• The user program or Controller
Configurations and Setup are
not correct because the power
supply to the Controller was
interrupted during online edit-
ing.
12
• The user program or Controller
Configurations and Setup are

12-2-3 Error Table


not correct because the power
supply to the Controller was
interrupted during a Clear All
Memory operation.
• The user program or Controller
Configurations and Setup are
not correct because the power
supply to the Controller was
interrupted during a restore
operation.
• Non-volatile memory failed.
10210000 hex Illegal User The user program • The user program execution √ page 12-56
Program execution IDs set in IDs set in the user program and
Execution ID the user program in the CPU Unit do not match.
and in the CPU Unit • A user program execution ID is
do not match. set in the CPU Unit but not in
the user program.
10240000 hex Illegal User The user program • There are more than 8 nesting √ page 12-56
Program is not correct. levels for functions or function
blocks.
10250000 hex Illegal User The upper limit of • The upper limit of the data size √ page 12-57
Pro- the usable memory was exceeded.
gram/Con- was exceeded or • The main memory capacity was
troller the user program or exceeded.
Configura- Controller Configu- • Non-volatile memory is deterio-
tions and rations and Setup is
rating or has failed.
Setup corrupted.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-23


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10270000 hex Error in Start- An error was • An SD Memory Card is not √ page 12-58
(Ver. 1.03 or ing Automatic detected in pre- inserted.
later) Transfer execution checks • The SD Memory Card type is
for automatic trans- not correct.
fer.
• The format of the SD Memory
Card is not correct.
• There is no autoload folder on
the SD Memory Card.
• There are no backup files in the
autoload folder on the SD
Memory Card.
• Either the backup files in the
autoload folder on the SD
Memory Card are corrupted or
required data is not in the
backup files on the SD Memory
Card.
• The unit version of the CPU
Unit to which to transfer the
files is older than the unit ver-
sion of the backup files on the
SD Memory Card.
• The model of the CPU Unit to
which to transfer the files is not
the same as the model of the
CPU Unit of the backup files on
the SD Memory Card.
• Recovery was executed for the
SD Memory Card.
• The CPU Unit is write-pro-
tected.
• The settings in the automatic
transfer command file (Auto-
loadCommand.ini) are not cor-
rect.
• Reading the data for automatic
transfer failed because the SD
Memory Card is faulty or not
formatted correctly.
• The SD Memory Card is dam-
aged.
• The database connection ser-
vice version of the CPU Unit to
which to transfer the files is
older than the database con-
nection service version of the
backup files on the SD Memory
Card.
• The robot version of the CPU
Unit to which to transfer the
files is older than the robot ver-
sion of the backup files on the
SD Memory Card.

12-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10280000 hex Error in Exe- The automatic • It was not possible to read the √ page 12-60
(Ver. 1.03 or cuting Auto- transfer ended in an data for automatic transfer.
later) matic error. • The SD Memory Card was
Transfer removed during an automatic
transfer.
• There are no backup files in the

12-2 Troubleshooting
autoload folder on the SD
Memory Card.
• The backup files in the autoload
folder on the SD Memory Card
are corrupted.
• The SD Memory Card is dam-
aged.

12

12-2-3 Error Table

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-25


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10330000 hex SD Memory An error was • An SD Memory Card is not √ page 12-61
(Ver. 1.11 or Card Pro- detected in pre- inserted.
later) gram Trans- execution checks • The SD Memory Card type is
fer Pre- for transferring SD not correct.
execution Memory Card pro-
• The format of the SD Memory
Check Error grams.
Card is not correct.
• There is no such folder on the
SD Memory Card as specified
by the _Card1PrgTransfer-
Cmd.DirName system-defined
variable.
• There are no backup files in
such a folder on the SD Mem-
ory Card as specified by the
_Card1PrgTransferCmd.Dir-
Name system-defined variable.
• Either the backup files in the
folder specified by the
_Card1PrgTransferCmd.Dir-
Name system-defined variable
on the SD Memory Card are
corrupted or required data is
not in the backup files on the
SD Memory Card.
• The unit version of the CPU
Unit to which to transfer the
files is older than the unit ver-
sion of the backup files on the
SD Memory Card.
• The model of the CPU Unit to
which to transfer the files is not
the same as the model of the
CPU Unit of the backup files on
the SD Memory Card.
• The CPU Unit is write-pro-
tected.
• Required files are not set to
transfer in the setting of the
_Card1PrgTransferCmd sys-
tem-defined variable.
• Reading the data for the SD
Memory Card program transfer
failed because the SD Memory
Card is faulty or not formatted
correctly.
• The SD Memory Card is dam-
aged.
• The database connection ser-
vice version of the CPU Unit to
which to transfer the files is
older than the database con-
nection service version of the
backup files on the SD Memory
Card.
• The robot version of the CPU
Unit to which to transfer the
files is older than the robot ver-
sion of the backup files on the
SD Memory Card.

12-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10340000 hex Error in Exe- The SD Memory • It was not possible to read the √ page 12-64
(Ver. 1.11 or cuting SD Card program data for SD Memory Card pro-
later) Memory Card transfer ended in an gram transfers.
Program error. • The SD Memory Card was
Transfer removed during a SD Memory
Card program transfer.

12-2 Troubleshooting
• There are no backup files in
such a folder on the SD Mem-
ory Card as specified by the
_Card1PrgTransferCmd.Dir-
Name system-defined variable.
• The backup files in such a
folder on the SD Memory Card
as specified by the _Card1Prg-
TransferCmd.DirName system-
defined variable are corrupted.
• The SD Memory Card is dam- 12
aged.
40110000 hex PLC Function A fatal error was • An error occurred in the soft- √ page 12-65

12-2-3 Error Table


Processing detected in the PLC ware.
Error Function Module.
40160000 hex Safe Mode The Controller • The power supply was turned √ page 12-65
(Ver. 1.02 or started in Safe ON to the Controller when Safe
earlier) Mode. Mode was set on the DIP
switch on the CPU Unit.
44420000 hex PLC Function A fatal error was • An error occurred in the soft- √ page 12-66
(Ver. 1.05 or Processing detected in the PLC ware.
later) Error Function Module.
40120000 hex PLC Function A fatal error was • An error occurred in the soft- √ page 12-66
Processing detected in the PLC ware.
Error Function Module.
40130000 hex PLC Function A fatal error was • An error occurred in the soft- √ page 12-67
Processing detected in part of ware.
Error the PLC Function
Module.
10230000 hex Event Log Saving the event • A low battery voltage prevented √ page 12-67
Save Error log failed. retention of memory during a
power interruption. (NJ/NX-
series)
• A forced shutdown was per-
formed. (NY-series)
• Data in the event log area are
invalid. (NY-series)
• Data in the NX Unit event log
area are invalid. (NX1P2 CPU
Unit)
10260000 hex Trace Set- The power supply • The power supply was inter- √ page 12-68
ting Transfer was interrupted rupted while transferring the
Failure while transferring trace settings.
the trace settings.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-27


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10290000 hex Backup An error was • An SD Memory Card is not √ page 12-68
(Ver. 1.03 or Failed to detected in pre- inserted.
later) Start execution checks • The SD Memory Card type is
for a backup opera- not correct.
tion.
• The format of the SD Memory
Card is not correct.
• The SD Memory Card is write
protected.
• The Prohibiting backing up data
to the SD Memory Card param-
eter is set to prohibit backing up
data to an SD Memory Card.
• Another backup operation is in
progress.
• Synchronization, online edit-
ing, or the Clear All Memory
operation is in progress.
• The backup was canceled by
the user.
• The online connection with the
Sysmac Studio was discon-
nected.
• The SD Memory Card is dam-
aged.
102A0000 hex Backup The backup opera- • The capacity of the SD Memory √ page 12-70
(Ver. 1.03 or Failed tion ended in an Card is insufficient.
later) error. • It was not possible to save the
data that was specified for
backup.
• The SD Memory Card was
removed during a backup oper-
ation.
• Failed to back up Unit or slave.
• The backup was canceled by
the user.
• Execution of the Save Cam
Table instruction or changing
the CPU Unit name is in prog-
ress.
• The online connection with the
Sysmac Studio was discon-
nected.
• It was not possible to save the
data that was specified for
backup to the computer.
• The SD Memory Card is dam-
aged.

12-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
102B0000 hex Restore An error was • An SD Memory Card is not √ page 12-71
(Ver. 1.03 or Operation detected in pre- inserted.
later) Failed to execution checks • The SD Memory Card type is
Start for a restore opera- not correct.
tion.
• The format of the SD Memory
Card is not correct.

12-2 Troubleshooting
• There are no backup files on
the SD Memory Card.
• Either the backup files on the
SD Memory Card are corrupted
or required data is not in the
backup files on the SD Memory
Card.
• The unit version of the CPU
Unit to which to restore the files
is older than the unit version of
the backup files on the SD
12
Memory Card.
• The model of the CPU Unit to

12-2-3 Error Table


which to restore the files is not
the same as the model of the
CPU Unit of the backup files on
the SD Memory Card.
• Recovery was executed for the
SD Memory Card.
• The CPU Unit is write-pro-
tected.
• The settings in the restore com-
mand file (RestoreCom-
mand.ini) are not correct.
• A backup operation is in prog-
ress.
• Synchronization, online edit-
ing, or the Clear All Memory
operation is in progress.
• The online connection with the
Sysmac Studio was discon-
nected.
• Reading the data for restoration
failed because the SD Memory
Card is faulty or not formatted
correctly.
• The SD Memory Card is dam-
aged.
• The database connection ser-
vice version of the CPU Unit to
which to restore the files is
older than the database con-
nection service version of the
backup files on the SD Memory
Card.
• The robot version of the CPU
Unit to which to restore the files
is older than the robot version
of the backup files on the SD
Memory Card.
Check the followings for specifi-
cation with system-defined vari-
ables.
• Restore by system-defined vari-
able is set to Do not use in the
Controller Setup.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-29


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
• Password of Restore by sys-
tem-defined variable in the
Controller Setup does not
agree with the _Card1Resto-
reCmd.Password system-
defined variable.
• The DIP switch on the CPU
Unit is not set to allow starting
the restore of SD Memory Card
backups by specification with
system-defined variables.
• There is no such folder as
specified by the system-defined
variable.
• Required files are not set to
transfer in the setting of the
system-defined variable.
102C 0000 hex Restore The restore opera- • It was not possible to read the √ page 12-75
(Ver. 1.03 or Operation tion ended in an data to restore.
later) Failed error. • The SD Memory Card was
removed during a restore oper-
ation.
• Failed to restore Unit or slave.
• The SD Memory Card is dam-
aged.

12-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
10320000 hex SD Memory An error was • Program transfer by system- √ page 12-76
(Ver. 1.11 or Card Pro- detected in pre-start defined variable is set to Do not
later) gram Trans- checks for transfer- use in the Controller Setup.
fer Failed to ring SD Memory • Password of Program transfer
Start Card programs. by system-defined variable in
the Controller Setup does not
agree with the _Card1Prg-

12-2 Troubleshooting
TransferCmd.Password sys-
tem-defined variable.
• The DIP switch on the CPU Unit
is not set to allow starting the SD
Memory Card program transfer.
• An SD Memory Card is not
inserted.
• The SD Memory Card type is
not correct.
• The format of the SD Memory
Card is not correct. 12
• There is no such folder on the
SD Memory Card as specified by
the _Card1PrgTransferCmd.Dir-

12-2-3 Error Table


Name system-defined variable.
• There are no backup files in
such a folder on the SD Mem-
ory Card as specified by the
_Card1PrgTransferCmd.Dir-
Name system-defined variable.
• Either the backup files in the
folder specified by the _Card1Prg-
TransferCmd.DirName system-
defined variable on the SD Mem-
ory Card are corrupted or required
data is not in the backup files on
the SD Memory Card.
• The unit version of the CPU
Unit to which to transfer the
files is older than the unit ver-
sion of the backup files on the
SD Memory Card.
• The model of the CPU Unit to
which to transfer the files is not
the same as the model of the
CPU Unit of the backup files on
the SD Memory Card.
• The CPU Unit is write-protected.
• Another backup operation is in
progress.
• Synchronization, online editing,
or the Clear All Memory opera-
tion is in progress.
• Required files are not set to
transfer in the setting of the
_Card1PrgTransferCmd sys-
tem-defined variable.
• Reading the data for the SD
Memory Card program transfer
failed because the SD Memory
Card is faulty or not formatted
correctly.
• The SD Memory Card is damaged.
• The database connection ser-
vice version of the CPU Unit to
which to transfer the files is older
than the database connection
service version of the backup
files on the SD Memory Card.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-31


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
• The robot version of the CPU
Unit to which to transfer the
files is older than the robot ver-
sion of the backup files on the
SD Memory Card.
103E0000 hex Restore Pre- An error was • An SD Memory Card is not √ page 12-79
(Ver. 1.14 or execution detected in pre- inserted.
later) Check Fail- execution checks • The SD Memory Card type is
ure for specification not correct.
with system-defined
• The format of the SD Memory
variables for the SD Card is not correct.
Memory Card
• There is no such folder on the
restore operation.
SD Memory Card as specified
by the _Card1RestoreCmd.Dir-
Name system-defined variable.
• There are no backup files in
such a folder on the SD Mem-
ory Card as specified by the
_Card1RestoreCmd.DirName
system-defined variable.
• Either the backup files in the
folder specified by the
_Card1RestoreCmd.DirName
system-defined variable on the
SD Memory Card are corrupted
or required data is not in the
backup files on the SD Memory
Card.
• The unit version of the CPU
Unit to which to transfer the
files is older than the unit ver-
sion of the backup files on the
SD Memory Card.
• The model of the CPU Unit to
which to transfer the files is not
the same as the model of the
CPU Unit of the backup files on
the SD Memory Card.
• The CPU Unit is write-pro-
tected.
• Required files are not set to
transfer in the setting of the
system-defined variable.
• Reading the data for the SD
Memory Card program transfer
failed because the SD Memory
Card is faulty or not formatted
correctly.
• The SD Memory Card is dam-
aged.
• The database connection ser-
vice version of the CPU Unit to
which to transfer the files is
older than the database con-
nection service version of the
backup files on the SD Memory
Card.
• The robot version of the CPU
Unit to which to transfer the
files is older than the robot ver-
sion of the backup files on the
SD Memory Card.

12-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
40140000 hex PLC System This event pro- • This event provides internal √ page 12-82
Information vides internal infor- information from the PLC Func-
mation from the tion Module. It is recorded to
PLC Function Mod- provide additional information
ule. for another event.
40170000 hex Safe Mode The Controller • The Controller started in Safe √ page 12-82

12-2 Troubleshooting
(Ver. 1.03 or started in Safe Mode.
later) Mode.
80230000 hex NX Message An error has • The communications cable is √ page 12-83
(Ver. 1.05 or Communica- occurred in mes- broken.
later) tions Error sage communica- • The communications cable con-
tions. nector is disconnected.
• The NX message communica-
tions load is high.
40150000 hex PLC System This event pro- • This event provides internal √ page 12-83
Information vides internal infor- information from the PLC Func- 12
mation from the tion Module. It is recorded to
PLC Function Mod- provide additional information
ule. for another event.

12-2-3 Error Table


44430000 hex PLC System This event pro- • This event provides internal √ page 12-84
(Ver. 1.05 or Information vides internal infor- information from the PLC Func-
later) mation from the tion Module. It is recorded to
PLC Function Mod- provide additional information
ule. for another event.
90010000 hex Clock The clock time was • The clock time was changed. √ page 12-84
Changed changed.
90020000 hex Time Zone The time zone was • The time zone was changed. √ page 12-84
Changed changed.
90050000 hex User Pro- The user program • The user program and the Con- √ page 12-85
(Ver. 1.10 or gram/Con- and the Controller troller configurations and setup
later) troller configurations and were downloaded.
Configura- setup were down-
tions and loaded.
Setup Down-
load
90070000 hex Online Edits The user program • The user program was edited √ page 12-85
(Ver. 1.10 or Transferred was edited online. online and the edits were trans-
later) ferred to the Controller.
90080000 hex Variable Changing a vari- • Changing a variable to TRUE √ page 12-86
Changed to able to TRUE with with forced refreshing was
TRUE with forced refreshing specified by the user.
Forced was specified.
Refreshing
90090000 hex Variable Changing a vari- • Changing a variable to FALSE √ page 12-86
Changed to able to FALSE with with forced refreshing was
FALSE with forced refreshing specified by the user.
Forced was specified.
Refreshing
900A0000 hex All Forced Clearing all forced • Clearing all forced refreshing √ page 12-86
Refreshing refreshing values values was specified by the
Cleared was specified. user.
900B0000 hex Memory All All memory was • A user with Administrator rights √ page 12-87
Cleared cleared. cleared all of the memory.
900C0000 hex Event Log The event log was • The event log was cleared by √ page 12-87
Cleared cleared. the user.
900F 0000 hex Automatic The automatic • The automatic transfer was √ page 12-87
(Ver. 1.03 or Transfer transfer was com- completed.
later) Completed pleted.
90110000 hex Power The power supply • The power supply was turned √ page 12-88
Turned ON was turned ON. ON.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-33


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
90120000 hex Power Inter- The power supply • The power supply was inter- √ page 12-88
rupted was interrupted. rupted.
90130000 hex Operation Operation was • A command to start operation √ page 12-88
Started started. was received.
90140000 hex Operation Operation was • A command to stop operation √ page 12-89
Stopped stopped. was received.
90150000 hex Reset Exe- A reset was exe- • A reset command was √ page 12-89
cuted cuted. received.
90160000 hex User Pro- The user program • A user with Administrator rights √ page 12-89
gram Execu- execution ID was changed the user program exe-
tion ID Write set or changed in cution ID that is set in the CPU
the CPU Unit. Unit.
90180000 hex All Controller All current errors • All current errors were changed √ page 12-90
Errors were cleared. by the user.
Cleared
90190000 hex Forced Clearing a forced • Clearing a forced refreshing √ page 12-90
Refreshing refreshing value value was specified by the user.
Cleared was specified.
901A0000 hex Backup A backup operation • A backup operation was √ page 12-90
(Ver. 1.03 or Started was started. started.
later)
901B0000 hex Backup Com- The backup opera- • The backup operation ended √ page 12-91
(Ver. 1.03 or pleted tion ended nor- normally.
later) mally.
901C 0000 hex Restore A restore operation • A restore operation started. √ page 12-91
(Ver. 1.03 or Operation started.
later) Started
901D 0000 hex Restore The restore opera- • The restore operation ended √ page 12-92
(Ver. 1.03 or Operation tion ended nor- normally.
later) Completed mally.
90200000 hex SD Memory Transferring the SD • Transferring the SD Memory √ page 12-92
(Ver. 1.11 or Card Pro- Memory Card pro- Card programs was started.
later) gram Trans- grams was started.
fer Started
90210000 hex SD Memory Transferring the SD • Transferring the SD Memory √ page 12-93
(Ver. 1.11 or Card Pro- Memory Card pro- Card programs was completed.
later) gram Trans- grams was com-
fer pleted.
Completed

12-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Errors Related to FINS Communications

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
14010000 hex CPU Bus An error was • The power supply to the Con- √ page 12-94
Unit Setup detected in the troller was interrupted or com-

12-2 Troubleshooting
Area Error memory check of munications with the Sysmac
the Setup Area for Studio were disconnected while
CPU Bus Units. downloading the CPU Bus Unit
Settings.
34100000 hex IP Address The IP address • The IP address conversion √ page 12-94
Table Setting table settings are method is set to the combined
Error incorrect. method or the IP address table
method, but the IP address
table settings are incorrect.
34130000 hex FINS/TCP The FINS/TCP con- • The power supply to the Con- √ page 12-95
Connection nection table is troller was interrupted or com- 12
Table Setting incorrect. munications with the Sysmac
Error Studio were disconnected while
downloading the FINS/TCP

12-2-3 Error Table


connection table.
34110000 hex Unknown The send destina- • The send destination node was √ page 12-95
Destination tion node is not not found when a FINS mes-
Node known. sage was sent.
80100000 hex Packet Dis- One or more pack- • A FINS response addressed to √ page 12-96
carded ets were discarded. the CPU Unit was received.
• The send designation Unit for
the FINS response does not
exist.
80110000 hex Packet Dis- One or more pack- • An attempt was made to send a √ page 12-97
carded ets were discarded. FINS response with over 2002
bytes.
• An attempt was made to route a
FINS response with over 2002
bytes.
• Packet was received with a No
Such Unit routing error.
• Packet was received with a
Routing Error routing error.
• Packet was received with a
Routing Table Not Registered
routing error.
• Packet was received with an
Event Area Size Over Limit
routing error.
• There is insufficient space in
the internal buffer.
• FINS message routing failed
because the communications
load is too high.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-35


12 Troubleshooting

Level
Event code Event name Meaning Assumed cause Reference
Maj Prt Min Obs Info
80120000 hex Packet Dis- One or more pack- • A FINS response was received √ page 12-97
carded ets were discarded. with the destination network
address (DNA) set to the local
network and the destination
node address (DA1) not set to
the local node.
• A FINS command or response
was received with a hub net-
work address specification for
which the destination network
address (DNA) was greater
than or equal to 80 hex.
• There is insufficient space in
the internal buffer.
• A FINS command that does not
have the minimum command
length was received.
• A FINS command that
exceeded the maximum com-
mand length was received.
• Sending packets failed.
• FINS message routing failed
because the communications
load is too high. Or a command
that was addressed to the built-
in EtherNet/IP port was
received with the source net-
work address (SNA) set to 0.
• A FINS response that was
addressed to the built-in Ether-
Net/IP port was received.
• A FINS response or a com-
mand for which a response is
not required was received when
the routing tables were not reg-
istered.
• A FINS response or a com-
mand for which a response is
not required was received when
there was an error in the routing
tables.
• A FINS response or a com-
mand for which a response is
not required was received that
exceeded the number of relay
points.
• Transmission is not possible
because the destination
address is not set in the routing
tables.
• Routing is not possible because
the FINS node address setting
in the Built-in EtherNet/IP Port
Settings is set to 0 or 255.

12-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

12-2-4 Error Descriptions


This section describes the information that is given for individual errors.

Controller Error Descriptions

12-2 Troubleshooting
The items that are used to describe individual errors (events) are described in the following copy of an
error table.

Event name Gives the name of the error. Event code Gives the code of the error.
Meaning Gives a short description of the error.
Source Gives the source of the error. Source details Gives details on Detection Tells when the
the source of the timing error is detected.
error.
Error attributes Level Tells the level of
influence on con-
Recovery Gives the recov- Log category Tells which log
the error is saved
12
ery method.*2
trol.*1 in.*3
Effects User program Tells what will hap- Operation Provides special information on the operation that results

12-2-4 Error Descriptions


pen to execution of from the error.
the user pro-
gram.*4
Indicators Gives the status of the built-in EtherNet/IP port and built-in EtherCAT port indicators. Indicator status is given only for
errors in the EtherCAT Master Function Module and the EtherNet/IP Function Module.
System-defined Variable Data type Name
variables Lists the variable names, data types, and meanings for system-defined variables that provide direct error notification,
that are directly affected by the error, or that contain settings that cause the error.
Cause and cor- Assumed cause Correction Prevention
rection
Lists the possible causes, corrections, and preventive measures for the error.
Attached This is the attached information that is displayed by the Sysmac Studio or an HMI.*5
information
Precautions/ Provides precautions, restrictions, and supplemental information. If the user can set the event level, the event levels
Remarks that can be set, the recovery method, operational information, and other information are also provided.

*1 One of the following:


Major fault: Major fault level
Partial fault: Partial fault level
Minor fault: Minor fault level
Observation
Information
*2 One of the following:
Automatic recovery: Normal status is restored automatically when the cause of the error is removed.
Error reset: Normal status is restored when the error is reset after the cause of the error is removed.
Cycle the power supply: Normal status is restored when the power supply to the Controller is turned OFF and then back
ON after the cause of the error is removed.
Controller reset: Normal status is restored when the Controller is reset after the cause of the error is removed.
Depends on cause: The recovery method depends on the cause of the error.
*3 One of the following:
System: System event log
Access: Access event log
*4 One of the following:
Continues: Execution of the user program will continue.
Stops: Execution of the user program stops.
Starts: Execution of the user program starts.
*5 Refer to the appendices of the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for the applicable range of the HMI
Troubleshooter.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-37


12 Troubleshooting

Errors Related to Tasks

Event name Task Execution Timeout Event code 60020000 hex


Meaning Task execution exceeded the timeout detection time.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
_<Task_name>_Exceeded BOOL Task Period Exceeded Flag
_<Task_name>_ExceedCount UDINT Task Period Exceeded Count
_<Task_name>_LastExecTime TIME Last Task Execution Time
_<Task_name>_MaxExecTime TIME Maximum Task Execution Time
Cause and Assumed cause Correction Prevention
correction The timeout detection time setting is Increase the timeout detection time. Design the tasks considering the cor-
too short. rections that are given on the left.
The task period setting is too short. Increase the task period.
A user program is too large. Separate the processes into different
tasks, for example move processes
that need a short execution period to
a periodic task with a lower priority.
The number of times that processing If there is a program with an
is repeated is larger than expected. extremely high number of repetitions,
correct the program to achieve the
correct number of repetitions. Set a
trap in the user program that monitors
the number of times a process is exe-
cuted to check the number of repeti-
tions.
Task Priority Error Increase the priority of the task. Or,
decrease the priorities of the other
tasks.
Frequent Event Task Execution Lower the frequency of event task
execution. Or, decrease the priorities
of the event tasks.
Attached Attached Information 1: Name of task where error occurred
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name I/O Refreshing Timeout Error Event code 60030000 hex
Meaning Consecutive I/O refresh failures occurred during the primary periodic task or periodic task period.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.

12-2 Troubleshooting
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
_<Task_name>_Exceeded BOOL Task Period Exceeded Flag
_<Task_name>_ExceedCount UDINT Task Period Exceeded Count
_<Task_name>_LastExecTime TIME Last Task Execution Time
_<Task_name>_MaxExecTime TIME Maximum Task Execution Time
Cause and Assumed cause Correction Prevention
correction The task period setting is too short. Check the task execution time and
change the task period to an appropri-
Design the tasks considering the cor-
rections that are given on the left.
12
ate value.
Task Priority Error for Periodic Tasks Increase the priorities of the periodic

12-2-4 Error Descriptions


and Event Tasks tasks. Or, decrease the priorities of
the event tasks so that they are lower
than the priorities of the periodic
tasks.
There are too many Units and slaves Move the I/O refresh processes to
that perform I/O refresh in the task other tasks, for example move I/O
period. refresh processes within the task to
other tasks.
Frequent Event Task Execution Lower the frequency of event task
execution. Or, decrease the priorities
of the event tasks.
Attached Attached Information 1: Name of task where error occurred
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-39


12 Troubleshooting

Event name Insufficient System Service Time Error Event code 60040000 hex
Meaning The specified system service execution time could not be obtained.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
_<Task_name>_Exceeded BOOL Task Period Exceeded Flag
_<Task_name>_ExceedCount UDINT Task Period Exceeded Count
_<Task_name>_LastExecTime TIME Last Task Execution Time
_<Task_name>_MaxExecTime TIME Maximum Task Execution Time
Cause and Assumed cause Correction Prevention
correction There was not sufficient time to exe- Check the available time for task exe- Set the System Service Monitoring
cute the tasks and tag data link ser- cution and the tag data link settings. Settings according to the corrections
vice. Increase the task periods or the that are given on the left.
packet intervals (RPI) in the tag data
link settings to obtain enough time for
execution of the tasks and tag data
link service.
The system service execution interval Check the effect on the processes
is too short or the system service exe- executed by the system services with
cution time ratio is too long in the Sys- this operation and increase the sys-
tem Service Monitoring Settings. tem service execution interval or
reduce the system service execution
time ratio.
Attached None
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Task Period Exceeded Event code 60010000 hex


Meaning Task execution was not completed during the set task period for the primary periodic task or a periodic task.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation If the task execution does not finish within the set task
period, the I/O refresh operation will be as follows:

12-2 Troubleshooting
• CJ-series Units: No I/O refresh is executed.
When task execution is completed, I/O refreshing for the
next period is executed.
• EtherCAT slaves: The same values are output as for the
previous output refresh.
If the task execution does not finish within the set task
period, overall control of the equipment may become
impossible.
System-defined Variable Data type Name
variables
_<Task_name>_Exceeded BOOL Task Period Exceeded Flag 12
_<Task_name>_ExceedCount UDINT Task Period Exceeded Count
_<Task_name>_LastExecTime TIME Last Task Execution Time

12-2-4 Error Descriptions


_<Task_name>_MaxExecTime TIME Maximum Task Execution Time
Cause and Assumed cause Correction Prevention
correction The task period setting is too short. Check the task execution time and Design the tasks considering the cor-
change the task period to an appropri- rections that are given on the left.
ate value.
A user program is too large. Separate the processes into different
tasks, for example move processes
that need a short execution period to
a periodic task with a lower priority.
The number of times that processing If there is a program with an
is repeated is larger than expected. extremely high number of repetitions,
correct the program to achieve the
correct number of repetitions. Set a
trap in the user program that monitors
the number of times a process is exe-
cuted to check the number of repeti-
tions.
Task Priority Error for Periodic Tasks Increase the priorities of the periodic
and Event Tasks tasks. Or, decrease the priorities of
the event tasks so that they are lower
than the priorities of the periodic
tasks.
Frequent Event Task Execution Lower the frequency of event task
execution. Or, decrease the priorities
of the event tasks.
Attached Attached Information 1: Name of task where error occurred
information
Precautions/ You can change the level of the error to an observation in the task settings.
Remarks

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-41


12 Troubleshooting

Event name Task Period Exceeded Event code 60050000 hex


Meaning Task execution was not completed during the set task period for the primary periodic task or fixed periodic task.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation If the task execution does not finish within the set task
period, the I/O refresh operation will be as follows:
• CJ-series Units: No I/O refresh is executed.
When task execution is completed, I/O refreshing for the
next period is executed.
• EtherCAT slaves: The same values are output as for the
previous output refresh.
If the task execution does not finish within the set task
period, overall control of the equipment may become
impossible.
System-defined Variable Data type Name
variables
_<Task_name>_Exceeded BOOL Task Period Exceeded Flag
_<Task_name>_ExceedCount UDINT Task Period Exceeded Count
_<Task_name>_LastExecTime TIME Last Task Execution Time
_<Task_name>_MaxExecTime TIME Maximum Task Execution Time
Cause and Assumed cause Correction Prevention
correction The task period setting is too short. Check the task execution time and Design the tasks considering the cor-
change the task period to an appropri- rections that are given on the left.
ate value.
A user program is too large. Separate the processes into different
tasks, for example move processes
that does not need a short execution
period to a periodic task with a lower
priority.
The number of times that processing If there is a program with an
is repeated is larger than expected. extremely high number of repetitions,
correct the program to achieve the
correct number of repetitions. Set a
trap in the user program that monitors
the number of times a process is exe-
cuted to check the number of repeti-
tions.
Task Priority Error for Periodic Tasks Increase the priorities of the periodic
and Event Tasks tasks. Or, decrease the priorities of
the event tasks so that they are lower
than the priorities of the periodic
tasks.
Frequent Event Task Execution Lower the frequency of event task
execution. Or, decrease the priorities
of the event tasks.
Attached Attached Information 1: Name of task where error occurred
information
Precautions/ This error can occur if you change the level of the error to an observation in the task settings.
Remarks

12-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Errors Related to the NX Bus

Event name NX Bus Controller Error Event code 04100000 hex *1


Meaning An error occurred in the NX bus.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at

12-2 Troubleshooting
Controller reset,
or during NX bus
communications
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation I/O communications will not operate and message com-
munications cannot be performed.
System-defined Variable Data type Name
variables None --- --- 12
Cause and Assumed cause Correction Prevention
correction An I/O communications error Cycle the power supply to the CPU None

12-2-4 Error Descriptions


occurred between the CPU Unit and Unit. If this error persists, replace the
the NX Unit. CPU Unit.
Attached Attached information 1: System information
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Bus Hardware Error Event code 04110000 hex *1

Meaning A hardware error was detected in the NX Bus Function Module.


Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation I/O communications will not operate and message com-
munications cannot be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction A hardware error related to the NX Cycle the power supply to the CPU None
bus was detected. Unit. If this error persists, replace the
CPU Unit.
Attached Attached information 1: System information
information Attached information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-43


12 Troubleshooting

Event name NX Bus Memory Check Error Event code 10600000 hex *1
Meaning An error was detected in the internal memory check for the NX Bus Function Module.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation I/O communications will not operate and message com-
munications cannot be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction An error was detected in the memory Cycle the power supply to the CPU None
check for the internal protection cir- Unit. If this error persists, replace the
cuit. CPU Unit.
Attached Attached information 1: System information
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name Failed to Read NX Unit Operation Settings Event code 10610000 hex *1
Meaning Reading the NX Unit operation settings failed.
Cycle the power supply to the CPU Unit to restore the previous normally-saved settings.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation I/O communications will not operate, but message com-
munications can be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction The NX Unit operation settings are Check the NX Unit operation settings Do not turn OFF the power supply to
not saved normally in the CPU Unit. and correct the settings. the CPU Unit while transfer of the Unit
operation settings for the CPU Unit or
execution of the NX_SaveParam
instruction is in progress.
Attached Attached information 1: System information
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

12-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Number of Mountable NX Units Exceeded Event code 24D00000 hex *1
Meaning The number of mounted NX Units exceeds the specified value for the CPU Unit.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System

12-2 Troubleshooting
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation • For NX Units within the range of the number of mount-
able Units, I/O communications will not operate, but
message communications can be performed.
• For NX Units outside the range of the number of mount-
able Units, I/O communications will not operate and
message communications cannot be performed.
System-defined Variable Data type Name
variables None --- ---
12
Cause and Assumed cause Correction Prevention
correction More than the maximum number of Keep the number of NX Units Mount the specified number of NX

12-2-4 Error Descriptions


NX Units are mounted on the CPU mounted on the CPU Unit at the spec- Units or less.
Unit. ified number or less.
Attached None
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name Total I/O Data Size in NX Units Excessive Event code 24D20000 hex *1

Meaning The total size of I/O data in the mounted NX Units exceeds the maximum specified value for the CPU Unit.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation I/O communications will not operate, but message com-
munications can be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction The total size of I/O data in the Reduce the number of NX Units Reduce the number of NX Units
mounted NX Units exceeds the maxi- mounted on the CPU Unit to keep the mounted on the CPU Unit to keep the
mum specified value for the CPU total size of I/O data at the maximum total size of I/O data at the maximum
Unit. specified value or less. specified value or less.
Attached None
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-45


12 Troubleshooting

Event name NX Unit Version Not Matched Event code 35900000 hex *1
Meaning There is a mounted NX Unit with a unit version earlier than that in the Unit configuration information registered in the
CPU Unit.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation • For NX Units with this error, I/O communications will not
operate and message communications cannot be per-
formed.
• For NX Units without this error, I/O communications will
not operate, but message communications can be per-
formed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction The unit version of an NX Unit To match the Unit configuration infor- Download Unit configuration informa-
mounted in the actual configuration is mation with the actual configuration, tion for which you confirmed that the
earlier than that in the Unit configura- download the Unit configuration infor- comparison result showed Not com-
tion information registered in the CPU mation that contains the unit version patible in the Compare and Merge
Unit. of the NX Unit mounted in the actual Window of the Sysmac Studio to the
configuration to the CPU Unit. To CPU Unit.
match the actual configuration with
the Unit configuration information,
replace the NX Unit in the actual con-
figuration with an NX Unit with a unit
version later than that in the Unit con-
figuration information.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information Attached information 2: Unit version in the Unit configuration information of the NX Unit where the error occurred
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

12-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Unregistered NX Unit Mounted Event code 35910000 hex *1

Meaning There is a mounted NX Unit that does not exist in the Unit configuration information registered in the CPU Unit.
If there are more than one NX Unit relevant to this event, only the NX Unit that is nearest to the CPU Unit is registered
with the event.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,

12-2 Troubleshooting
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation • For NX Units with this error, I/O communications will not
operate and message communications cannot be per-
formed.
12
• For NX Units without this error, I/O communications will
not operate, but message communications can be per-

12-2-4 Error Descriptions


formed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction There is a mounted Unit that does not To match the Unit configuration infor- Match the project downloaded to the
exist in the Unit configuration informa- mation with the actual configuration, CPU Unit with the system configura-
tion registered in the CPU Unit. download to the CPU Unit the Unit tion.
configuration information to which you
added the relevant NX Unit. To match
the actual configuration with the Unit
configuration information, remove the
relevant NX Unit.
There is a mounted Unit in which the To match the Unit configuration infor-
NX Unit Mounting Setting is set to mation with the actual configuration,
Disabled. download to the CPU Unit the Unit
configuration information in which the
NX Unit Mounting Setting for the rele-
vant NX Unit is set to Enabled. To
match the actual configuration with
the Unit configuration information,
remove the relevant NX Unit.
Attached Attached information 1: Mounting position of the NX Unit where the error occurred
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-47


12 Troubleshooting

Event name NX Unit Serial Number Mismatch Event code 35930000 hex *1
Meaning There is a mounted NX Unit with a serial number different from that in the Unit configuration information registered in
the CPU Unit.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation • For NX Units with this error, I/O communications will not
operate and message communications cannot be per-
formed.
• For NX Units without this error, I/O communications will
not operate, but message communications can be per-
formed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction There is no mounted NX Unit with the To match the actual configuration with Read the serial numbers of the actu-
serial number that you set in the Unit the Unit configuration information, ally mounted Units into a project in
configuration information registered in match the serial number of the rele- the Sysmac Studio before you set the
the CPU Unit. vant NX Unit . To match the Unit con- Serial Number Verification setting to
figuration information with the actual verify the serial numbers.
configuration, download the Unit con-
figuration information with the serial
number of the relevant NX Unit to the
CPU Unit.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information Attached information 2: Serial number in the Unit configuration information of the NX Unit where the error occurred
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Bus Function Processing Error Event code 44440000 hex *1
Meaning A fatal error was detected in the NX Bus Function Module.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply to the
CPU Unit.
Effects User program Continues. Operation I/O communications will not operate and message com-
munications cannot be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

12-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name NX Bus I/O Communications Stopped Due to Another Event code 85540000 hex *1
Event
Meaning The I/O communications on the NX bus were stopped based on the Fail-soft Operation Setting because an error that
triggers fail-soft operation occurred.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Partial fault Recovery Error reset Log category System
Effects User program Continues. Operation I/O communications will not operate, but message com-

12-2 Troubleshooting
munications can be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction I/O refreshing was stopped based on Eliminate errors that trigger fail-soft To continue the I/O refreshing when
the Fail-soft Operation Setting. operation, which occurred before this an error that triggers fail-soft opera-
event. tion is encountered, change the Fail-
soft Operation Setting to Fail-soft.
Attached Attached information 1: Event code that triggered fail-soft operation
information Attached information 2: Unit number of the NX Unit where the error occurred 12
Precautions/ None
Remarks

12-2-4 Error Descriptions


*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name Registered NX Unit Not Mounted Event code 35920000 hex *1
Meaning There is no mounted NX Unit that exists in the Unit configuration information registered in the CPU Unit.
If there are more than one NX Unit relevant to this event, only the NX Unit that is nearest to the CPU Unit is registered
with the event.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
or at NX bus
restart
Error attributes Level Minor fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation For NX Units with this error, I/O communications will not
operate and message communications cannot be per-
formed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction There is no mounted NX Unit that To match the actual configuration with Match the project downloaded to the
exists in the Unit configuration infor- the Unit configuration information, CPU Unit with the system configura-
mation registered in the CPU Unit. mount the relevant NX Unit. To match tion.
the Unit configuration information with
the actual configuration, download to
the CPU Unit the Unit configuration
information from which you deleted
the relevant NX Unit.
The power supply to the Additional Turn ON the power supply to the Use the same Unit power supply to
NX Unit Power Supply Unit is not Additional NX Unit Power Supply supply the Unit power to the CPU
turned ON. Unit. Rack.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-49


12 Troubleshooting

Event name NX Bus Communications Error Event code 85500000 hex *1


Meaning A communications error that prevents normal NX bus communications was detected.
If there are more than one NX Unit relevant to this event, only the NX Unit that is nearest to the CPU Unit is registered
with the event.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Minor fault Recovery Cycle the power Log category System
supply to the
CPU Unit, reset
the Controller, or
restart the NX
bus.
Effects User program Continues. Operation • For NX Units located outside the NX Unit where an error
occurred, I/O communications will not operate and mes-
sage communications cannot be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction The NX bus connector contact is Mount the NX Units and End Cover Perform installation according to the
faulty due to vibration or shock. securely and secure them with End user's manual.
Plates.
Excessive noise is applied to the NX Implement noise countermeasures
bus connector. according to the user's manual.
An NX Unit was removed. Mount the removed NX Unit again.
An error occurred in an NX Unit. Cycle the power supply to the rele- None
vant NX Unit. If this error persists,
replace the NX Unit.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Unit Communications Timeout Event code 85510000 hex *1


Meaning An error occurred in I/O data communications with the NX Units.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation For NX Units with this error, I/O communications will not
operate, but message communications can be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction An NX Bus Communications Error Correct the NX Bus Communications Take preventive measures against
has occurred. Error. the NX Bus Communications Error.
An error occurred in an NX Unit. Cycle the power supply to the rele- None
vant NX Unit. If this error persists,
replace the NX Unit.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information Attached information 2: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

12-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name NX Unit Initialization Error Event code 85520000 hex *1


Meaning Initializing an NX Unit failed.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
at NX bus restart,
or at error reset
Error attributes Level Minor fault Recovery Error reset Log category System

12-2 Troubleshooting
Effects User program Continues. Operation For NX Units with this error, I/O communications will not
operate, but message communications can be performed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction Initialization with the Unit configura- Connect the Sysmac Studio and Download the Unit configuration infor-
tion information registered in the CPU reconfigure the Unit configuration mation to the CPU Unit and the NX
Unit failed. information in the CPU Unit. Unit.
An NX Bus Communications Error Correct the NX Bus Communications Take preventive measures against
has occurred. Error. the NX Bus Communications Error. 12
The Channel Enable/Disable Setting Set the Channel Enable/Disable Set- For an Analog Unit, set the Channel
for all channels of the Analog Unit are ting to Enable for at least one chan- Enable/Disable Setting to Enable for
set to Disable. nel. at least one channel.

12-2-4 Error Descriptions


Initialization of an NX Unit failed. Cycle the power supply to the rele- For an Analog Unit, set the Channel
vant NX Unit. If this error persists, Enable/Disable Setting to Enable for
replace the NX Unit. at least one channel.
Attached Attached information 1: Unit number of the NX Unit where the error occurred
information Attached information 2: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Unit Startup Error Event code 85530000 hex *1

Meaning Starting an NX Unit failed.


Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON, at
Controller reset,
at NX bus restart,
or at error reset
Error attributes Level Minor fault Recovery Cycle the power Log category System
supply to the
CPU Unit or reset
the Controller.
Effects User program Continues. Operation For NX Units with this error, I/O communications will not
operate and message communications cannot be per-
formed.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction A startup error occurred in an NX Cycle the power supply to the rele- None
Unit. vant NX Unit. If this error persists,
replace the NX Unit.
Attached Attached information 1: Mounting position of the NX Unit where the error occurred
information Attached information 2: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-51


12 Troubleshooting

Event name NX Unit Backup Failed Event code 103C0000 hex *1


Meaning The backup operation for an NX Unit ended in an error.
Source NX Bus Function Module Source details Master Detection When backup is
timing executed
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction There is also another error related to Check errors related to the NX Bus Back up the data when there are no
the NX Bus Function Module. Function Module and perform the NX bus errors.
required corrections.
An NX Bus Communications Error Implement countermeasures against
has occurred. the NX Bus Communications Error.
Backup data cannot be received from Reset the error for the relevant NX
an NX Unit. Unit.
Attached Attached Information 1: Error location
information 0: NX bus master
1 or higher: Unit number of the NX Unit
Attached Information 2: Cause of the error
1: There is an error related to the NX Bus Function Module.
2: Communications with an NX Unit failed.
Attached information 3: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

12-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name NX Unit Restore Operation Failed Event code 103D0000 hex *1
Meaning The restore operation for an NX Unit ended in an error.
Source NX Bus Function Module Source details Master Detection During restore
timing operation
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables

12-2 Troubleshooting
None --- ---
Cause and Assumed cause Correction Prevention
correction There is also another error related to Check errors related to the NX Bus Restore the data when there are no
the NX Bus Function Module. Function Module and perform the NX bus errors.
required corrections.
An NX Bus Communications Error Implement countermeasures against
has occurred. the NX Bus Communications Error.
The backup data cannot be sent to an Reset the error for the relevant NX
NX Unit. Unit.
The Unit configuration in the backup Use an NX Unit revision that is the
file does not agree with the actual same or higher than the revision used
12
Unit configuration. when the data was backed up. If you
replace a slave with the Serial Num-

12-2-4 Error Descriptions


ber Check Method set to Setting =
Actual device, do not use the restore
function. Instead, change the network
configuration from the Sysmac Stu-
dio, download the network configura-
tion, and then transfer the slave
parameters.
Attached Attached Information 1: Error location
information 0: NX bus master
1 or higher: Unit number of the NX Unit
Attached Information 2: Cause of the error
1: There is an error related to the NX Bus Function Module.
2: Communications with an NX Unit failed.
3: The Unit configuration in the backup data does not agree with the actual Unit configuration.
Attached information 3: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Unit Event Log Save Error Event code 10620000 hex *1
Meaning Saving or reading the NX Unit event log failed.
Continuing to operate with this error may result in no event log saved at CPU Unit power OFF although it has no effect
on the control function.
Source NX Bus Function Module Source details Master Detection At CPU Unit
timing power ON or at
Controller reset
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Part or all of the past event log cannot be read.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction Data in the NX Unit event log area are If this error persists even after you None
invalid. cycle the power supply to the CPU
Unit, a hardware failure may occur in
the NX Unit event log area. Replace
the CPU Unit if you use the event logs
in the CPU Unit.
Attached Attached information 1: System information
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-53


12 Troubleshooting

Event name NX Bus System Information Event code 44450000 hex *1


Meaning This event provides internal information from the NX Bus Function Module.
Source NX Bus Function Module Source details Master Detection Continuously
timing
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction This event provides internal informa- --- ---
tion from the NX Bus Function Mod-
ule.
Attached Attached information 1: System information
information Attached information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Event name NX Bus Restart Executed Event code 95800000 hex *1


Meaning An NX bus restart was executed.
Source NX Bus Function Module Source details Master Detection At NX bus restart
timing or at NX Unit
restart
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables _NXB_UnitIOActiveTbl ARRAY [0..8] OF BOOL NX Unit I/O Data Active Status
_NXB_UnitMsgActiveTbl ARRAY [0..8] OF BOOL NX Unit Message Enabled Status
Cause and Assumed cause Correction Prevention
correction An NX bus restart command was --- ---
received.
Attached Attached information 1: Type of restart
information 0: The NX bus was restarted
1: An NX Unit was restarted
Attached information 2: Unit number of the Unit that executed a restart
0: NX bus master
1 or higher: NX Unit
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.13 or later of the CPU Unit.

Errors Related to Controller Operation

Event name User Program/Controller Configurations and Setup Trans- Event code 10200000 hex
fer Error
Meaning The user program or Controller Configurations and Setup were not transferred correctly.
Source PLC Function Module Source details None or I/O bus Detection At power ON or
master timing Controller reset
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
None --- ---

12-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction The user program or Controller Con- Clear all of memory and then down- Do not turn OFF the power supply to
figurations and Setup are not correct load the project from the Sysmac Stu- the Controller during a download of
because the power supply to the Con- dio. If attached information is the user program or the Controller
troller was interrupted during a down- registered, cycle the power supply to Configurations and Setup.
load of the user program or the the Controller and then implement the
Controller Configurations and Setup. above correction.
The user program or Controller Con- If you cannot perform a Clear All Do not interrupt the power supply to

12-2 Troubleshooting
figurations and Setup are not correct Memory operation from the Sysmac the Controller during online editing.
because the power supply to the Con- Studio, transfer the project to the
troller was interrupted during online Controller with a restore operation
editing. from an SD Memory Card.
The user program or Controller Con- Do not interrupt the power supply to
figurations and Setup are not correct the Controller during a Clear All Mem-
because the power supply to the Con- ory operation.
troller was interrupted during a Clear
All Memory operation.
The user program or Controller Con- Do not interrupt the power supply to
figurations and Setup are not correct the Controller during a restore opera- 12
because the power supply to the Con- tion.
troller was interrupted during a
restore operation.

12-2-4 Error Descriptions


Non-volatile memory failed. If the error persists even after you None
make the above correction, replace
the CPU Unit.
Attached Attached Information 1: Cause Details
information None: Power was interrupted during a download, during online editing, or during restoration.
Downloading/Predownloading: For other causes, the timing of error occurrence (during download or during download
preparations) is given.
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-55


12 Troubleshooting

Event name Illegal User Program Execution ID Event code 10210000 hex
Meaning The user program execution IDs set in the user program and in the CPU Unit do not match.
Source PLC Function Module Source details None Detection At user program
timing download, power
ON, or Controller
reset
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The user program execution IDs set Set the same user program execution Set the same user program execution
in the user program and in the CPU ID in the user program and CPU Unit. ID in the user program and CPU Unit.
Unit do not match. Keep a record of the user program
A user program execution ID is set in If user program execution ID is not set execution IDs set in the user program
and in the CPU Unit. They are not dis-
the CPU Unit but not in the user pro- in the user program, clear the user
played.
gram. program execution ID set in the CPU
Unit by clearing all memory in the
CPU Unit.
Attached None
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

Event name Illegal User Program Event code 10240000 hex


Meaning The user program is not correct.
Source PLC Function Module Source details None Detection At download,
timing power ON, or
Controller reset
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
There are more than 8 nesting levels Find the location in the user program Write the user program so that there
for functions or function blocks. with more than 8 nesting levels for is never more than 8 nesting levels for
functions or function blocks and functions or function blocks. Use the
reduce the number of nesting levels program check on the Sysmac Studio
to 8 or fewer. Then, download the to confirm that there are not more
user program again. than 8 nesting levels.
Attached None
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Illegal User Program/Controller Configurations and Setup Event code 10250000 hex
Meaning The upper limit of the usable memory was exceeded or the user program or Controller Configurations and Setup is cor-
rupted.
Source PLC Function Module Source details None Detection At download,
timing power ON, or
Controller reset
Error attributes Level Major fault Recovery Cycle the power Log category System

12-2 Troubleshooting
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The upper limit of the data size was If an event on restrictions on the num- None
exceeded. ber of items used occurred at the
same time as this event, correct the
user program and settings so that the 12
number of items used is not
exceeded and then download the

12-2-4 Error Descriptions


data again.
The main memory capacity was If an event on restrictions on the num-
exceeded. ber of items used did not occur at the
same time as this event, perform the
Clear All Memory operation, cycle the
power supply, and then confirm that
this event was cleared. If it was
cleared, reduce the size of the proj-
ect, e.g., by sharing programming,
and then download the project again.
Non-volatile memory is deteriorating If this error persists even after you
or has failed. implement the above two corrections,
replace the CPU Unit.
Attached None
information
Precautions/ None
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-57


12 Troubleshooting

Event name Error in Starting Automatic Transfer Event code 10270000 hex*1
Meaning An error was detected in pre-execution checks for automatic transfer.
Source PLC Function Module Source details None Detection At power ON
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card.
rect. SD or SDHC card.
The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card,
not correct. Sysmac Studio and then create an create an autoload folder on the SD
autoload folder and place the backup Memory Card, and place the backup
files in it. files in it. Also, do not remove the SD
Memory Card or turn OFF the power
There is no autoload folder on the SD Create an autoload folder on the SD
supply while the SD BUSY indicator is
Memory Card. Memory Card and place the backup
files in it. lit.

There are no backup files in the auto- Place the backup files in the autoload
load folder on the SD Memory Card. folder on the SD Memory Card.
Either the backup files in the autoload Replace the backup files in the auto-
folder on the SD Memory Card are load folder on the SD Memory Card. If
corrupted or required data is not in this error occurs again even after
the backup files on the SD Memory replacing the files, create the backup
Card. files again and place them in the auto-
load folder.
The unit version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the unit version of the
which to transfer the files is older than Unit that has a unit version that is the CPU Unit and the unit version of the
the unit version of the backup files on same as or newer than the unit ver- backup files are compatible.
the SD Memory Card. sion of the CPU that was used to cre-
ate the backup files. Or, place the
backup files with the correct unit ver-
sion for the CPU Unit in the autoload
folder.

12-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Cause and The model of the CPU Unit to which Replace the CPU Unit with a CPU Make sure that the model of the CPU
correction to transfer the files is not the same as Unit that has the same model as the Unit is the same as the model of the
the model of the CPU Unit of the CPU Unit that was used to create the CPU Unit that was used to create the
backup files on the SD Memory Card. backup files. Or, place the backup backup files.
files with the same model of CPU Unit
in the autoload folder.
Recovery was executed for the SD If there are no backup files or no auto- None
Memory Card. matic transfer command file in the
autoload folder, place the files in the

12-2 Troubleshooting
folder again.
The CPU Unit is write-protected. If you use automatic transfers, select If you use automatic transfers, select
the Do not use Option for the Write the Do not use Option for the Write
protection at startup setting of the protection at startup setting of the
CPU Unit. CPU Unit.
The settings in the automatic transfer Make sure that the required files are Make sure that the required files are
command file (AutoloadCommand.ini) set to “Yes” in the automatic transfer set to “Yes” in the automatic transfer
are not correct. command file. command file.
Reading the data for automatic trans- Perform the same corrective mea- Perform the same preventive mea-
fer failed because the SD Memory sures as for when the format of the sures as for the following events: SD 12
Card is faulty or not formatted cor- SD Memory Card is not correct or the Memory Card Invalid Format or Faulty
rectly. SD Memory Card is damaged. SD Memory Card.

12-2-4 Error Descriptions


The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Or,
replace the SD Memory Card periodi-
cally according to the write life of the
SD Memory Card.
The database connection service ver- Replace the CPU Unit with a CPU Make sure that the database connec-
sion of the CPU Unit to which to Unit that has a database connection tion service version of the CPU Unit
transfer the files is older than the service version that is the same as or and the database connection service
database connection service version newer than the database connection version of the backup files are com-
of the backup files on the SD Memory service version of the CPU Unit that patible.
Card. was used to create the backup files.
Or, place the backup files with the
correct database connection service
version for the CPU Unit in the auto-
load folder.
The robot version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the robot version of
which to transfer the files is older than Unit that has a robot version that is the CPU Unit and the robot version of
the robot version of the backup files the same as or newer than the robot the backup files are compatible.
on the SD Memory Card. version of the CPU Unit that was used
to create the backup files. Or, place
the backup files with the correct robot
version for the CPU Unit in the auto-
load folder.
Attached Attached Information 1: Error Details
information 0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory
Card is not the correct type of card.
0004 hex: Recovery was executed for the SD Memory Card.
0101 hex: There is no autoload folder on the SD Memory Card.
0102 hex: There are no backup files in the autoload folder on the SD Memory Card.
0103 hex: The backup files are corrupted.
0104 hex: The contents of the automatic transfer command file are not correct.
0105 hex: The required transfer data is not in the backup file.
0201 hex: The unit version of the CPU Unit is old.
0202 hex: The model numbers of the CPU Unit are not the same.
0203 hex: The CPU Unit is write-protected.
0211 hex: The database connection service or robot version of the CPU Unit is old.
0301 hex: Reading data for automatic transfer failed or the SD Memory Card is faulty.
Precautions/ None
Remarks

*1 This event code occurs for unit version 1.03 or later of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-59


12 Troubleshooting

Event name Error in Executing Automatic Transfer Event code 10280000 hex*1
Meaning The automatic transfer ended in an error.
Source PLC Function Module Source details None Detection At power ON
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction It was not possible to read the data for Format the SD Memory Card with the Do not remove the SD Memory Card
automatic transfer. Sysmac Studio and then create an or turn OFF the power supply while
autoload folder and place the backup the SD BUSY indicator is lit. Replace
files in it. the SD Memory Card periodically
according to the write life of the SD
Memory Card.
The SD Memory Card was removed Insert an SD Memory Card that con- Do not remove the SD Memory Card
during an automatic transfer. tains the backup files in an autoload during the automatic transfer.
folder, and then cycle the power sup-
ply to execute the automatic transfer
again.
There are no backup files in the auto- Create an autoload folder in the SD Use a formatted SD Memory Card,
load folder on the SD Memory Card. Memory Card and store the backup create an autoload folder in the SD
files in it. Memory Card, and store the backup
files in the folder. Do not turn OFF the
The backup files in the autoload Store the backup files in the autoload
folder on the SD Memory Card are folder again. If this error occurs again power supply or remove the SD Mem-
ory Card while the SD BUSY indicator
corrupted. even after replacing the files, create
is lit.
the backup files again and place them
in the autoload folder.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
Attached Attached Information 1: Error Details
information 0001 hex: The SD Memory Card was removed.
0102 hex: There are no backup files in the autoload folder on the SD Memory Card.
0103 hex: The backup files are corrupted.
0301 hex: Reading data for automatic transfer failed or the SD Memory Card is damaged.
Precautions/ None
Remarks

*1 This event code occurs for unit version 1.03 or later of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name SD Memory Card Program Transfer Pre-execution Check Event code 10330000 hex *1
Error
Meaning An error was detected in pre-execution checks for transferring SD Memory Card programs.
Source PLC Function Module Source details None Detection Before SD Mem-
timing ory Card pro-
grams are
transferred after
a Controller reset

12-2 Troubleshooting
Error attributes Level Major fault Recovery Cycle the power- Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables
_Card1PrgTransferSta _sPRGTRANSFER_STA SD Memory Card Program Transfer
Status
Cause and Assumed cause Correction Prevention
correction
An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
12
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card.
rect. SD or SDHC card.

12-2-4 Error Descriptions


The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card,
not correct. Sysmac Studio, create a folder speci- create a folder specified by the
fied by the _Card1PrgTransfer- _Card1PrgTransferCmd.DirName
Cmd.DirName system-defined system-defined variable on the card,
variable on the card, and store the and store the backup files in the
backup files in the folder. folder.
There is no such folder on the SD Create a folder specified by the Also, do not remove the SD Memory
Memory Card as specified by the _Card1PrgTransferCmd.DirName Card or turn OFF the power supply
_Card1PrgTransferCmd.DirName system-defined variable on the SD while the SD BUSY indicator is lit.
system-defined variable. Memory Card and store the backup
files in the folder.
There are no backup files in such a
folder on the SD Memory Card as
specified by the _Card1PrgTransfer-
Cmd.DirName system-defined vari-
able.
Either the backup files in the folder Replace the backup files in the folder
specified by the _Card1PrgTransfer- specified by the _Card1PrgTransfer-
Cmd.DirName system-defined vari- Cmd.DirName system-defined vari-
able on the SD Memory Card are able.
corrupted or required data is not in If this error occurs again even after
the backup files on the SD Memory replacing the files, create the backup
Card. files again and place them in the
folder specified by the _Card1Prg-
TransferCmd.DirName system-
defined variable.
The unit version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the unit version of the
which to transfer the files is older than Unit that has a unit version that is the CPU Unit and the unit version of the
the unit version of the backup files on same as or newer than the unit ver- backup files are compatible.
the SD Memory Card. sion of the CPU that was used to cre-
ate the backup files.
Or, place the backup files with the
correct unit version for the CPU Unit,
in the folder specified by the
_Card1PrgTransferCmd.DirName
system-defined variable.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-61


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction The model of the CPU Unit to which Replace the CPU Unit with a CPU Make sure that the model of the CPU
to transfer the files is not the same as Unit that has the same model as the Unit is the same as the model of the
the model of the CPU Unit of the CPU Unit that was used to create the CPU Unit that was used to create the
backup files on the SD Memory Card. backup files. backup files.
Or, place the backup files with the
correct model for the used CPU Unit,
in the folder specified by the
_Card1PrgTransferCmd.DirName
system-defined variable.
The CPU Unit is write-protected. If you transfer SD Memory Card pro- If you transfer SD Memory Card pro-
grams, select the Do not use Option grams, select the Do not use Option
for the Write protection at startup set- for the Write protection at startup set-
ting of the CPU Unit. ting of the CPU Unit.
Required files are not set to transfer Make sure that TRUE is set in the Make sure that TRUE is set in the
in the setting of the _Card1PrgTrans- _Card1PrgTransferCmd system- _Card1PrgTransferCmd system-
ferCmd system-defined variable. defined variable to transfer required defined variable to transfer required
files. files.
Reading the data for the SD Memory Perform the same corrective mea- Perform the same preventive mea-
Card program transfer failed because sures as for when the format of the sures as for the following events: SD
the SD Memory Card is faulty or not SD Memory Card is not correct or the Memory Card Invalid Format or Faulty
formatted correctly. SD Memory Card is damaged. SD Memory Card.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Or,
replace the SD Memory Card periodi-
cally according to the write life of the
SD Memory Card.
The database connection service ver- Replace the CPU Unit with a CPU Make sure that the database connec-
sion of the CPU Unit to which to Unit that has the same or a newer tion service version of the CPU Unit
transfer the files is older than the database connection service version and the database connection service
database connection service version than the database connection service version of the backup files are com-
of the backup files on the SD Memory version of the CPU Unit that was used patible.
Card. to create the backup files. Or, place
the backup files with the correct data-
base connection service version for
the CPU Unit, in the folder specified
by the _Card1PrgTransferCmd.Dir-
Name system-defined variable.
The robot version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the robot version of
which to transfer the files is older than Unit that has the same or a newer the CPU Unit and the robot version of
the robot version of the backup files robot version than the robot version of the backup files are compatible.
on the SD Memory Card. the CPU Unit that was used to create
the backup files. Or, place the backup
files with the correct robot version for
the CPU Unit, in the folder specified
by the _Card1PrgTransferCmd.Dir-
Name system-defined variable.

12-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Attached Attached Information 1: Error Details


information 0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory
Card is not the correct type of card.
0004 hex: Recovery was executed for the SD Memory Card.
0101 hex: There is no such folder on the SD Memory Card as specified by the _Card1PrgTransferCmd.DirName
system-defined variable.
0102 hex: There are no backup files in such a folder on the SD Memory Card as specified by the _Card1PrgTrans-

12-2 Troubleshooting
ferCmd.DirName system-defined variable.
0103 hex: The backup files are corrupted.
0104 hex: Required files are not set to transfer in the setting of the _Card1PrgTransferCmd system-defined vari-
able.
0105 hex: The required transfer data is not in the backup file.
0201 hex: The unit version of the CPU Unit is old.
0202 hex: The model numbers of the CPU Unit are not the same.
0203 hex: The CPU Unit is write-protected.
0211 hex: The database connection service or robot version of the CPU Unit is old.
0214 hex: The DIP switch on the CPU Unit is not set to allow starting the SD Memory Card program transfer. 12
0301 hex: Reading data for transferring the programs failed or the SD Memory Card is faulty.
Precautions/ None

12-2-4 Error Descriptions


Remarks

*1 This event code occurs for unit version 1.11 or later of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-63


12 Troubleshooting

Event name Error in Executing SD Memory Card Program Transfer Event code 10340000 hex *1
Meaning The SD Memory Card program transfer ended in an error.
Source PLC Function Module Source details None Detection During SD Mem-
timing ory Card program
transfers
Error attributes Level Major fault Recovery Cycle the power- Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables _Card1PrgTransferSta _sPRGTRANSFER_STA SD Memory Card Program Transfer
Status
Cause and Assumed cause Correction Prevention
correction
It was not possible to read the data for Format the SD Memory Card with the Do not remove the SD Memory Card
SD Memory Card program transfers. Sysmac Studio, create a folder speci- or turn OFF the power supply while
fied by the _Card1PrgTransfer- the SD BUSY indicator is lit. Or,
Cmd.DirName system-defined replace the SD Memory Card periodi-
variable on the card, and store the cally according to the write life of the
backup files in the folder. SD Memory Card.
The SD Memory Card was removed Insert an SD Memory Card that con- Do not remove the SD Memory Card
during a SD Memory Card program tains the backup files in the folder during the SD Memory Card program
transfer. specified by the _Card1PrgTransfer- transfer.
Cmd.DirName system-defined vari-
able, and then cycle the power supply
to execute the SD Memory Card pro-
gram transfer again.
There are no backup files in such a Create a folder specified by the Use a formatted SD Memory Card,
folder on the SD Memory Card as _Card1PrgTransferCmd.DirName create a folder specified by the
specified by the _Card1PrgTransfer- system-defined variable on the SD _Card1PrgTransferCmd.DirName
Cmd.DirName system-defined vari- Memory Card and store the backup system-defined variable on the card,
able. files in the folder. and store the backup files in the
folder.
The backup files in such a folder on Replace the backup files in the folder
the SD Memory Card as specified by specified by the _Card1PrgTransfer- Also, do not remove the SD Memory
the _Card1PrgTransferCmd.DirName Cmd.DirName system-defined vari- Card or turn OFF the power supply
system-defined variable are cor- able. If this error occurs again even while the SD BUSY indicator is lit.
rupted. after replacing the files, create the
backup files again and place them in
the folder specified by the _Card1Prg-
TransferCmd.DirName system-
defined variable.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Or,
replace the SD Memory Card periodi-
cally according to the write life of the
SD Memory Card.
Attached Attached Information 1: Error Details
information 0001 hex: The SD Memory Card was removed.
0102 hex: There are no backup files in such a folder on the SD Memory Card as specified by the _Card1PrgTrans-
ferCmd.DirName system-defined variable.
0103 hex: The backup files are corrupted.
0301 hex: Reading data for transferring the SD Memory Card programs failed or the SD Memory Card is faulty.
Precautions/ None
Remarks

*1 This event code occurs for unit version 1.11 or later of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name PLC Function Processing Error Event code 40110000 hex
Meaning A fatal error was detected in the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply.
Effects User program Stops. Operation Stops.*

12-2 Troubleshooting
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None 12
Remarks

* For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

12-2-4 Error Descriptions


Event name Safe Mode Event code 40160000 hex *1
Meaning The Controller started in Safe Mode.
Source PLC Function Module Source details None Detection At power ON or
timing Controller reset
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The power supply was turned ON to --- ---
the Controller when Safe Mode was
set on the DIP switch on the CPU
Unit.
Attached None
information
Precautions/ If the Controller is started when the CPU Unit is in Safe Mode, the user program is not executed even if the startup
Remarks mode is set to RUN mode.

*1 This event code occurs for unit version 1.02 or earlier of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-65


12 Troubleshooting

Event name PLC Function Processing Error Event code 44420000 hex*1
Meaning A fatal error was detected in the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Major fault Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Stops. Operation Stops.*2
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

*1 This event code occurs for unit version 1.05 or later of the CPU Unit.
*2 For details, refer to I/O Operation for Major Fault Level Controller Errors on page 12-11.

Event name PLC Function Processing Error Event code 40120000 hex
Meaning A fatal error was detected in the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Partial fault Recovery Cycle the power Log category System
supply.
Effects User program Stops. Operation Stops.*
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

* Operation is the same as for a major fault level error. For details, refer to I/O Operation for Major Fault Level Controller
Errors on page 12-11.

12-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name PLC Function Processing Error Event code 40130000 hex
Meaning A fatal error was detected in part of the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Minor fault Recovery Cycle the power Log category System
supply or reset
the Controller.

12-2 Troubleshooting
Effects User program Continues. Operation Operation is not affected.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction An error occurred in the software. Contact your OMRON representative. None
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information 12
Precautions/ None
Remarks

12-2-4 Error Descriptions


Event name Event Log Save Error Event code 10230000 hex
Meaning Saving the event log failed.
Source PLC Function Module Source details None Detection At power ON or
timing Controller reset
Error attributes Level Observation Recovery --- Log category System
Effects User program Starts. Operation Not affected. However, part or all of the past event log
cannot be read.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
A low battery voltage prevented Replace the Battery. Replace the battery periodically.
retention of memory during a power
interruption. (NJ/NX-series)
A forced shutdown was performed. None Perform a shutdown with other
(NY-series) method than the forced shutdown.
Data in the event log area are invalid. If the error persists even after you None
(NY-series) cycle the power to the Industrial PC, a
hardware failure may occur in the
event log area. Replace the Industrial
PC if you use the event logs in the
Industrial PC.
Data in the NX Unit event log area are If this error persists even after you None
invalid. (NX1P2 CPU Unit) cycle the power supply to the CPU
Unit, a hardware failure may occur in
the event log area. Replace the CPU
Unit if you use the event logs in the
CPU Unit.
Attached Attached information 1: Error Details
information 0: Failure to save all categories of logs,
1: Failure to save system event log,
2: Failure to save access event log,
100: Failure to save user-defined event log
Precautions/ None
Remarks

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-67


12 Troubleshooting

Event name Trace Setting Transfer Failure Event code 10260000 hex
Meaning The power supply was interrupted while transferring the trace settings.
Source PLC Function Module Source details None Detection At power ON or
timing Controller reset
Error attributes Level Observation Recovery Cycle the power Log category System
supply or reset
the Controller.
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The power supply was interrupted Transfer the trace settings again. Do not interrupt the power supply
while transferring the trace settings. while transferring the trace settings.
Attached None
information
Precautions/ All trace settings are initialized when this error occurs.
Remarks

Event name Backup Failed to Start Event code 10290000 hex*


Meaning An error was detected in pre-execution checks for a backup operation.
Source PLC Function Module Source details None Detection When backup is
timing specified by the
user
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---

12-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card.
rect. SD or SDHC card.
The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card.
not correct. Sysmac Studio. Also, do not remove the SD Memory
Card or turn OFF the power supply
while the SD BUSY indicator is lit.

12-2 Troubleshooting
The SD Memory Card is write pro- Remove write protection from the SD Make sure that the SD Memory Card
tected. Memory Card. is not write protected.
The Prohibiting backing up data to the Change the setting of the Prohibiting Set the Prohibiting backing up data to
SD Memory Card parameter is set to backing up data to the SD Memory the SD Memory Card parameter to
prohibit backing up data to an SD Card parameter to enable backing up enable backing up data to an SD
Memory Card. data to an SD Memory Card. Memory Card.
Another backup operation is in prog- Wait for the other backup operation to Do not attempt to perform other
ress. end and then perform the backup backup operation during a backup
operation again. operation.
Synchronization, online editing, or the Wait for the synchronization, online Do not attempt to perform a backup
12
Clear All Memory operation is in prog- editing, or the Clear All Memory oper- operation during a synchronization,
ress. ation to end and then perform the online editing, or the Clear All Mem-

12-2-4 Error Descriptions


backup operation again. ory operation.
The backup was canceled by the None None
user.
The online connection with the Sys- Check the cable connections. Go Check the cable to see if it is discon-
mac Studio was disconnected. offline and then go back online and nected or broken. Make sure the
execute the backup again. cable is connected properly.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
Attached Attached information 1: Operation type
information 0101 hex: Controller to SD Memory Card for switch operation on front of CPU Unit
0102 hex: Controller to SD Memory Card for system variable operation
0103 hex: Controller to SD Memory Card for Sysmac Studio operation
0104 hex: Controller to SD Memory Card for instruction operation.
0201 hex: Controller to computer
Attached Information 2: Error Details
0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory Card
is not the correct type of card.
0003 hex: The SD Memory Card is write protected.
0204 hex: SD Memory Card backup is prohibited.
0205 hex: Another backup operation is in progress.
0206 hex: Synchronization, online editing, or the Clear All Memory operation is in progress.
0207 hex: A prohibited character is used in the directory name that is specified in the system-defined variable.
0401 hex: The backup was canceled by the user.
0501 hex: The online connection with the Sysmac Studio was disconnected.
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-69


12 Troubleshooting

Event name Backup Failed Event code 102A0000 hex*


Meaning The backup operation ended in an error.
Source PLC Function Module Source details None Detection During backup
timing operation
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The capacity of the SD Memory Card Replace the SD Memory Card for one Use an SD Memory Card that has
is insufficient. with sufficient available space. sufficient available space.
It was not possible to save the data Perform the backup operation again Do not write to the CPU Unit when a
that was specified for backup. when no data write operation to the backup operation is in progress.
CPU Unit is in progress.
The SD Memory Card was removed Insert an SD Memory Card. Insert an SD Memory Card.
during a backup operation.
Failed to back up Unit or slave. Refer to the corrections for the follow- Refer to the prevention information for
ing events: CJ-series Unit Backup the following events: CJ-series Unit
Failed (102D0000 hex) or EtherCAT Backup Failed (102D0000 hex) or
Slave Backup Failed (102F0000 hex). EtherCAT Slave Backup Failed
(102F0000 hex).
The backup was canceled by the None None
user.
Execution of the Save Cam Table Perform the operation after execution Do not perform a backup during exe-
instruction or changing the CPU Unit of the Save Cam Table instruction or cution of the Save Cam Table instruc-
name is in progress. changing the CPU Unit name is com- tion or while changing the CPU Unit
pleted. name.
The online connection with the Sys- Check the cable connections. Go Check the cable to see if it is discon-
mac Studio was disconnected. offline and then go back online and nected or broken. Make sure the
execute the backup again. cable is connected properly.
It was not possible to save the data Increase the available space on the Make sure there is sufficient space
that was specified for backup to the hard disk on the computer. available on the hard disk before you
computer. perform a backup.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
Attached Attached information 1: Operation type
information 0101 hex: Controller to SD Memory Card for switch operation on front of CPU Unit
0102 hex: Controller to SD Memory Card for system variable operation
0103 hex: Controller to SD Memory Card for Sysmac Studio operation
0104 hex: Controller to SD Memory Card for instruction operation.
0201 hex: Controller to computer
Attached Information 2: Error Details
0001 hex: The SD Memory Card was removed.
0005 hex: There is not sufficient space available on the SD Memory Card.
0006 hex: Too many files or directories.
0206 hex: Execution of the Save Cam Table instruction or changing the CPU Unit name is in progress.
0210 hex: A file already exists with the same name as one of the specified directory.
0302 hex: Saving the backup data failed or the SD Memory Card is faulty.
0304 hex: The Unit or slave could not be backed up.
0401 hex: The backup was canceled by the user.
0501 hex: The online connection with the Sysmac Studio was disconnected.
0502 hex: It was not possible to save the data that was specified for backup to the computer.
Precautions/ None
Remarks

12-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

* This event code occurs for unit version 1.03 or later of the CPU Unit.

Event name Restore Operation Failed to Start Event code 102B0000 hex*
Meaning An error was detected in pre-execution checks for a restore operation.
Source PLC Function Module Source details None Detection When restoring
timing data is specified
by the user

12-2 Troubleshooting
Error attributes Level Observation Recovery --- Log category System
Effects User program --- Operation Not affected.
System-defined Variable Data type Name
variables
Specification with system-defined variables
_Card1RestoreSta _sRESTORE_STA SD Memory Card Restore Status

12

12-2-4 Error Descriptions

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-71


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card.
rect. SD or SDHC card.
The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card
not correct. Sysmac Studio and then place the and place the backup files on it. Also,
backup files on it. do not remove the SD Memory Card
There are no backup files on the SD Place the backup files in the specified or turn OFF the power supply while
the SD BUSY indicator is lit.
Memory Card. folder on the SD Memory Card.
Either the backup files on the SD Create the backup files again.
Memory Card are corrupted or
required data is not in the backup files
on the SD Memory Card.
The unit version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the unit version of the
which to restore the files is older than Unit that has a unit version that is the CPU Unit and the unit version of the
the unit version of the backup files on same as or newer than the unit ver- backup files are compatible.
the SD Memory Card. sion of the CPU Unit that was used to
create the backup files. Or, specify
backup files with the correct unit ver-
sion for the CPU Unit.
The model of the CPU Unit to which Replace the CPU Unit with a CPU Make sure that the model of the CPU
to restore the files is not the same as Unit that has the same model as the Unit is the same as the model of the
the model of the CPU Unit of the CPU Unit that was used to create the CPU Unit that was used to create the
backup files on the SD Memory Card. backup files. Or, specify backup files backup files.
with the correct model for the CPU
Unit.
Recovery was executed for the SD If there are no backup files or no None
Memory Card. restore command file in the specified
folder on the SD Memory Card, place
the files in the folder again.
The CPU Unit is write-protected. If you use the restore function, select If you use the restore function, select
the Do not use Option for the Write the Do not use Option for the Write
protection at startup setting of the protection at startup setting of the
CPU Unit. CPU Unit.
The settings in the restore command Make sure that the required files are Make sure that the required files are
file (RestoreCommand.ini) are not set to “Yes” in the restore command set to “Yes” in the restore command
correct. file. file.
A backup operation is in progress. Wait for the backup operation to end Do not attempt to perform a restore
and then perform the restore opera- operation during a backup operation.
tion again.
Synchronization, online editing, or the Wait for the synchronization, online Do not attempt to perform a restore
Clear All Memory operation is in prog- editing, or the Clear All Memory oper- operation during a synchronization,
ress. ation to end and then perform the online editing, or the Clear All Mem-
restore operation again. ory operation.
The online connection with the Sys- Check the cable connections. Go Check the cable to see if it is discon-
mac Studio was disconnected. offline and then go back online and nected or broken. Make sure the
execute the backup again. cable is connected properly.
Reading the data for restoration failed Perform the same corrective mea- Perform the same preventive mea-
because the SD Memory Card is sures as for when the format of the sures as for the following events: SD
faulty or not formatted correctly. SD Memory Card is not correct or the Memory Card Invalid Format or Faulty
SD Memory Card is damaged. SD Memory Card.

12-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Cause and The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
correction replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
The database connection service ver- Replace the CPU Unit with a CPU Make sure that the database connec-
sion of the CPU Unit to which to Unit that has a database connection tion service version of the CPU Unit
restore the files is older than the data- service version that is the same as or and the database connection service

12-2 Troubleshooting
base connection service version of newer than the database connection version of the backup files are com-
the backup files on the SD Memory service version of the CPU Unit that patible.
Card. was used to create the backup files.
Or, specify backup files with the cor-
rect database connection service ver-
sion for the CPU Unit.
The robot version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the robot version of
which to restore the files is older than Unit that has a robot version that is the CPU Unit and the robot version of
the robot version of the backup files the same as or newer than the robot the backup files are compatible.
on the SD Memory Card. version of the CPU Unit that was used
to create the backup files. Or, specify
12
backup files with the correct robot
version for the CPU Unit.

12-2-4 Error Descriptions


Check the followings for specification with system-defined variables.
Restore by system-defined variable is Set Restore by system-defined vari- Set Restore by system-defined vari-
set to Do not use in the Controller able to Use in the Controller Setup. able to Use in the Controller Setup.
Setup.
Password of Restore by system- Set Password of Restore by system- Set Password of Restore by system-
defined variable in the Controller defined variable in the Controller defined variable in the Controller
Setup does not agree with the Setup to the _Card1Resto- Setup to the _Card1Resto-
_Card1RestoreCmd.Password sys- reCmd.Password system-defined reCmd.Password system-defined
tem-defined variable. variable. variable.
The DIP switch on the CPU Unit is not Turn OFF all pins on the DIP switch of Turn OFF all pins on the DIP switch of
set to allow starting the restore of SD the CPU Unit, and then start the the CPU Unit, and then start the
Memory Card backups by specifica- restore of SD Memory Card backups restore of SD Memory Card backups
tion with system-defined variables. by specification with system-defined by specification with system-defined
variables. variables.
There is no such folder as specified Create a folder specified by the sys- Create a folder specified by the sys-
by the system-defined variable. tem-defined variable and store the tem-defined variable and store the
backup files in the folder. backup files in the folder.
Required files are not set to transfer Make sure that TRUE is set in the Make sure that TRUE is set in the
in the setting of the system-defined system-defined variable to transfer system-defined variable to transfer
variable. required files. required files.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-73


12 Troubleshooting

Attached Attached information 1: Operation type


information 0101 hex: SD Memory Card to Controller for switch operation on front of CPU Unit
0102 hex: SD Memory Card to Controller for specification with a system-defined variable
0201 hex: Computer to Controller
Attached Information 2: Error Details
0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory Card
is not the correct type of card.
0004 hex: Recovery was executed for the SD Memory Card.
0101 hex: There is no such folder on the SD Memory Card as specified by the _Card1RestoreCmd.DirName sys-
tem-defined variable.
0102 hex: There are no backup files.
0103 hex: The backup files are corrupted.
0104 hex: The contents of the restore command file are not correct or required files are not set to transfer in the
setting of the system-defined variable.
0105 hex: The required transfer data is not in the backup file.
0201 hex: The unit version of the CPU Unit is old.
0202 hex: The model numbers of the CPU Unit are not the same.
0203 hex: The CPU Unit is write-protected.
0205 hex: Another backup operation is in progress.
0206 hex: Synchronization, online editing, or the Clear All Memory operation is in progress.
0211 hex: The database connection service or robot version of the CPU Unit is old.
0212 hex: Restore by system-defined variable is set to Do not use in the Controller Setup.
0213 hex: Password of Restore by system-defined variable in the Controller Setup does not agree with the
_Card1RestoreCmd.Password system-defined variable.
0214 hex: The DIP switch on the CPU Unit is not set to allow starting the restore of SD Memory Card backups by
specification with system-defined variables.
0301 hex: Reading data for restoration failed or the SD Memory Card is faulty.
0501 hex: The online connection with the Sysmac Studio was disconnected.
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

12-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Restore Operation Failed Event code 102C0000 hex*


Meaning The restore operation ended in an error.
Source PLC Function Module Source details None Detection During restore
timing operation
Error attributes Level Observation Recovery --- Log category System
Effects User program --- Operation Not affected.
System-defined Variable Data type Name

12-2 Troubleshooting
variables _Card1RestoreSta _sRESTORE_STA SD Memory Card Restore Status
Cause and Assumed cause Correction Prevention
correction
It was not possible to read the data to Format the SD Memory Card with the Do not remove the SD Memory Card
restore. Sysmac Studio and then place the or turn OFF the power supply while
backup files on it. the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
The SD Memory Card was removed Insert an SD Memory Card that con- Do not remove the SD Memory Card 12
during a restore operation. tains the backup files, and then exe- during the restore operation.
cute the restore operation again.
Failed to restore Unit or slave. Refer to the corrections for the follow- Refer to the prevention information for

12-2-4 Error Descriptions


ing events: CJ-series Unit Restore the following events: CJ-series Unit
Operation Failed (102E0000 hex) or Restore Operation Failed (102E0000
EtherCAT Slave Restore Operation hex) or EtherCAT Slave Restore
Failed (10300000 hex). Operation Failed (10300000 hex).
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Replace
the SD Memory Card periodically
according to the write life of the SD
Memory Card.
Attached Attached information 1: Operation type
information 0101 hex: SD Memory Card to Controller for switch operation on front of CPU Unit
0102 hex: SD Memory Card to Controller for specification with a system-defined variable
0201 hex: Computer to Controller
Attached Information 2: Error Details
0001 hex: The SD Memory Card was removed.
0102 hex: There are no backup files.
0103 hex: The backup files are corrupted.
0301 hex: Reading data for restoration failed or the SD Memory Card is faulty.
0303 hex: The Unit or slave could not be restored.
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-75


12 Troubleshooting

Event name SD Memory Card Program Transfer Failed to Start Event code 1032 0000 hex *1
Meaning An error was detected in pre-start checks for transferring SD Memory Card programs.
Source PLC Function Module Source details None Detection When transfer-
timing ring SD Memory
Card programs is
started
Error attributes Level Observation Recovery --- Log category System
Effects User program --- Operation Not affected.
System-defined Variable Data type Name
variables
_Card1PrgTransferSta _sPRGTRANSFER_STA SD Memory Card Program Transfer
Status
Cause and Assumed cause Correction Prevention
correction Program transfer by system-defined Set Program transfer by system- Set Program transfer by system-
variable is set to Do not use in the defined variable to Use in the Control- defined variable to Use in the Control-
Controller Setup. ler Setup. ler Setup.
Password of Program transfer by sys- Set Password of Program transfer by Set Password of Program transfer by
tem-defined variable in the Controller system-defined variable in the Con- system-defined variable in the Con-
Setup does not agree with the troller Setup to the _Card1PrgTrans- troller Setup to the _Card1PrgTrans-
_Card1PrgTransferCmd.Password ferCmd.Password system-defined ferCmd.Password system-defined
system-defined variable. variable. variable.
The DIP switch on the CPU Unit is not Turn OFF all pins on the DIP switch of Turn OFF all pins on the DIP switch of
set to allow starting the SD Memory the CPU Unit, and then start the SD the CPU Unit, and then start the SD
Card program transfer. Memory Card program transfer. Memory Card program transfer.
An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card.
rect. SD or SDHC card.
The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card,
not correct. Sysmac Studio, create a folder speci- create a folder specified by the
fied by the _Card1PrgTransfer- _Card1PrgTransferCmd.DirName
Cmd.DirName system-defined system-defined variable on the card,
variable on the card, and store the and store the backup files in the
backup files in the folder. folder.
There is no such folder on the SD Create a folder specified by the Also, do not remove the SD Memory
Memory Card as specified by the _Card1PrgTransferCmd.DirName Card or turn OFF the power supply
_Card1PrgTransferCmd.DirName sys- system-defined variable on the SD while the SD BUSY indicator is lit.
tem-defined variable. Memory Card and store the backup
There are no backup files in such a files in the folder.
folder on the SD Memory Card as
specified by the _Card1PrgTransfer-
Cmd.DirName system-defined vari-
able.
Either the backup files in the folder Replace the backup files in the folder
specified by the _Card1PrgTransfer- specified by the _Card1PrgTransfer-
Cmd.DirName system-defined vari- Cmd.DirName system-defined vari-
able on the SD Memory Card are able.
corrupted or required data is not in the If this error occurs again even after
backup files on the SD Memory Card. replacing the files, create the backup
files again and place them in the
folder specified by the _Card1Prg-
TransferCmd.DirName system-
defined variable.

12-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction The unit version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the unit version of the
which to transfer the files is older than Unit that has a unit version that is the CPU Unit and the unit version of the
the unit version of the backup files on same as or newer than the unit ver- backup files are compatible.
the SD Memory Card. sion of the CPU that was used to cre-
ate the backup files.
Or, place the backup files with the
correct unit version for the CPU Unit,
in the folder specified by the

12-2 Troubleshooting
_Card1PrgTransferCmd.DirName
system-defined variable.
The model of the CPU Unit to which to Replace the CPU Unit with a CPU Make sure that the model of the CPU
transfer the files is not the same as Unit that has the same model as the Unit is the same as the model of the
the model of the CPU Unit of the CPU Unit that was used to create the CPU Unit that was used to create the
backup files on the SD Memory Card. backup files. backup files.
Or, place the backup files with the
correct model for the used CPU Unit,
in the folder specified by the
_Card1PrgTransferCmd.DirName 12
system-defined variable.
The CPU Unit is write-protected. If you transfer SD Memory Card pro- If you transfer SD Memory Card pro-
grams, select the Do not use Option grams, select the Do not use Option

12-2-4 Error Descriptions


for the Write protection at startup set- for the Write protection at startup set-
ting of the CPU Unit. ting of the CPU Unit.
Another backup operation is in prog- Wait for the other backup operation to Do not attempt to perform other
ress. end and then perform the backup backup operation during a backup
operation again. operation.
Synchronization, online editing, or the Wait for the synchronization, online Do not attempt to perform a backup
Clear All Memory operation is in prog- editing, or the Clear All Memory oper- operation during a synchronization,
ress. ation to end and then perform the online editing, or the Clear All Mem-
backup operation again. ory operation.
Required files are not set to transfer in Make sure that TRUE is set in the Make sure that TRUE is set in the
the setting of the _Card1PrgTransfer- _Card1PrgTransferCmd system- _Card1PrgTransferCmd system-
Cmd system-defined variable. defined variable to transfer required defined variable to transfer required
files. files.
Reading the data for the SD Memory Perform the same corrective mea- Perform the same preventive mea-
Card program transfer failed because sures as for when the format of the sures as for the following events: SD
the SD Memory Card is faulty or not SD Memory Card is not correct or the Memory Card Invalid Format or Faulty
formatted correctly. SD Memory Card is damaged. SD Memory Card.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Or,
replace the SD Memory Card periodi-
cally according to the write life of the
SD Memory Card.
The database connection service ver- Replace the CPU Unit with a CPU Make sure that the database connec-
sion of the CPU Unit to which to trans- Unit that has the same or a newer tion service version of the CPU Unit
fer the files is older than the database database connection service version and the database connection service
connection service version of the than the database connection service version of the backup files are com-
backup files on the SD Memory Card. version of the CPU Unit that was used patible.
to create the backup files.
Or, place the backup files with the
correct database connection service
version for the CPU Unit, in the folder
specified by the _Card1PrgTransfer-
Cmd.DirName system-defined vari-
able.
The robot version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the robot version of
which to transfer the files is older than Unit that has the same or a newer the CPU Unit and the robot version of
the robot version of the backup files robot version than the robot version of the backup files are compatible.
on the SD Memory Card. the CPU Unit that was used to create
the backup files.
Or, place the backup files with the
correct robot version for the CPU
Unit, in the folder specified by the
_Card1PrgTransferCmd.DirName
system-defined variable.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-77


12 Troubleshooting

Attached Attached Information 1: Error Details


information 0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory Card
is not the correct type of card.
0004 hex: Recovery was executed for the SD Memory Card.
0101 hex: There is no such folder on the SD Memory Card as specified by the _Card1PrgTransferCmd.DirName
system-defined variable.
0102 hex: There are no backup files in such a folder on the SD Memory Card as specified by the _Card1PrgTrans-
ferCmd.DirName system-defined variable.
0103 hex: The backup files are corrupted.
0104 hex: Required files are not set to transfer in the setting of the _Card1PrgTransferCmd system-defined vari-
able.
0105 hex: The required transfer data is not in the backup file.
0201 hex: The unit version of the CPU Unit is old.
0202 hex: The model numbers of the CPU Unit are not the same.
0203 hex: The CPU Unit is write-protected.
0205 hex: Another backup operation is in progress.
0206 hex: Synchronization, online editing, or the Clear All Memory operation is in progress.
0211 hex: The database connection service or robot version of the CPU Unit is old.
0212 hex: Program transfer by system-defined variable is set to Do not use in the Controller Setup.
0213 hex: Password of Program transfer by system-defined variable in the Controller Setup does not agree with the
_Card1PrgTransferCmd.Password system-defined variable.
0214 hex: The DIP switch on the CPU Unit is not set to allow starting the SD Memory Card program transfer.
0301 hex: Reading data for transferring the programs failed or the SD Memory Card is faulty.
Precautions/ None
Remarks

*1 This event code occurs for unit version 1.11 or later of the CPU Unit.

12-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Restore Pre-execution Check Failure Event code 103E0000 hex*1

Meaning An error was detected in pre-execution checks for specification with system-defined variables for the SD Memory Card
restore operation.
Source PLC Function Module Source details None Detection Before the
timing restore operation
after a Controller
reset in Restore
by system-

12-2 Troubleshooting
defined variable
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.

System-defined Variable Data type Name


variables
_Card1RestoreSta _sRESTORE_STA SD Memory Card Restore Status
Cause and Assumed cause Correction Prevention
correction An SD Memory Card is not inserted. Insert an SD Memory Card. Insert an SD Memory Card.
The SD Memory Card type is not cor- Replace the SD Memory Card with an Use an SD or SDHC card. 12
rect. SD or SDHC card.
The format of the SD Memory Card is Format the SD Memory Card with the Use a formatted SD Memory Card,
not correct. Sysmac Studio, create a folder speci- create a folder specified by the

12-2-4 Error Descriptions


fied by the _Card1RestoreCmd.Dir- _Card1RestoreCmd.DirName sys-
Name system-defined variable on the tem-defined variable on the card, and
card, and store the backup files in the store the backup files in the folder.
folder. Also, do not remove the SD Memory
There is no such folder on the SD Create a folder specified by the Card or turn OFF the power supply
Memory Card as specified by the _Card1RestoreCmd.DirName sys- while the SD BUSY indicator is lit.
_Card1RestoreCmd.DirName sys- tem-defined variable on the SD Mem-
tem-defined variable. ory Card and store the backup files in
the folder.
There are no backup files in such a
folder on the SD Memory Card as
specified by the _Card1Resto-
reCmd.DirName system-defined vari-
able.
Either the backup files in the folder Replace the backup files in the folder
specified by the _Card1Resto- specified by the _Card1Resto-
reCmd.DirName system-defined vari- reCmd.DirName system-defined vari-
able on the SD Memory Card are able.
corrupted or required data is not in If this error occurs again even after
the backup files on the SD Memory replacing the files, create the backup
Card. files again and place them in the
folder specified by the _Card1Resto-
reCmd.DirName system-defined vari-
able.
The unit version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the unit version of the
which to transfer the files is older than Unit that has a unit version that is the CPU Unit and the unit version of the
the unit version of the backup files on same as or newer than the unit ver- backup files are compatible.
the SD Memory Card. sion of the CPU that was used to cre-
ate the backup files.
Or, place the backup files with the
correct unit version for the CPU Unit,
in the folder specified by the
_Card1RestoreCmd.DirName sys-
tem-defined variable.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-79


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction The model of the CPU Unit to which Replace the CPU Unit with a CPU Make sure that the model of the CPU
to transfer the files is not the same as Unit that has the same model as the Unit is the same as the model of the
the model of the CPU Unit of the CPU Unit that was used to create the CPU Unit that was used to create the
backup files on the SD Memory Card. backup files. backup files.
Or, place the backup files with the
correct model for the used CPU Unit,
in the folder specified by the
_Card1RestoreCmd.DirName sys-
tem-defined variable.
The CPU Unit is write-protected. If you transfer SD Memory Card pro- If you transfer SD Memory Card pro-
grams, select the Do not use Option grams, select the Do not use Option
for the Write protection at startup set- for the Write protection at startup set-
ting of the CPU Unit. ting of the CPU Unit.
Required files are not set to transfer Make sure that TRUE is set in the Make sure that TRUE is set in the
in the setting of the system-defined system-defined variable to transfer system-defined variable to transfer
variable. required files. required files.
Reading the data for the SD Memory Perform the same corrective mea- Perform the same preventive mea-
Card program transfer failed because sures as for when the format of the sures as for the following events: SD
the SD Memory Card is faulty or not SD Memory Card is not correct or the Memory Card Invalid Format or Faulty
formatted correctly. SD Memory Card is damaged. SD Memory Card.
The SD Memory Card is damaged. If none of the above causes applies, Do not remove the SD Memory Card
replace the SD Memory Card. or turn OFF the power supply while
the SD BUSY indicator is lit. Or,
replace the SD Memory Card periodi-
cally according to the write life of the
SD Memory Card.
The database connection service ver- Replace the CPU Unit with a CPU Make sure that the database connec-
sion of the CPU Unit to which to Unit that has the same or a newer tion service version of the CPU Unit
transfer the files is older than the database connection service version and the database connection service
database connection service version than the database connection service version of the backup files are com-
of the backup files on the SD Memory version of the CPU Unit that was used patible.
Card. to create the backup files. Or, specify
backup files with the correct database
connection service version for the
CPU Unit.
The robot version of the CPU Unit to Replace the CPU Unit with a CPU Make sure that the robot version of
which to transfer the files is older than Unit that has the same or a newer the CPU Unit and the robot version of
the robot version of the backup files robot version than the robot version of the backup files are compatible.
on the SD Memory Card. the CPU Unit that was used to create
the backup files. Or, specify backup
files with the correct robot version for
the CPU Unit.
Attached Attached Information 1: Operation type
information 0102 hex: SD Memory Card to Controller for specification with a system-defined variable
Attached Information 2: Error Details
0001 hex: An SD Memory Card is not inserted.
0002 hex: The SD Memory Card is faulty, the format of the SD Memory Card is not correct, or the SD Memory
Card is not the correct type of card.
0004 hex: Recovery was executed for the SD Memory Card.
0101 hex: There is no such folder on the SD Memory Card as specified by the _Card1RestoreCmd.DirName sys-
tem-defined variable.
0102 hex: There are no backup files in such a folder on the SD Memory Card as specified by the _Card1Resto-
reCmd.DirName system-defined variable.
0103 hex: The backup files are corrupted.
0104 hex: Required files are not set to transfer in the setting of the system-defined variable.
0105 hex: The required transfer data is not in the backup file.
0201 hex: The unit version of the CPU Unit is old.
0202 hex: The model numbers of the CPU Unit are not the same.
0203 hex: The CPU Unit is write-protected.
0211 hex: The database connection service or robot version of the CPU Unit is old.
0214 hex: The DIP switch on the CPU Unit is not set to allow starting the restore of SD Memory Card backups by
specification with system-defined variables.
0301 hex: Reading data for transferring the programs failed or the SD Memory Card is faulty.

12-80 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Precautions/ None
Remarks

*1 This event code occurs for unit version 1.14 or later of the CPU Unit

12-2 Troubleshooting
12

12-2-4 Error Descriptions

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-81


12 Troubleshooting

Event name PLC System Information Event code 40140000 hex


Meaning This event provides internal information from the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Operation is not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
This event provides internal informa- --- ---
tion from the PLC Function Module. It
is recorded to provide additional infor-
mation for another event.
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

Event name Safe Mode Event code 40170000 hex*


Meaning The Controller started in Safe Mode.
Source PLC Function Module Source details None Detection At power ON or
timing Controller reset
Error attributes Level Observation Recovery --- Log category System
Effects User program Stops. Operation ---
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The Controller started in Safe Mode. --- ---
Attached None
information
Precautions/ If the Controller is started when the CPU Unit is in Safe Mode, the CPU Unit will start in PROGRAM mode even if the
Remarks startup mode is set to RUN mode.

* This event code occurs for unit version 1.03 or later of the CPU Unit.

12-82 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name NX Message Communications Error Event code 80230000 hex*


Meaning An error has occurred in message communications.
Source PLC Function Module, Source details None Detection During NX mes-
timing sage communi-
EtherCAT Master Function Module,
cations
EtherNet/IP Function Module, or NX
Bus Function Module
Error attributes Level Observation Recovery --- Log category System

12-2 Troubleshooting
Effects User program Continues. Operation ---
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The communications cable is broken. Check the communications cable and Check the communications cable to
replace it if it is broken. see if it is operating properly.
Attached The communications cable connec- Reconnect the connector and make Make sure the communications cable
information tor is disconnected. sure it is mated correctly. is connected properly.
12
The NX message communications Reduce the number of times that Reduce the number of times that
load is high. instructions are used to send NX instructions are used to send NX
messages. Or, increase the value of messages. Or, increase the value of

12-2-4 Error Descriptions


the TimeOut input variable to the the TimeOut input variable to the
instruction. If more than one copy of instruction. If more than one copy of
the Sysmac Studio is connected, the Sysmac Studio is connected,
reduce the frequency of simultaneous reduce the frequency of simultaneous
operations. operations.
Precautions/ Attached Information 1: System Information
Remarks Attached Information 2: Type of Communications
0: NX bus
1: EtherCAT
65,535: Unit internal communications (routing)

* This event code occurs for unit version 1.05 or later of the CPU Unit.

Event name PLC System Information Event code 40150000 hex


Meaning This event provides internal information from the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Operation is not affected.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction This event provides internal informa- --- ---
tion from the PLC Function Module. It
is recorded to provide additional infor-
mation for another event.
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-83


12 Troubleshooting

Event name PLC System Information Event code 44430000 hex*


Meaning This event provides internal information from the PLC Function Module.
Source PLC Function Module Source details None Detection Continuously
timing
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Operation is not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
This event provides internal informa- --- ---
tion from the PLC Function Module. It
is recorded to provide additional infor-
mation for another event.
Attached Attached information 1: System information
information Attached Information 2: System information
Attached information 3: System information
Attached information 4: System information
Precautions/ None
Remarks

* This event code occurs for unit version 1.05 or later of the CPU Unit.

Event name Clock Changed Event code 90010000 hex


Meaning The clock time was changed.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_CurrentTime DATE_AND_TIME System Time
Cause and Assumed cause Correction Prevention
correction The clock time was changed. --- ---
Attached Attached information 1: Time before change
information
Precautions/ Clock changes by the Set Time instruction (SetTime) are not recorded in the event log.
Remarks The time stamp for this event will be for the time after the change.

Event name Time Zone Changed Event code 90020000 hex


Meaning The time zone was changed.
Source PLC Function Module Source details None Detection When download-
timing ing
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
_CurrentTime DATE_AND_TIME System Time
Cause and Assumed cause Correction Prevention
correction The time zone was changed. --- ---
Attached None
information
Precautions/ None
Remarks

12-84 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name User Program/Controller Configurations and Setup Down- Event code 90050000 hex*
loaded
Meaning The user program and the Controller configurations and setup were downloaded.
Source PLC Function Module Source details None Detection During user pro-
timing gram/Controller
configurations
and setup down-
load

12-2 Troubleshooting
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Operation starts according to the user program and the
Controller setup data that were downloaded.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The user program and the Controller --- ---
configurations and setup were down-
loaded. 12
Attached Attached Information 1: Connection method
information 1: Direct USB connection

12-2-4 Error Descriptions


2: Direct Ethernet connection
3: Remote USB connection or Ethernet hub connection
Attached Information 2: Connecting IP address, Connection through proxy: Proxy IP address
(When attached information 1 is 2 or 3)
Attached information 3: Device Output Hold Status
1: Retained.
2: Not retained.
Precautions/ None
Remarks

* This event code occurs for unit version 1.10 or later of the CPU Unit.

Event name Online Edits Transferred Event code 90070000 hex*


Meaning The user program was edited online.
Source PLC Function Module Source details None Detection When transfer-
timing ring online edits
is started
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Operation is performed according to the changed user
program.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The user program was edited online --- ---
and the edits were transferred to the
Controller.
Attached Attached Information 1: Connection method
information 1: Direct USB connection
2: Direct Ethernet connection
3: Remote USB connection or Ethernet hub connection
Attached Information 2: Connecting IP address, Connection through proxy: Proxy IP address
(When attached information 1 is 2 or 3)
Precautions/ None
Remarks

* This event code occurs for unit version 1.10 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-85


12 Troubleshooting

Event name Variable Changed to TRUE with Forced Refreshing Event code 90080000 hex
Meaning Changing a variable to TRUE with forced refreshing was specified.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Operation is performed according to the forced refreshing
values.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
Changing a variable to TRUE with --- ---
forced refreshing was specified by the
user.
Attached None
information
Precautions/ None
Remarks

Event name Variable Changed to FALSE with Forced Refreshing Event code 90090000 hex
Meaning Changing a variable to FALSE with forced refreshing was specified.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Operation is performed according to the forced refreshing
values.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
Changing a variable to FALSE with --- ---
forced refreshing was specified by the
user.
Attached None
information
Precautions/ None
Remarks

Event name All Forced Refreshing Cleared Event code 900A0000 hex
Meaning Clearing all forced refreshing values was specified.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Forced refreshing values are all cleared and operation is
performed according to the user program.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
Clearing all forced refreshing values --- ---
was specified by the user.
Attached None
information
Precautions/ None
Remarks

12-86 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Memory All Cleared Event code 900B0000 hex


Meaning All of memory was cleared.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program --- Operation Operation returns to the factory state.
System-defined Variable Data type Name

12-2 Troubleshooting
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
A user with Administrator rights --- ---
cleared all of the memory.
Attached None
information
Precautions/ None
Remarks
12
Event name Event Log Cleared Event code 900C0000 hex

12-2-4 Error Descriptions


Meaning The event log was cleared.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The event log was cleared by the --- ---
user.
Attached Attached information 1: Cleared events 0: All log categories were cleared
information 1: The system event log was cleared.
2: The access event log was cleared.
100: The user-defined event log was cleared.
Precautions/ None
Remarks

Event name Automatic Transfer Completed Event code 900F0000 hex*


Meaning The automatic transfer was completed.
Source PLC Function Module Source details None Detection At power ON
timing
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Operation starts according to the Controller Configura-
tions and Setup data that was automatically transferred.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The automatic transfer was com- --- ---
pleted.
Attached None
information
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-87


12 Troubleshooting

Event name Power Turned ON Event code 90110000 hex


Meaning The power supply was turned ON.
Source PLC Function Module Source details None Detection At power ON
timing
Error attributes Level Information Recovery --- Log category System
Effects User program ---- Operation Operation starts.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The power supply was turned ON. --- ---
Attached None
information
Precautions/ None
Remarks

Event name Power Interrupted Event code 90120000 hex


Meaning The power supply was interrupted.
Source PLC Function Module Source details None Detection At power inter-
timing ruption
Error attributes Level Information Recovery --- Log category System
Effects User program Stops. Operation All operations stops.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The power supply was interrupted. --- ---
Attached None
information
Precautions/ None
Remarks

Event name Operation Started Event code 90130000 hex


Meaning Operation was started.
Source PLC Function Module Source details None Detection When changing
timing to RUN mode
Error attributes Level Information Recovery --- Log category System
Effects User program Starts. Operation User program execution starts.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
A command to start operation was --- ---
received.
Attached Attached information 1: Device Output Hold Status
information 1: Retained.
2: Not retained.
Precautions/ None
Remarks

12-88 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Operation Stopped Event code 90140000 hex


Meaning Operation was stopped.
Source PLC Function Module Source details None Detection When changing
timing to PROGRAM
mode
Error attributes Level Information Recovery --- Log category System
Effects User program Stops. Operation User program execution stops.

12-2 Troubleshooting
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
A command to stop operation was --- ---
received.
Attached Attached information 1: Device Output Hold Status
information 1: Retained.
2: Not retained.
12
Precautions/ None
Remarks

12-2-4 Error Descriptions


Event name Reset Executed Event code 90150000 hex
Meaning A reset was executed.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program --- Operation Operation is started after a reset is executed.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction A reset command was received. --- ---
Attached None
information
Precautions/ None
Remarks

Event name User Program Execution ID Write Event code 90160000 hex
Meaning The user program execution ID was set or changed in the CPU Unit.
Source PLC Function Module Source details None Detection When download-
timing ing
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
A user with Administrator rights --- ---
changed the user program execution
ID that is set in the CPU Unit.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-89


12 Troubleshooting

Event name All Controller Errors Cleared Event code 90180000 hex
Meaning All current errors were cleared.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Clearing all errors for which the causes have been
removed.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
The user cleared all current errors. --- ---
Attached None
information
Precautions/ None
Remarks

Event name Forced Refreshing Cleared Event code 90190000 hex


Meaning Clearing a forced refreshing value was specified.
Source PLC Function Module Source details None Detection Commands from
timing user
Error attributes Level Information Recovery --- Log category Access
Effects User program Continues. Operation Forced refreshing values are cleared and operation is per-
formed according to the user program.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction
Clearing a forced refreshing value --- ---
was specified by the user.
Attached None
information
Precautions/ None
Remarks

Event name Backup Started Event code 901A0000 hex*


Meaning A backup operation was started.
Source PLC Function Module Source details None Detection At start of backup
timing operation
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
A backup operation was started. --- ---
Attached Attached information 1: Operation type
information 0101 hex: Controller to SD Memory Card for switch operation on front of CPU Unit
0102 hex: Controller to SD Memory Card for system variable operation
0103 hex: Controller to SD Memory Card for Sysmac Studio operation
0104 hex: Controller to SD Memory Card for instruction operation
0201 hex: Controller to computer
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

12-90 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Backup Completed Event code 901B0000 hex*


Meaning The backup operation ended normally.
Source PLC Function Module Source details None Detection At end of normal
timing backup operation
Error attributes Level Information Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name

12-2 Troubleshooting
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The backup operation ended nor- --- ---
mally.
Attached Attached information 1: Operation type
information 0101 hex: Controller to SD Memory Card for switch operation on front of CPU Unit
0102 hex: Controller to SD Memory Card for system variable operation
0103 hex: Controller to SD Memory Card for Sysmac Studio operation 12
0104 hex: Controller to SD Memory Card for instruction operation
0201 hex: Controller to computer

12-2-4 Error Descriptions


Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

Event name Restore Operation Started Event code 901C0000 hex*


Meaning A restore operation started.
Source PLC Function Module Source details None Detection At start of restore
timing operation
Error attributes Level Information Recovery --- Log category System
Effects User program --- Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction A restore operation started. --- ---
Attached Attached information 1: Operation type
information 0101 hex: SD Memory Card to Controller for switch operation on front of CPU Unit
0102 hex: SD Memory Card to Controller for specification with a system-defined variable
0201 hex: Computer to Controller
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-91


12 Troubleshooting

Event name Restore Operation Completed Event code 901D0000 hex*


Meaning The restore operation ended normally.
Source PLC Function Module Source details None Detection At end of normal
timing restore operation
Error attributes Level Information Recovery --- Log category System
Effects User program --- Operation Operation does not start after the completion of a restore
operation. To start operation according to the restored
user program and settings, turn OFF the power supply to
the Controller, turn OFF all pins on the DIP switch on the
CPU Unit, and then turn ON the power supply again.
System-defined Variable Data type Name
variables
_Card1RestoreSta _sRESTORE_STA SD Memory Card Restore Status
Cause and Assumed cause Correction Prevention
correction
The restore operation ended nor- --- ---
mally.
Attached Attached information 1: Operation type
information 0101 hex: SD Memory Card to Controller for switch operation on front of CPU Unit
0102 hex: SD Memory Card to Controller for specification with a system-defined variable
0201 hex: Computer to Controller
Precautions/ None
Remarks

* This event code occurs for unit version 1.03 or later of the CPU Unit.

Event name SD Memory Card Program Transfer Started Event code 90200000 hex *1
Meaning Transferring the SD Memory Card programs was started.
Source PLC Function Module Source details None Detection When transfer-
timing ring SD Memory
Card programs is
started
Error attributes Level Information Recovery --- Log category System
Effects User program --- Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction Transferring the SD Memory Card --- ---
programs was started.
Attached None
information
Precautions/ None
Remarks
*1 This event code occurs for unit version 1.11 or later of the CPU Unit.

12-92 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name SD Memory Card Program Transfer Completed Event code 90210000 hex *1
Meaning Transferring the SD Memory Card programs was completed.
Source PLC Function Module Source details None Detection When transfer-
timing ring SD Memory
Card programs is
completed
Error attributes Level Information Recovery --- Log category System

12-2 Troubleshooting
Effects User program --- Operation Not affected.
System-defined Variable Data type Name
variables _Card1PrgTransferSta _sPRGTRANSFER_STA SD Memory Card Program Trans-
fer Status
Cause and Assumed cause Correction Prevention
correction
Transferring the SD Memory Card --- ---
programs was completed.
Attached None
information
Precautions/ None 12
Remarks
*1 This event code occurs for unit version 1.11 or later of the CPU Unit.

12-2-4 Error Descriptions

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-93


12 Troubleshooting

Errors Related to FINS Communications

Event name CPU Bus Unit Setup Area Error Event code 14010000 hex
Meaning An error was detected in the memory check of the Setup Area for CPU Bus Units.
Source PLC Function Module Source details None Detection At power ON, at
timing Controller reset,
or when writing
CPU Bus Unit
Setup Area
Error attributes Level Minor fault Recovery Error reset or Log category System
cycling power
supply
Effects User program Continues. Operation The CPU Bus Unit may stop.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The power supply to the Controller Clear all memory or download the Do not interrupt the power supply to
was interrupted or communications CPU Bus Unit Settings. If this error the Controller or disconnect commu-
with the Sysmac Studio were discon- persists, replace the CPU Unit. nications with the Sysmac Studio
nected while downloading the CPU while downloading the CPU Bus Unit
Bus Unit Settings. Settings.
Attached None
information
Precautions/ None
Remarks

Event name IP Address Table Setting Error Event code 34100000 hex
Meaning The IP address table settings are incorrect.
Source PLC Function Module Source details None Detection At power ON,
timing Controller reset,
or restart of built-
in Ethernet port
Error attributes Level Minor fault Recovery Error reset Log category System
Effects User program Continues. Operation FINS/UDP communications will not operate.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
The IP address conversion method is Correct the IP address table settings. Set the IP address table correctly.
set to the combined method or the IP
address table method, but the IP
address table settings are incorrect.
Attached None
information
Precautions/ None
Remarks

12-94 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name FINS/TCP Connection Table Setting Error Event code 34130000 hex
Meaning The FINS/TCP connection table is incorrect.
Source PLC Function Module Source details None Detection At power ON,
timing Controller reset,
or restart of built-
in Ethernet port
Error attributes Level Minor fault Recovery Error reset Log category System

12-2 Troubleshooting
Effects User program Continues. Operation FINS/UDP communications will not operate.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The power supply to the Controller Download the FINS/TCP connection Do not interrupt the power supply to
was interrupted or communications table again. the Controller or disconnect commu-
with the Sysmac Studio were discon- nications with the Sysmac Studio
nected while downloading the while downloading the FINS/TCP
FINS/TCP connection table. connection table.
12
Attached None
information
Precautions/ None

12-2-4 Error Descriptions


Remarks

Event name Unknown Destination Node Event code 34110000 hex


Meaning The send destination node is not known.
Source PLC Function Module Source details None Detection At FINS message
timing reception
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected. Packets are discarded.
System-defined Variable Data type Name
variables
None --- ---
Cause and Assumed cause Correction Prevention
correction The send destination node was not Correct the setting of the send desti- Set the send destination node for
found when a FINS message was nation node for FINS/UDP communi- FINS/UDP communications correctly.
sent. cations. Or, check the source FINS Or, make sure that the destination
message and correct the destination node address in the source FINS
node address. message is correct.
Attached None
information
Precautions/ None
Remarks

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-95


12 Troubleshooting

Event name Packet Discarded Event code 80100000 hex


Meaning One or more packets were discarded.
Source PLC Function Module Source details None Detection At FINS message
timing reception
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
A FINS response addressed to the Correct the contents of the FINS mes- Set the FINS messages correctly.
CPU Unit was received. sage at the source.
The send designation Unit for the
FINS response does not exist.
Attached Attached information 1: Cause of packet discard (01 hex: FINS response addressed to CPU Unit received, 02 hex:
information Response send failed)
Precautions/ None
Remarks

12-96 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

Event name Packet Discarded Event code 80110000 hex


Meaning One or more packets were discarded.
Source PLC Function Module Source details None Detection At FINS message
timing reception
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name

12-2 Troubleshooting
variables None --- ---
Cause and Assumed cause Correction Prevention
correction
1. An attempt was made to send a Do not send a FINS response with Set the FINS message at the source
FINS response with over 2002 over 2002 bytes. correctly.
bytes.
2. An attempt was made to route a
FINS response with over 2002
bytes.
3. Packet was received with a No Check the FINS message at the 12
Such Unit routing error. source and correct the unit number in
the response frame or a command
frame that does not require a

12-2-4 Error Descriptions


response.
4. Packet was received with a Rout- Check the FINS message at the
ing Error routing error. source and correct the unit number in
the response frame or a command
frame that does not require a
response to a unit number that is in
the routing table.
5. Packet was received with a Rout- Check the FINS message at the
ing Table Not Registered routing source, and correct the routing table
error. include the network address of the
destination network.
6. Packet was received with an Check the FINS message at the
Event Area Size Over Limit rout- source and correct the event area
ing error. size in the response frame or a com-
mand frame that does not require a
response so that it does not exceed
the limit.
7. There is insufficient space in the Reduce the frequency of sending Keep the frequency of sending FINS
internal buffer. FINS messages at the source. messages as low as possible.
8. FINS message routing failed
because the communications
load is too high.
Attached Attached information 1: Cause of discarding packets
information 1: 01 hex, 2: 02 hex, 3: 03 hex, 4: 04 hex, 5: 05 hex, 6: 06 hex, 7: 07 hex, 8: 08 hex
The numbers refer to the numbers of the above causes.
Precautions/ None
Remarks

Event name Packet Discarded Event code 80120000 hex


Meaning One or more packets were discarded.
Source PLC Function Module Source details None Detection At FINS message
timing reception
Error attributes Level Observation Recovery --- Log category System
Effects User program Continues. Operation Not affected.
System-defined Variable Data type Name
variables
None --- ---

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-97


12 Troubleshooting

Cause and Assumed cause Correction Prevention


correction 1. A FINS response was received Correct the IP address table settings. Make sure that the IP address table
with the destination network settings are correct.
address (DNA) set to the local
network and the destination node
address (DA1) not set to the local
node.
2. A FINS command or response Correct the FINS message at the Make sure that the FINS message at
was received with a hub network source so that the hub network the source does not have a hub net-
address specification for which address specification does not spec- work address specification that speci-
the destination network address ify a destination network address fies a destination network address
(DNA) was greater than or equal (DNA) that is greater than or equal to (DNA) that is greater than or equal to
to 80 hex. 80 hex. 80 hex.
3. There is insufficient space in the Reduce the frequency of sending Keep the frequency of sending FINS
internal buffer. FINS messages at the source. messages as low as possible.
4. A FINS command that does not Correct the FINS command at the Set the FINS commands at the
have the minimum command source so that it has at least the mini- sources so that they have at least the
length was received. mum command length. minimum command length.
5. A FINS command that exceeded Correct the FINS command at the Set the FINS commands at the
the maximum command length source so that it does not exceed the sources so that they do not exceed
was received. maximum command length. the maximum command length.
6. Sending packets failed. If the destination node is not in the Confirm that the destination node is in
network, add it to the network. the network.
7. FINS message routing failed Reduce the frequency of sending Keep the frequency of sending FINS
because the communications FINS messages at the source. Or, messages as low as possible. Or, set
load is too high. Or a command correct the source network address the correct source network address
that was addressed to the built-in (SNA) in the source FINS message. (SNA) in the source FINS message.
EtherNet/IP port was received
with the source network address
(SNA) set to 0.
8. A FINS response that was Correct the contents of the FINS mes- Set the FINS messages correctly.
addressed to the built-in Ether- sage at the source.
Net/IP port was received.
9. A FINS response or a command Register the routing tables. Register the routing tables.
for which a response is not
required was received when the
routing tables were not regis-
tered.
A: A FINS response or a command Register the routing tables again. If None
for which a response is not there is an error in the routing tables,
required was received when there there will be an Illegal User Pro-
was an error in the routing tables. gram/Controller Configurations and
Setup (10250000 hex) error.
B: A FINS response or a command Increase the set value of the gateway Set the gateway counter in the routing
for which a response is not counter in the routing table at the table at the source so that it is suit-
required was received that source. able for the system configuration.
exceeded the number of relay
points.
C: Transmission is not possible Register the destination address in Register the destination address in
because the destination address the routing tables. the routing tables.
is not set in the routing tables.
D: Routing is not possible because Set the FINS node address in the If you set the lower eight bits of the IP
the FINS node address setting in Built-in EtherNet/IP Port Settings to address in the TCP/IP Settings in the
the Built-in EtherNet/IP Port Set- any value other than 0 or 255 from Built-in EtherNet/IP Port Settings to 0
tings is set to 0 or 255. the Sysmac Studio. or 255, set the IP Address-FINS
Address Conversion Method to any
setting other than Automatic Genera-
tion.
Attached Attached Information 1: Cause of Discarding Packets
information 1: 01 hex, 2: 02 hex, 3: 03 hex, 4: 04 hex, 5: 05 hex, 6: 06 hex, 7: 07 hex, 8: 08 hex, 9: 09 hex, A: 0A hex, B: 0B hex,
C: 0C hex, D: 0D hex
The numbers correspond to the above cause numbers.
Precautions/ None
Remarks

12-98 NJ/NX-series CPU Unit Software User’s Manual (W501)


12 Troubleshooting

12-2-5 Troubleshooting Errors That Are Not in the CPU Unit

Security Errors

No. Problem Correction

12-2 Troubleshooting
1 Forgot the Administrator password. You cannot access the Administrator’s password. Always
record the Administrator password so that you do not for-
get it.
2 Cannot release the operation lock with Log in with verification authority that is equal to or higher
the Sysmac Studio. than the verification rights when you connected online.
3 Operation was locked when verifying If the password for verification of operation authority is
operation authority on the Sysmac entered incorrectly five time in row, operation is locked for
Studio. 10 minutes. Wait until the operation lock is released.
4 An online connection was made with Verification of operation authority is required every time 12
the operation authority that is required for the following functions to prevent hazards to equip-
for operation, but operation authority ment and people.
verification was requested for a spe-

12-2-5 Troubleshooting Errors That Are Not in the CPU Unit


• I/O monitoring (writing) by an Operator
cific operation.
• Operating mode change by a Maintainer
• Online editing by a Maintainer
5 Cannot release the operation lock with You can release the operation lock with an operation
the Sysmac Studio after the operator authority that is equal to or higher than the operator. The
left the Sysmac Studio unattended. required operation authority will be that of an operator
(the operation authority that was verified when going
online with the Sysmac Studio).
6 Some of the user program data cannot The source data was not downloaded along with the user
be read for certain operations. program. You will be able to read the data if you down-
• Monitoring load the user program normally.
Variables
• Operation Commands
SET/RESET, forced refreshing,
online editing, data tracing, MC Test
Run, and setting the user program
execution ID in the CPU Unit
• Synchronizing, Uploading, Verifica-
tion, and Backup
POU algorithms
7 Writing to the CPU Unit is not possible The CPU Unit is write protected. Release the write pro-
for some operations. tection.
• Names
CPU Unit name
• Operation Commands
Online editing, Clear All Memory,
event log clearing, and setting the
user program execution ID in the
CPU Unit
• Synchronizing and Downloading
User program, CPU/Expansion
Rack Configuration and Setup, Eth-
erCAT Settings, Controller Setup,
Axis Settings, Cam Table Settings,
Data Trace Settings, User-defined
Event Setup, restoring

NJ/NX-series CPU Unit Software User’s Manual (W501) 12-99


12 Troubleshooting

No. Problem Correction


8 I do not know how to change the user The user program execution ID cannot be changed or
program execution ID. deleted after it is set.
9 I forgot the user program execution ID There is no way to access the user program execution ID
assigned to user program. that is set. Always record the user program execution ID
so that you do not forget it.
10 I forgot the user program execution ID This is no way to access the user program execution ID
that is registered in the CPU Unit. that is set. Set the user program execution ID again. You
can also clear the user program execution ID if you exe-
cute the Clear All Memory operation.

12-100 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices
The appendices provide the CPU Unit specifications, real processing times of tasks,
system-defined variable lists, and other supplemental information for the body of this
manual. A

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-10
A-2 Calculating Guidelines for the Real Processing Times of
Tasks for the NX701 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-18
A-2-1 Calculating the Average Real Processing Times of Tasks . . . . . . . . . . . . . . . A-19
A-2-2 Example of Calculating the Average Real Processing Time of a
Task and Setting the Task Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-26
A-3 Calculating Guidelines for the Real Processing Times of
Tasks for the NX1P2 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-29
A-3-1 Calculating the Average Real Processing Times of Tasks . . . . . . . . . . . . . . . A-30
A-3-2 Example of Calculating the Average Real Processing Time of a
Task and Setting the Task Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-36
A-4 Calculating Guidelines for the Real Processing Times of
Tasks for the NJ-series System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-39
A-4-1 Calculating the Average Real Processing Times of Tasks . . . . . . . . . . . . . . . A-40
A-4-2 Example of Calculating the Average Real Processing Time of a
Task and Setting the Task Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-50
A-5 System-defined Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-54
A-5-1 System-defined Variables for the Overall NJ/NX-series
Controller (No Category) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-55
A-5-2 PLC Function Module, Category Name: _PLC . . . . . . . . . . . . . . . . . . . . . . . A-65
A-5-3 PLC Function Module, Category Name: _CJB . . . . . . . . . . . . . . . . . . . . . . . A-70
A-5-4 NX Bus Function Module, Category Name: _NXB . . . . . . . . . . . . . . . . . . . . A-72
A-5-5 Motion Control Function Module, Category Name: _MC . . . . . . . . . . . . . . . . A-75
A-5-6 EtherCAT Master Function Module, Category Name: _EC . . . . . . . . . . . . . . A-78
A-5-7 EtherNet/IP Function Module, Category Name: _EIP . . . . . . . . . . . . . . . . . . A-83
A-5-8 Meanings of Error Status Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-110
A-6 Specifications for Individual System-defined Variables . . . . . . . . . . . . . A-112

NJ/NX-series CPU Unit Software User’s Manual (W501) A-1


Appendices

A-6-1 System-defined Variables for the Overall NJ/NX-series


Controller (No Category) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-113
A-6-2 PLC Function Module, Category Name: _PLC . . . . . . . . . . . . . . . . . . . . . . .A-130
A-6-3 PLC Function Module, Category Name: _CJB . . . . . . . . . . . . . . . . . . . . . . .A-135
A-6-4 NX Bus Function Module, Category Name: _NXB . . . . . . . . . . . . . . . . . . . .A-140
A-6-5 Motion Control Function Module, Category Name: _MC . . . . . . . . . . . . . . .A-143
A-6-6 EtherCAT Master Function Module, Category Name: _EC . . . . . . . . . . . . . .A-147
A-6-7 EtherNet/IP Function Module, Category Name: _EIP . . . . . . . . . . . . . . . . . .A-156
A-7 Attributes of CPU Unit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-181
A-8 Contents of Memory Used for CJ-series Units . . . . . . . . . . . . . . . . . . . . .A-185
A-8-1 CIO Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-185
A-8-2 Internal I/O Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-187
A-8-3 Holding Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-188
A-8-4 DM Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-188
A-8-5 EM Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-189
A-9 Variable Memory Allocation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-190
A-9-1 Variable Memory Allocation Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-190
A-9-2 Important Case Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-198
A-10 Registering a Symbol Table on the CX-Designer . . . . . . . . . . . . . . . . . . .A-202
A-11 Enable/Disable EtherCAT Slaves and Axes . . . . . . . . . . . . . . . . . . . . . . .A-205
A-11-1 Project Settings When Using EtherCAT Slaves and Axes . . . . . . . . . . . . . .A-205
A-11-2 Using Instructions to Enable/Disable EtherCAT Slaves and Axes . . . . . . . .A-205
A-11-3 System-defined Variables That Indicate EtherCAT Slave or Axis Status . . .A-206
A-11-4 Enabling/Disabling Execution of Program . . . . . . . . . . . . . . . . . . . . . . . . . . .A-207
A-11-5 Checking Enabled/Disabled Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-207
A-11-6 Settings with the Sysmac Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-207
A-11-7 Examples of Applications of Enabling/Disabling EtherCAT Slaves
and Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-208
A-12 Size Restrictions for the User Program . . . . . . . . . . . . . . . . . . . . . . . . . .A-211
A-12-1 User Program Object Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-211
A-12-2 Counting User Program Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-215
A-13 Replacing CPU Units with Unit Version 1.02 or Earlier . . . . . . . . . . . . . .A-217
A-13-1 Uploading the Data from the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-217
A-13-2 Connecting the New CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-220
A-13-3 Downloading the Data to the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-221
A-14 Version Information for NX-series Controllers . . . . . . . . . . . . . . . . . . . . .A-225
A-14-1 Relationship Between Unit Versions of CPU Units and
Sysmac Studio Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-225
A-14-2 Functions That Were Added or Changed for Each Unit
Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-227
A-15 Version Information for NJ-series Controllers . . . . . . . . . . . . . . . . . . . . .A-228
A-15-1 Relationship between Unit Versions of CPU Units and
Sysmac Studio Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-228
A-15-2 Relationship between Hardware Revisions of CPU Units and
Sysmac Studio Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A-230
A-15-3 Functions That Were Added or Changed for Each Unit Version . . . . . . . . . .A-231
A-15-4 Performance Improvements for Unit Version Upgrades . . . . . . . . . . . . . . . .A-234

A-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-1 Specifications
This section gives the specifications of the NJ/NX-series Controllers.

A-1-1 General Specifications


Refer to the following hardware manuals for general specifications.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NX-series NX1P2 CPU Unit Hardware User's Manual (Cat. No. W578)
• NJ-series CPU Unit Hardware User's Manual (Cat. No. W500)

A-1 Specifications
A-1-2 Performance Specifications
NX701- NX1P2- NJ501- NJ301- NJ101-
Item
    
0.37 ns or more 3.3 ns 1.2 ns (1.9 ns 2.0 ns (3.0 ns 3.3 ns (5.0 ns
LD instruction
Process-
Instruction
execution
or less)*1 or less) or less)
A
ing time Math instructions (for long 3.2 ns or more 70 ns or more 42 ns or more 70 ns or more
times 26 ns or more*2
real data)
Size 80 MB 1.5 MB 20 MB 5 MB 3 MB

A-1-1 General Specifications


Number of 6,000 450 3,000 750 450
POU defini-
Program
tions
capacity*3 Quantity
Number of 48,000 1,800 9,000 (*) 3,000 (*) 1,800
POU
Instances
Size 4 MB 32 KB*5 2 MB 0.5 MB
Retain attri-
*4 Number of 40,000 5,000 10,000 5,000 (*)
Memory butes
variables
capacity for
variables Size 256 MB 2 MB 4 MB 2 MB
No Retain
*6 Number of 360,000 90,000 90,000 22,500
attributes
Program- variables
ming Data types Number of data types 8,000 1,000 2,000 1,000
--- 6,144 words (CIO 0 to 6,144 words (CIO 0 to CIO 6143)
CIO Area
CIO 6143)*7
--- 512 words (W0 to 512 words (W0 to W511)
Memory for Work Area
W511)*7
CJ-series
--- 1,536 words (H0 to 1,536 words (H0 to H1535)
Units (Can be Holding Area
specified with H1535)*8
AT specifica- --- 16,0000 words (D0 to 32,768 words (D0 to D32767)
DM Area
tions for vari- D15999)*8
ables.) --- --- 32,768 words × 32,768 words × 4 banks
25 banks (E0_00000 to E3_32767)
EM Area
(E0_00000 to
E18_32767)
Motion control Refer to Performance Specifications of Motion Control for Each Type of CPU Units on page A-7.
Sysmach Studio --- Sysmach Studio connection
Supported services
connection
Periph-
USB 2.0-compli- --- USB 2.0-compliant B-type connector
eral USB
Physical layer ant B-type con-
port
nector
Transmission distance 5 m max. --- 5 m max.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-3


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Number of ports 2 1
10BASE- 10BASE-T/100BASE-TX
Physical layer T/100BASE-TX/
1000BASE-T
Frame length 1,514 bytes max.
Media access method CSMA/CD
Modulation Baseband
Topology Star
1 Gbps 100 Mbps (100BASE-TX)
Baud rate
(1000BASE-T)
Transmission media STP (shielded, twisted-pair) cable of Ethernet category 5, 5e or higher
Maximum transmission distance between 100 m
Ethernet switch and node
Maximum number of cascade connections There are no restrictions if an Ethernet switch is used.
Maximum number of con- 256 per port 32
nections 512 total
Can be set for 2 to 10,000 ms in 1.0- 1 to 10,000 ms in 1.0-ms increments (*)
each connec- ms increments (*) Can be set for each connection.
tion. Can be set for each
Packet interval*8
0.5 to 10,000 ms connection.
in 0.5-ms incre-
ments
40,000 pps*10 3,000 pps*9 (including heartbeat) (*)
Permissible communica-
(including heart-
tions band
beat)
Maximum number of tag 256 per port 32
sets 512 total
Network vari- Network variables, Network variables, CIO, Work, Holding, DM, and
Tag types ables CIO, Work, Holding EM Areas
and DM Areas
CIP service:
Number of tags per connec- 8 (7 tags if Controller status is included in the tag set.)
Built-in Tag data links
tion (i.e., per tag set)
Ether- (cyclic com-
munications) 256 per port 256
Net/IP Maximum number of tags
port 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 (1 connection = 1 tag set)
Maximum number of regis- 512 total
trable tag sets (1 connection =
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 Controller
Maximum tag set size
status is
included in the
tag set.)
Multi-cast packet filter*11 Supported
128 per port 32 (clients plus server)
Class 3 (number of connec- 256 total
tions) (clients plus
server)
Maximum 32 per port 32
number of 64 total
CIP message clients that
service: can com-
Explicit mes- municate at
sages UCMM (non- one time
connection
type) Maximum 32 per port 32
number of 64 total
servers that
can com-
municate at
one time
Number of TCP sockets 30 (*)

A-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Built-in Communications standard IEC 61158 Type12
Ether- EtherCAT master specifications Class B (Feature Pack Motion Control compliant)
CAT port Physical layer 100BASE-TX
Modulation Baseband
Baud rate 100 Mbps (100BASE-TX)
Duplex mode Auto
Topology Line, daisy chain, and branching
Twisted-pair cable of category 5 or higher (double-shielded straight cable with aluminum tape
Transmission media
and braiding)
Maximum transmission distance between 100 m
nodes
Maximum number of slaves 512 16 192 64

A-1 Specifications
Range of node addresses that can be set 1 to 512 1 to 192
Inputs: 11,472 Inputs: 1,434 bytes Inputs: 5,736 bytes
bytes Outputs: 1,434 bytes Outputs: 5,736 bytes
Outputs: 11,472 However, the maxi- However, the maximum number of process data
bytes mum number of pro- frames is 4.
Maximum process data size
However, the cess data frames is 1.
Built-in maximum num-
Ether- ber of process
CAT port data frames is 8.

Maximum process data size per slave


Inputs: 1,434 bytes A
Outputs: 1,434 bytes
• Primary peri- 2,000 µs to 8,000 ms 500, 1,000, 2,000, or 4,000 µs (*) 1,000, 2,000,
odic task (in 250-µs incre- or 4,000 µs

A-1-2 Performance Specifications


125 µs ments)

250 µs to 8 ms
(in 250-µs incre-
ments)
Communications cycle
• Priority-5 peri-
odic task
125 µs
250 µs to 100
ms (in 250-µs
increments)
Sync jitter 1 µs max.
--- Half duplex (when ---
connected to the
Communications method
Serial Communica-
tions Option Board)
--- Start-stop synchroni- ---
zation (when con-
Serial
Synchronization method nected to the Serial
commu-
Communications
nications
Option Board)
--- 1.2/2.4/4.8/9.6/19.2/3 ---
8.4/57.6/115.2 kbps
Baud rate (when connected to
the Serial Communi-
cations Option Board)

NJ/NX-series CPU Unit Software User’s Manual (W501) A-5


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Maximum number of CJ --- 10
Units per CPU Rack or
Expansion Rack
Maximum number of NX --- 8 ---
Maximum Units per CPU Rack
number of
Maximum number of CJ --- 40
connectable
Units for entire controller
Units
4,096 24 4,096 400
Maximum number of NX (On EtherCAT (On CPU Rack: 8 and (On EtherCAT Slave Terminals) (On EtherCAT
Units for entire controller Slave Terminals) on EtherCAT Slave Slave Termi-
Unit con- nals)
Terminals: 16)
figura-
tion Maximum number of Expansion Racks 0 3
Maximum number of I/O --- 2,560
I/O capacity
points on CJ-series Units
NX-PA9001 A non-isolated power NJ-P3001
NX-PD7001 supply for DC input is
Power Supply Model
built into the CPU
Unit for CPU Unit.
Rack and
AC power 30 to 45 ms --- 30 to 45 ms
Expansion Power OFF
supply
Racks detection
time DC power 5 to 20 ms 2 to 8 ms 22 to 25 ms
supply
Option --- *12 ---
Number of slots
Board
Input Number of points --- *13 ---
Built-in Number of points --- *14 ---
I/O Output --- *15 ---
Load short-circuit
protection
At ambient temperature of 55°C: −3.5 to +0.5 min error per month
At ambient temperature of 25°C: −1.5 to +1.5 min error per month
Internal
Accuracy At ambient temperature of 0°C: −3 to +1 min error per month
clock
--- At ambient tempera- ---
Retention time of built-in capacitor ture of 40°C: 10 days
*1 When the hardware revision for the Unit is A, the processing time is 1.1 ns (1.7 ns or less).
*2 When the hardware revision for the Unit is A, the processing time is 24 ns or more.
*3 Execution objects and variable tables (including variable names)
*4 Does not include Holding, DM, and EM Area memory for CJ-series Units.
*5 Memory for CJ-series Units is included.
*6 Does not include CIO and Work Area memory for CJ-series Units.
*7 Variables without a Retain attribute are used. The value can be set in 1-word increments.
*8 Variables with a Retain attribute are used. The value can be set in 1-word increments.
*9 Data will be refreshed at the set interval, regardless of the number of nodes.
*10 “pps” means packets per second, i.e., the number of communications packets that can be sent or received in one second.
*11 As the EtherNet/IP port implements the IGMP client, unnecessary multi-cast packets can be filtered by using an Ethernet switch that supports IGMP Snoop-
ing.
*12 NX1P2-40: 2 and NX1P2-24: 1
*13 NX1P2-40: 24 and NX1P2-24: 14
*14 NX1P2-40: 16 and NX1P2-24: 10
*15 NX1P2-: Not provided (NPN) and NX1P2-1: Provided (PNP)

Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to A-
14 Version Information for NX-series Controllers and A-15 Version Information for NJ-series Controllers for information
on version upgrades.

A-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Performance Specifications of Motion Control for Each Type of CPU Units

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

A-1-2 Performance Specifications


Position units Pulse, mm, µm, nm, degree, and inch
Override factors 0.00%, or 0.01% to 500.00%

*1 Refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) for descriptions of axes.

NX1P2-
Item
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-7


Appendices

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
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
Maximum number of cam tables 160 tables
Position units Pulse, mm, µm, nm, degree, and inch
Override factors 0.00%, or 0.01% to 500.00%

*1 Refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) for descriptions of axes.
Note Items that are marked with asterisks in the table are improvements that were made during version upgrades. Refer to A-14 Version Information for NX-
series Controllers and A-15 Version Information for NJ-series Controllers for information on version upgrades.

A-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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

A-1 Specifications
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 A
Cams points
Maximum points for 262,140 points ---
all cam tables

A-1-2 Performance Specifications


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-9


Appendices

A-1-3 Function Specifications

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
I/O refresh and the user program are executed in units that are called tasks. Tasks
Function
are used to specify execution conditions and execution priority.
Maximum 1
Periodi- number of pri-
cally mary periodic
exe- tasks
cuted Maximum 4 2 3
tasks number of peri-
odic tasks
Tasks
Condi- Maximum 32
tionally number of
exe- event tasks
cuted Execution con- When Activate Event Task instruction is executed or when condition expression for
tasks (*) ditions variable is met
--- The execution interval and the percentage of
System Service Monitor- the total user program execution time are moni-
Setup
ing Settings tored for the system services (processes that
are executed by the CPU Unit separate from

POUs (pro- Programs POUs that are assigned to tasks.


gram orga- Function blocks POUs that are used to create objects with specific conditions.
nization POUs that are used to create an object that determine unique outputs for the inputs,
units) Functions
such as for data processing.
Program- Ladder diagrams*1 and structured text (ST)
ming Types
languages
Namespaces (*) Namespaces are used to create named groups of POU definitions.
External The function which allows access from the HMI, host computers, or other Control-
access Network vari- lers
Variables
Pro- of vari- ables
gram- ables
ming Boolean BOOL
Bit strings BYTE, WORD, DWORD, and LWORD
Integers INT, SINT, DINT, LINT, UINT, USINT, UDINT, and ULINT
Real numbers REAL and LREAL
Basic
Durations TIME
data
Data types Dates DATE
types
Times of day TIME_OF_DAY
Dates and DATE_AND_TIME
times
Text strings STRING
Derivative data types Structures, Unions, and Enumerations

A-10 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Function A derivative data type that groups together data with different data types.
Maximum 2,048
number of
members
Nesting maxi- 8
Struc-
mum levels
tures
Member data Basic data types, structures, unions, enumerations, or array variables
types
Specifying You can use member offsets to place structure members at any memory locations.
Data types member off-
sets (*)

A-1 Specifications
A derivative data type that enables access to the same data with different data
Function
types.
Maximum 4
Union number of
Pro- members
gram- Member data BOOL, BYTE, WORD, DWORD, and LWORD
ming types
Enumer- A derivative data type that uses text strings called enumerators to express variable
Function
ation values.
An array is a group of elements with the same data type. You specify the number A
Function
(subscript) of the element from the first element to specify the element.
Maximum 3

A-1-3 Function Specifications


number of
Array dimensions
specifi- Maximum 65,535
Data type cations number of ele-
attributes ments
Array specifi- Supported
cations for FB
instances
You can specify a range for a data type in advance. The data type can take only val-
Range specifications
ues that are in the specified range.
Libraries (*) You can use user libraries.

Control modes Position control, Velocity control, and Torque control


Axis types Servo axes, Virtual servo axes, Encoder axes, and Virtual encoder axes
Positions that can be managed Command positions and actual positions
Absolute posi- Positioning is performed for a target position that is specified with an absolute
tioning value.
Relative posi- Positioning is performed for a specified travel distance from the command current
Single- tioning position.
axis Interrupt feed- Positioning is performed for a specified travel distance from the position where an
position ing interrupt input was received from an external input.
control Cyclic syn- A positioning command is output each control period in Position Control Mode.
Motion chronous
control absolute posi-
*2
tioning (*)
Single axes
Velocity con- Velocity control is performed in Position Control Mode.
Single- trol
axis Cyclic syn- A velocity command is output each control period in Velocity Control Mode.
velocity chronous
control velocity con-
trol
Single- The torque of the motor is controlled.
axis
Torque control
torque
control

NJ/NX-series CPU Unit Software User’s Manual (W501) A-11


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Starting cam A cam motion is performed using the specified cam table.
operation
Ending cam The cam motion for the axis that is specified with the input parameter is ended.
operation
Starting gear A gear motion with the specified gear ratio is performed between a master axis and
operation slave axis.
Single-
Positioning gear A gear motion with the specified gear ratio and sync position is performed between
axis
operation a master axis and slave axis.
synchro-
nized Ending gear The specified gear motion or positioning gear motion is ended.
operation
control
Synchronous Positioning is performed in sync with a specified master axis.
positioning
Master axis The phase of a master axis in synchronized control is shifted.
phase shift
Combining The command positions of two axes are added or subtracted and the result is out-
axes put as the command position.
Single- Powering the The Servo in the Servo Drive is turned ON to enable axis motion.
axis Servo
manual An axis is jogged at a specified target velocity.
opera- Jogging
tion
Resetting axis Axes errors are cleared.
errors
A motor is operated and the limit signals, home proximity signal, and home signal
Homing
are used to define home.
Homing with The parameters are specified, the motor is operated, and the limit signals, home
specified proximity signal, and home signal are used to define home.
parameters (*)
High-speed Positioning is performed for an absolute target position of 0 to return to home.
Motion homing
control Single axes
*2
Stopping An axis is decelerated to a stop.
Immediately An axis is stopped immediately.
stopping
Setting over- The target velocity of an axis can be changed.
ride factors
Changing the The command current position or actual current position of an axis can be changed
current posi- to any position.
Auxil- tion
iary Enabling exter- The position of an axis is recorded when a trigger occurs.
func- nal latches
tions for Disabling The current latch is disabled.
single- external
axis latches
control Zone monitor- You can monitor the command position or actual position of an axis to see when it is
ing within a specified range (zone).
Enabling digi- You can turn a digital output ON and OFF according to the position of an axis.
tal cam
switches (*)
Monitoring You can monitor whether the difference between the command positions or actual
axis following positions of two specified axes exceeds a threshold value.
error
Resetting the The error between the command current position and actual current position is set to
following error 0.
The torque control function of the Servo Drive can be enabled or disabled and the
Torque limit
torque limits can be set to control the output torque.
Command The function which compensate the position for the axis in operation.
position com-
pensation
Start velocity You can set the initial velocity when axis motion starts.
(*)

A-12 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Absolute lin- Linear interpolation is performed to a specified absolute position.
ear interpola-
tion
Multi- Relative linear Linear interpolation is performed to a specified relative position.
axes interpolation
coordi- Circular 2D Circular interpolation is performed for two axes.
nated interpolation
control Axes group A positioning command is output each control period in Position Control Mode.
cyclic synchro-
nous absolute
positioning (*)
Resetting axes Axes group errors and axis errors are cleared.

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-3 Function Specifications


control factors
Reading axes The command current positions and actual current positions of an axes group can
group posi- be read.
tions (*)
Changing the The Composition Axes parameter in the axes group parameters can be overwritten
Motion axes in an axes temporarily.
control group (*)
*2 Setting cam The end point index of the cam table that is specified in the input parameter is
table proper- changed.
ties
Cams Saving cam The cam table that is specified with the input parameter is saved in non-volatile
tables memory in the CPU Unit.
Common
Generating The cam table is generated from the cam property and cam node that is specified in
items
cam tables (*) input parameters.
Writing MC set- Some of the axis parameters or axes group parameters are overwritten temporarily.
Parame- tings
ters Changing axis Some of the axis parameters can be accessed or changed from the user program.
parameters (*)
Count modes You can select either Linear Mode (finite length) or Rotary Mode (infinite length).
Unit conversions You can set the display unit for each axis according to the machine.
Automatic Jerk is set for the acceleration/deceleration curve for an axis motion or axes group
accelera- motion.
Acceler- tion/decelera-
ation/de
tion control
celera-
Changing the You can change the acceleration or deceleration rate even during acceleration or
tion con-
trol acceleration deceleration.
and decelera-
tion rates
Auxiliary
You can set an in-position range and in-position check time to confirm when posi-
functions In-position check
tioning is completed.
Stop method You can set the stop method to the immediate stop input signal or limit input signal.
Re-execution of motion You can change the input variables for a motion control instruction during execution
control instructions and execute the instruction again to change the target values during operation.
Multi-execution of motion You can specify when to start execution and how to connect the velocities between
control instructions (Buf- operations when another motion control instruction is executed during operation.
fer Mode)
Continuous axes group You can specify the Transition Mode for multi-execution of instructions for axes
motions group operation.
(Transition Mode)

NJ/NX-series CPU Unit Software User’s Manual (W501) A-13


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Software limits The movement range of an axis is monitored.
The error between the command current value and the actual current value is mon-
Following error
itored for an axis.
Velocity, acceler- You can set and monitor warning values for each axis and each axes group.
ation rate, decel-
Monitor- eration rate,
ing func- torque, interpola-
tions tion velocity,
Auxiliary
interpolation
Motion functions acceleration rate,
control and interpola-
*2 tion decelera-
tion rate
You can use an OMRON 1S-seies or G5-series Servomotor with an Absolute
Absolute encoder support
Encoder to eliminate the need to perform homing at startup.
Input signal logic inversion You can inverse the logic of immediate stop input signal, positive limit input signal,
(*) negative limit input signal, or home proximity input signal.
The Servo Drive input signals listed on the right are used.
External interface signals Home signal, home proximity signal, positive limit signal, negative limit signal,
immediate stop signal, and interrupt input signal
Unit EtherCAT Maximum number of 512 16 192 64
(I/O) slaves slaves
manage- CJ-series Maximum number of --- 40
ment Units Units
A port for --- A port for communications with various kinds of
communica- Support Software running on a personal com-
tions with vari- puter.
ous kinds of
Peripheral (USB) port
Support Soft-
ware running
on a personal
computer.
Communications protocol TCP/IP and UDP/IP
CIP Programless cyclic data exchange is performed with the devices on the EtherNet/IP
Tag data links
commu- network.
nica- CIP commands are sent to or received from the devices on the EtherNet/IP net-
Message com-
tions work.
munications
services
Data is sent to and received from any node on Ethernet using the UDP or TCP proto-
Socket services
Commu- col. Socket communications instructions are used.
nica- EtherNet/IP Files are transferred via FTP from the CPU Unit to computers or Controllers at other
tions FTP client (*)
port Ethernet nodes. FTP client communications instructions are used.
Files can be read from or written to the SD Memory Card in the CPU Unit from com-
TCP/IP FTP server
puters at other Ethernet nodes.
applica-
tions Automatic Clock information is read from the NTP server at the specified time or at a specified
clock adjust- interval after the power supply to the CPU Unit is turned ON. The internal clock time
ment in the CPU Unit is updated with the read time.
Built-in EtherNet/IP port internal status information is provided to network manage-
SNMP agent ment software that uses an SNMP manager.

Process data A communications method to exchange control information in cyclic communica-


communica- tions between the EtherCAT master and slaves.
Sup- tions This communications method is defined by CoE.
EtherCAT
ported
port A communications method to exchange control information in noncyclic event com-
services SDO communi- munications between EtherCAT master and slaves.
cations
This communications method is defined by CoE.

A-14 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Information is read from connected slave devices and the slave configuration is
Network scanning
automatically generated.
Time is synchronized by sharing the EtherCAT system time among all EtherCAT
DC (distributed clock)
devices (including the master).
The frames that are sent by the master and the frames that are received by the
Packet monitoring master can be saved. The data that is saved can be viewed with WireShark or other
applications. (*)
EtherCAT
port 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.
Support SDO messages of the CAN application can be sent to slaves via EtherCAT

A-1 Specifications
applica-
CoE
Commu- tion pro-
nica- tocol
tions --- Host link (FINS), ---
no-protocol, and
Modbus-RTU
Serial com- master (when
Protocol
munications connected to the
Serial Commu-
nications Option A
Board)
FTP client instructions, CIP com- FTP client instructions (*), CIP communications

A-1-3 Function Specifications


munications instructions, socket instructions, socket communications instruc-
communications instructions, tions, SDO message instructions, no-protocol
Communications instructions SDO message instructions, no- communications instructions, protocol macro
protocol communications instruc- instructions, and Modbus RTU protocol instruc-
tions, and Modbus RTU protocol tions (*)
instructions (*)
Opera- The output on --- The output on the Power Supply Unit turns ON
tion the Power in RUN mode.
man- RUN output contacts Supply Unit
age- turns ON in
ment RUN mode.
Function Events are recorded in the logs
Sys- System event 2,048 576*3 1,024 512
Maxi- log
tem
mum
man- Event logs Access event 1,024 528*4 1,024 512
age- number
log
of
ment User-defined 1,024 512 1,024 512
events
event log

NJ/NX-series CPU Unit Software User’s Manual (W501) A-15


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
Programs, function blocks, functions, and global variables can be changed online.
Online editing
More than one operators can change POUs individually via network.
Forced refreshing The user can force specific variables to TRUE or FALSE.
Device vari- 64
Maxi- ables for Ether-
mum CAT slaves
number Device vari- --- 64
of ables for CJ-
forced series Units
vari- and variables
ables with AT specifi-
cations
MC Test Run*2 Motor operation and wiring can be checked from the Sysmac Studio.
The project file in the Sysmac Studio and the data in the CPU Unit can be made the
Synchronizing
Debug- same when online.
ging Differential monitoring (*) You can monitor when a variable changes to TRUE or changes to FALSE.
Maximum number of 8
monitored variables
Single trig- When the trigger condition is met, the specified number of samples are taken and
gered trace then tracing stops automatically.
Types
Continuous Data tracing is executed continuously and the trace data is collected by the Sysmac
trace Studio.
Maximum number of 4 2 4 2
simultaneous data traces
Data tracing
Maximum number of 10,000
records
Maximum number of sam- 192 variables 48 variables 192 variables 48 variables
pled variables
Sampling is performed for the specified task period, at the specified time, or when a
Timing of sampling
sampling instruction is executed.
Triggered traces Trigger conditions are set to record data before and after an event.
• When BOOL variable changes to TRUE or FALSE
Trigger condi- • Comparison of non-BOOL variable with a constant
Debug- Data tracing tions Comparison Method: Equals (=), Greater than (>), Greater than or equals (≥),
ging Less Than (<), Less than or equals (≤), Not equal (≠)
Trigger position setting: A slider is used to set the percentage of sampling before
Delay
and after the trigger condition is met.
Simulation The operation of the CPU Unit is emulated in the Sysmac Studio.
Levels Major faults, partial faults, minor faults, observation, and information
Control- Maximum 9 (Sysmac Studio)
ler number of 2 (NS-series PT)
errors message lan-
Reli- guages
ability Self-diagno- User-defined errors are registered in advance and then records are created by exe-
Function
func- sis cuting instructions.
tions User- Levels 8
defined Maximum 9
errors number of
message lan-
guages

A-16 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

NX701- NX1P2- NJ501- NJ301- NJ101-


Item
    
CPU Unit names and When going online to a CPU Unit from the Sysmac Studio, the CPU Unit name in
serial IDs the project is compared to the name of the CPU Unit being connected to.
User program You can prevent reading data in the CPU Unit from the Sysmac Studio.
transfer with
no restoration
information
Protecting Protec- CPU Unit write- You can prevent writing data to the CPU Unit from the Sysmac Studio or SD Mem-
software tion protection ory Card.
Secu- assets and Overall Project You can use passwords to protect .smc files from unauthorized opening on the Sys-
rity preventing file protection mac Studio.
operating Data protection You can use passwords to protect POUs on the Sysmac Studio.
mistakes (*)

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

A-1-3 Function Specifications


SD Memory Card opera- You can access SD Memory Cards from instructions in the user program.
Card Application
func- tion instructions
tions File operations from the You can perform file operations for Controller files in the SD Memory Card and
Sysmac Studio read/write general-purpose document files on the computer.
SD Memory Card life expi- Notification of the expiration of the life of the SD Memory Card is provided in a sys-
ration detection tem-defined variable and event log.
CPU Unit front- Backup, verification, and restoration operations are performed by manipulating the
panel DIP front-panel DIP switch on the CPU Unit.
switch
Specification Backup and verification operations are performed by manipulating system-defined
with system- variables.
Operat- defined vari-
ing ables
SD Memory
Back- methods SD Memory Backup and verification operations are performed from the SD Memory Card Win-
Card back-
ing up Card Window dow of the Sysmac Studio.
ups
data (*) in Sysmac Stu-
dio
Special The special instruction is used to backup data.
instruction (*)
Disabling Backing up data to a SD Memory Card is prohibited.
Protec-
backups to SD
tion
Memory Cards
Sysmac Studio Controller backups The Sysmac Studio is used to backup, restore, or verify Controller data.
*1 Inline ST is supported. (Inline ST is ST that is written as an element in a ladder diagram.)
*2 This function is not available for NJ101-90 CPU Units.
*3 This is the total of 512 events for the CPU Unit and 64 events for the NX Unit.
*4 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-14 Version Information for
NX-series Controllers and A-15 Version Information for NJ-series Controllers for information on version upgrades.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-17


Appendices

A-2 Calculating Guidelines for the Real


Processing Times of Tasks for the
NX701 System
This section describes how to calculate guidelines for the average real processing times of tasks on
paper for the NX701 System.

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.

Precautions for Safe Use


The task execution times in the physical Controller depends on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.

Precautions for Correct Use


Calculation of the average real processing times of tasks for the priority-5 periodic task will
require 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.

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-110.

A-18 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-2 Calculating Guidelines for the Real Processing Times of Tasks


A-2-1 Calculating the Average Real Processing Times of Tasks
The average real processing time of a task is the total of the I/O refresh processing time, user program
execution time, motion control processing time and common processing time.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
The following processing is performed.

Priority-17

for the NX701 System


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. A
Motion control process- • Motion control com- Performed. Performed. Not per- Not per-
ing mands from the user formed. formed.

A-2-1 Calculating the Average Real Processing Times of Tasks


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-19


Appendices

I/O Refresh Processing Time


Use the following formula for the I/O refresh processing time.

I/O refresh processing time = EtherCAT slave processing time

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.

Precautions for Correct Use


When calculating for the priority-5 periodic task, you need to determine the task period of the pri-
mary periodic task in advance.

Additional Information

The EtherCAT slave processing time is 0 in tasks to which EtherCAT slaves are not assigned.

 EtherCAT Slave Processing Time in Primary Periodic Task


Use the following formula to calculate the EtherCAT slave processing time in the primary periodic
task.

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]

A-20 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-2 Calculating Guidelines for the Real Processing Times of Tasks


 EtherCAT Slave Processing Time in Priority-5 Periodic Task
Use the following formula to calculate the EtherCAT slave processing time in the priority-5 periodic
task.

EtherCAT slave processing time [µs] = 0.0006 × pDout + (Larger of the following A and B)
+ sTsend + 0.0001 × sDin + 16

A [µs] = ((0.0623 × sDout + 37) × pTcycle) ÷ (pTcycle − (0.0243 × pDout + 35))


B [µs] = 0.082 × pDinout

for the NX701 System


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]
A
pDinout : Total of the larger of the input and output processing data size of each EtherCAT
slave assigned to the primary periodic task [byte]

A-2-1 Calculating the Average Real Processing Times of Tasks


*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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-21


Appendices

User Program Execution Time


The user program execution time depends on the specific instructions multiplied by the numbers of
instructions used.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
• Trigonometric instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-22 and Instruction Configuration for Standard ST
Instructions on page A-24 for information on the instruction configuration.

 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.

Execution Time for Standard Ladder Diagram Instructions


1000

900

800
Execution time (µs)

700

600

500

400

300

200
NX701-
100

0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000
Total number of instructions

• Instruction Configuration for Standard Ladder Diagram Instructions


The instruction execution ratio for this configuration is 20%.

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

A-22 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-2 Calculating Guidelines for the Real Processing Times of Tasks


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%

Execution Times for Ladder Diagram Arithmetic and Trigonometric

for the NX701 System


Instructions for LREAL Data
300

270

240
Execution time (µs)

210
NX701-
180

150

120
A
90

A-2-1 Calculating the Average Real Processing Times of Tasks


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

• Configuration of Arithmetic Instructions for LREAL Data


Instructions Percent of instructions [%]
Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data


Instructions Percent of instructions [%]
Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
Sin−1 of LREAL data 16.7%

Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0%

NJ/NX-series CPU Unit Software User’s Manual (W501) A-23


Appendices

Execution Time for Standard ST Instructions


1000

900

800
Execution time (µs)

700

600

500

400

300
NX701-
200

100

0 10000 20000 30000 40000 50000 60000 70000


Total number of instructions

• Instruction Configuration for Standard ST Instructions


Percent of
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
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%

Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL


Data
300

270

240
Execution time (µs)

210
NX701-
180

150

120

90

60
NX701-
30

0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data

A-24 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-2 Calculating Guidelines for the Real Processing Times of Tasks


• Configuration of Arithmetic Instructions for LREAL Data
Instructions Percent of instructions [%]
Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data


Instructions Percent of instructions [%]

for the NX701 System


Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
Sin−1 of LREAL data 16.7%

Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0% A

A-2-1 Calculating the Average Real Processing Times of Tasks


Motion Control Processing Time
The motion control processing time depends on the number of servo axes and virtual servo axes that
are used.
For the number of servo and virtual servo axes, read the motion control processing time from the follow-
ing graph.

NX701-
300

250
Processing time (µs)

200

150

100

50

0 32 64 96 128 160 192 224 256


Number of axes

NJ/NX-series CPU Unit Software User’s Manual (W501) A-25


Appendices

Common Processing Time


The common processing time is the following values by the total time for system overhead, system
common processing 1, and system common processing 2. The common processing time depends on
the type of task.

Common processing times [µs] (reference values)


Type of task
NX701-
Primary periodic task 15
Priority-5 periodic task 55
Priority-16, 17, or 18 periodic task 10

A-2-2 Example of Calculating the Average Real Processing Time of a


Task and Setting the Task Period

Example of Calculating the Average Real Processing Times of Tasks


If you are using an NX701- CPU Unit with a unit version of 1.10, first find the average real pro-
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].

A-26 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-2 Calculating Guidelines for the Real Processing Times of Tasks


 I/O Refresh Time

EtherCAT slave processing time:


The following table gives the pDout (output processing data size), pDin (input processing data size),
and pDinout (larger of the input and output data size) values of the GX-ID1611 (Ver. 1.1) Input
Slave, GX-OD1611 (Ver. 1.1) Output Slave, R88D-1SN-ECT Servo Drives, and EtherCAT
Slave Terminal configured with Units shown above.

pDout: Output pDinout: Larger of


pDin: Input process-
EtherCAT slave processing data size the input and output
ing data size in bytes
in bytes data size

for the NX701 System


GX-ID1611 (Ver. 1.1) 0 3 3
GX-OD1611 (Ver. 1.1) 2 1 2
R88D-1SN-ECT 23 26 26
EtherCAT Slave Terminal (Total) 62 88 88
NX-ECC203 0 18
NX-ID5342 0 2
NX-OD5121 2 0
NX-AD3608 0 8 --- A
NX-DA2605 4 0
NX-CIF101 28 30

A-2-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
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]

 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 NX701- is 12 µ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 NX701- is 4
µs.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-27


Appendices

• 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 NX701- is 9
µ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]

 Motion Control Processing Time


From the graph of the execution time for motion control processing, the execution time of the motion
control processing for four axes for the NX701- with a unit version 1.10 is read as 10 µs.

 Common Processing Time


Because the task is the primary periodic task, the common processing time for the NX701-
is 15 µs.

Therefore, the average real processing time of the task is given by the following formula.

Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
= 51 + 25 + 10 + 15
= 101 [µs]

Setting the Task Period


The task period is set based on the average real processing time of the task that is calculated as above.
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.

Task period ≥ Average real processing time of task × 1.1

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.

A-28 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-3 Calculating Guidelines for the Real Processing Times of Tasks


A-3 Calculating Guidelines for the Real
Processing Times of Tasks for the
NX1P2 System
This section describes how to calculate guidelines for the average real processing times of tasks on
paper for the NX1P2 System.

for the NX1P2 System


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.

Precautions for Safe Use


The task execution times in the physical Controller depends on the logic operations that are per-
formed in the user program, the presence of communications commands and data links, on A
whether data tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions on
the actual system and make sure that the task periods are not exceeded and that suitable com-
munications performance is achieved.

Additional Information

Periodic tasks 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-110.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-29


Appendices

A-3-1 Calculating the Average Real Processing Times of Tasks


The average real processing time of a task is the total of the I/O refresh processing time, user program
execution time, motion control processing time and common processing time.
Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
The following processing is performed.

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, built-in Performed. Not per-
I/O, and EtherCAT 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
Common System • Variable refresh processing (if there are accessing Performed. Performed.
process- common tasks) is performed.
ing time processing 1 • Motion input processing
• Data trace processing
System • Variable refresh processing (if there are refreshing Performed. Performed.
common tasks) is performed.
processing 2 • Variable access processing external to the Control-
ler to ensure concurrency with task execution

System Other system common processing Performed. Performed.


overhead
time

Guidelines are provided below for calculating the various processing times.

A-30 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-3 Calculating Guidelines for the Real Processing Times of Tasks


I/O Refresh Processing Time
Use the following formula for the 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.

for the NX1P2 System


 EtherCAT Slave Processing Time
Use the following formula to calculate the EtherCAT slave processing time.

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 A
pDin : Total input processing data size [byte] of EtherCAT slaves assigned to the primary
periodic task

A-3-1 Calculating the Average Real Processing Times of Tasks


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


Use the following formula for the NX Unit processing time.
The calculation must include all NX Units on the CPU Unit.

NX Unit processing time [µs] = 0.248 × Dnxout + 0.241 × Dnxin + 0.549 × Dnxnum + 125.36

Dnxout : Total output data size [byte]*1


Dnxin : Total input data size [byte]*1
Dnxnum : Number of connected NX Units
*1 If the data size of an NX Unit is less than 2 bytes, calculate as 2 bytes.

Additional Information

The NX Unit processing time is 0 if NX Units are not connected to the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-31


Appendices

User Program Execution Time


The user program execution time depends on the specific instructions multiplied by the numbers of
instructions used.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
• Trigonometric instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-22 and Instruction Configuration for Standard ST
Instructions on page A-24 for information on the instruction configuration.

 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.

Execution Time for Standard Ladder Diagram Instructions


500

450

400
Execution time (µs)

350

300

250

200

150

100
NX1P2-
50

0 1500 3000 4500 6000 7500 9000 10500 12000 13500 15000
Total number of instructions

• Instruction Configuration for Standard Ladder Diagram Instructions


The instruction execution ratio for this configuration is 20%.

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

A-32 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-3 Calculating Guidelines for the Real Processing Times of Tasks


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%

Execution Times for Ladder Diagram Arithmetic and Trigonometric

for the NX1P2 System


Instructions for LREAL Data
1000

900

800
NX1P2-
Execution time (µs)

700

600

500

400
A
NX1P2-
300

A-3-1 Calculating the Average Real Processing Times of Tasks


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

• Configuration of Arithmetic Instructions for LREAL Data


Instructions Percent of instructions [%]
Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data


Instructions Percent of instructions [%]
Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
−1 16.7%
Sin of LREAL data
Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0%

NJ/NX-series CPU Unit Software User’s Manual (W501) A-33


Appendices

Execution Time for Standard ST Instructions


1000

900

800
Execution time (µs)

700

600

500

400

300
NX1P2-
200

100

0 1000 2000 3000 4000 5000 6000 7000


Total number of instructions

• Instruction Configuration for Standard ST Instructions


Percent of
Percent of execution
Types of instructions Instructions instructions time in
[%] instruction
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%

Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL


Data
1000

900

800
Execution time (µs)

700
NX1P2-
600

500

400
NX1P2-
300

200

100

0 300 600 900 1200 1500 1800 2100 2400 2700 3000
Total number of instructions
Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data

A-34 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-3 Calculating Guidelines for the Real Processing Times of Tasks


• Configuration of Arithmetic Instructions for LREAL Data
Instructions Percent of instructions [%]
Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data


Instructions Percent of instructions [%]

for the NX1P2 System


Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
Sin−1 of LREAL data 16.7%

Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0% A

A-3-1 Calculating the Average Real Processing Times of Tasks


Motion Control Processing Time
The motion control processing time depends on the number of servo axes and virtual servo axes that
are used.
For the number of servo and virtual servo axes, read the motion control processing time from the follow-
ing graph.
NX1P2-
300

250
Processing time (µs)

200

150

100

50

0
0 1 2 3 4 5 6 7 8
Number of axes

Common Processing Time


The common processing time is the following values by the total time for system overhead, system
common processing 1, and system common processing 2. The common processing time depends on
the type of task.

Common processing times [µs] (reference values)


Type of task
NX1P2-
Primary periodic task 133
Periodic task 175

NJ/NX-series CPU Unit Software User’s Manual (W501) A-35


Appendices

A-3-2 Example of Calculating the Average Real Processing Time of a


Task and Setting the Task Period

Example of Calculating the Average Real Processing Times of Tasks


If you are using an NX1P2- CPU Unit with a unit version of 1.13, first find the average real pro-
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
EtherCAT slaves GX-OD1611 (Ver. 1.1) Output Slave: 1
R88D-1SN-ECT Servo Drives: 4
NX-PF0630 Additional I/O Power Supply Unit: 1
Slaves/Units that are used
NX-ID5342 Digital Input Units: 3
NX Units
NX-OD3153 Digital Output Units: 2
(on CPU Rack)
NX-AD4608 Analog Input Unit: 1
NX-DA3605 Analog Output Unit: 1
Language Ladder diagrams
Standard instruction Number of instructions: 5,000
configuration
Arithmetic 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].

 I/O Refresh Time

EtherCAT slave processing time:


The following table gives the pDout (output processing data size), pDin (input processing data size),
and pDinout (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.

pDout: Output pDinout: Larger of


pDin: Input process-
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]

A-36 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-3 Calculating Guidelines for the Real Processing Times of Tasks


NX Unit processing time:
The following table gives the Dnxout (output data size), Dnxin (input data size) values of the NX-
PF0630 Additional I/O Power Supply Unit, NX-ID5342 Digital Input Unit, NX-OD3153 Digital Output
Unit, NX-AD4608 Analog Input Unit, and NX-DA3605 Analog Output Unit.

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

for the NX1P2 System


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. A
I/O refresh processing time

A-3-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
= 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.937 + (7.24 + 0.1) + 151.11
+ 2.976 + 5.302 + 4.392 + 125.36
≈ 308 [µs]

 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 NX1P2- is 189 µ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 NX1P2- is 41
µ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 NX1P2- is 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 = 189 + 41 + 51
= 281 [µs]

NJ/NX-series CPU Unit Software User’s Manual (W501) A-37


Appendices

 Motion Control Processing Time


From the graph of the execution time for motion control processing, the execution time of the motion
control processing for four axes for the NX1P2- with a unit version 1.13 is read as 148 µs.

 Common Processing Time


Because the task is the primary periodic task, the common processing time for the NX1P2-
is 133 µs.

Therefore, the average real processing time of the task is given by the following formula.

Average real processing time of task = I/O refresh processing time + User program execution time
+ Motion control processing time + Common processing time
= 308 + 281 + 148 + 133
= 870 [µs]

Setting the Task Period


The task period is set based on the average real processing time of the task that is calculated as above.
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.

Task period ≥ Average real processing time of task × 1.1

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.

A-38 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


A-4 Calculating Guidelines for the Real
Processing Times of Tasks for the
NJ-series System
This section describes how to calculate guidelines for the average real processing times of tasks on
paper for the NJ-series System.

for the NJ-series System


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.

Precautions for Safe Use


• 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 tracing is performed, and on other factors.
Before starting actual operation, you must test performance under all foreseeable conditions
on the actual system and make sure that the task periods are not exceeded and that suitable A
communications performance is achieved.
• The performance may be different if the hardware revisions are different. Before you transfer
the user program, data, and parameter settings to the CPU Units with the different hardware
revisions, check them for proper execution and then use them for actual operation.

Precautions for Correct Use


When the hardware revisions are different, the actual execution timing of the event tasks, tag
data link service and system services may be different even if the user program, data, and
parameter settings are same.

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-110.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-39


Appendices

A-4-1 Calculating the Average Real Processing Times of Tasks


The average real processing time of a task is the total of the I/O refresh processing time, user program
execution time, motion control processing time and common processing time.
Average real processing time of task = I/O refresh processing time + User program execution time +
Motion control processing time + Common processing time
The following processing is performed.

Priority-17
Primary Priority-16
and prior-
Processing Processing contents periodic periodic
ity-18 peri-
task task
odic tasks
I/O refresh processing I/O is refreshed for CJ-series Units Performed. Performed. Not per-
(Basic I/O Units, Special I/O Units, and formed.
CPU Bus Units) and EtherCAT slaves.
User program execution Programs assigned to tasks are exe- Performed. Performed. Performed.
cuted in the order that they are
assigned.
Motion control processing • Motion control commands from the Performed. Not per- Not per-
user program are executed. formed. formed.
• Motion control outputs are processed.
Common System com- • Variable refresh processing (if there Performed. Performed. Performed.
processing mon pro- are accessing tasks) is performed.
time cessing 1 • Motion input processing
• Data trace processing
System com- • Variable refresh processing (if there Performed. Performed. Performed.
mon pro- are refreshing tasks) is performed.
cessing 2 • Variable access processing external to
the Controller to ensure concurrency
with task execution
System over- Other system common processing Performed. Performed. Performed.
head time

Guidelines are provided below for calculating the various processing times.

I/O Refresh Processing Time


Use the following formula for the I/O refresh processing time.

I/O refresh processing time = I/O refresh overhead time


+ (Larger of the EtherCAT slave processing time and the CJ-series Unit
processing time)

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.

A-40 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


 I/O Refresh Overhead Time
The I/O refresh overhead time is given by the following table, depending on whether there are Ether-
CAT slaves and CJ-series Units, and also depending on the models of the CPU Units.

CJ-series I/O refresh overhead time [µs]


EtherCAT slave
Unit NJ501- NJ301- NJ101-
Present Present 65 *1 95 135
Present None 35*2 50 65
None Present 30 45 70

for the NJ-series System


*1 The value is 90 for a CPU Unit with unit version 1.01 or earlier.
*2 The value is 60 for a CPU Unit with unit version 1.01 or earlier.

 EtherCAT Slave Processing Time


Use the following formula for the EtherCAT slave processing time.

EtherCAT slave processing time [µs] = Tout × Dout + Tin × Din + Tref × Dinout
+ (1.24 × Snum + 0.01 × Clen - Tec)
A
Tout : Output processing time per byte [µs]
Dout : Total output processing data size [byte] of EtherCAT slaves assigned to the primary peri-

A-4-1 Calculating the Average Real Processing Times of Tasks


odic task or the priority-16 periodic task
Tin : Input processing time per byte [µs]
Din : Total input processing data size [byte] of EtherCAT slaves assigned to the primary periodic
task or the priority-16 periodic task
Snum : Number of connected EtherCAT slaves
Tref : Refresh processing time per byte [µs]
Dinout : 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]
Clen : Total cable length [m]
Tec : EtherCAT communications adjustment time [µs]

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-41


Appendices

 CJ-series Unit Processing Time


Use the following formula for the CJ-series Unit processing time.

Σ (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.
The method for calculating the I/O refresh time for each CJ-series Unit is provided later.
The value of Tcj depends on the model and the unit version of the CPU Unit.

Model Unit version Tcj [µs]


NJ501- Ver. 1.01 or earlier 230
Ver. 1.02 or later 110
NJ301- Ver. 1.01 or earlier 230
Ver. 1.02 or later 165
NJ101- Ver. 1.10 or later*1 225

*1 There is no NJ101- CPU Unit with unit version 1.09 or earlier.

If any of the following CJ-series Units is used, add Tcj µs to the result that is calculated from the
above formula, regardless of the number of Units.
• CJ1W-PH41U Analog Input Unit with Universal Inputs
• CJ1W-AD04U Analog Input Unit with Universal Inputs
• CJ1W-PDC15 Analog Input Unit with Universal Inputs
• CJ1W-V680C11 ID Sensor Unit
• CJ1W-V680C12 ID Sensor Unit
• CJ1W-CRM21 CompoNet Master Unit

A-42 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


I/O Refresh Times for CJ-series Units
This section gives the I/O refresh times for CJ-series Units.

 Basic I/O Units


The following table gives the I/O refresh times for Basic I/O Units that are used on the CPU Rack.
The I/O refresh times for these Units on Expansion Racks are approx. 1.5 times the values that are
given in the table.

for the NJ-series System


I/O refresh time per Unit
Unit name Model numbers
[µs]
8/16-point DC Input Units CJ1W-ID201/211/212 1
32-point DC Input Units CJ1W-ID231/232/233 2
64-point DC Input Units CJ1W-ID261/262 4
8/16-point AC Input Units CJ1W-IA201/111 1
16-point Interrupt Input Unit CJ1W-INT01 1
16-point Quick-response Input CJ1W-IDP01 1
Unit
Relay Contact Output Units CJ1W-OC201/211 1 A
Triac Output Unit CJ1W-OA201 1
8/16-point Transistor Output CJ1W-OD201/202/203/204//211/212/213 1

A-4-1 Calculating the Average Real Processing Times of Tasks


Units
32-point Transistor Output CJ1W-OD231/232/233/234 2
Units
64-point Transistor Output CJ1W-OD261/262/263 4
Units
24-VDC Input/Transistor Out- CJ1W-MD231/232/233 1
put Units (16 inputs/16 outputs)
24-VDC Input/Transistor Out- CJ1W-MD261/263 2
put Units (32 inputs/32 outputs)
TTL I/O Unit CJ1W-MD563 4
CJ1W-B7A04 4
B7A Interface Units CJ1W-B7A14 4
CJ1W-B7A22 4

 Special I/O Units


The following table gives the I/O refresh times for Special I/O Units that are used on the CPU Rack.
The I/O refresh times for these Units on Expansion Racks are approx. 1.5 times the values that are
given in the table.

I/O refresh time per Unit


Unit name Model numbers
[µs]
Isolated-type Units with Uni- CJ1W-AD04U 66
versal Inputs
Analog Input Units CJ1W-AD041-V1/081-V1/042 24
Analog Output Units CJ1W-DA021/041/042V/08V/08C 24
Analog I/O Units CJ1W-MAD42 24
Isolated-type Units with Uni- CJ1W-PH41U 80 (180)*1
versal Inputs
Isolated-type DC Input Unit CJ1W-PDC15 60 (100)*1
Temperature Control Units CJ1W-TC 114
CJ1W-V680C11 76
ID Sensor Units
CJ1W-V680C12 86
High-speed Counter Unit CJ1W-CT021 54

NJ/NX-series CPU Unit Software User’s Manual (W501) A-43


Appendices

I/O refresh time per Unit


Unit name Model numbers
[µs]
CJ1W-CRM21 Communications mode 0 34
Communications mode 1 52
Communications mode 2 88
CompoNet Master Unit
Communications mode 3 84
Communications mode 8 14 + (1.0 × Number of allo-
cated words)
*1 The values in parentheses are the I/O refresh times when an expansion allocation area is used.
*2 The number of allocated words is the total number of I/O area words that are allocated to all of the slaves.

 CPU Bus Units


The following table gives the I/O refresh times for CPU Bus Units. The times are the same regard-
less of whether the Units are used on the CPU Rack or an Expansion Rack.

I/O refresh time per Unit


Unit name Model numbers
[µs]
CJ1W-SCU42 Coefficient*1 × 25*2
Serial Communications Units CJ1W-SCU32
CJ1W-SCU22
CJ1W-DRM21 Coefficient*1 × (Number of
DeviceNet Unit
allocated words*3 + 25)
EtherNet/IP Unit CJ1W-EIP21 7.0 + 0.8 × Number of tags*4
*1 The coefficient is determined by the model of the CPU Unit as follows.
NJ501-: 0.1
NJ301-: 0.2
NJ101-: 0.3
*2 The following maximum time is added if a protocol macro is executed:
Coefficient × Number of refresh words [µs]
*3 The number of allocated words is the total number of I/O area words that are allocated to all of the slaves.
*4 For a CPU Unit with unit version 1.03 or later, the I/O refresh times for EtherNet/IP Units are not added.

User Program Execution Time


The user program execution time depends on the specific instructions multiplied by the numbers of
instructions used.
As a guideline, instructions are divided into three groups and the number of instructions in each group
is used for measurements and estimates.
• Standard instructions
• Arithmetic instructions for LREAL data
• Trigonometric instructions for LREAL data
Different instructions are used in a ladder diagram and in ST. Refer to Instruction Configuration for
Standard Ladder Diagram Instructions on page A-45 and Instruction Configuration for Standard ST
Instructions on page A-47 for information on the instruction configuration.

 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.

A-44 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


Execution Time for Standard Ladder Diagram Instructions
2000

1800
NJ101-
1600

1400
Execution time (ms)

NJ301-
1200
NJ501-
1000

800

600

for the NJ-series System


NJ501- *1
400

200

0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000

Total number of instructions


*1 It is the case when the hardware revision for the Unit is A. The other cases are for the Units that hardware revi-
sions are in blank.

• Instruction Configuration for Standard Ladder Diagram Instructions A


The instruction execution ratio for this configuration is 20%.

A-4-1 Calculating the Average Real Processing Times of Tasks


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%

Execution Times for Ladder Diagram Arithmetic and Trigonometric


Instructions for LREAL Data
• When hardware revisions for the Units are in blank
200
NJ101- NJ501-
180
NJ301-
160
NJ101-
140
Execution time (µs)

120

100

80

60
NJ301-
40
NJ501-
20

0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions

Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data

NJ/NX-series CPU Unit Software User’s Manual (W501) A-45


Appendices

• When the hardware revision for the Units is A


200

180

160

140
Execution time (µs)

120
NJ501-
100

80

60
NJ501-
40

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

• Configuration of Arithmetic Instructions for LREAL Data

Instructions Percent of instructions [%]


Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data

Instructions Percent of instructions [%]


Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
Sin−1 of LREAL data 16.7%

Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0%

A-46 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


Execution Time for Standard ST Instructions
2000

1800
NJ101-
Execution time (ms) 1600

1400
NJ301-
1200

1000
NJ501-
800

600

for the NJ-series System


400
NJ501- *1
200

0 5000 10000 15000 20000 25000 30000 35000

Total number of instructions


*1 It is the case when the hardware revision for the Unit is A. The other cases are for the Units that hardware revi-
sions are in blank.

• Instruction Configuration for Standard ST Instructions A


Percent of exe-
Percent of

A-4-1 Calculating the Average Real Processing Times of Tasks


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%

Execution Times for ST Arithmetic and Trigonometric Instructions for LREAL


Data
• When hardware revisions for the Units are in blank
200
NJ501-
180
NJ101- NJ301-
160
NJ101-
140
Execution time (µs)

120

100

80

60
NJ301-
40
NJ501-
20

0 100 200 300 400 500 600 700 800 900 1000
Total number of instructions

Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data

NJ/NX-series CPU Unit Software User’s Manual (W501) A-47


Appendices

• When the hardware revision for the Units is A


200

180

160

140
Execution time (µs)

NJ501-
120

100

80

60
NJ501-
40

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

• Configuration of Arithmetic Instructions for LREAL Data

Instructions Percent of instructions [%]


Addition instructions for LREAL data 20.0%
Subtraction instructions for LREAL data 20.0%
Multiplication instructions for LREAL data 30.0%
Division instructions for LREAL data 30.0%
Total 100.0%

• Configuration of Trigonometric Instructions for LREAL Data

Instructions Percent of instructions [%]


Sin of LREAL data 16.7%
Cos of LREAL data 16.7%
Tan of LREAL data 16.7%
−1 16.7%
Sin of LREAL data
Cos−1 of LREAL data 16.7%

Tan−1 of LREAL data 16.7%


Total 100.0%

A-48 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


Motion Control Processing Time
The motion control processing time depends on the number of servo axes and virtual servo axes that are used. For
the number of servo and virtual servo axes, read the motion control processing time from the following graph.
NJ501- NJ301-
600 120

500 100
Unit version 1.01 Unit version 1.01
or earlier
Processing time (µs)

Processing time (µs)


or earlier
400 80

for the NJ-series System


Unit version 1.02
or later Unit version 1.02
or later
300 60

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 A
120

A-4-1 Calculating the Average Real Processing Times of Tasks


100
Processing time (µs)

80

60

40

20

0
0 1 2
Number of axes
*2 It is the case when the hardware revision for the Unit is A. The other cases are for the Units that hardware revi-
sions are in blank.

Note You cannot use the motion control functions with an NJ101-90 CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-49


Appendices

Common Processing Time


The common processing time is the following values by the total time for system overhead, system
common processing 1, and system common processing 2. The common processing time depends on
the type of task.

Common processing times [µs] (reference values)


Type of task
NJ501- NJ301- NJ101-
Primary periodic task 150*1 240*2 300
Periodic task 10 32 82

*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-4-2 Example of Calculating the Average Real Processing Time of a


Task and Setting the Task Period

Example of Calculating the Average Real Processing Times of Tasks


If you are using an NJ501- CPU Unit with a unit version of 1.02 and the hardware revision for the
Unit is in blank, first find the average real processing time of the task for the following conditions. The
task is the primary periodic task.

Item Conditions
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].

 I/O Refresh Time

I/O refresh overhead time:


The I/O refresh overhead time is 65 µs because the EtherCAT slaves and CJ-series Units are con-
nected.

A-50 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


EtherCAT slave processing time:
The following table gives the Tout (output processing time per byte), Tin (input processing time per
byte), and Tref (refresh processing time per byte) values when an NJ501- CPU Unit is used.

Tec: EtherCAT commu-


Tout: Output process- Tin: Input processing Tref: Refresh process-
nications adjustment
ing time per byte [µs] time per byte [µs] ing time per byte [µs]
time [µs]
0.004 0.011 0.082 55

The following table gives the Dout (output processing data size), Din (input processing data size),

for the NJ-series System


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.

Dout: Output process- Din: Input processing Dinout: Larger of the


EtherCAT slave
ing data size in bytes data size in bytes input and output 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 Dout, Din and Dinout. A
Dout = 2 + 23 × 4 = 94 [byte]
Din = 3 + 1 + 26 × 4 = 108 [byte]

A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
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.

CJ-series Unit processing time:


The following table gives the I/O refresh time per Unit for the CJ1W-ID211 DC Input Unit, CJ1W-
OD211 Transistor Output Unit, CJ1W-AD042 Analog Input Unit, CJ1W-DA021 Analog Output Unit,
and CJ1W-SCU42 Serial Communications Unit that are used on the CPU Rack.

Model I/O refresh time per Unit [µs]


CJ1W-ID211 1
CJ1W-OD211 1
CJ1W-AD042 24
CJ1W-DA021 24
CJ1W-SCU42 2.5

Because the number of Units is all one, the CJ-series Unit processing time is regarded as 0 µs.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-51


Appendices

CJ-series Unit processing time = Σ (I/O refresh time for each CJ-series Unit × Number of Units) - 110
= 1 × 1 + 1 × 1 + 24 × 1 + 24 × 1 + 2.5 × 1 - 110
= -57.5 [µ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.

Item Value [µs]


I/O refresh overhead time 65
EtherCAT slave processing time 11
CJ-series Unit processing time 0

From these values, the I/O refresh time is calculated by the following formula.
I/O refresh time = I/O refresh overhead time + (Larger of the EtherCAT slave processing
time and the CJ-series Unit processing time)
= 65 + 11
= 76 [µs]

 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]

 Motion Control Processing Time


From the graph of the execution time for motion control processing, the execution time of the motion
control processing for four axes for the NJ501- with a unit version 1.02 is read as 46 µs.

 Common Processing Time


Because the task is the primary periodic task, the common processing time for the NJ501- is
150 µs.

A-52 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-4 Calculating Guidelines for the Real Processing Times of Tasks


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]

Setting the Task Period

for the NJ-series System


The task period is set based on the average real processing time of the task that is calculated as above.
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.
Task period ≥ Average real processing time of task × 1.1
Because the average real processing time of the task that is calculated above is 419 µs, the task period
is set to 500 µs, which is larger than 1.1 times the average time.
The task execution times in the physical Controller depends on the logic operations that are performed A
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

A-4-2 Example of Calculating the Average Real Processing Time of a Task and Setting the Task Period
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-53


Appendices

A-5 System-defined Variables


System-defined variables are assigned specific functions by the system. They are registered in the
global variable table, or the local variable table for each POU, in advance.
These variables cannot be changed. Some of the variables start with an underbar and some start with
”P_”.
Some of the system-defined variables are read-only and some are read/write.
You read and write the variables with the user program, with communications from external devices,
with the Sysmac Studio, or with an NS/NA-series PT.
Basically, system-defined variables are classified according to the function modules. The variables start
with the following category names.

Function module Category name


System-defined variables for the overall None
NJ/NX-series Controller
PLC Function Module _PLC
_CJB
NX Bus Function Module _NXB
Motion Control Function Module _MC, _MC1, and _MC2
EtherCAT Master Function Module _EC
EtherNet/IP Function Module _EIP, _EIP1, and _EIP2

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.

Precautions for Correct Use


There are system-defined variables that are not supported or differ in specifications such as the
number of arrays. Refer to A-6 Specifications for Individual System-defined Variables for details on the
specifications for individual system-defined variables.

A-54 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-5-1 System-defined Variables for the Overall NJ/NX-series


Controller (No Category)
 Functional Classification: Clock

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-113

A-5 System-defined Variables


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

 Functional Classification: Tasks A

Range of

A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name Meaning Function Data type Reference
values
_TaskName_ Task Active Flag TRUE during task execution. BOOL TRUE or page A-113
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-113
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-114
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-114
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-114
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-55


Appendices

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-114
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.
_TaskName_ Task Period Contains the number of times that the UDINT Depends on page A-115
ExceedCount Exceeded Count period was exceeded. data type.
If the present value exceeds the maximum
value of the data type, the present value
returns to 0 and the count is continued.
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.

 Functional Classification: Errors


Range of
Variable name Meaning Function Data type Reference
values
_ErrSta Controller Error TRUE if there is a Controller error. WORD 16#0000 to page A-115
Status FALSE if there is no Controller error. 16#C0F0

Note Do not use this variable in the user pro-


gram. There may be a delay in updat-
ing it and concurrency problems in
relation to the error status of the func-
tion module. Use this variable only to
access status through communications
from an external device. Refer to infor-
mation on the meanings of the error
status bits at the end of this appendix
for details.
_AlarmFlag User-defined The bit corresponding to the event level is WORD 16#0000 to page A-115
Error Status TRUE while there is a user-defined error. Bits 16#00FF
00 to 07 correspond to user fault levels 1 to 8.
This variable contains 0000 hex when there is
no user-defined error.

A-56 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: SD Memory Card


Range of
Variable name Meaning Function Data type Reference
values
_Card1Ready SD Memory Card TRUE when the SD Memory Card is recog- BOOL TRUE or page A-116
Ready Flag nized. FALSE
FALSE when the SD Memory Card is not rec-
ognized.
TRUE: The Card can be used.
FALSE: The Card cannot be used.

A-5 System-defined Variables


_Card1Protect SD Memory Card TRUE when the SD Memory Card is write- BOOL TRUE or page A-116
Write protected with the LOCK switch. FALSE
Protected Flag TRUE: Write protected.
FALSE: Not write protected.
_Card1Err SD Memory Card TRUE when an unusable SD Memory Card is BOOL TRUE or page A-116
Error Flag inserted or a format error occurs. FALSE
TRUE: There is an error
FALSE: There is no error
_Card1Access SD Memory Card TRUE during SD Memory Card access. BOOL TRUE or page A-116
Access Flag TRUE: Card is being accessed. FALSE

FALSE: Card is not being accessed. A


The system updates the flag every 100 ms.
Because of this, access to the SD Memory

A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Card is shown by this flag with a delay of up to
100 ms. We therefore do not recommend the
use of this variable in the user program.
_Card1Deteriorated SD Memory Card TRUE when the life of the SD Memory Card is BOOL TRUE or page A-117
Life exceeded. FALSE
Warning Flag TRUE: The life of the Card has been
exceeded.
FALSE: The Card can still be used.
_Card1PowerFail SD Memory Card TRUE when the power supply to the CPU Unit BOOL TRUE or page A-117
Power Interrup- was interrupted during access to the SD FALSE
tion Flag Memory Card.
TRUE: Power was interrupted during SD
Memory Card access.
FALSE: Normal

NJ/NX-series CPU Unit Software User’s Manual (W501) A-57


Appendices

Variable name Range of


Meaning Function Data type Reference
Member name values
_Card1BkupCmd SD Memory Card _sBKUP_ page A-117
(Ver.1.03) Backup Com- CMD
mands
ExecBkup Execute Backup Change this variable to TRUE to back up BOOL TRUE or page A-117
Flag Controller data to an SD Memory Card. FALSE
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.
CancelBkup Cancel Backup Change this variable to TRUE to cancel back- BOOL TRUE or page A-117
Flag ing up data to an SD Memory Card. FALSE

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.
ExecVefy Execute Verify Change this variable to TRUE to compare the BOOL TRUE or page A-118
Flag Controller data to a backup file in the SD FALSE
Memory Card.

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.
CancelVefy Cancel Verify Change this variable to TRUE to cancel com- BOOL TRUE or page A-118
Flag paring the Controller data to a backup file in FALSE
the SD Memory Card.

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.
DirName Directory Name Used to specify the directory name in the SD STRING(64) Depends on page A-118
Memory Card for which to back up or verify data type.
data.

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.

A-58 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Variable name Range of


Meaning Function Data type Reference
Member name values

_Card1BkupSta SD Memory Card _sBKUP_ page A-118


(Ver. 1.03) Backup Status STA
Done Done Flag TRUE when a backup is completed. BOOL TRUE or page A-118
FALSE
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

A-5 System-defined Variables


host computer.
Active Active Flag TRUE when a backup is in progress. BOOL TRUE or page A-119
FALSE
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.
Err Error Flag TRUE when processing a backup ended in an BOOL TRUE or page A-119
error. FALSE
Note You cannot use this system-defined
variable in the user program. Use it in
CIP message communications when A
sending a command from an HMI or
host computer.
_Card1VefySta SD Memory Card _sVEFY_ page A-119

A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
(Ver. 1.03) Verify Status STA
Done Done Flag TRUE when a verification is completed. BOOL TRUE or page A-119
FALSE
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.
Active Active Flag TRUE when a verification is in progress. BOOL TRUE or page A-119
FALSE
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.
VefyRslt Verify Result Flag TRUE if the data was the same. FALSE if dif- BOOL TRUE or page A-120
ferences were found. FALSE
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.
Err Error Flag TRUE when processing a verification ended BOOL TRUE or page A-120
in an error. FALSE

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.
_Card1PrgTransfer- SD Memory Card _sPRG- page A-120
Cmd (Ver.1.11) Program Trans- TRANS-
fer Command FER_CMD
Exec Execute Pro- Change this variable to TRUE to transfer the BOOL TRUE or page A-120
gram Transfer data in a backup file on the SD Memory Card FALSE
Flag to the Controller by using the function to
transfer programs from the SD Memory Card.
DirName Directory Name Use this variable to specify the directory name STRING(64) Depends on page A-120
in the SD Memory Card in which the backup data type.
file to be transferred is stored.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-59


Appendices

Variable name Range of


Meaning Function Data type Reference
Member name values

Password Password Use this variable to specify the password that STRING(33) Depends on page A-121
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-121
gram and Settings program or setting as the transfer target. FALSE
Transfer Flag 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 TRUE or page A-121
Transfer Flag IP address of the built-in EtherNet/IP port as FALSE
the transfer target.
The IP address means setting type, IP
address, subnet mask, and default gateway.
TargetVariable Present Values of Change this variable to TRUE to set the pres- BOOL TRUE or page A-121
Variables with the ent values of variables with the Retain attri- FALSE
Retain Attribute bute as the transfer target.
Transfer Flag
TargetMemory Present Values of Change this variable to TRUE to set the pres- BOOL TRUE or page A-122
Memory Used for ent values of the memory used for CJ-series FALSE
CJ-series Units Units with the Retain attribute as the transfer
with the Retain target.
Attribute Trans-
fer Flag
_Card1PrgTransfer- SD Memory Card _sPRG- page A-122
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-122
FALSE

Active Active Flag TRUE when a program transfer is in progress. BOOL TRUE or page A-122
FALSE

Err Error Flag TRUE when a program transfer ended in an BOOL TRUE or page A-122
error. FALSE

_Card1RestoreCmd SD Memory Card _sRE- page A-122


(Ver.1.14) Restore Com- STORE_CM
mand D
Exec Execute Restore Change this variable to TRUE to restore the BOOL TRUE or page A-122
Flag data in a backup file on the SD Memory Card FALSE
to the Controller.
DirName Directory Name Use this variable to specify the directory name STRING(64) Depends on page A-123
in the SD Memory Card in which the backup data type.
file to be restored by the system-defined vari-
able is stored.
Password Password Use this variable to specify the password that STRING(33) Depends on page A-123
is used for verification when you start the data type.
restore by the system-defined variable.
The password is initialized every time when
the restore by the system-defined variable is
started.

A-60 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Variable name Range of


Meaning Function Data type Reference
Member name values

_Card1RestoreSta SD Memory Card _sRE- page A-123


(Ver.1.14) Restore Status STORE_ST
A
Done Done Flag TRUE when a restore operation is completed. BOOL TRUE or page A-123
FALSE

Active Active Flag TRUE when a restore operation is in prog- BOOL TRUE or page A-123

A-5 System-defined Variables


ress. FALSE

Err Error Flag TRUE when a restore operation ended in an BOOL TRUE or page A-123
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-124
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.
A
_Card1RestoreCmd- IP Address Change this variable to TRUE to include the BOOL TRUE or page A-124
TargetIPAdr Transfer Flag IP address of the built-in EtherNet/IP port for FALSE

A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
(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-124
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-124
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-125
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-125
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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-61


Appendices

 Functional Classification: Backup


Range of
Variable name Meaning Function Data type Reference
values
_BackupBusy Backup Function TRUE when a backup, restoration, or verifica- BOOL TRUE or page A-125
(Ver. 1.03) Busy Flag tion is in progress. FALSE

 Functional Classification: Power Supply


Range of
Variable name Meaning Function Data type Reference
values
_PowerOnHour Total Power ON Contains the total time that the power has UDINT 0 to page A-125
Time been ON. 4294967295
Contains the total time that the CPU Unit has
been ON in 1-hour increments.
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.
_PowerOnCount Power Contains the number of times that the power UDINT 0 to page A-126
Interruption supply has been interrupted. The value is 4294967295
Count incremented by 1 each time the power supply
is interrupted after the first time that the power
was turned ON.
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-126
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.

Note When the encoder home offset data is


not retained, the status is given in the
error status of the axis variable, and not
in this flag.

A-62 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: Programming


Range of
Variable name Meaning Function Data type Reference
values
P_On Always TRUE This flag is always TRUE. BOOL TRUE page A-126
Flag
P_Off Always FALSE This flag is always FALSE. BOOL FALSE page A-126
Flag
P_CY Carry Flag This flag is updated by some instructions. BOOL TRUE or page A-126
FALSE

A-5 System-defined Variables


P_First_RunMode First RUN Period This flag is TRUE for only one task period BOOL TRUE or page A-127
Flag after the operating mode of the CPU Unit is FALSE
changed from PROGRAM mode to RUN
mode if execution of the program is in prog-
ress.
This flag remains FALSE if execution of the
program is not in progress.
Use this flag to perform initial processing
when the CPU Unit begins operation.

Note You cannot use this system-defined


variable inside functions.
P_First_Run First Program This flag is TRUE for one task period after BOOL TRUE or page A-127 A
(Ver.1.08) Period Flag execution of the program starts. FALSE
Use this flag to perform initial processing
when execution of a program starts.

A-5-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Note You cannot use this system-defined
variable inside functions.
P_PRGER Instruction Error This flag changes to and remains TRUE when BOOL TRUE or page A-127
Flag an instruction error occurs in the program or FALSE
in a function/function block called from the
program.
After this flag changes to TRUE, it stays
TRUE until the user program changes it back
to FALSE.

 Functional Classification: Communications


Range of
Variable name Meaning Function Data type Reference
values
_Port_numUsingPort Number of Used Gives the number of internal logical ports that USINT 0 to 32 page A-127
Ports are currently used. You can use this variable
when you debug the user program.

Note You can use this system-defined vari-


able only for NJ-series CPU Units.
_Port_isAvailable Network Commu- Indicates whether there is an available inter- BOOL FALSE or page A-128
nications Instruc- nal logical port. TRUE
tion Enabled Flag TRUE when an internal logical port is avail-
able. Otherwise FALSE.

Note You can use this system-defined vari-


able only for NJ-series CPU Units.
_FINSTCPConnSta FINS/TCP Con- Gives the FINS/TCP connection status. WORD 16#0000 to page A-128
nection Status 16#FFFF
Note You can use this system-defined vari-
able only for NJ-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-63


Appendices

 Functional Classification: Version

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-128
(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.
Example 1) If the unit version is 1.08, “1”
is stored in element number 0 and “8” is
stored in element number 1.
Example 2) If the unit version is 1.10, “1”
is stored in element number 0 and “10” is
stored in element number 1.
_HardwareRevision Hardware Revision Contains the hardware revision of the STRING[2] - or A to Z page A-128
(Ver.1.11) CPU Unit.
Contains - if the hardware revision is in
blank, and A to Z for other cases.

 Functional Classification: Self-diagnosis

Range of
Variable name Meaning Function Data type Reference
values
_SelfTest_HighTem- CPU Unit High Tem- TRUE when the internal temperature of BOOL TRUE or page A-129
perature perature Flag the CPU Unit is too high. FALSE
(Ver.1.10)
Note Always FALSE for an NX1P2 CPU
Unit.
_SelfTest_LowBattery Low Battery Flag TRUE when the battery is disconnected or BOOL TRUE or page A-129
(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-129
Revolution Flag rotation speed of a fan is decreased. FALSE
(Ver.1.10)
Note Always FALSE for an NX1P2 CPU
Unit and NJ-series CPU Unit.

 Functional Classification: PLC Built-in

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-129
(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-129
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.

A-64 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-5-2 PLC Function Module, Category Name: _PLC


 Functional Classification: Debugging
Variable name Range of
Meaning Function Data type Reference
Member values

_PLC_TraceSta[0..3] _sTRACE_ page A-130


STA

A-5 System-defined Variables


.IsStart Trace Busy Flag TRUE when a trace starts. BOOL TRUE or page A-130
FALSE
Note You cannot use this system-defined
variable in the user program. It is used
only to monitor the status of data trac-
ing from the Sysmac Studio.
.IsComplete Trace TRUE when a trace is completed. BOOL TRUE or page A-130
Completed Flag FALSE
Note You cannot use this system-defined
variable in the user program. It is used
only to monitor the status of data trac-
ing from the Sysmac Studio.
.IsTrigger Trace Trigger TRUE when the trigger condition is met. BOOL TRUE or page A-130
Monitor Flag FALSE when the next trace starts. FALSE A
Note You cannot use this system-defined
variable in the user program. It is used

A-5-2 PLC Function Module, Category Name: _PLC


only to monitor the status of data trac-
ing from the Sysmac Studio.
.ParamErr Trace TRUE when a trace starts, but there is an BOOL TRUE or page A-131
Parameter Error error in the trace settings. FALSE
Flag FALSE when the settings are normal.

Note You cannot use this system-defined


variable in the user program. It is used
only to monitor the status of data trac-
ing from the Sysmac Studio.

 Functional Classification: Errors


Range of
Variable name Meaning Function Data type Reference
values
_PLC_ErrSta PLC Function TRUE when there is a Controller error that WORD 16#0000 to page A-131
Module Error Sta- involves the PLC Function Module. 16#00F0
tus FALSE when there is no Controller error that
involves the PLC Function Module.
Refer to information on the meanings of the
error status bits at the end of this appendix for
details.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-65


Appendices

 Functional Classification: Option Boards


Variable name Range of
Meaning Function Data type Reference
Member values

_PLC_OptBoardSta Option Board Contains the status of Option Boards. This ARRAY[0..2 page A-131
(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.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
isDetect Option Board Indicates an Option Board is mounted to the BOOL TRUE or page A-131
Mounted option board slot. FALSE
TRUE: Mounted.
FALSE: Not mounted.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
Run Option Board Indicates whether an Option Board is nor- BOOL TRUE or page A-132
Normal Opera- mally operating. FALSE
tion To use device variables or communications
instructions for an Option Board, program this
member as an interlock condition in the user
program.
TRUE: Normally operating.
FALSE: Initializing, changing settings, or an
error occurred.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
Error Option Board Indicates whether an Option Board error BOOL TRUE or page A-132
Error occurred. FALSE
TRUE: An error occurred.
FALSE: An error not occurred.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
_PLC_OptSeri- Serial Option Contains the error status of an transmission ARRAY[0..2 page A-133
alErrSta Board Error Sta- error for the Serial Communications Option ] OF
(Ver.1.13) tus Board. When the Serial communications _sOPTSE-
mode of an Serial Communications Option RIALER-
Board is only set to Host Link (FINS), the R_STA
value of each member is updated.
Other than the above setting, the values of all
members are FALSE.
The array element 1 corresponds to the
option board slot 1 and array element 2 corre-
sponds to the option board slot 2.

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 exter-
nal device such as an HMI.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.

A-66 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Variable name Range of


Meaning Function Data type Reference
Member values

Error Transmission Indicates whether a transmission error BOOL TRUE or page A-133
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

A-5 System-defined Variables


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.

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 exter-
nal device such as an HMI. A
Note You can use this system-defined vari-
able only for the NX1P2 CPU Units.

A-5-2 PLC Function Module, Category Name: _PLC

NJ/NX-series CPU Unit Software User’s Manual (W501) A-67


Appendices

Variable name Range of


Meaning Function Data type Reference
Member values

ParityErr Parity Error Indicates whether a parity error occurred. If BOOL TRUE or page A-133
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.
• A parity 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.

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 exter-
nal device such as an HMI.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
FramingErr Framing Error Indicates whether a framing error occurred. If BOOL TRUE or page A-134
this error occurs, it means that the serial com- FALSE
munications settings may not apply to the
remote device to connect.
TRUE: A framing error occurred.
FALSE: FALSE due to one of the following
causes.
• A framing 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.

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 exter-
nal device such as an HMI.
Note You can use this system-defined vari-
able only for the NX1P2 CPU Units.

A-68 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Variable name Range of


Meaning Function Data type Reference
Member values

OverRun Overrun Error Indicates whether an overrun error occurred. BOOL TRUE or page A-134
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-5 System-defined Variables


• 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.

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 exter-
nal device such as an HMI.
A
Note You can use this system-defined vari-
able only for the NX1P2 CPU Units.

A-5-2 PLC Function Module, Category Name: _PLC

NJ/NX-series CPU Unit Software User’s Manual (W501) A-69


Appendices

A-5-3 PLC Function Module, Category Name: _CJB


 Functional Classification: I/O Bus Status
Range of
Variable name Meaning Function Data type Reference
values
_CJB_MaxRackNo Largest Rack Contains the largest rack number of the UINT 0 to 3 page A-135
Number Expansion Racks that are detected by the 0: Only CPU
Controller. Rack.
Note You can use this system-defined variable
only for NJ-series CPU Units.
_CJB_MaxSlotNo Largest Slot Contains one higher than the largest slot ARRAY 0 to 10 page A-135
Number number with a CJ-series Unit on each of the [0..3] 0: No CJ-
Racks that are detected by the Controller. OF UINT series Unit
mounted.
Note You can use this system-defined variable
only for NJ-series CPU Units.

 Functional Classification: I/O Bus Errors


Range of
Variable name Meaning Function Data type Reference
values
_CJB_ErrSta I/O Bus Error Sta- Gives the I/O bus error status. WORD 16#0000 to page A-135
tus 16#C0F0
Note Do not use this variable in the user pro-
gram. There may be a delay in updat-
ing it. Use this variable only to access
status through communications from an
external device. Refer to information on
the meanings of the error status bits at
the end of this appendix for details.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_MstrErrSta I/O Bus Master Gives the I/O bus master error status. WORD 16#0000 to page A-136
Error Status 16#00F0
Note Do not use this variable in the user pro-
gram. There may be a delay in updat-
ing it. Use this variable only to access
status through communications from an
external device. Refer to information on
the meanings of the error status bits at
the end of this appendix for details.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_UnitErrSta I/O Bus Unit Error Gives the error status of the I/O Bus Unit. ARRAY 16#0000 to page A-136
Status [0..3, 0..9] 16#80F0
Note Do not use this variable in the user pro- OF WORD
gram. There may be a delay in updat-
ing it. Use this variable only to access
status through communications from an
external device. Refer to information on
the meanings of the error status bits at
the end of this appendix for details.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_InRespTm Basic Input Unit Contains the response times of the Basic ARRAY 0 to 320 page A-136
Input Response Input Units. [0..3, 0..9]
Times OF UNIT
Note You can use this system-defined variable
only for NJ-series CPU Units.

A-70 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: Auxiliary Area Bits for CJ-series Units

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-137
Information output (load short-circuit protection). [0..3, 0..9, FALSE
TRUE: Load short-circuit 0..7] OF
BOOL
FALSE: No load short-circuit

A-5 System-defined Variables


Note You can use this system-defined variable
only for NJ-series CPU Units.
_CJB_CBU00InitSta CPU Bus Unit Ini- The corresponding variable is TRUE during BOOL TRUE or page A-137
to tializing Flags initialization of the CPU Bus Unit. FALSE

_CJB_CBU15InitSta The corresponding variable changes to


FALSE when the initialization is completed.
The numbers in the variables indicate the unit
numbers of the applicable Units.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_SIO00InitSta Special I/O Unit The corresponding variable is TRUE during BOOL TRUE or page A-137
Initializing Flags initialization of the Special I/O Unit. FALSE
to
The corresponding variable changes to
A
_CJB_SIO95InitSta
FALSE when the initialization is completed.
The numbers in the variables indicate the unit

A-5-3 PLC Function Module, Category Name: _CJB


numbers of the applicable Units.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_CBU00Restart CPU Bus Unit The CPU Bus Unit is restarted when the cor- BOOL TRUE or page A-138
to Restart Bits responding variable changes to TRUE. (It is FALSE
changed to FALSE by the system after the
_CJB_CBU15Restart
CPU Bus Unit is restarted.)
The numbers in the variables indicate the unit
numbers of the applicable Units.
If you change the Restart Flag to TRUE with
an instruction, the restart process begins from
refresh processing in the next task period.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_SIO00Restart Special I/O Unit The Special I/O Unit is restarted when the cor- BOOL TRUE or page A-138
to Restart Bits responding variable changes to TRUE. (It is FALSE
changed to FALSE by the system after the
_CJB_SIO95Restart
Special I/O Unit is restarted.)
The numbers in the variables indicate the unit
numbers of the applicable Units.
If you change the Restart Flag to TRUE with
an instruction, the restart process begins from
refresh processing in the next task period.

Note You can use this system-defined variable


only for NJ-series CPU Units.
_CJB_SCU00P1ChgSta Serial Communi- TRUE when the parameters of the specified BOOL TRUE or page A-139
to cations Unit 0, port are being changed. FALSE
Port 1/2 Settings FALSE after the parameters are changed.
_CJB_SCU00P2ChgSta
Changing Flags
It is also possible for the user to indicate a
change in serial port settings by turning ON
_CJB_SCU15P1ChgSta Serial Communi- the corresponding flag through the execution BOOL TRUE or page A-139
to cations Units 1 to of an instruction or a user operation. FALSE
15, Port 1/2 Set-
_CJB_SCU15P2ChgSta
tings Changing Note You can use this system-defined variable
Flags only for NJ-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-71


Appendices

A-5-4 NX Bus Function Module, Category Name: _NXB


 Functional Classification: NX Bus Function Module Status
Range of
Variable name Meaning Function Data type Reference
values
_NXB_MaxUnitNo Largest Unit Contains the largest NX Unit number of the UINT 0 to 8 page A-140
(Ver.1.13) Number NX Units on the CPU Unit that are detected 0: No NX Unit
by the NX Bus Function Module. mounted.
If the Unit configuration information is regis-
tered by the Sysmac Studio, the value will be
largest NX Unit number of the registered Unit
configuration. Units that are set as
unmounted Units are also included.
If the Unit configuration information is not reg-
istered by the Sysmac Studio, the value will
be the largest Unit number of an actual Unit
configuration.
Note You can use this system-defined vari-
able only for the NX1P2 CPU Units.
_NXB_UnitIOAc- NX Unit I/O Data Indicates whether I/O data in the NX Units on ARRAY TRUE or page A-140
tiveTbl Active Status the CPU Unit is valid. This status is given as [0..8] OF FALSE
(Ver.1.13) an array of BOOL data. The subscript of the BOOL
array corresponds to the NX Unit number. A
subscript of 0 indicates the NX Bus Function
Module and it is always TRUE.
TRUE: The I/O data in the NX Unit is valid.
FALSE: The I/O data in the NX Unit is invalid.
The status is FALSE for NX Units that are set
as unmounted Units.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
_NXB_UnitMsgAc- NX Unit Mes- Indicates whether the NX Units on the CPU ARRAY TRUE or page A-140
tiveTbl sage Enabled Unit can process message communications. [0..8] OF FALSE
(Ver.1.13) Status This status is given as an array of BOOL data. BOOL
The subscript of the array corresponds to the
NX Unit number. A subscript of 0 indicates the
NX Bus Function Module and it is always
TRUE.
TRUE: Message communications possible.
FALSE: Message communications not possi-
ble.
The status is FALSE for NX Units that are set
as unmounted Units.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.
_NXB_UnitRegTbl NX Unit Registra- Indicates whether the NX Units on the CPU ARRAY TRUE or page A-141
(Ver.1.13) tion Status Unit are registered in the Unit configuration. [0..8] OF FALSE
This status is given as an array of BOOL data. BOOL
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.

Note You can use this system-defined vari-


able only for the NX1P2 CPU Units.

A-72 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: NX Bus Function Module Errors

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-141
(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

A-5 System-defined Variables


NX Units.

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. Refer to A-5-8 Meanings of
Error Status Bits for the meaning of
the error status bits.

Note You can use this system-defined


variable only for the NX1P2 CPU
Units. A
_NXB_MstrErrSta NX Bus Function Gives the status of errors that are WORD 16#0000 to page A-141
(Ver.1.13) Module Master Error detected in the NX Bus Function Module 16#40F2

A-5-4 NX Bus Function Module, Category Name: _NXB


Status 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. Refer to A-5-8 Meanings of
Error Status Bits for the meaning of
the error status bits.
Note You can use this system-defined
variable only for the NX1P2 CPU
Units.
_NXB_UnitErrStaTbl NX Bus Function Gives the status of errors that are ARRAY 16#0000 to page A-142
(Ver.1.13) Module Unit Error detected in the NX Unit on the CPU Unit. [1..8] OF 16#40F2
Status This status is given as an array of BOOL BOOL
data. The subscript of the array corre-
sponds to the NX Unit number.

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. Refer to A-5-8 Meanings of
Error Status Bits for the meaning of
the error status bits.

Note You can use this system-defined


variable only for the NX1P2 CPU
Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-73


Appendices

Range of
Variable name Meaning Function Data type Reference
values
_NXB_UnitErrFlagTbl NX Unit Error Status Indicates whether errors occurred in the ARRAY TRUE or page A-142
(Ver.1.13) NX Unit on the CPU Unit. [0..8] OF FALSE
This status is given as an array of BOOL BOOL
data. The subscript of the array corre-
sponds to the NX Unit number. A sub-
script of 0 indicates the NX Bus Function
Module and whether an event occurred
that is detected by the NX Bus Function
Module.
TRUE: Error.
FALSE: No error.
The status is FALSE for NX Units that are
set as unmounted Units.

Note You can use this system-defined


variable only for the NX1P2 CPU
Units.

A-74 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-5-5 Motion Control Function Module, Category Name: _MC


 Functional Classification: Motion Control Functions

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-143
tion Module Error Sta- detected in the Motion Control Function 16#40F0

A-5 System-defined Variables


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-143
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 A
appendix for details.
_MC_AX_ErrSta Axis Error Shows the error status for each axis. The ARRAY 16#0000 to page A-143
Status status of up to 256 axes*1 is shown. [0..255] OF 16#00F0

A-5-5 Motion Control Function Module, Category Name: _MC


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-143
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-144
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-144
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.
NX1P2 CPU Units and NJ-series CPU
Units: Used to specify axes groups and
shows multi-axes coordinated control sta-
tus, and multi-axes coordinated 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-75


Appendices

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-144
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.
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.

Note You can use this system-defined vari-


able 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.
_MC2_GRP Axes Group Variables Used to specify axes groups and shows ARRAY[0..63] --- page A-145
multi-axes coordinated control status, and OF
multi-axes coordinated control settings for _sGROUP_R
motion control instructions used for EF
motion control 2.
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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_MC_AX Axis Variables NX701 CPU Units: Used to specify axes ARRAY[0..25 --- page A-145
and shows single-axis control status, and 5] OF _sAX-
single-axis control settings for motion con- IS_REF*4
trol instructions used for motion control 1.
NX1P2 CPU Units and NJ-series CPU
Units: Used to specify axes and shows
single-axis control status, and single-axis
control settings for motion control instruc-
tions.
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.

A-76 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-145
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

A-5 System-defined Variables


different name.
Refer to the NJ/NX-series Motion Control
Instructions Reference Manual (Cat. No.
W508) for details on structure members.

Note You can use this system-defined vari-


able 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.
_MC2_AX Axis Variables Used to specify axes and shows single- ARRAY[0..25 --- page A-146
axis control status, and single-axis control 5] OF _sAX-
settings for motion control instructions IS_REF A
used for motion control 2.
When you create an axis on the System Stu-
dio, a user-defined axis variable with a differ-

A-5-5 Motion Control Function Module, Category Name: _MC


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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
*1 For the NX1P2 CPU Units, the error status of up to 16 axes is shown and the data type is ARRAY [0..15] OF WORD.
For NJ-series CPU Units, the error status of up to 64 axes is shown and the data type is ARRAY [0..63] OF WORD.
*2 For the NX1P2 CPU Units, the error status of up to 8 axes is shown and data type is ARRAY [0..7] OF WORD.
For NJ-series CPU Units, the error status of up to 32 axes groups is shown and the data type is ARRAY [0..31] OF WORD.
*3 For the NX1P2 CPU Units, the error status of up to 8 axes is shown and data type is ARRAY[0..7] OF _sGROUP_REF.
For NJ-series CPU Units, the error status of up to 32 axes groups is shown and the data type is ARRAY [0..31] OF _sGROUP_REF.
*4 For the NX1P2 CPU Units, the error status of up to 16 axes is shown and the data type is ARRAY [0..15] OF _sAXIS_REF.
For NJ-series CPU Units, the error status of up to 64 axes is shown and the data type is ARRAY [0..63] OF _sAXIS_REF.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-77


Appendices

A-5-6 EtherCAT Master Function Module, Category Name: _EC


 Functional Classification: EtherCAT Communications Errors

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-147
EtherCAT Error collective status of errors in the EtherCAT 16#40F0
Master Function Module.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_EC_PortErr Communications Port This system-defined variable provides the WORD 16#0000 to page A-147
Error collective status of errors in the communi- 16#00F0
cations ports for the EtherCAT master.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_EC_MstrErr Master Error This system-defined variable provides the WORD 16#0000 to page A-147
collective status of EtherCAT master 16#00F0
errors and slave errors detected by the
EtherCAT master.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_EC_SlavErr Slave Error This system-defined variable provides the WORD 16#0000 to page A-147
collective status of all the error status for 16#00F0
EtherCAT slaves.
Refer to information on the meanings of
the error status bits at the end of this
appendix for details.
_EC_SlavErrTbl Slave Error Table This system-defined variable gives the Array [1..512] 16#0000 to page A-148
error status for each EtherCAT slave. OF WORD*1 16#00F0
The error status is given for each slave in
the actual system configuration. This vari-
able array indicates slaves in which there
are errors. Status is provided for each Eth-
erCAT slave node address (1 to 512)*1.
Refer to information on the meanings of the
error status bits at the end of this appendix
for details.
_EC_MacAdrErr MAC Address Error TRUE if there is an illegal MAC address. BOOL TRUE or page A-148
FALSE
_EC_LanHwErr Communications TRUE if there is a communications con- BOOL TRUE or page A-148
Controller Error troller hardware error. FALSE
_EC_LinkOffErr Link OFF Error TRUE if the communications controller BOOL TRUE or page A-148
link is not established. FALSE
_EC_NetCfgErr Network TRUE if there is illegal network configura- BOOL TRUE or page A-148
Configuration Infor- tion information. FALSE
mation Error
_EC_NetCfgCmpErr Network TRUE if the network configuration infor- BOOL TRUE or page A-149
Configuration Verifi- mation does not match the actual network FALSE
cation Error configuration.
_EC_NetTopologyErr Network TRUE if there is a network configuration BOOL TRUE or page A-149
Configuration Error error (too many devices connected or ring FALSE
connection).
_EC_PDCommErr Process Data Com- TRUE if there is an unexpected slave dis- BOOL TRUE or page A-149
munications Error connection or connection or if a slave FALSE
WDT error is detected during process
data communications.
_EC_PDTimeoutErr Process Data Recep- TRUE if a timeout occurs while receiving BOOL TRUE or page A-149
tion process data. FALSE
Timeout Error

A-78 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-149
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-149
Duplicated Error more than one slave. FALSE
_EC_SlavInitErr Slave TRUE if there is an error in an initialization BOOL TRUE or page A-150
Initialization Error command addressed to a slave. FALSE

A-5 System-defined Variables


_EC_SlavAppErr Slave TRUE if there is an error in the slave’s BOOL TRUE or page A-150
Application Error application status register. FALSE
_EC_MsgErr EtherCAT TRUE when a message is sent to a slave BOOL TRUE or page A-150
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-150
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-150
(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. A
• When the task period is 10 ms or
shorter: 100 ms

A-5-6 EtherCAT Master Function Module, Category Name: _EC


• 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 [1..512] TRUE or page A-151
Error Slave Table of slave node addresses. The correspond- OF BOOL*2 FALSE
ing slave element is TRUE if the master
detected an error for the slave.
_EC_CycleExceeded EtherCAT Communi- TRUE if the CPU Unit cannot establish BOOL TRUE or page A-151
cations Cycle communications within the set communi- FALSE
Exceeded cations period at startup.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the node address is 1 to 192 and the data type is Array [1..192] OF WORD.
*2 For NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-79


Appendices

Additional Information

Typical Relationships for the Built-in EtherCAT Error Flags


Variable Variable
Meaning Meaning Variable Name Meaning Event level
Name Name
_EC_ErrSta Built-in _EC_PortErr Communi- _EC_MacAdrErr MAC Address Error Partial fault
EtherCAT cations level
_EC_LanHwErr Communications
Error Port Error Controller Error
_EC_LinkOffErr Link OFF Error
_EC_MstrErr Master _EC_NetCfgErr Network Configura- Minor fault
Error tion Information Error level
_EC_NetCfgCmpErr Network Configura-
tion Verification Error
_EC_NetTopologyErr Network Configura-
tion Error
_EC_PDCommErr Process Data Com-
munications Error
_EC_PDTimeoutErr Process Data Recep-
tion Timeout Error
_EC_PDSendErr Process Data Trans-
mission Error
_EC_SlavAdrDupErr Slave Node Address
Duplicated Error
_EC_SlavInitErr Slave Initialization
Error
_EC_SlavAppErr Slave Application
Error
_EC_CommErrTbl Communications
Error Slave Table
_EC_CycleExceeded EtherCAT Communi-
cations Cycle
Exceeded
_EC_MsgErr EtherCAT Message Observation
Error
_EC_SlavEmergErr Emergency Message
Detected
_EC_SlavErr Slave _EC_SlavErrTbl Slave Error Table Defined by
Error the slave.

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.

A-80 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: EtherCAT Communications Status

Range of
Variable name Meaning Function Data type Reference
values
_EC_RegSlavTbl Registered Slave This table indicates the slaves that are Array [1..512] TRUE or page A-151
Table registered in the network configuration OF BOOL*1 FALSE
information. Slaves are given in the table
in the order of slave node addresses. The
element for a slave is TRUE if the corre-
sponding slave is registered.

A-5 System-defined Variables


_EC_EntrySlavTbl Network This table indicates which slaves are con- Array [1..512] TRUE or page A-151
Connected Slave nected to the network. Slaves are given in OF BOOL*1 FALSE
Table the table in the order of slave node
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 [1..512] TRUE or page A-152
cations Enabled perform message communications. OF BOOL*1 FALSE
Slave Table Slaves are given in the table in the order
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). A
Note Use this variable to confirm that
message communications are pos-

A-5-6 EtherCAT Master Function Module, Category Name: _EC


sible for the relevant slave before
you execute message communica-
tions with an EtherCAT slave.
_EC_PDSlavTbl Process Data Com- This table indicates the slaves that are Array [1..512] TRUE or page A-152
municating Slave performing process data communications. OF BOOL*1 FALSE
Table Slaves are given in the table in the order
of slave node addresses.
The element for a slave is TRUE if pro-
cess data of the corresponding slave is
enabled (operational) for both slave inputs
and outputs.

Note Use this variable to confirm that the


data for the relevant slave is valid
before controlling an EtherCAT
slave.
_EC_DisconnSlavTbl Disconnected Slave Slaves are given in the table in the order Array [1..512] TRUE or page A-152
Table of slave node addresses. OF BOOL*1 FALSE
The element for a slave is TRUE if the
corresponding slave was disconnected.
_EC_DisableSlavTbl Disabled Slave Table Slaves are given in the table in the order Array [1..512] TRUE or page A-153
of slave node addresses. OF BOOL*1 FALSE
The element for a slave is TRUE if the
corresponding slave is disabled.
_EC_PDActive Process Data Com- TRUE when process data communica- BOOL TRUE or page A-153
munications Status tions are performed with all slaves*. FALSE
* Disabled slaves are not included.
_EC_PktMonStop Packet TRUE when packet monitoring is stopped. BOOL TRUE or page A-153
Monitoring Stopped FALSE
_EC_LinkStatus Link Status TRUE if the communications controller BOOL TRUE or page A-153
link status is Link ON. FALSE
_EC_PktSaving Saving Packet Data Shows whether a packet data file is being BOOL TRUE or page A-153
File saved. FALSE
TRUE: Packet data file being saved.
FALSE: Packet data file not being saved.
_EC_InDataInvalid Input Data Invalid TRUE when process data communica- BOOL TRUE or page A-154
tions performed in the primary periodic FALSE
task are not normal and the input data is
not valid.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-81


Appendices

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-154
tions performed in the primary periodic FALSE
task are not normal and the input data is
not valid.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EC_InData2Invalid Input Data2 Invalid TRUE when process data communica- BOOL TRUE or page A-154
tions performed in the priority-5 periodic FALSE
task are not normal and the input data is
not valid.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

Note This variable is always TRUE for


the NX1P2 CPU Units.
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

Note All system-defined variables that are related to the status of EtherCAT communications give the current status.

 Functional Classification: EtherCAT Communications Diagnosis/Statistics


Log

Range of
Variable name Meaning Function Data type Reference
values
_EC_StatisticsLogEn- Diagnosis/Statistics Changes to TRUE when the diagno- BOOL TRUE or page A-155
able Log Enable sis/statistics log is started. FALSE
(Ver.1.11) Changes to FALSE when the diagno-
sis/statistics log is ended.
_EC_StatisticsLogCy- Diagnosis/Statistics Specifies the interval to write the diagnos- UINT 0, or 30 to page A-155
cleSec Log Cycle tic and statistical information of the diag- 1800
(Ver.1.11) nosis/statistics log in units of seconds.
When 0 is specified, the diagnostic and
statistical information is written only once
when the diagnosis/statistics log is ended.

Note The write interval does not change


even if you change the value of this
system-defined variable while the
diagnosis/statistics log operation is
in progress.
_EC_StatisticsLog- Diagnosis/Statistics TRUE while the diagnosis/statistics log BOOL TRUE or page A-155
Busy Log Busy operation is in progress. FALSE
(Ver.1.11)
_EC_StatisticsLogErr Diagnosis/Statistics TRUE when the diagnosis/statistics log BOOL TRUE or page A-155
(Ver.1.11) Log Error failed to start or it is impossible to write FALSE
into the log.
The value of this flag is determined when
_EC_StatisticsLogBusy (Diagnosis/Statis-
tics Log Busy) changes to FALSE after the
diagnosis/statistics log operation is
started.
The error end is caused by the following.
• Another records cannot be added in the
log file because the capacity of the SD
Memory Card is fully used.
• The SD Memory Card is write protected.
• There is no SD Memory Card.
• The function cannot be started because
the value specified for _EC_Statis-
ticsLogCycleSec (Diagnosis/Statistics
Log Cycle) is invalid.

A-82 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


 Functional Classification: EtherNet/IP Communications Errors

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-156
EtherNet/IP Error built-in EtherNet/IP port. 16#00F0

A-5 System-defined Variables


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- A
lective status of the following error flags.
• _EIP_PortErr (Communications Port
Error)

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


• _EIP_CipErr (CIP Communications
Error)
• _EIP_TcpAppErr (TCP Application Com-
munications Error)

Note Refer to information on the mean-


ings of the error status bits at the
end of this appendix for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-83


Appendices

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-156
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)
• _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)
NJ-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP_MacAdrErr (MAC Address Error)
• _EIP_LanHwErr (Communications Control-
ler Error)
• _EIP_EtnCfgErr (Basic Ethernet Setting
Error)
• _EIP_IPAdrCfgErr (IP Address Setting Error)
• _EIP_IPAdrDupErr (IP Address Duplication
Error)
• _EIP_BootpErr (BOOTP Server Error)
• _EIP_IPRTblErr (IP Route Table Error)

Note If a Link OFF Detected or Built-in


EtherNet/IP Processing Error
occurs, it is recorded in the event
log and then the corresponding bit
turns ON. Refer to information on
the meanings of the error status bits
at the end of this appendix for
details.

A-84 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-156
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)

A-5 System-defined Variables


• _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)
A
Note If a Link OFF Detected or Built-in
EtherNet/IP Processing Error
occurs, it is recorded in the event

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


log and then the corresponding bit
turns ON.
Refer to information on the mean-
ings of the error status bits at the
end of this appendix for details.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_PortErr Communications This is the error status variable for the WORD 16#0000 to page A-156
Port2 Error communications port. 16#00F0
It represents the collective status of the
following error flags.
• _EIP2_MacAdrErr (Port2 MAC Address
Error)
• _EIP2_LanHwErr (Port2 Communications
Controller Error)
• _EIP2_EtnCfgErr (Port2 Basic Ethernet Set-
ting Error)
• _EIP2_IPAdrCfgErr (Port2 IP Address Set-
ting Error)
• _EIP2_IPAdrDupErr (Port2 IP Address
Duplication Error)
• _EIP2_BootpErr (Port2 BOOTP Server
Error)
• _EIP_DNSCfgErr (DNS Setting Error)
• _EIP_DNSSrvErr (DNS Server Connection
Error)
• _EIP_IPRTblErr (IP Route Table Error)

Note If a Link OFF Detected or Built-in


EtherNet/IP Processing Error
occurs, it is recorded in the event
log and then the corresponding bit
turns ON.
Refer to information on the mean-
ings of the error status bits at the
end of this appendix for details.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-85


Appendices

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-158
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)
• _EIP1_TDLinkOpnErr (CIP Communica-
tions1 Tag Data Link Connection Failed)
• _EIP1_TDLinkErr (CIP Communications1
Tag Data Link Communications Error)
• _EIP1_TagAdrErr (CIP Communications1
Tag Name Resolution Error)
• _EIP1_MultiSwONErr (CIP Communica-
tions1 Multiple Switches ON Error)
NJ-series CPU Units: Represents the col-
lective status of the following error flags.
• _EIP_IdentityErr (Identity Error)
• _EIP_TDLinkCfgErr (Tag Data Link Set-
ting Error)
• _EIP_TDLinkOpnErr (Tag Data Link
Connection Failed)
• _EIP_TDLinkErr (Tag Data Link Com-
munications Error)
• _EIP_TagAdrErr (Tag Name Resolution
Error)
• _EIP_MultiSwONErr (Multiple Switches
ON Error)

Note If a Tag Name Resolution Error


occurs, it is recorded in the event
log and this variable changes to
TRUE. Refer to information on the
meanings of the error status bits at
the end of this appendix for details.
_EIP1_CipErr CIP Communica- This is the error status variable for CIP WORD 16#0000 to page A-158
tions1 Error communications 1. 16#00F0
It represents the collective status of the
following error flags.
• _EIP1_IdentityErr (CIP Communications1
Identity Error)
• _EIP1_TDLinkCfgErr (CIP Communica-
tions1 Tag Data Link Setting Error)
• _EIP1_TDLinkOpnErr (CIP Communica-
tions1 Tag Data Link Connection Failed)
• _EIP1_TDLinkErr (CIP Communications1
Tag Data Link Communications Error)
• _EIP1_TagAdrErr (CIP Communications1
Tag Name Resolution Error)
• _EIP1_MultiSwONErr (CIP Communica-
tions1 Multiple Switches ON Error)

Note If a Tag Name Resolution Error


occurs, it is recorded in the event
log and this variable changes to
TRUE. Refer to information on the
meanings of the error status bits at
the end of this appendix for details.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

A-86 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-159
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)

A-5 System-defined Variables


• _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)

Note If a Tag Name Resolution Error


occurs, it is recorded in the event
log and this variable changes to
TRUE. Refer to information on the
meanings of the error status bits at
A
the end of this appendix for details.

Note You can use this system-defined vari-

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


able only for the NX701 CPU Units.
_EIP_TcpAppErr TCP Application This is the error status variable for TCP appli- WORD 16#0000 to page A-159
Communications cation communications. 16#00F0
Error It represents the collective status of the
following error flags.
• _EIP_TcpAppCfgErr (TCP Application Set-
ting Error)
• _EIP_NTPSrvErr (NTP Server Connection
Error)

Note Refer to information on the mean-


ings of the error status bits at the
end of this appendix for details.
_EIP_MacAdrErr MAC Address Error NX-series CPU Units: Indicates that an BOOL TRUE or page A-159
error occurred when the MAC address FALSE
was read on the communications port 1 at
startup.
TRUE: Error
FALSE: Normal
NJ-series CPU Units: Indicates that an
error occurred when the MAC address
was read at startup.
TRUE: Error
FALSE: Normal
_EIP1_MacAdrErr Port1 MAC Address Indicates that an error occurred when the BOOL TRUE or page A-160
Error MAC address was read on the communi- FALSE
cations port 1 at startup.
TRUE: Error
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-87


Appendices

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-160
Error MAC address was read on the communi- FALSE
cations port 2 at startup.
TRUE: Error
FALSE: Normal

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_LanHwErr Communications Con- NX-series CPU Units: Indicates that a BOOL TRUE or page A-160
troller Error communications controller failure FALSE
occurred on the communications port 1.
TRUE: Failure
FALSE: Normal
NJ-series CPU Units: Indicates that a
communications controller failure
occurred.
TRUE: Failure
FALSE: Normal
_EIP1_LanHwErr Port1 Communica- Indicates that a communications controller BOOL TRUE or page A-160
tions Controller Error failure occurred on the communications FALSE
port 1.
TRUE: Failure
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_LanHwErr Port2 Communica- Indicates that a communications controller BOOL TRUE or page A-161
tions Controller Error failure occurred on the communications FALSE
port 2.
TRUE: Failure
FALSE: Normal

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_EtnCfgErr Basic Ethernet Setting NX-series CPU Units: Indicates that the BOOL TRUE or page A-161
Error Ethernet communications speed setting FALSE
(Speed/Duplex) for the communications
port 1 is incorrect. Or, a read operation
failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
NJ-series CPU Units: Indicates that the
Ethernet communications speed setting
(Speed/Duplex) is incorrect. Or, a read
operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
_EIP1_EtnCfgErr Port1 Basic Ethernet Indicates that the Ethernet communica- BOOL TRUE or page A-161
Setting Error tions speed setting (Speed/Duplex) for the FALSE
communications port 1 is incorrect. Or, a
read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.

A-88 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-161
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

Note You can use this system-defined vari-

A-5 System-defined Variables


able only for the NX701 CPU Units.
_EIP_IPAdrCfgErr IP Address Setting NX-series CPU Units: Indicates the IP BOOL TRUE or page A-162
Error address setting errors for the communica- FALSE
tions port 1.
TRUE:
• There is an illegal IP address
setting.
• A read operation failed.
• The IP address obtained from
the BOOTP server is incon-
sistent.
FALSE: Normal
NJ-series CPU Units: Indicates the IP A
address setting errors.
TRUE:

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


• There is an illegal IP address
setting.
• A read operation failed.
• The IP address obtained from
the BOOTP server is incon-
sistent.
• The default gateway settings
are not correct.
FALSE: Normal
_EIP1_IPAdrCfgErr Port1 IP Address Set- Indicates the IP address setting errors for BOOL TRUE or page A-162
ting Error the communications port 1. FALSE
TRUE:
• There is an illegal IP address
setting.
• A read operation failed.
• The IP address obtained from
the BOOTP server is incon-
sistent.
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_IPAdrCfgErr Port2 IP Address Set- Indicates the IP address setting errors for BOOL TRUE or page A-162
ting Error the communications port 2. FALSE
TRUE:
• There is an illegal IP address
setting.
• A read operation failed.
• The IP address obtained from
the BOOTP server is incon-
sistent.
FALSE: Normal

Note You can use this system-defined vari-


able only for NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-89


Appendices

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-163
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.
TRUE: Duplication occurred.
FALSE: Other than the above.
_EIP1_IPAdrDupErr Port1 IP Address Indicates that the same IP address is BOOL TRUE or page A-163
Duplication Error assigned to more than one node for the FALSE
communications port 1.
TRUE: Duplication occurred.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_IPAdrDupErr Port2 IP Address Indicates that the same IP address is BOOL TRUE or page A-163
Duplication Error assigned to more than one node for the FALSE
communications port 2.
TRUE: Duplication occurred.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_DNSCfgErr*1 DNS Setting Error Indicates that the DNS or hosts settings BOOL TRUE or page A-163
are incorrect. Or, a read operation failed. FALSE
TRUE: Setting incorrect or read failed
FALSE: Normal
_EIP_BootpErr BOOTP Server Error NX-series CPU Units: Indicates that a BOOL TRUE or page A-164
BOOTP server connection failure FALSE
occurred on the communications port 1.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP
address was normally obtained
from the BOOTP server.
NJ-series CPU Units: Indicates that a
BOOTP server connection failure
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.
_EIP1_BootpErr Port1 BOOTP Server Indicates that a BOOTP server connection BOOL TRUE or page A-164
Error failure occurred on the communications FALSE
port 1.
TRUE: There was a failure to connect to
the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or
BOOTP is enabled and an IP
address was normally obtained
from the BOOTP server.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

A-90 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-164
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

A-5 System-defined Variables


from the BOOTP server.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_IPRTblErr IP Route Table Error NX-series CPU Units: Indicates that the BOOL TRUE or page A-164
default gateway settings or IP router table FALSE
settings are incorrect.
Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
NJ-series CPU Units: Indicates that the IP
router table or hosts settings are incorrect.
Or, a read operation failed. A
TRUE: Setting incorrect or read failed
FALSE: Normal

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


_EIP_IdentityErr Identity Error NX-series CPU Units: Indicates that the BOOL TRUE or page A-165
identity information for CIP communica- FALSE
tions 1 (which you cannot overwrite) is
incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
NJ-series CPU Units: Indicates that the
identity information (which you cannot
overwrite) is incorrect. Or, a read opera-
tion failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
_EIP1_IdentityErr CIP Communica- Indicates that the identity information for BOOL TRUE or page A-165
tions1 Identity Error CIP communications 1 (which you cannot FALSE
overwrite) is incorrect. Or, a read opera-
tion failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_IdentityErr CIP Communica- Indicates that the identity information for BOOL TRUE or page A-165
tions2 Identity Error CIP communications 2 (which you cannot FALSE
overwrite) is incorrect. Or, a read opera-
tion failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-91


Appendices

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-165
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
read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal
_EIP1_TDLinkCfgErr CIP Communica- Indicates that the tag data link settings for BOOL TRUE or page A-166
tions1 Tag Data Link CIP communications 1 are incorrect. Or, a FALSE
Setting Error read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkCfgErr CIP Communica- Indicates that the tag data link settings for BOOL TRUE or page A-166
tions2 Tag Data Link CIP communications 2 are incorrect. Or, a FALSE
Setting Error read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_TDLinkOpnErr Tag Data Link Con- NX-series CPU Units: Indicates that BOOL TRUE or page A-166
nection Failed establishing a tag data link connection for FALSE
CIP communications 1 failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the
following causes.
• The information registered for
a target node in the tag data
link parameters is different
from the actual node informa-
tion.
• There was no response from
the remote node.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that estab-
lishing a tag data link connection failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the
following causes.
• The information registered for
a target node in the tag data
link parameters is different
from the actual node informa-
tion.
• There was no response from
the remote node.
FALSE: Other than the above.

A-92 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-167
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

A-5 System-defined Variables


link parameters is different
from the actual node informa-
tion.
• There was no response from
the remote node.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkOpnErr CIP Communica- Indicates that establishing a tag data link BOOL TRUE or page A-167
tions2 Tag Data Link connection for CIP communications 2 FALSE
Connection Failed failed.
TRUE: Establishing a tag data link con-
nection failed due to one of the A
following causes.
• The information registered for

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_TDLinkErr Tag Data Link Com- NX-series CPU Units: Indicates that a tim- BOOL TRUE or page A-167
munications Error eout occurred in a tag data link connection FALSE
for CIP communications 1.
TRUE: A timeout occurred.
FALSE: Other than the above.
NJ-series CPU Units: Indicates that a tim-
eout occurred in a tag data link connec-
tion.
TRUE: A timeout occurred.
FALSE: Other than the above.
_EIP1_TDLinkErr CIP Communica- Indicates that a timeout occurred in a tag BOOL TRUE or page A-167
tions1 Tag Data Link data link connection for CIP communica- FALSE
Communications tions 1.
Error TRUE: A timeout occurred.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkErr CIP Communica- Indicates that a timeout occurred in a tag BOOL TRUE or page A-168
tions2 Tag Data Link data link connection for CIP communica- FALSE
Communications tions 2.
Error TRUE: A timeout occurred.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-93


Appendices

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-168
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.
• 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.
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 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.
_EIP1_TagAdrErr CIP Communica- Indicates that tag resolution for CIP com- BOOL TRUE or page A-168
tions1 Tag Name munications 1 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.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

A-94 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-169
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-

A-5 System-defined Variables


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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units. A
_EIP_MultiSwONErr Multiple Switches ON NX-series CPU Units: Indicates that more BOOL TRUE or page A-169
Error than one switch turned ON at the same FALSE
time in CIP communications 1.

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


TRUE: More than one data link start/stop
switch changed to TRUE at the
same time.
FALSE: Other than the above.
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.
_EIP1_MultiSwONErr CIP Communica- Indicates that more than one switch BOOL TRUE or page A-169
tions1 Multiple turned ON at the same time in CIP com- FALSE
Switches ON Error munications 1.
TRUE: More than one data link start/stop
switch changed to TRUE at the
same time.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_MultiSwONErr CIP Communica- Indicates that more than one switch BOOL TRUE or page A-169
tions2 Multiple turned ON at the same time in CIP com- FALSE
Switches ON Error munications 2.
TRUE: More than one data link start/stop
switch changed to TRUE at the
same time.
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_TcpAppCfgErr TCP Application Set- TRUE: At least one of the set values for a BOOL TRUE or page A-170
ting Error TCP application (FTP, NTP, FALSE
SNMP) is incorrect. Or, a read
operation failed.
FALSE: Normal
_EIP_NTPSrvErr NTP Server Connec- TRUE: The NTP client failed to connect to BOOL TRUE or page A-170
tion Error the server (timeout). FALSE
FALSE: NTP is not set or the connection
was successful.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-95


Appendices

Range of
Variable name Meaning Function Data type Reference
values
_EIP_DNSSrvErr DNS Server Connec- TRUE: The DNS client failed to connect to BOOL TRUE or page A-170
tion Error the server (timeout). FALSE
FALSE: DNS is not enabled. Or, DNS is
enabled and the connection was
successful.
*1 With the NJ-series CPU Unit, this variable can be used with the unit version 1.11 or later.

Hierarchical Relationship of System-defined Variables Related to EtherNet/IP Errors in the


NJ-series CPU Unit
The system-defined variables that are related to EtherNet/IP errors have the following hierarchi-
cal relationship. For example, if the value of any of the _EIP_PortErr, _EIP_CipErr, or _EIP_Tc-
pAppErr variables in the second level is TRUE, then the _EIP_ErrSta variable in the first level
also changes to TRUE. Therefore, you can check the values of system-defined variables in a
higher level to see if an error has occurred for a variable in a lower level.
Level 1 Level 2 Level 3
Variable Name Variable Name Variable Name
_EIP_ErrSta Built-in Ether- _EIP_PortErr Communica- _EIP_MacAdr MAC Address Error
Net/IP Error tions Port Error Err
_EIP_LanHwErr Communications Con-
troller Error
_EIP_EtnCfgErr Basic Ethernet Set-
tings Error
_EIP_IPAdrCfg IP Address Setting
Err Error
_EIP_IPAdrDupErr IP Address Duplica-
tion Error
_EIP_BootpErr BOOTP Server Error
_EIP_DNSSrvErr DNS Server Connec-
tion Error
_EIP_IPRTblErr IP Route Table Error
_EIP_CipErr CIP Communi- _EIP_Identity Identity Error
cations Error Err
_EIP_TDLink Tag Data Link Setting
CfgErr Error
_EIP_TDLink Tag Data Link Con-
OpnErr nection Failed
_EIP_TDLink Tag Data Link Com-
Err munications Error
_ EIP_TagAdr Tag Name Resolution
Err Error
_EIP_MultiSw Multiple Switches ON
ONErr Error
_EIP_TcpAppErr TCP Applica- _EIP_TcpApp TCP Application Set-
tion Communi- CfgErr ting Error
cations Error
_EIP_NTPSrv NTP Server Connec-
Err tion Error

A-96 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Hierarchical Relationship of System-defined Variables Related to EtherNet/IP Errors in the


NX-series CPU Unit
The system-defined variables that are related to EtherNet/IP errors have the following hierarchical
relationship. For example, if the value of any of the _EIP1_PortErr, _EIP2_PortErr, EIP1_CipErr,
_EIP2_CipErr, and _EIP_TcpAppErr variables in the second level is TRUE, then the _EIP_ErrSta
variable in the first level also changes to TRUE. Therefore, you can check the values of system-
defined variables in a higher level to see if an error has occurred for a variable in a lower level.

Level 1 Level 2 Level 3

A-5 System-defined Variables


Variable Name Variable Name Variable Name
_EIP_ErrSta Built-in _EIP1_Po Communi- _EIP1_MacAdrErr Port1 MAC Address Error
EtherNet/IP rtErr cations _EIP1_LanHwErr Port1 Communications Controller
Error Port1 Error
Error _EIP1_EtnCfgErr Port1 Basic Ethernet Setting Error
_EIP1_IPAdrCfgErr Port1 IP Address Setting 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 A
_EIP2_Po Communi- _EIP2_MacAdrErr Port2 MAC Address Error
rtErr cations _EIP2_LanHwErr Port2 Communications Controller

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


Port2 Error
Error _EIP2_EtnCfgErr Port2 Basic Ethernet Setting Error
_EIP2_IPAdrCfgErr Port2 IP Address Setting Error
_EIP2_IPAdrDupErr Port2 IP Address Duplication Error
_EIP2_BootpErr Port2 BOOTP Server Error
_EIP_DNSCfgErr DNS Setting Error
_EIP_DNSSrvErr DNS Server Connection Error
_EIP_IPRTblErr IP Route Table Error
_EIP1_Ci- CIP Com- _EIP1_IdentityErr CIP Communications1 Identity Error
pErr munica- _EIP1_TDLinkCfgErr CIP Communications1 Tag Data Link
tions1 Setting Error
Error _EIP1_TDLinkOpnErr CIP Communications1 Tag Data Link
Connection Failed
_EIP1_TDLinkErr CIP Communications1 Tag Data Link
Communications Error
_EIP1_TagAdrErr CIP Communications1 Tag Name
Resolution Error
_EIP1_MultiSwONErr CIP Communications1 Multiple
Switches ON Error
_EIP2_Ci- CIP Com- _EIP2_IdentityErr CIP Communications2 Identity Error
pErr munica- _EIP2_TDLinkCfgErr CIP Communications2 Tag Data Link
tions2 Setting Error
Error _EIP2_TDLinkOpnErr CIP Communications2 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 Communications2 Multiple
Switches ON Error
_EIP_Tc- TCP _EIP_TcpAppCfgErr TCP Application Setting Error
pAppErr Applica- _EIP_NTPSrvErr NTP Server Connection Error
tion Com-
municatio
ns Error

NJ/NX-series CPU Unit Software User’s Manual (W501) A-97


Appendices

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.

 Functional Classification: EtherNet/IP Communications Status

Range of
Variable name Meaning Function Data type Reference
values
_EIP_EtnOnlineSta Online NX-series CPU Units: Indicates that the BOOL TRUE or page A-170
built-in EtherNet/IP port’s communications FALSE
can be used via the communications port
1 (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 processing, or link OFF
status.
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 processing, or link OFF
status.
_EIP1_EtnOnlineSta Port1 Online Indicates that the built-in EtherNet/IP BOOL TRUE or page A-171
port’s communications can be used via FALSE
the communications port 1 (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 processing, or link OFF
status.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_EtnOnlineSta Port2 Online Indicates that the built-in EtherNet/IP BOOL TRUE or page A-171
port’s communications can be used via FALSE
the communications port 2 (that is, the link
is ON, IP address is defined, and there
are no errors).
TRUE: The built-in EtherNet/IP port’s
communications can be used.
FALSE: The built-in EtherNet/IP port’s
communications is disabled due
to an error in initial processing,
restart processing, or link OFF
status.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

A-98 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-171
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.

A-5 System-defined Variables


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-171
tions1 Tag Data Link normal operation in CIP communications FALSE
Communications Sta- 1.
tus TRUE: Normal operation
FALSE: Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkRunSta CIP Communica- Indicates that at least one connection is in BOOL TRUE or page A-172
tions2 Tag Data Link normal operation in CIP communications FALSE
Communications Sta- 2. A
tus TRUE: Normal operation
FALSE: Other than the above.

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


Note You can use this system-defined vari-
able only for the NX701 CPU Units.
_EIP_TDLinkAllRun- All Tag Data Link NX-series CPU Units: Indicates that all tag BOOL TRUE or page A-172
Sta Communications Sta- data links are communicating in CIP com- FALSE
tus munications 1.
TRUE: Tag data links are communicating
in all connections as the origina-
tor.
FALSE: An error occurred in at least one
connection.
NJ-series CPU Units: Indicates that all tag
data links are communicating.
TRUE: Tag data links are communicating
in all connections as the origina-
tor.
FALSE: An error occurred in at least one
connection.
_EIP1_TDLinkAllRun- CIP Communica- Indicates that all tag data links are com- BOOL TRUE or page A-172
Sta tions1 All Tag Data municating in CIP communications 1. FALSE
Link Communica- TRUE: Tag data links are communicating
tions Status in all connections as the origina-
tor.
FALSE: An error occurred in at least one
connection.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkAllRun- CIP Communica- Indicates that all tag data links are com- BOOL TRUE or page A-172
Sta tions2 All Tag Data municating in CIP communications 2. FALSE
Link Communica- TRUE: Tag data links are communicating
tions Status in all connections as the origina-
tor.
FALSE: An error occurred in at least one
connection.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-99


Appendices

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-173
[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-
get node ID of x is registered.
Array[x] is FALSE:
The connection to the node with a tar-
get node ID of x is not registered.
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 tar-
get node ID of x is registered.
Array[x] is FALSE:
The connection to the node with a tar-
get node ID of x is not registered.
_EIP1_RegTargetSta CIP Communica- Gives a list of nodes for which built-in Eth- ARRAY TRUE or page A-173
[255] tions1 Registered Tar- erNet/IP connections are registered for [0..255] OF FALSE
get Node Information CIP communications 1. BOOL
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-
get node ID of x is registered.
Array[x] is FALSE:
The connection to the node with a tar-
get node ID of x is not registered.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_RegTargetSta CIP Communica- Gives a list of nodes for which built-in Eth- ARRAY TRUE or page A-173
[255] tions2 Registered Tar- erNet/IP connections are registered for [0..255] OF FALSE
get Node Information CIP communications 2. BOOL
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-
get node ID of x is registered.
Array[x] is FALSE:
The connection to the node with a tar-
get node ID of x is not registered.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

A-100 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-174
[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:

A-5 System-defined Variables


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. A
_EIP1_EstbTargetSta CIP Communica- Gives a list of nodes that have normally ARRAY TRUE or page A-174
[255] tions1 Normal Target established EtherNet/IP connections for [0..255] OF FALSE
Node Information CIP communications 1. BOOL

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


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.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_EstbTargetSta CIP Communica- Gives a list of nodes that have normally ARRAY TRUE or page A-174
[255] tions2 Normal Target established EtherNet/IP connections for [0..255] OF FALSE
Node Information CIP communications 2. 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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-101


Appendices

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-175
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
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.
NJ-series CPU Units: Shows the operat-
ing status of the target node Controllers
that are connected with the built-in Ether-
Net/IP port as the originator.
The array elements are valid only when the
corresponding Normal Target Node Infor-
mation is TRUE. If the corresponding Nor-
mal Target Node Information is FALSE, the
Target Node Controller Operating Informa-
tion 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.
_EIP1_TargetPLC- CIP Communica- Shows the operating status of the target ARRAY TRUE or page A-175
ModeSta [255] tions1 Target PLC node Controllers that are connected for [0..255] OF FALSE
Operating Mode CIP communications 1, with the built-in BOOL
EtherNet/IP port as the originator.
The array elements are valid only when
the corresponding Normal Target Node
Information is TRUE. If the corresponding
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.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

A-102 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-175
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

A-5 System-defined Variables


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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_TargetPLCErr Target PLC Error NX-series CPU Units: Shows the error ARRAY TRUE or page A-176
[255] Information status (logical OR of fatal and non-fatal [0..255] OF FALSE
errors) of the target node Controllers that BOOL A
are connected for CIP communications 1,
with the built-in EtherNet/IP ports as the
originator. The array elements are valid

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


only when the corresponding Normal Tar-
get Node Information is TRUE. The imme-
diately preceding value is retained if this
variable is FALSE.
Array[x] is TRUE:
A fatal or non-fatal error occurred in the
target Controller with a target node ID
of x.
Array[x] is FALSE:
Other than the above.
NJ-series CPU Units: Shows the error sta-
tus (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 variable is FALSE.
Array[x] is TRUE:
A fatal or non-fatal error occurred in the
target Controller with a target node ID
of x.
Array[x] is FALSE:
Other than the above.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-103


Appendices

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-176
[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
value is retained if this variable is FALSE.
Array[x] is TRUE:
A fatal or non-fatal error occurred in the
target Controller with a target node ID
of x.
Array[x] is FALSE:
Other than the above.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TargetPLCErr CIP Communica- Shows the error status (logical OR of fatal ARRAY TRUE or page A-176
[255] tions2 Target PLC and non-fatal errors) of the target node [0..255] OF FALSE
Error Information Controllers that are connected for CIP BOOL
communications 2, 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
value is retained if this variable is FALSE.
Array[x] is TRUE:
A fatal or non-fatal error occurred in the
target Controller with a target node ID
of x.
Array[x] is FALSE:
Other than the above.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

A-104 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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-177
[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.

A-5 System-defined Variables


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 A
connection was normally established
with the target node (the Registered
Target Node Information is TRUE and

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


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).

NJ/NX-series CPU Unit Software User’s Manual (W501) A-105


Appendices

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-177
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.
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 Information is TRUE and the Nor-
mal 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).

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_Target- CIP Communica- Indicates that the connection for the Reg- ARRAY TRUE or page A-178
NodeErr [255] tions2 Target Node istered Target Node Information for CIP [0..255] OF FALSE
Error Information communications 2 was not established or BOOL
that an error occurred in the target Con-
troller.
The array elements are valid only when
the Registered Target Node Information is
TRUE.
Array[x] is TRUE:
A connection was not normally estab-
lished with the target node for a target
node ID of x (the Registered Target
Node Information is TRUE and the Nor-
mal 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).

Note You can use this system-defined vari-


able only for the NX701 CPU Units.

A-106 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Range of
Variable name Meaning Function Data type Reference
values
_EIP_NTPResult NTP Operation Infor- Use the GetNTPStatus instruction to read _sNTP_ page A-178
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-178
Time ended normally. The time that was TIME data type.
obtained from the NTP server is stored
when the time is obtained normally. The

A-5 System-defined Variables


time is not stored if it is not obtained from
the NTP server normally.

Note Do not use this variable in the user


program. There may be a delay in
updating it. Use this variable only to
access status through communica-
tions from an external device.
.ExecNormal NTP Operation Result TRUE: Indicates an NTP normal end. BOOL TRUE or page A-178
FALSE: Indicates that NTP operation FALSE
ended in an error or has not been exe-
cuted even once.

Note Do not use this variable in the user


program. There may be a delay in A
updating it. Use this variable only to
access status through communica-
tions from an external device.

A-5-7 EtherNet/IP Function Module, Category Name: _EIP

NJ/NX-series CPU Unit Software User’s Manual (W501) A-107


Appendices

Additional Information

Communications Status with Target Node


The communications status with the target node of an NJ/NX-series Controller is shown by the
combination of the values of four system-defined variables.
• _EIP_RegTargetSta (Registered Target Node Information)
• _EIP_EstbTargetSta (Normal Target Node Information)
• _EIP_TargetPLCErr (Target PLC Error Information)
• _EIP_TargetNodeErr (Target Node Error Information)

Value of Value of Value of Value of


Communications status with target
_EIP_RegTarget- _EIP_EstbTar- _EIP_Target- _EIP_Target-
node
Sta getSta PLCErr NodeErr
TRUE TRUE FALSE FALSE A connection with the target node was
established normally and there is no error
in the target PLC.
TRUE TRUE A connection with the target node was
established but there is an error in the
target PLC.
FALSE Disabled TRUE A connection with the target node was
not established normally.
FALSE Disabled Disabled Disabled The information is not valid because the
target node is not registered.

For the NX-series Controller, the communications status of CIP communications 1 and CIP com-
munications 2 is shown by the combination of the values of four system-defined variables in the
same way as shown in the above table.
• CIP Communications 1
• _EIP1_RegTargetSta (CIP Communications1 Registered Target Node Information)
• _EIP1_EstbTargetSta (CIP Communications1 Normal Target Node Information)
• _EIP1_TargetPLCErr (CIP Communications1 Target PLC Error Information)
• _EIP_TargetNodeErr (Target Node Error Information)
• CIP Communications 2
• _EIP2_RegTargetSta (CIP Communications2 Registered Target Node Information)
• _EIP2_EstbTargetSta (CIP Communications2 Normal Target Node Information)
• _EIP2_TargetPLCErr (CIP Communications2 Target PLC Error Information)
• _EIP_TargetNodeErr (Target Node Error Information)

A-108 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Functional Classification: EtherNet/IP Communications Switches

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-179
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.

A-5 System-defined Variables


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.

Note Do not force this switch to change


to FALSE from the user program or
from the Sysmac Studio. It changes
to FALSE automatically.
_EIP1_TDLinkStart- CIP Communica- Change this variable to TRUE to start tag BOOL TRUE or page A-179
Cmd tions1 Tag Data Link data links for CIP communications 1. FALSE
Communications Start It automatically changes back to FALSE
Switch after tag data link operation starts.

Note Do not force this switch to change


A
to FALSE from the user program or
from the Sysmac Studio. It changes

A-5-7 EtherNet/IP Function Module, Category Name: _EIP


to FALSE automatically.

Note You can use this system-defined vari-


able only for NX-series CPU Units.
_EIP2_TDLinkStart- CIP Communica- Change this variable to TRUE to start tag BOOL TRUE or page A-179
Cmd tions2 Tag Data Link data links for CIP communications 2. FALSE
Communications Start It automatically changes back to FALSE
Switch 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.

Note You can use this system-defined vari-


able only for the NX701 CPU Units.
_EIP_TDLinkStop- Tag Data Link Com- NX-series CPU Units: Change this vari- BOOL TRUE or page A-180
Cmd munications Stop able to TRUE to stop tag data links for CIP FALSE
Switch communications 1.
It automatically changes back to FALSE
after tag data link operation stops.
NJ-series CPU Units: Change this vari-
able 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.
_EIP1_TDLinkStop- CIP Communica- Change this variable to TRUE to stop tag BOOL TRUE or page A-180
Cmd tions1 Tag Data Link data links for CIP communications 1. FALSE
Communications Stop It automatically changes back to FALSE
Switch 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.

Note You can use this system-defined vari-


able only for NX-series CPU Units.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-109


Appendices

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-180
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.

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 vari-


able only for the NX701 CPU Units.

A-5-8 Meanings of Error Status Bits


The meanings of the individual bits in the following error status are the same.
• _ErrSta (Controller Error Status)
• _PLC_ErrSta (PLC Function Module Error Status)
• _CJB_ErrSta (I/O Bus Error Status)
• _CJB_MstrErrSta (I/O Bus Master Error Status)
• _CJB_UnitErrSta (I/O Bus Unit Error Status)
• _NXB_ErrSta (NX Bus Function Module Error Status)
• _NXB_MstrErrSta (NX Bus Function Module Master Error Status)
• _NXB_UnitErrStaTbl (NX Bus Function Module Unit Error Status)
• _MC_ErrSta (Motion Control Function Module Error Status)
• _MC_ComErrSta (MC Common Error Status)
• _MC_AX_ErrSta (Axis Error Status)
• _MC_GRP_ErrSta (Axes Group Error Status)
• _EC_ErrSta (Built-in EtherCAT Error)
• _EC_PortErr (Communications Port Error)
• _EC_MstrErr (Master Error)
• _EC_SlavErr (Slave Error)
• _EC_SlavErrTbl (Slave Error Table)
• _EIP_ErrSta (Built-in EtherNet/IP Error)
• EIP_PortErr (Communications Port Error), _EIP1_PortErr (Communications Port1 Error), and
_EIP2_PortErr (Communications Port2 Error)
• _EIP_CipErr (CIP Communications Error), _EIP1_CipErr (CIP Communications1 Error), and
_EIP2_CipErr (CIP Communications2 Error)
• _EIP_TcpAppErr (TCP Application Communications Error)
The meaning of the bits are shown in the following table.
However, do not use the following variables in the user program:_ErrSta (Controller Error Status),
_CJB_ErrSta (I/O Bus Error Status), _CJB_MstrErrSta (I/O Bus Master Error Status), _CJB_UnitErrSta
(I/O Bus Master Unit Status), _NXB_ErrSta (NX Bus Function Module Error Status), _NXB_MstrErrSta
(NX Bus Function Module Master Error Status), and _NXB_UnitErrStaTbl (NX Bus Function Module
Unit Error Status). There may be a delay in updating them and concurrency problems in relation to the
error status of the function module.
Use these variables only to access status through communications from an external device.

A-110 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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.

A-5 System-defined Variables


(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.
A
FALSE: A partial fault level Controller error has not occurred.
5 This bit indicates whether a minor fault level Controller error has occurred.

A-5-8 Meanings of Error Status Bits


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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-111


Appendices

A-6 Specifications for Individual System-


defined Variables
The specifications for each system-defined variable are given as described below.

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.
the user pro-
gram is speci-
fied.

A-112 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


A-6-1 System-defined Variables for the Overall NJ/NX-series Controller
(No Category)
 Functional Classification: Clock

Variable name _CurrentTime


Meaning System Time Global/local Global
Function This variable contains the CPU Unit’s internal clock data.
Data type DATE_AND_TIME Range of values • NX-series CPU Units
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
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- Clock instructions
tions

A
 Functional Classification: Tasks

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name _TaskName_Active
Meaning Task Active Flag Global/local Global
Function TRUE during task execution.
FALSE when task execution is not in progress.

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

Variable name _TaskName_LastExecTime


Meaning Last Task Execution Time Global/local Global
Function Contains the task execution time the last time the task was executed (unit: 0.1 µs).

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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-113


Appendices

Variable name _TaskName_MaxExecTime


Meaning Maximum Task Execution Time Global/local Global
Function Contains the maximum value of the task execution time (unit: 0.1 µs).

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

Variable name _TaskName_MinExecTime


Meaning Minimum Task Execution Time Global/local Global
Function Contains the minimum value of the task execution time (unit: 0.1 µs).

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

Variable name _TaskName_ExecCount


Meaning Task Execution Count Global/local Global
Function Contains the number of executions of the task.
If 4294967295 is exceeded, the value returns to 0 and counting is continued.

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

Variable name _TaskName_Exceeded


Meaning Task Period Exceeded Flag Global/local Global
Function TRUE if the task period was exceeded.
FALSE if task execution was completed 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 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

A-114 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _TaskName_ExceedCount
Meaning Task Period Exceeded Count Global/local Global
Function Contains the number of times that the period was exceeded.
If the present value exceeds the maximum value of the data type, the present value returns to 0 and the count is
continued.
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 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

 Functional Classification: Errors

Variable name _ErrSta


Meaning Controller Error Status Global/local Global
Function TRUE if there is a Controller error. A
FALSE if there is no Controller error.

Note Do not use this variable in the user program. There may be a delay in updating it and concurrency prob-

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
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-5-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

Variable name _AlarmFlag


Meaning User-defined Error Status Global/local Global
Function The bit corresponding to the event level is TRUE while there is a user-defined error.
Bits 00 to 07 correspond to user fault levels 1 to 8.
This variable contains 0000 hex when there is no user-defined error.
Data type WORD Range of values 16#0000 to 16#00FF
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • SetAlarm
tions • ResetAlarm
• GetAlarm

NJ/NX-series CPU Unit Software User’s Manual (W501) A-115


Appendices

 Functional Classification: SD Memory Card

Variable name _Card1Ready


Meaning SD Memory Card Ready Flag Global/local Global
Function TRUE when the SD Memory Card is recognized.
FALSE when an SD Memory Card is not recognized.
TRUE: The Card can be used.
FALSE: The Card cannot be used.
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- ---
tions

Variable name _Card1Protect


Meaning SD Memory Card Write Protected Flag Global/local Global
Function TRUE when the SD Memory Card is write-protected with the LOCK switch.
TRUE: Write protected.
FALSE: Not write protected.
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- ---
tions

Variable name _Card1Err


Meaning SD Memory Card Error Flag Global/local Global
Function TRUE when an unusable SD Memory Card is inserted or a format error occurs.
TRUE: There is an error
FALSE: There is no error
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- ---
tions

Variable name _Card1Access


Meaning SD Memory Card Access Flag Global/local Global
Function TRUE during SD Memory Card access.
TRUE: Card is being accessed.
FALSE: Card is not being accessed.
The system updates the flag every 100 ms. Because of this, access to the SD Memory Card is shown by this flag
with a delay of up to 100 ms. We therefore do not recommend the use of this variable in the user program.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions

A-116 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _Card1Deteriorated
Meaning SD Memory Card Life Warning Flag Global/local Global
Function TRUE when the life of the SD Memory Card is exceeded.
If this variable changed to TRUE, replace the SD Memory Card.
Read/write operation may fail if the SD Memory Card is not replaced.
TRUE: The life of the Card has been exceeded.
FALSE: The Card can still be used.
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- ---
tions

Variable name _Card1PowerFail


Meaning SD Memory Card Power Interruption Flag Global/local Global
Function TRUE when the power supply to the CPU Unit was interrupted during access to the SD Memory Card.
TRUE: Power was interrupted during SD Memory Card access.
FALSE: Normal.
Data type BOOL Range of values TRUE or FALSE A
R/W access RW Retained Retained.*1 Network Publish Published.

Usage in user program Possible. Related instruc- ---

A-6-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.

Variable name _Card1BkupCmd*1 Member name .ExecBkup

Meaning Execute Backup Flag Global/local Global


Function Change this variable to TRUE to back up Controller data to an SD Memory Card.

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.

Variable name _Card1BkupCmd*1 Member name .CancelBkup


Meaning Cancel Backup Flag Global/local Global
Function Change this variable to TRUE to cancel backing up data to an SD Memory Card.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-117


Appendices

Variable name _Card1BkupCmd*1 Member name .ExecVefy


Meaning Execute Verify Flag Global/local Global
Function Change this variable to TRUE to compare the Controller data to a backup file in the SD Memory Card.

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.

Variable name _Card1BkupCmd*1 Member name .CancelVefy


Meaning Cancel Verify Flag Global/local Global
Function Change this variable to TRUE to cancel comparing the Controller data to a backup file in the SD Memory Card.

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.

Variable name _Card1BkupCmd*1 Member name .DirName


Meaning Directory Name Global/local Global
Function Used to specify the directory name in the SD Memory Card for which to back up data.

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.

Variable name _Card1BkupSta*1 Member name .Done


Meaning Done Flag Global/local Global
Function TRUE when a backup is completed.

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.

A-118 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _Card1BkupSta*1 Member name .Active
Meaning Active Flag Global/local Global
Function TRUE when a backup is in progress.

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.

Variable name _Card1BkupSta*1 Member name .Err


Meaning Error Flag Global/local Global
Function TRUE when processing a backup ended in an error.

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. A
Usage in user program Not possible. Related instruc- ---
tions

A-6-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.

Variable name _Card1VefySta*1 Member name .Done


Meaning Done Flag Global/local Global
Function TRUE when a verification is completed.

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.

Variable name _Card1VefySta*1 Member name .Active


Meaning Active Flag Global/local Global
Function TRUE when a verification is in progress.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-119


Appendices

Variable name _Card1VefySta*1 Member name .VefyRslt


Meaning Verify Result Flag Global/local Global
Function TRUE if the data was the same. FALSE if differences were found.

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.

Variable name _Card1VefySta*1 Member name .Err


Meaning Error Flag Global/local Global
Function TRUE when processing a verification ended in an error.

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.

Variable name _Card1PrgTransferCmd*1 Member name .Exec


Meaning Execute Program Transfer Flag Global/local Global
Function Change this variable to TRUE to transfer the data in a backup file on the SD Memory Card to the Controller by
using the function to transfer programs from the SD Memory Card.

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.

Variable name _Card1PrgTransferCmd*1 Member name .DirName


Meaning Directory Name Global/local Global
Function Use this variable to specify the directory name in the SD Memory Card in which the backup file to be transferred
is stored.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: Depends on data type.
Range of values
STRING(64)
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.

A-120 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _Card1PrgTransferCmd*1 Member name .Password
Meaning Password Global/local Global
Function Use this variable to specify the password that is used for verification when you start transferring the programs.
The password is initialized every time you start transferring programs from the SD Memory Card.
Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sPRGTRANSFER_CMD, Member: Depends on data type.
Range of values
STRING(33)
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.11 of the CPU Unit.

Variable name _Card1PrgTransferCmd*1 Member name .TargetUserProgram


Meaning User Program and Settings Transfer Flag Global/local Global
Function Change this variable to TRUE to set a user program or setting as the transfer target.

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- --- A
tions
*1 This system-defined variable was added for unit version 1.11 of the CPU Unit.

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
*2 This system-defined variable is not applicable for the data backup function even with a Retain attribute.

Variable name _Card1PrgTransferCmd*1 Member name .TargetIPAdr


Meaning IP Address Transfer Flag Global/local Global
Function Change this variable to TRUE to include the 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.
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.

Variable name _Card1PrgTransferCmd*1 Member name .TargetVariable


Meaning Present Values of Variables with the Retain Attribute Global
Global/local
Transfer Flag
Function Change this variable to TRUE to set the present values of variables with the Retain attribute as the transfer tar-
get.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-121


Appendices

Variable name _Card1PrgTransferCmd*1 Member name .TargetMemory


Meaning Present Values of Memory Used for CJ-series Units Global
Global/local
with the Retain Attribute Transfer Flag
Function Change this variable to TRUE to set the present values of the memory used for CJ-series Units with the Retain
attribute as the transfer target.

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.

Variable name _Card1PrgTransferSta*1 Member name .Done


Meaning Done Flag Global/local Global
Function TRUE when a program transfer is completed.

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.

Variable name _Card1PrgTransferSta*1 Member name .Active


Meaning Active Flag Global/local Global
Function TRUE when a program transfer is in progress.

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.

Variable name _Card1PrgTransferSta*1 Member name .Err


Meaning Error Flag Global/local Global
Function TRUE when a program transfer ended in an error.

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.

Variable name _Card1RestoreCmd*1 Member name .Exec


Meaning Execute Restore Flag Global/local Global
Function Change this variable to TRUE to restore the data in a backup file on the SD Memory Card to the Controller.

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.

A-122 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _Card1RestoreCmd*1 Member name .DirName
Meaning Directory Name Global/local Global
Function Use this variable to specify the directory name in the SD Memory Card in which the backup file to be restored by
the system-defined variable is stored.

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.

Variable name _Card1RestoreCmd*1 Member name .Password


Meaning Password Global/local Global
Function Use this variable to specify the password that is used for verification when you start the restore by the system-
defined variable.
The password is initialized every time when the restore by the system-defined variable is started.

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. A
R/W access RW Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.

Variable name _Card1RestoreSta*1 Member name .Done


Meaning Done Flag Global/local Global
Function TRUE when a restore operation is completed.

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.

Variable name _Card1RestoreSta*1 Member name .Active


Meaning Active Flag Global/local Global
Function TRUE when a restore operation is in progress.

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.

Variable name _Card1RestoreSta*1 Member name .Err


Meaning Error Flag Global/local Global
Function TRUE when a restore operation ended in an error.

Note You can use this system-defined variable only for NJ/NX-series CPU Units.
Data type Structure: _sRESTORE_STA, Member: BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions
*1 This system-defined variable was added for unit version 1.14 of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-123


Appendices

Variable name _Card1RestoreCmdTargetUserProgram*1


Meaning User Program and Settings Transfer Flag Global/local Global
Function Change this variable to TRUE to set a user program or setting for the restore by the system-defined variable as
the transfer target.
Always set this variable to TRURE for the restore by the system-defined variable.

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.

Variable name _Card1RestoreCmdTargetIPAdr*1


Meaning IP Address Transfer Flag Global/local Global
Function Change this variable to TRUE to include the IP address of the built-in EtherNet/IP port for the restore by the sys-
tem-defined variable as the transfer target.
The IP address means setting type, IP address, subnet mask, and default gateway.
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.

Variable name _Card1RestoreCmdTargetVariable*1


Meaning Present Values of Variables with the Retain Attribute Global
Global/local
Transfer Flag
Function Change this variable to TRUE to set the present values of variables with the Retain attribute for the restore by the
system-defined variable as the transfer target.

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.

Variable name _Card1RestoreCmdTargetMemory*1


Meaning Present Values of Memory Used for CJ-series Units Global
Global/local
with the Retain Attribute Transfer Flag
Function hange this variable to TRUE to set the present values of the memory used for CJ-series Units with the Retain
attribute for the restore by the system-defined variable as the transfer target.
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-124 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _Card1RestoreCmdTargetUnitConfig*1
Meaning Unit and Slave Parameters Transfer Flag Global/local Global
Function Change this variable to TRUE to set the Unit and slave settings for the restore by the system-defined variable as
the transfer target.

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.

Variable name _Card1RestoreCmdTargetAbsEncoder*1


Meaning Absolute Encoder Home Offset Transfer Flag Global/local Global
Function Change this variable to TRUE to set the absolute encoder home offset for the restore by the system-defined vari-
able as the transfer target.

Note You can use this system-defined variable only for NJ/NX-series CPU Units. A
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Retained.*2 Network Publish Published.

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
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.

 Functional Classification: Backup

Variable name _BackupBusy*1


Meaning Backup Function Busy Flag Global/local Global
Function TRUE when a backup, restoration, or verification is in progress.
Data type BOOL Range of values TRUE or FALSE
R/W access Read 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.03 of the CPU Unit.

 Functional Classification: Power Supply

Variable name _PowerOnHour


Meaning Total Power ON Time Global/local Global
Function Contains the total time that the power has been ON.
Contains the total time that the CPU Unit has been ON in 1-hour increments.
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.
Data type UDINT Range of values 0 to 4294967295
R/W access RW Retained Retained.*1 Network Publish Published.

Usage in user program Possible. Related instruc- ---


tions

*1 This system-defined variable is not applicable for the data backup function even with a Retain attribute.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-125


Appendices

Variable name _PowerOnCount


Meaning Power Interruption Count Global/local Global
Function Contains the number of times that the power supply has been interrupted.
The value is incremented by 1 each time the power supply is interrupted after the first time that the power was
turned ON.
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.
Data type UDINT Range of values 0 to 4294967295
R/W access RW Retained Retained.*1 Network Publish Published.

Usage in user program Possible. Related instruc- ---


tions

*1 This system-defined variable is not applicable for the data backup function even with a Retain attribute.

Variable name _RetainFail


Meaning Retention Failure Flag Global/local Global
Function TRUE at the following times (failure of retention during power interruptions).
• 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.

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

 Functional Classification: Programming

Variable name P_On


Meaning Always TRUE Flag Global/local Global
Function This flag is always TRUE.
Data type BOOL Range of values TRUE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions

Variable name P_Off


Meaning Always FALSE Flag Global/local Global
Function This flag is always FALSE.
Data type BOOL Range of values FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions

Variable name P_CY


Meaning Carry Flag Global/local Local
Function This flag is updated by some instructions.

A-126 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


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

Variable name P_First_RunMode


Meaning First RUN Period Flag Global/local Local
Function This flag is TRUE for only one task period after the operating mode of the CPU Unit is changed from PROGRAM
mode to RUN mode if execution of the program is in progress.
This flag remains FALSE if execution of the program is not in progress.
Use this flag to perform initial processing when the CPU Unit begins operation.

Note You cannot use this system-defined variable inside functions.


Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions

Variable name P_First_Run*1


Meaning First Program Period Flag Global/local Local A
Function This flag is TRUE for one task period after execution of the program starts.
Use this flag to perform initial processing when execution of a program starts.

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Note You cannot use this system-defined variable inside functions.
Data type BOOL Range of values TRUE or FALSE
R/W access R Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions

*1 This system-defined variable was added for unit version 1.08 of the CPU Unit.

Variable name P_PRGER


Meaning Instruction Error Flag Global/local Local
Function This flag changes to and remains TRUE when an instruction error occurs in the program or in a function/function
block called from the program. After this flag changes to TRUE, it stays TRUE until the user program changes it
back to FALSE.
Data type BOOL Range of values TRUE or FALSE
R/W access RW Retained Not retained. Network Publish Not published.
Usage in user program Possible. Related instruc- ---
tions

 Functional Classification: Communications

Variable name _Port_numUsingPort


Meaning Number of Used Ports Global/local Global
Function Gives the number of internal logical ports that are currently used.
You can use this variable when you debug the user program.

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)

NJ/NX-series CPU Unit Software User’s Manual (W501) A-127


Appendices

Variable name _Port_isAvailable


Meaning Network Communications Instruction Enabled Flag Global/local Global
Function Indicates whether there is an available internal logical port.
TRUE when an internal logical port is available. Otherwise FALSE.

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)

Variable name _FINSTCPConnSta


Meaning FINS/TCP Connection Status Global/local Global
Function Gives the FINS/TCP connection status.

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

*1 The network for CPU Units with unit version 1.07 or earlier is not published.

 Functional Classification: Version

Variable name _UnitVersion*1


Meaning Unit Version Global/local Global
Function Contains the unit version of the CPU Unit.
The integer part of the unit version is stored in element number 0.
The fractional part of the unit version is stored in element number 1.
Example 1) If the unit version is 1.08, “1” is stored in element number 0 and “8” is stored in element number 1.
Example 2) If the unit version is 1.10, “1” is stored in element number 0 and “10” is stored in element number 1.
Data type ARRAY[0..1] OF USINT Range of values 0 to 99
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.08 of the CPU Unit.

Variable name _HardwareRevision*1


Meaning Hardware Revision Global/local Global
Contains the hardware revision of the CPU Unit.
Function
Contains - if the hardware revision is in blank, and A to Z for other cases.
Data type STRING[2] Range of values - or A to Z
R/W access R Retained Not retained. Network Publish Published.
Possible. Related instruc- ---
Usage in user program
tions
*1 This system-defined variable was added for unit version 1.11 of the CPU Unit.

A-128 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


 Functional Classification: Self-diagnosis

Variable name _SelfTest_HighTemperature*1


Meaning CPU Unit High Temperature Flag Global/local Global
Function TRUE when the internal temperature of the CPU Unit is too high.

Note Always FALSE for an 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.

Variable name _SelfTest_LowBattery*1


Meaning Low Battery Flag Global/local Global
Function TRUE when the battery is disconnected or the battery voltage is dropped.
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 A
*1 This system-defined variable was added for unit version 1.10 of the CPU Unit.

A-6-1 System-defined Variables for the Overall NJ/NX-series Controller (No Category)
Variable name _SelfTest_LowFanRevolution*1
Meaning Low FAN Revolution Flag Global/local Global
Function TRUE when the fan is disconnected or the rotation speed of a fan is decreased.

Note Always FALSE for an 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.

 Functional Classification: PLC Built-in

Variable name _DeviceOutHoldCfg*1


Meaning Device Output Hold Configuration Global/local Global
Function It is 16#A5A5 if you retain the target device output when the operating mode is changed or when downloaded.
In the case other than 16#A5A5, the target device output is initialized when the operating mode is changed or when
downloaded.
Data type WORD Range of values 16#0000 to 16#FFFF
R/W access RW Retained 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.

Variable name _DeviceOutHoldStatus*1


Meaning Device Output Hold Status Global/local Global
Function It is TRUE if the target device output is retained when the operating mode is 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 target device output is initialized and changes to FALSE.
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-129


Appendices

A-6-2 PLC Function Module, Category Name: _PLC


 Functional Classification: Debugging

Variable name _PLC_TraceSta[0..3] Member name .IsStart


Meaning Trace Busy Flag Global/local Global
Function TRUE when a trace starts.

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

Variable name _PLC_TraceSta[0..3] Member name .IsComplete


Meaning Trace Completed Flag Global/local Global
Function TRUE when a trace is completed.

Note You cannot use this system-defined variable 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

Variable name _PLC_TraceSta[0..3] Member name .IsTrigger


Meaning Trace Trigger Monitor Flag Global/local Global
Function TRUE when the trigger condition is met.
FALSE when the next trace starts.

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

A-130 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _PLC_TraceSta[0..3] Member name .ParamErr
Meaning Trace Parameter Error Flag Global/local Global
Function TRUE when a trace starts, but there is an error in the trace settings.
FALSE when the settings are normal.

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

 Functional Classification: Errors

Variable name _PLC_ErrSta


Meaning PLC Function Module Error Status Global/local Global
Function TRUE when there is a Controller error that involves the PLC Function Module.
FALSE when there is no Controller error that involves the PLC Function Module.
Refer to A-5-8 Meanings of Error Status Bits for the meanings of the error status bits.
A
Data type WORD Range of values 16#0000 to 16#00F0

A-6-2 PLC Function Module, Category Name: _PLC


R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • GetPLCError
tions You can use the following instruction to clear this variable.
• ResetPLCError

 Functional Classification: Option Boards

Variable name _PLC_OptBoardSta*1


Meaning Option Board Status Global/local Global
Function Contains the status of Option Boards. This variable is commonly used regardless of the models of Option Boards.
The array element 1 corresponds to the option board slot 1 and array element 2 corresponds to the option board
slot 2.

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.

Variable name _PLC_OptBoardSta*1 Member name isDetect


Meaning Option Board Mounted Global/local Global
Function Indicates an Option Board is mounted to the option board slot.
TRUE: Mounted.
FALSE: Not mounted.
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-131


Appendices

Variable name _PLC_OptBoardSta*1 Member name Run


Meaning Option Board Normal Operation Global/local Global
Function Indicates whether an Option Board is normally operating.
To use device variables or communications instructions for an Option Board, program this member as an interlock
condition in the user program.
TRUE: Normally operating.
FALSE: Initializing, changing settings, or an error occurred.

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.

Variable name _PLC_OptBoardSta*1 Member name Error


Meaning Option Board Error Global/local Global
Function Indicates whether an Option Board error occurred.
TRUE: An error occurred.
FALSE: An error not occurred.

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.

Variable name _PLC_OptSerialErrSta*1


Meaning Serial Option Board Error Status Global/local Global
Function Contains the error status of an transmission error for the Serial Communications Option Board.
When the Serial communications mode of an Serial Communications Option Board is only set to Host Link (FINS),
the value of each member is updated.
Other than the above setting, the values of all members are FALSE.
The array element 1 corresponds to the option board slot 1 and array element 2 corresponds to the option board
slot 2.
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 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.

A-132 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _PLC_OptSerialErrSta*1 Member name Error
Meaning Transmission Error Global/local Global
Function Indicates whether a transmission error occurred.
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.
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
Variable name _PLC_OptSerialErrSta*1 Member name ParityErr

A-6-2 PLC Function Module, Category Name: _PLC


Meaning Parity Error Global/local Global
Function Indicates whether a parity error occurred. If this error occurs, it means that the serial communications settings may
not apply to the remote device to connect.
TRUE: A parity error occurred.
FALSE: FALSE due to one of the following causes.
• A parity 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.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-133


Appendices

Variable name _PLC_OptSerialErrSta*1 Member name FramingErr


Meaning Framing Error Global/local Global
Function Indicates whether a framing error occurred. If this error occurs, it means that the serial communications settings
may not apply to the remote device to connect.
TRUE: A framing error occurred.
FALSE: FALSE due to one of the following causes.
• A framing 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.

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.

Variable name _PLC_OptSerialErrSta*1 Member name OverRun


Meaning Overrun Error Global/local Global
Function Indicates whether an overrun error occurred. If this error occurs, it means that the baud rate 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.

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-134 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


A-6-3 PLC Function Module, Category Name: _CJB
 Functional Classification: I/O Bus Status

Variable name _CJB_MaxRackNo


Meaning Largest Rack Number Global/local Global
Function Contains the largest rack number of the Expansion Racks that are detected by the Controller.

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

Variable name _CJB_MaxSlotNo


Meaning Largest Slot Number Global/local Global
Function Contains one higher than the largest slot number with a CJ-series Unit on each of the Racks that are detected by A
the Controller.

Note You can use this system-defined variable only for NJ-series CPU Units.

A-6-3 PLC Function Module, Category Name: _CJB


Data type ARRAY [0..3] OF UINT Range of values 0 to 10
0: No CJ-series Unit mounted.
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions

 Functional Classification: I/O Bus Errors

Variable name _CJB_ErrSta


Meaning I/O Bus Error Status Global/local Global
Function Gives the I/O bus error status.

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-5-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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-135


Appendices

Variable name _CJB_MstrErrSta


Meaning I/O Bus Master Error Status Global/local Global
Function Gives the I/O bus master error status.

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-5-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

Variable name _CJB_UnitErrSta


Meaning I/O Bus Unit Error Status Global/local Global
Function Gives the error status of the I/O Bus Unit.

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-5-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

Variable name _CJB_InRespTm


Meaning Basic Input Unit Input Response Times Global/local Global
Function Contains the response times of the Basic I/O Units.

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

A-136 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


 Functional Classification: Auxiliary Area Bits for CJ-series Units

Variable name _CJB_IOUnitInfo


Meaning Basic I/O Unit Information Global/local Global
Function Shows the status of the Basic I/O Unit alarm output (load short-circuit protection).
TRUE: Load short-circuit
FALSE: No load short-circuit

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

Variable name _CJB_CBU00InitSta


to
_CJB_CBU15InitSta A
Meaning CPU Bus Unit Initializing Flags Global/local Global
Function The corresponding variable is TRUE during initialization of the CPU Bus Unit.

A-6-3 PLC Function Module, Category Name: _CJB


The corresponding variable changes to FALSE when the initialization is completed.
The numbers in the variables indicate the unit numbers of the applicable Units.

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

Variable name _CJB_SIO00InitSta


to
_CJB_SIO95InitSta
Meaning Special I/O Unit Initializing Flags Global/local Global
Function The corresponding variable is TRUE during initialization of the Special I/O Unit.
The corresponding variable changes to FALSE when the initialization is completed.
The numbers in the variables indicate the unit numbers of the applicable Units.

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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-137


Appendices

Variable name _CJB_CBU00Restart


to
_CJB_CBU15Restart
Meaning CPU Bus Unit Restart Bits Global/local Global
Function The CPU Bus Unit is restarted when the corresponding variable changes to TRUE. (It is changed to FALSE by the
system after the CPU Bus Unit is restarted.)
The numbers in the variables indicate the unit numbers of the applicable Units.
If you change the Restart Flag to TRUE with an instruction, the restart process begins from refresh processing in
the next task period.

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

Variable name _CJB_SIO00Restart


to
_CJB_SIO95Restart
Meaning Special I/O Unit Restart Bits Global/local Global
Function The Special I/O Unit is restarted when the corresponding variable changes to TRUE. (It is changed to FALSE by
the system after the CPU Bus Unit is restarted.)
The numbers in the variables indicate the unit numbers of the applicable Units.
If you change the Restart Flag to TRUE with an instruction, the restart process begins from refresh processing in
the next task period.

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

A-138 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _CJB_SCU00P1ChgSta
_CJB_SCU00P2ChgSta
to
_CJB_SCU15P1ChgSta
_CJB_SCU15P2ChgSta
Meaning Serial Communications Unit 0, Port 1/2 Settings Global/local Global
Changing Flags
···
Serial Communications Units 1 to 15, Port 1/2 Settings
Changing Flags
Function TRUE when the parameters of the specified port are being changed.
FALSE after the parameters are changed.
It is also possible for the user to indicate a change in serial port settings by turning ON the corresponding flag
through the execution of an instruction or a user operation.

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

A-6-3 PLC Function Module, Category Name: _CJB


Bits Port on Serial Communications Unit with unit number 0: A620.01 to A620.02
Ports on Serial Communications Unit with unit numbers 1 to 15: A621.01 to A635.02

NJ/NX-series CPU Unit Software User’s Manual (W501) A-139


Appendices

A-6-4 NX Bus Function Module, Category Name: _NXB


 Functional Classification: NX Bus Function Module Status

Variable name _NXB_MaxUnitNo*1


Meaning Largest Unit Number Global/local Global
Function Contains the largest NX Unit number of the NX Units on the CPU Unit that are detected by the NX Bus Function
Module.
If the Unit configuration information is registered by the Sysmac Studio, the value will be largest NX Unit number of
the registered Unit configuration. Units that are set as unmounted Units are also included.
If the Unit configuration information is not registered by the Sysmac Studio, the value will be the largest Unit num-
ber of an actual Unit configuration.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type UINT Range of values 0 to 8
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.

Variable name _NXB_UnitIOActiveTbl*1


Meaning NX Unit I/O Data Active Status Global/local Global
Function Indicates whether I/O data in the NX Units on the CPU Unit is valid. This status is given as an array of BOOL data.
The subscript of the array corresponds to the NX Unit number. A subscript of 0 indicates the NX Bus Function Mod-
ule and it is always TRUE.
TRUE: The I/O data in the NX Unit is valid.
FALSE: The I/O data in the NX Unit is invalid.
The status is FALSE for NX Units that are set as unmounted Units.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY[0..8] OF 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.

Variable name _NXB_UnitMsgActiveTbl*1


Meaning NX Unit Message Enabled Status Global/local Global
Function Indicates whether the NX Units on the CPU Unit can process message communications. This status is given as an
array of BOOL data. The subscript of the array corresponds to the NX Unit number. A subscript of 0 indicates the
NX Bus Function Module and it is always TRUE.
TRUE: Message communications possible.
FALSE: Message communications not possible.
The status is FALSE for NX Units that are set as unmounted Units.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY[0..8] OF 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.

A-140 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _NXB_UnitRegTbl*1
Meaning NX Unit Registration Status Global/local Global
Function Indicates whether the NX Units on the CPU Unit are registered in the Unit configuration.
This status is given as an array of BOOL data.
The subscript of the array corresponds to the NX Unit number. A subscript of 0 indicates the NX Bus Function Mod-
ule.
TRUE: Registered.
FALSE: Not registered.
If the Unit configuration information is not registered by the Sysmac Studio, the status is FALSE for all Units. The
status is TRUE for NX Units that are set as unmounted Units.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY[0..8] OF 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.

 Functional Classification: NX Bus Function Module Errors

Variable name _NXB_ErrSta*1


A
Meaning NX Bus Function Module Error Status Global/local Global
Function

A-6-4 NX Bus Function Module, Category Name: _NXB


Gives the NX Bus Function Module error status.
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.
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.
Refer to A-5-8 Meanings of Error Status Bits for the meaning of the error status bits.

Note You can use this system-defined variable only for the 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.

Variable name _NXB_MstrErrStal*1


Meaning NX Bus Function Module Master Error Status Global/local Global
Function Gives the status of errors that are detected in the NX Bus Function Module 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.
Refer to A-5-8 Meanings of Error Status Bits for the meaning of the error status bits.

Note You can use this system-defined variable only for the 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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-141


Appendices

Variable name _NXB_UnitErrStaTbl*1


Meaning NX Bus Function Module Unit Error Status Global/local Global
Function Gives the status of errors that are detected in the NX Unit on the CPU Unit.
This status is given as an array of BOOL data. The subscript of the array corresponds to the NX Unit number.
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.
Refer to A-5-8 Meanings of Error Status Bits for the meaning of the error status bits.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY [1..8] OF BOOL 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.

Variable name _NXB_UnitErrFlagTbl*1


Meaning NX Unit Error Status Global/local Global
Function Indicates whether errors occurred in the NX Unit on the CPU Unit.
This status is given as an array of BOOL data. The subscript of the array corresponds to the NX Unit number. A
subscript of 0 indicates the NX Bus Function Module and whether an event occurred that is detected by the NX Bus
Function Module.
TRUE: Error.
FALSE: No error.
The status is FALSE for NX Units that are set as unmounted Units.

Note You can use this system-defined variable only for the NX1P2 CPU Units.
Data type ARRAY [0..8] OF BOOL 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.

A-142 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


A-6-5 Motion Control Function Module, Category Name: _MC
 Functional Classification: Motion Control Functions

Variable name _MC_ErrSta


Meaning Motion Control Function Module Error Status Global/local Global
Function Shows the status of errors that are detected in the Motion Control Function Module.
You can use this variable directly in the user program.
Refer to A-5-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type WORD Range of values 16#0000 to 16#40F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- • GetMCError
tions • ResetMCError
• MC_Reset
• MC_GroupReset

Variable name _MC_ComErrSta


Meaning Common Error Status Global/local Global A
Function Shows the status of errors that are detected in common processing for motion control.
You can use this variable directly in the user program.

A-6-5 Motion Control Function Module, Category Name: _MC


Refer to A-5-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- • GetMCError
tions • ResetMCError

Variable name _MC_AX_ErrSta


Meaning Axis Error Status Global/local Global
Function Shows the error status for each axis. The status of up to 256 axes*1 is shown.
You can use this variable directly in the user program. Refer to A-5-8 Meanings of Error Status Bits for the mean-
ings of the error status bits.
Data type ARRAY [0..255] OF WORD*1 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- • GetMCError
tions • ResetMCError
• MC_Reset
*1 For the NX1P2 CPU Units, the error status of up to 16 axes is shown and the data type is ARRAY [0..15] OF WORD.
For NJ-series CPU Units, the error status of up to 64 axes is shown and the data type is ARRAY [0..63] OF WORD.

Variable name _MC_GRP_ErrSta


Meaning Axes Group Error Status Global/local Global
Function Shows the error status for each axes group. The error status for up to 64 axes groups*1 is shown.
You can use this variable directly in the user program. Refer to A-5-8 Meanings of Error Status Bits for the mean-
ings of the error status bits.
Data type ARRAY [0..63] OF 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- • GetMCError
tions • ResetMCError
• MC_GroupReset
*1 For the NX1P2 CPU Units, the error status of up to 8 axes is shown and data type is ARRAY [0..7] OF WORD.
For NJ-series CPU Units, the error status of up to 32 axes groups is shown and the data type is ARRAY [0..31] OF WORD.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-143


Appendices

Variable name _MC_COM


Meaning Common Variable Global/local Global
Function Shows the status that is common to the Motion Control Function Module.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details on structure
members.
Data type _sCOMMON_REF Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- ---
tions

Variable name _MC_GRP


Meaning Axes Group Variables Global/local Global
Function NX701 CPU Units: Used to specify axes groups and shows multi-axes coordinated control status, and multi-axes
coordinated control settings for motion control instructions used for motion control 1.
NX1P2 CPU Units and NJ-series CPU Units: Used to specify axes groups and shows multi-axes coordinated con-
trol status, and multi-axes coordinated 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.
Data type ARRAY[0..63] OF _sGROUP_REF*1 Range of values ---

R/W access R Retained Not retained. Network Publish Published.


Usage in user program Possible. Related instruc- ---
tions
*1 For NX1P2 CPU Units, the data type is ARRAY[0..7] OF _sGROUP_REF.
For NJ-series CPU Units, the data type is ARRAY[0..31] OF _sGROUP_REF.

Variable name _MC1_GRP


Meaning Axes Group Variables Global/local Global
Function Used to specify axes groups and shows multi-axes coordinated control status, and multi-axes coordinated control
settings for motion control instructions used for 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.
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.

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

A-144 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _MC2_GRP
Meaning Axes Group Variables Global/local Global
Function Used to specify axes groups and shows multi-axes coordinated control status, and multi-axes coordinated control
settings for motion control instructions used for motion control 2.
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.

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

Variable name _MC_AX


Meaning Axis Variables Global/local Global
Function NX701 CPU Units: Used to specify axes and shows single-axis control status, and single-axis control settings for
motion control instructions used for motion control 1.
NX1P2 CPU Units and NJ-series CPU Units: Used to specify axes and shows single-axis control status, and sin-
A
gle-axis control settings for motion control instructions.
When you create an axis on the System Studio, a user-defined axis variable with a different name is created.

A-6-5 Motion Control Function Module, Category Name: _MC


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.
Data type ARRAY[0..255] OF _sAXIS_REF*1 Range of values ---
R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions
*1 For the NX1P2 CPU Units, the data type is ARRAY[0..15] OF _sAXIS_REF.
For NJ-series CPU Units, the data type is ARRAY[0..63] OF _sAXIS_REF.

Variable name _MC1_AX


Meaning Axis Variables Global/local Global
Function Used to specify axes and shows single-axis control status, and single-axis control settings for motion control
instructions used for motion control 1.
When you create an axis on the System Studio, a user-defined axis variable with a different name is created.
Normally, you use an Axis Variable with a different name.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details on structure
members.

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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-145


Appendices

Variable name _MC2_AX


Meaning Axis Variables Global/local Global
Function Used to specify axes and shows single-axis control status, and single-axis control settings for motion control
instructions used for motion control 2.
When you create an axis on the System Studio, a user-defined axis variable with a different name is created.
Normally, you use an Axis Variable with a different name.
Refer to the NJ/NX-series Motion Control Instructions Reference Manual (Cat. No. W508) for details on structure
members.

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

A-146 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


A-6-6 EtherCAT Master Function Module, Category Name: _EC
 Functional Classification: EtherCAT Communications Errors

Variable name _EC_ErrSta


Meaning Built-in EtherCAT Error Global/local Global
Function This system-defined variable provides the collective status of errors in the EtherCAT Master Function Module.
Refer to A-5-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type WORD Range of values 16#0000 to 16#40F0
R/W access R Retained Not retained. Network Publish Published.
Usage in user program Possible. Related instruc- Get EtherCAT Error Status
tions • GetECError
Reset EtherCAT Controller Error
• ResetECError

Variable name _EC_PortErr


Meaning Communications Port Error Global/local Global
Function This system-defined variable provides the collective status of errors in the communications ports for the EtherCAT
A
master.
Refer to A-5-8 Meanings of Error Status Bits for the meanings of the error status bits.

A-6-6 EtherCAT Master Function Module, Category Name: _EC


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- Get EtherCAT Error Status
tions • GetECError
Reset EtherCAT Controller Error
• ResetECError

Variable name _EC_MstrErr


Meaning Master Error Global/local Global
Function This system-defined variable provides the collective status of EtherCAT master errors and slave errors detected
by the EtherCAT master.
Refer to A-5-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- Get EtherCAT Error Status
tions • GetECError
Reset EtherCAT Controller Error
• ResetECError

Variable name _EC_SlavErr


Meaning Slave Error Global/local Global
Function This system-defined variable provides the collective status of all the error status for EtherCAT slaves.
Refer to A-5-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- Get EtherCAT Error Status
tions • GetECError
Reset EtherCAT Controller Error
• ResetECError

NJ/NX-series CPU Unit Software User’s Manual (W501) A-147


Appendices

Variable name _EC_SlavErrTbl


Meaning Slave Error Table Global/local Global
Function This system-defined variable gives the error status for each EtherCAT slave.
The error status is given for each slave in the actual system configuration.
This variable array indicates slaves in which there are errors. Status is provided for each EtherCAT slave node
address (1 to 512)*.
Refer to A-5-8 Meanings of Error Status Bits for the meanings of the error status bits.
Data type Array [1..512] OF WORD*1 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- Get EtherCAT Error Status
tions • GetECError
Reset EtherCAT Controller Error
• ResetECError

*1 For the NX1P2 CPU Units and NJ-series CPU Units, the node address is 1 to 192 and the data type is Array [1..192] OF WORD.

Variable name _EC_MacAdrErr


Meaning MAC Address Error Global/local Global
Function TRUE if there is an illegal MAC address.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_LanHwErr


Meaning Communications Controller Error Global/local Global
Function TRUE if there is a communications controller hardware error.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_LinkOffErr


Meaning Link OFF Error Global/local Global
Function TRUE if the communications controller link is not established.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_NetCfgErr


Meaning Network Configuration Information Error Global/local Global
Function TRUE if there is illegal network configuration information.
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- Reset EtherCAT Controller Error
tions • ResetECError

A-148 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EC_NetCfgCmpErr
Meaning Network Configuration Verification Error Global/local Global
Function TRUE if the network configuration information does not match the actual network configuration.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_NetTopologyErr


Meaning Network Configuration Error Global/local Global
Function TRUE if there is a network configuration error (too many devices connected or ring connection).
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_PDCommErr


Meaning Process Data Communications Error Global/local Global
A
Function TRUE if there is an unexpected slave disconnection or connection or if a slave WDT error is detected during pro-
cess data communications.

A-6-6 EtherCAT Master Function Module, Category Name: _EC


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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_PDTimeoutErr


Meaning Process Data Reception Timeout Error Global/local Global
Function TRUE if a timeout occurs while receiving process data.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_PDSendErr


Meaning Process Data Transmission Error Global/local Global
Function TRUE if there is a process data transmission error (cannot send within the process data communications period
or transmission jitter is over the limit).
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_SlavAdrDupErr


Meaning Slave Node Address Duplicated Error Global/local Global
Function TRUE if the same node address is set for more than one slave.
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- Reset EtherCAT Controller Error
tions • ResetECError

NJ/NX-series CPU Unit Software User’s Manual (W501) A-149


Appendices

Variable name _EC_SlavInitErr


Meaning Slave Initialization Error Global/local Global
Function TRUE if there is an error in an initialization command addressed to a slave.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_SlavAppErr


Meaning Slave Application Error Global/local Global
Function TRUE if there is an error in the slave’s application status register.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_MsgErr


Meaning EtherCAT Message Error Global/local Global
Function TRUE when a message is sent to a slave that does not support messages or when there is an error in the format
of the response to a message that was sent to a slave.
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- CoE messages (Read CoE SDO)
tions • EC_CoESDORead
CoE messages (Write CoE SDO)
• EC_CoESDOWrite

Variable name _EC_SlavEmergErr


Meaning Emergency Message Detected Global/local Global
Function TRUE if the master detects an emergency message that was sent by a slave.
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- Reset EtherCAT Controller Error
tions • ResetECError

Variable name _EC_IndataInvalidErr*1


Meaning Input Process Data Invalid Error Global/local Global
Function TRUE if the Input Data Invalid state continued for the following period because the EtherCAT master could not
perform process 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 long than 10 ms: 10 periods of the task
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- Reset EtherCAT Controller Error
gram tions • ResetECError
*1 This system-defined variable was added for unit version 1.13 of the CPU Unit.

A-150 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EC_CommErrTbl
Meaning Communications Error Slave Table Global/local Global
Function Slaves are given in the table in the order of slave node addresses.
The corresponding slave element is TRUE if the master detected an error for the slave.
Data type Array [1..512] OF BOOL*1 Range of values TRUE or FALSE

R/W access R Retained Not retained. Network Publish Published.


Usage in user program Possible. Related instruc- Reset EtherCAT Controller Error
tions • ResetECError
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

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.

Variable name _EC_CycleExceeded


Meaning EtherCAT Communications Cycle Exceeded Global/local Global
Function TRUE if the CPU Unit cannot establish communications within the set communications period at startup.

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

A-6-6 EtherCAT Master Function Module, Category Name: _EC


gram instructions

 Functional Classification: EtherCAT Communications Status

Variable name _EC_RegSlavTbl


Meaning Registered Slave Table Global/local Global
Function This table indicates the slaves that are registered in the network configuration information.
Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if the corresponding slave is registered.
Data type Array [1..512] OF BOOL*1 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 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

Variable name _EC_EntrySlavTbl


Meaning Network Connected Slave Table Global/local Global
Function This table indicates which slaves are connected to the network.
Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if the corresponding slave has entered the network.
Data type Array [1..512] OF BOOL*1 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 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-151


Appendices

Variable name _EC_MBXSlavTbl


Meaning Message Communications Enabled Slave Table Global/local Global
Function This table indicates the slaves that can perform message communications.
Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if message communications are enabled for it (pre-operational, safe-operation,
or operational state).

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

R/W access R Retained Not retained. Network Publish Published.


Usage in user program Possible. Related instruc- Disconnect EtherCAT Slave
tions • EC_DisconnectSlave
Connect EtherCAT Slave
• EC_ConnectSlave
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

Variable name _EC_PDSlavTbl


Meaning Process Data Communicating Slave Table Global/local Global
Function This is a table that indicates the slaves that are performing process data communications.
Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if process data of the corresponding slave is enabled (operational) for both slave
inputs and outputs.

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

R/W access R Retained Not retained. Network Publish Published.


Usage in user program Possible. Related instruc- Disconnect EtherCAT Slave
tions • EC_DisconnectSlave
Connect EtherCAT Slave
• EC_ConnectSlave
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

Variable name _EC_DisconnSlavTbl


Meaning Disconnected Slave Table Global/local Global
Function Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if the corresponding slave was disconnected.
Data type Array [1..512] OF BOOL*1 Range of values TRUE or FALSE

R/W access R Retained Not retained. Network Publish Published.


Usage in user program Possible. Related instruc- Disconnect EtherCAT Slave
tions • EC_DisconnectSlave
Connect EtherCAT Slave
• EC_ConnectSlave
*1 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

A-152 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EC_DisableSlavTbl
Meaning Disabled Slave Table Global/local Global
Function Slaves are given in the table in the order of slave node addresses.
The element for a slave is TRUE if the corresponding slave is disabled.
Data type Array [1..512] OF BOOL*1 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 For the NX1P2 CPU Units and NJ-series CPU Units, the data type is Array [1..192] OF BOOL.

Variable name _EC_PDActive


Meaning Process Data Communications Status Global/local Global
Function TRUE when process data communications are performed with all slaves*.
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- Disconnect EtherCAT Slave
tions • EC_DisconnectSlave
Connect EtherCAT Slave A
• EC_ConnectSlave

A-6-6 EtherCAT Master Function Module, Category Name: _EC


* Disabled slaves are not included.

Variable name _EC_PktMonStop


Meaning Packet Monitoring Stopped Global/local Global
Function TRUE when packet monitoring is stopped.
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- Stop Packet Monitor
tions • EC_StopMon
Start Packet Monitor
• EC_StartMon

Variable name _EC_LinkStatus


Meaning Link Status Global/local Global
Function TRUE if the communications controller link status is Link ON.
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- ---
tions

Variable name _EC_PktSaving


Meaning Saving Packet Data File Global/local Global
Function Shows whether a packet data file is being saved.
TRUE: Packet data file being saved.
FALSE: Packet data file not being saved.
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- Saving Packet Data File
tions • EC_SaveMon

NJ/NX-series CPU Unit Software User’s Manual (W501) A-153


Appendices

Variable name _EC_InDataInvalid


Meaning Input Data Invalid Global/local Global
Function TRUE when process data communications performed in the primary periodic task are not normal and the input
data is not valid.
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- ---
tions

Note All system-defined variables that are related to the status of EtherCAT communications give the current status.

Variable name _EC_InData1Invalid


Meaning Input Data1 Invalid Global/local Global
Function TRUE when process data communications performed in the primary periodic task are not normal and the input data
is not valid.

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.

Variable name _EC_InData2Invalid


Meaning Input Data2 Invalid Global/local Global
Function TRUE when process data communications performed in the priority-5 periodic task are not normal and the input
data is not valid.

Note You can use this system-defined variable only for NX-series CPU Units.

Note This variable is always TRUE 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

Note All system-defined variables that are related to the status of EtherCAT communications give the current status.

A-154 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


 Functional Classification: EtherCAT Communications Diagnosis/Statistics Log

Variable name _EC_StatisticsLogEnable*1


Meaning Diagnosis/Statistics Log Enable Global/local Global
Function Changes to TRUE when the diagnosis/statistics log is started.
Changes to FALSE when the diagnosis/statistics log is ended.
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.11 of the CPU Unit.

Variable name _EC_StatisticsLogCycleSec*1


Meaning Diagnosis/Statistics Log Cycle Global/local Global
Function Specifies the interval to write the diagnostic and statistical information of the diagnosis/statistics log in units of sec-
onds.
When 0 is specified, the diagnostic and statistical information is written only once when the diagnosis/statistics log
is ended.

Note The write interval does not change even if you change the value of this system-defined variable while the A
diagnosis/statistics log operation is in progress.
Data type UINT Range of values 0, or 30 to 1800

A-6-6 EtherCAT Master Function Module, Category Name: _EC


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.11 of the CPU Unit.

Variable name _EC_StatisticsLogBusy*1


Meaning Diagnosis/Statistics Log Busy Global/local Global
Function TRUE while the diagnosis/statistics log operation is in progress.
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.11 of the CPU Unit.

Variable name _EC_StatisticsLogErr*1


Meaning Diagnosis/Statistics Log Error Global/local Global
Function TRUE when the diagnosis/statistics log failed to start or it is impossible to write into the log.
The value of this flag is determined when _EC_StatisticsLogBusy (Diagnosis/Statistics Log Busy) changes to
FALSE after the diagnosis/statistics log operation is started.
The error end is caused by the following.
• Another records cannot be added in the log file because the capacity of the SD Memory Card is fully used.
• The SD Memory Card is write protected.
• There is no SD Memory Card.
• The function cannot be started because the value specified for _EC_StatisticsLogCycleSec (Diagnosis/Statistics
Log Cycle) is invalid.
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.11 of the CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-155


Appendices

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


 Functional Classification: EtherNet/IP Communications Errors

Variable name _EIP_ErrSta


Meaning Built-in EtherNet/IP Error Global/local Global
Function This is the error status variable for the built-in EtherNet/IP port.
NX-series CPU Units: Represents the collective 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 Communications Error)
NJ-series CPU Units: Represents the collective status of the following error flags.
• _EIP_PortErr (Communications Port Error)
• _EIP_CipErr (CIP Communications Error)
• _EIP_TcpAppErr (TCP Application Communications Error)

Note Refer to A-5-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

Variable name _EIP_PortErr


Meaning Communications Port Error Global/local Global
Function This is the error status variable for the communications port.
NX-series CPU Units: 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 Setting Error)
• _EIP1_IPAdrCfgErr (Port1 IP Address Setting 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)
NJ-series CPU Units: Represents the collective status of the following error flags.
• _EIP_MacAdrErr (MAC Address Error)
• _EIP_LanHwErr (Communications Controller Error)
• _EIP_EtnCfgErr (Basic Ethernet Setting Error)
• _EIP_IPAdrCfgErr (IP Address Setting Error)
• _EIP_IPAdrDupErr (IP Address Duplication Error)
• _EIP_BootpErr (BOOTP Server Error)
• _EIP_DNSSrvErr (DNS Server Connection Error)
• _EIP_IPRTblErr (IP Route Table Error)

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-5-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

A-156 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP1_PortErr
Meaning Communications Port1 Error Global/local Global
Function This is the error status variable for the communications port 1.
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 Setting Error)
• _EIP1_IPAdrCfgErr (Port1 IP Address Setting 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)

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-5-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

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


Variable name _EIP2_PortErr
Meaning Communications Port2 Error Global/local Global
Function This is the error status variable for the communications port 2.
It represents the collective status of the following error flags.
• _EIP2_MacAdrErr (Port2 MAC Address Error)
• _EIP2_LanHwErr (Port2 Communications Controller Error)
• _EIP2_EtnCfgErr (Port2 Basic Ethernet Setting Error)
• _EIP2_IPAdrCfgErr (Port2 IP Address Setting Error)
• _EIP2_IPAdrDupErr (Port2 IP Address Duplication Error)
• _EIP2_BootpErr (Port2 BOOTP Server Error)
• _EIP_DNSCfgErr (DNS Setting Error)
• _EIP_DNSSrvErr (DNS Server Connection Error)
• _EIP_IPRTblErr (IP Route Table Error)

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-5-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.
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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-157


Appendices

Variable name _EIP_CipErr


Meaning CIP Communications Error Global/local Global
Function This is the error status variable for CIP communications.
NX-series CPU Units: Represents the collective status of the following error flags.
• _EIP1_IdentityErr (CIP Communications1 Identity Error)
• _EIP1_TDLinkCfgErr (CIP Communications1 Tag Data Link Setting Error)
• _EIP1_TDLinkOpnErr (CIP Communications1 Tag Data Link Connection Failed)
• _EIP1_TDLinkErr (CIP Communications1 Tag Data Link Communications Error)
• _EIP1_TagAdrErr (CIP Communications1 Tag Name Resolution Error)
• _EIP1_MultiSwONErr (CIP Communications1 Multiple Switches ON Error)
NJ-series CPU Units: Represents the collective status of the following error flags.
• _EIP_IdentityErr (Identity Error)
• _EIP_TDLinkCfgErr (Tag Data Link Setting Error)
• _EIP_TDLinkOpnErr (Tag Data Link Connection Failed)
• _EIP_TDLinkErr (Tag Data Link Communications Error)
• _EIP_TagAdrErr (Tag Name Resolution Error)
• _EIP_MultiSwOnErr (Multiple Switches ON Error)

Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-5-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

Variable name _EIP1_CipErr


Meaning CIP Communications1 Error Global/local Global
Function This is the error status variable for CIP communications 1.
It represents the collective status of the following error flags.
• _EIP1_IdentityErr (CIP Communications1 Identity Error)
• _EIP1_TDLinkCfgErr (CIP Communications1 Tag Data Link Setting Error)
• _EIP1_TDLinkOpnErr (CIP Communications1 Tag Data Link Connection Failed)
• _EIP1_TDLinkErr (CIP Communications1 Tag Data Link Communications Error)
• _EIP1_TagAdrErr (CIP Communications1 Tag Name Resolution Error)
• _EIP1_MultiSwONErr (CIP Communications1 Multiple Switches ON Error)

Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-5-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

A-158 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP2_CipErr
Meaning CIP Communications2 Error Global/local Global
Function This is the error status variable for CIP communications 2.
It represents the collective status of the following error flags.
• _EIP2_IdentityErr (CIP Communications2 Identity Error)
• _EIP2_TDLinkCfgErr (CIP Communications2 Tag Data Link Setting Error)
• _EIP2_TDLinkOpnErr (CIP Communications2 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 Communications2 Multiple Switches ON Error)

Note If a Tag Name Resolution Error occurs, it is recorded in the event log and this variable changes to TRUE.
Refer to A-5-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.
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

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


Function This is the error status variable for TCP application communications.
It represents the collective status of the following error flags.
• _EIP_TcpAppCfgErr (TCP Application Setting Error)
• _EIP_NTPSrvErr (NTP Server Connection Error)

Note Refer to A-5-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

Variable name _EIP_MacAdrErr


Meaning MAC Address Error Global/local Global
Function NX-series CPU Units: Indicates that an error occurred when the MAC address was read on the communications
port 1 at startup.
TRUE: Error
FALSE: Normal

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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-159


Appendices

Variable name _EIP1_MacAdrErr


Meaning Port1 MAC Address Error Global/local Global
Function Indicates that an error occurred when the MAC address was read on the communications port 1 at startup.
TRUE: Error
FALSE: Normal

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

Variable name _EIP2_MacAdrErr


Meaning Port2 MAC Address Error Global/local Global
Function Indicates that an error occurred when the MAC address was read on the communications port 2 at startup.
TRUE: Error
FALSE: Normal

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 program Possible. Related ---
instructions

Variable name _EIP_LanHwErr


Meaning Communications Controller Error Global/local Global
Function NX-series CPU Units: Indicates that a communications controller failure occurred on the communications port 1.
TRUE: Failure
FALSE: Normal

NJ-series CPU Units: Indicates that a communications controller failure occurred.


TRUE: Failure
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

Variable name _EIP1_LanHwErr


Meaning Port1 Communications Controller Error Global/local Global
Function Indicates that a communications controller failure occurred on the communications port 1.
TRUE: Failure
FALSE: Normal

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

A-160 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP2_LanHwErr
Meaning Port2 Communications Controller Error Global/local Global
Function Indicates that a communications controller failure occurred on the communications port 2.
TRUE: Failure
FALSE: Normal

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 program Possible. Related ---
instructions

Variable name _EIP_EtnCfgErr


Meaning Basic Ethernet Setting Error Global/local Global
Function NX-series CPU Units: Indicates that the Ethernet communications speed setting (Speed/Duplex) for the communi-
cations port 1 is incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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

Variable name _EIP1_EtnCfgErr


Meaning Port1 Basic Ethernet Setting Error Global/local Global
Function Indicates that the Ethernet communications speed setting (Speed/Duplex) for the communications port 1 is incor-
rect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

Variable name _EIP2_EtnCfgErr


Meaning Port2 Basic Ethernet Setting Error Global/local Global
Function Indicates that the Ethernet communications speed setting (Speed/Duplex) for the communications port 2 is incor-
rect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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 program Possible. Related ---
instructions

NJ/NX-series CPU Unit Software User’s Manual (W501) A-161


Appendices

Variable name _EIP_IPAdrCfgErr


Meaning IP Address Setting Error Global/local Global
Function NX-series CPU Units: Indicates the IP address setting errors for the communications port 1.
TRUE: • There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the BOOTP server is inconsistent.
FALSE: Normal

NJ-series CPU Units: Indicates the IP address setting errors.


TRUE: • There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the BOOTP server is inconsistent.
• The default gateway settings are not correct.
FALSE: Normal
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

Variable name _EIP1_IPAdrCfgErr


Meaning Port1 IP Address Setting Error Global/local Global
Function Indicates the IP address setting errors for the communications port 1.
TRUE: • There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the BOOTP server is inconsistent.
FALSE: Normal

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

Variable name _EIP2_IPAdrCfgErr


Meaning Port2 IP Address Setting Error Global/local Global
Function Indicates the IP address setting errors for the communications port 2.
TRUE: • There is an illegal IP address setting.
• A read operation failed.
• The IP address obtained from the BOOTP server is inconsistent.
FALSE: Normal

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 program Possible. Related ---
instructions

A-162 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP_IPAdrDupErr
Meaning IP Address Duplication Error Global/local Global
Function NX-series CPU Units: Indicates that the same IP address is assigned to more than one node for the communica-
tions 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.
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

Variable name _EIP1_IPAdrDupErr


Meaning Port1 IP Address Duplication Error Global/local Global
Function Indicates that the same IP address is assigned to more than one node for the communications port 1.
TRUE: Duplication occurred.
A
FALSE: Other than the above.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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

Variable name _EIP2_IPAdrDupErr


Meaning Port2 IP Address Duplication Error Global/local Global
Function Indicates that the same IP address is assigned to more than one node for the communications port 2.
TRUE: Duplication occurred.
FALSE: Other than the above.

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

Variable name _EIP_DNSCfgErr*1


Meaning DNS Setting Error Global/local Global
Function Indicates that the DNS 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
*1 With the NJ-series CPU Unit, this variable can be used with the unit version 1.11 or later.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-163


Appendices

Variable name _EIP_BootpErr


Meaning BOOTP Server Error Global/local Global
Function NX-series CPU Units: Indicates that a BOOTP server connection failure occurred on the communications port 1.
TRUE: There was a failure to connect to the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or BOOTP is enabled and an IP address was normally obtained from the
BOOTP server.

NJ-series CPU Units: Indicates that a BOOTP server connection failure 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

Variable name _EIP1_BootpErr


Meaning Port1 BOOTP Server Error Global/local Global
Function Indicates that a BOOTP server connection failure occurred on the communications port 1.
TRUE: There was a failure to connect to the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or BOOTP is enabled and an IP address was normally obtained from the
BOOTP server.

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

Variable name _EIP2_BootpErr


Meaning Port2 BOOTP Server Error Global/local Global
Function Indicates that a BOOTP server connection failure occurred on the communications port 2.
TRUE: There was a failure to connect to the BOOTP server (timeout).
FALSE: The BOOTP is not enabled, or BOOTP is enabled and an IP address was normally obtained from the
BOOTP server.

Note You can use this system-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

Variable name _EIP_IPRTblErr


Meaning IP Route Table Error Global/local Global
Function NX-series CPU Units: Indicates that the default gateway settings or IP router table settings are incorrect. Or, a read
operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

NJ-series CPU Units: Indicates that the IP router table or hosts settings are 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

A-164 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP_IdentityErr
Meaning Identity Error Global/local Global
Function NX-series CPU Units: Indicates that the identity information for CIP communications 1 (which you cannot over-
write) is incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

Variable name _EIP1_IdentityErr


Meaning CIP Communications1 Identity Error Global/local Global
Function Indicates that the identity information for CIP communications 1 (which you cannot overwrite) is incorrect. Or, a
read operation failed.
A
TRUE: Setting incorrect or read failed
FALSE: Normal

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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

Variable name _EIP2_IdentityErr


Meaning CIP Communications2 Identity Error Global/local Global
Function Indicates that the identity information for CIP communications 2 (which you cannot overwrite) is incorrect. Or, a
read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

Variable name _EIP_TDLinkCfgErr


Meaning Tag Data Link Setting Error Global/local Global
Function NX-series CPU Units: Indicates that the tag data link settings for CIP communications 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 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/NX-series CPU Unit Software User’s Manual (W501) A-165


Appendices

Variable name _EIP1_TDLinkCfgErr


Meaning CIP Communications1 Tag Data Link Setting Global/local Global
Error
Function Indicates that the tag data link settings for CIP communications 1 are incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

Variable name _EIP2_TDLinkCfgErr


Meaning CIP Communications2 Tag Data Link Setting Global/local Global
Error
Function Indicates that the tag data link settings for CIP communications 2 are incorrect. Or, a read operation failed.
TRUE: Setting incorrect or read failed
FALSE: Normal

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

Variable name _EIP_TDLinkOpnErr


Meaning Tag Data Link Connection Failed Global/local Global
Function NX-series CPU Units: Indicates that establishing a tag data link connection for CIP communications 1 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.

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

A-166 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP1_TDLinkOpnErr
Meaning CIP Communications1 Tag Data Link Connec- Global/local Global
tion Failed
Function Indicates that establishing a tag data link connection for CIP communications 1 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.

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

Variable name _EIP2_TDLinkOpnErr


Meaning CIP Communications2 Tag Data Link Connec- Global/local Global
tion Failed
Function Indicates that establishing a tag data link connection for CIP communications 2 failed.
TRUE: Establishing a tag data link connection failed due to one of the following causes. A
•The information registered for a target node in the tag data link parameters is different from the actual
node information.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


•There was no response from the remote node.
FALSE: Other than the above.

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

Variable name _EIP_TDLinkErr


Meaning Tag Data Link Communications Error Global/local Global
Function NX-series CPU Units: Indicates that a timeout occurred in a tag data link connection for CIP communications 1.
TRUE: A timeout occurred.
FALSE: Other than the above.

NJ-series CPU Units: Indicates that a timeout occurred in a tag data link 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

Variable name _EIP1_TDLinkErr


Meaning CIP Communications1 Tag Data Link Communi- Global/local Global
cations Error
Function Indicates that a timeout occurred in a tag data link connection for CIP communications 1.
TRUE: A timeout occurred.
FALSE: Other than the above.

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/NX-series CPU Unit Software User’s Manual (W501) A-167


Appendices

Variable name _EIP2_TDLinkErr


Meaning CIP Communications2 Tag Data Link Communi- Global/local Global
cations Error
Function Indicates that a timeout occurred in a tag data link connection for CIP communications 2.
TRUE: A timeout occurred.
FALSE: Other than the above.

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

Variable name _EIP_TagAdrErr


Meaning Tag Name Resolution Error Global/local Global
Function NX-series CPU Units: Indicates that tag resolution for CIP communications 1 failed (i.e., the address could not be identi-
fied 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.

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

Variable name _EIP1_TagAdrErr


Meaning CIP Communications1 Tag Name Resolution Global/local Global
Error
Function Indicates that tag resolution for CIP communications 1 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.

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

A-168 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP2_TagAdrErr
Meaning CIP Communications2 Tag Name Resolution Global/local Global
Error
Function Indicates that tag resolution for CIP communications 2 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.

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

Variable name _EIP_MultiSwONErr


Meaning Multiple Switches ON Error Global/local Global
A
Function NX-series CPU Units: Indicates that more than one switch turned ON at the same time in CIP communications 1.
TRUE: More than one data link start/stop switch changed to TRUE at the same time.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


FALSE: Other than the above.

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

Variable name _EIP1_MultiSwONErr


Meaning CIP Communications1 Multiple Switches ON Global/local Global
Error
Function Indicates that more than one switch turned ON at the same time in CIP communications 1.
TRUE: More than one data link start/stop switch changed to TRUE at the same time.
FALSE: Other than the above.

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

Variable name _EIP2_MultiSwONErr


Meaning CIP Communications2 Multiple Switches ON Global/local Global
Error
Function Indicates that more than one switch turned ON at the same time in CIP communications 2.
TRUE: More than one data link start/stop switch changed to TRUE at the same time.
FALSE: Other than the above.

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/NX-series CPU Unit Software User’s Manual (W501) A-169


Appendices

Variable name _EIP_TcpAppCfgErr


Meaning TCP Application Setting Error Global/local Global
Function TRUE: At least one of the set values for a TCP application (FTP, NTP, SNMP) is incorrect. Or, a read operation
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

Variable name _EIP_NTPSrvErr


Meaning NTP Server Connection Error Global/local Global
Function TRUE: The NTP client failed to connect to the server (timeout).
FALSE: NTP is not set or the connection was successful.
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

Variable name _EIP_DNSSrvErr


Meaning DNS Server Connection Error Global/local Global
Function TRUE: The DNS client failed to connect to the server (timeout).
FALSE: DNS is not enabled. Or, DNS is enabled and the connection was successful.
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

 Functional Classification: EtherNet/IP Communications Status

Variable name _EIP_EtnOnlineSta


Meaning Online Global/local Global
Function NX-series CPU Units: Indicates that the built-in EtherNet/IP port’s communications can be used via the communications
port 1 (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.

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

A-170 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP1_EtnOnlineSta
Meaning Port1 Online Global/local Global
Function Indicates that the built-in EtherNet/IP port’s communications can be used via the communications port 1 (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.

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

Variable name _EIP2_EtnOnlineSta


Meaning Port2 Online Global/local Global
Function Indicates that the built-in EtherNet/IP port’s communications can be used via the communications port 2 (that is, the link
is ON, IP address is defined, and there are no errors).
TRUE: The built-in EtherNet/IP port’s communications can be used.
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.
A
Note You can use this system-defined variable only for the NX701 CPU Units.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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

Variable name _EIP_TDLinkRunSta


Meaning Tag Data Link Communications Status Global/local Global
Function NX-series CPU Units: Indicates that at least one connection is in normal operation 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 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

Variable name _EIP1_TDLinkRunSta


Meaning CIP Communications1 Tag Data Link Communi- Global/local Global
cations Status
Function Indicates that at least one connection is in normal operation in CIP communications 1.
TRUE: Normal operation
FALSE: Other than the above.

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/NX-series CPU Unit Software User’s Manual (W501) A-171


Appendices

Variable name _EIP2_TDLinkRunSta


Meaning CIP Communications2 Tag Data Link Communi- Global/local Global
cations Status
Function Indicates that at least one connection is in normal operation in CIP communications 2.
TRUE: Normal operation
FALSE: Other than the above.

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

Variable name _EIP_TDLinkAllRunSta


Meaning All Tag Data Link Communications Status Global/local Global
Function NX-series CPU Units: Indicates that all tag data links are communicating in CIP communications 1.
TRUE: Tag data links are communicating in all connections as the originator.
FALSE: An error occurred in at least one connection.

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

Variable name _EIP1_TDLinkAllRunSta


Meaning CIP Communications1 All Tag Data Link Com- Global/local Global
munications Status
Function Indicates that all tag data links are communicating in CIP communications 1.
TRUE: Tag data links are communicating in all connections as the originator.
FALSE: An error occurred in at least one connection.

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

Variable name _EIP2_TDLinkAllRunSta


Meaning CIP Communications2 All Tag Data Link Com- Global/local Global
munications Status
Function Indicates that all tag data links are communicating in CIP communications 2.
TRUE: Tag data links are communicating in all connections as the originator.
FALSE: An error occurred in at least one connection.

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

A-172 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP_RegTargetSta [255]
Meaning Registered Target Node Information Global/local Global
Function NX-series CPU Units: Gives a list of nodes for which built-in EtherNet/IP connections are registered for CIP com-
munications 1.
This variable is valid only when the built-in EtherNet/IP port is the originator.
Array[x] is TRUE: The connection to the node with a target node ID of x is registered.
Array[x] is FALSE: The connection to the node with a target node ID of x is not registered.

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

Variable name _EIP1_RegTargetSta [255]


Meaning CIP Communications1 Registered Target Node Global/local Global A
Information
Function Gives a list of nodes for which built-in EtherNet/IP connections are registered for CIP communications 1.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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.

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

Variable name _EIP2_RegTargetSta [255]


Meaning CIP Communications2 Registered Target Node Global/local Global
Information
Function Gives a list of nodes for which built-in EtherNet/IP connections are registered for CIP communications 2.
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.

Note You can use this system-defined variable only for the NX701 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/NX-series CPU Unit Software User’s Manual (W501) A-173


Appendices

Variable name _EIP_EstbTargetSta [255]


Meaning Normal Target Node Information Global/local Global
Function NX-series CPU Units: Gives a list of nodes that have normally established EtherNet/IP connections for CIP com-
munications 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 target node ID of x was not established, or an error occurred.

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

Variable name _EIP1_EstbTargetSta [255]


Meaning CIP Communications1 Normal Target Node Global/local Global
Information
Function Gives a list of nodes that have normally established EtherNet/IP connections for CIP communications 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 target node ID of x was not established, or an error occurred.

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

Variable name _EIP2_EstbTargetSta [255]


Meaning CIP Communications2 Normal Target Node Global/local Global
Information
Function Gives a list of nodes that have normally established EtherNet/IP connections for CIP communications 2.
Array[x] is TRUE: The connection to the node with a target node ID of x was established normally.
Array[x] is FALSE: The connection to the node with a target node ID of x was not established, or an error occurred.

Note You can use this system-defined variable only for the NX701 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

A-174 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP_TargetPLCModeSta [255]
Meaning Target PLC Operating Mode Global/local Global
Function NX-series CPU Units: Shows the operating status of the target node Controllers that are connected for CIP com-
munications 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 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.

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

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


Variable name _EIP1_TargetPLCModeSta [255]
Meaning CIP Communications1 Target PLC Operating Global/local Global
Mode
Function Shows the operating status of the target node Controllers that are connected for CIP communications 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 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.

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

Variable name _EIP2_TargetPLCModeSta [255]


Meaning CIP Communications2 Target PLC Operating Global/local Global
Mode
Function Shows the operating status of the target node Controllers that are connected for CIP communications 2, 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.

Note You can use this system-defined variable only for the NX701 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/NX-series CPU Unit Software User’s Manual (W501) A-175


Appendices

Variable name _EIP_TargetPLCErr [255]


Meaning Target PLC Error Information Global/local Global
Function NX-series CPU Units: Shows the error status (logical OR of fatal and non-fatal errors) of the target node Controllers
that are connected for CIP communications 1, with the built-in EtherNet/IP ports as the originator. The array ele-
ments are valid only when the corresponding Normal Target Node Information is TRUE. The immediately preced-
ing value is retained if this variable is FALSE.
Array[x] is TRUE: A fatal or non-fatal error occurred in the target Controller with a target node ID of x.
Array[x] is FALSE: Other than the above.

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

Variable name _EIP1_TargetPLCErr [255]


Meaning CIP Communications1 Target PLC Error Infor- Global/local Global
mation
Function Shows the error status (logical OR of fatal and non-fatal errors) of the target node Controllers that are connected
for CIP communications 1, with the built-in EtherNet/IP ports as the originator. The array elements are valid only
when the corresponding Normal Target Node Information is TRUE. The immediately preceding value is retained if
this variable is FALSE.
Array[x] is TRUE: A fatal or non-fatal error occurred in the target Controller with a target node ID of x.
Array[x] is FALSE: Other than the above.

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

Variable name _EIP2_TargetPLCErr [255]


Meaning CIP Communications2 Target PLC Error Infor- Global/local Global
mation
Function Shows the error status (logical OR of fatal and non-fatal errors) of the target node Controllers that are connected
for CIP communications 2, with the built-in EtherNet/IP ports as the originator. The array elements are valid only
when the corresponding Normal Target Node Information is TRUE. The immediately preceding value is retained if
this variable is FALSE.
Array[x] is TRUE: A fatal or non-fatal error occurred in the target Controller with a target node ID of x.
Array[x] is FALSE: Other than the above.

Note You can use this system-defined variable only for the NX701 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

A-176 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


Variable name _EIP_TargetNodeErr [255]
Meaning Target Node Error Information Global/local Global
Function NX-series CPU Units: Indicates that the connection for the Registered Target Node Information for CIP communi-
cations 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 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
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 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

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


R/W access R Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions

Variable name _EIP1_TargetNodeErr [255]


Meaning CIP Communications1 Target Node Error Infor- Global/local Global
mation
Function Indicates that the connection for the Registered Target Node Information for CIP communications 1 was not estab-
lished 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
Target PLC Error Information is TRUE).

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

NJ/NX-series CPU Unit Software User’s Manual (W501) A-177


Appendices

Variable name _EIP2_TargetNodeErr [255]


Meaning CIP Communications2 Target Node Error Infor- Global/local Global
mation
Function Indicates that the connection for the Registered Target Node Information for CIP communications 2 was not estab-
lished 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
Target PLC Error Information is TRUE).

Note You can use this system-defined variable only for the NX701 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

Variable name _EIP_NTPResult Member name .ExecTime


Meaning NTP Last Operation Time Global/local Global
Function Gives the last time that NTP processing ended normally.
The time that was 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.

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

Variable name _EIP_NTPResult Member name .ExecNormal


Meaning NTP Operation Result Global/local Global
Function This variable shows if the NTP operation ended normally.
TRUE: Indicates an NTP normal end.
FALSE: Indicates that NTP operation ended in an error or has not been executed even once.

Note Do not use this variable in the user program. There may be a delay in updating it. Use this variable only to
access status through communications from an external device.
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

A-178 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-6 Specifications for Individual System-defined Variables


 Functional Classification: EtherNet/IP Communications Switches

Variable name _EIP_TDLinkStartCmd


Meaning Tag Data Link Communications Start Switch Global/local Global
Function NX-series CPU Units: Change this variable to TRUE to start tag data links for CIP communications 1.
It automatically changes back to FALSE after tag data link operation starts.

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

Variable name _EIP1_TDLinkStartCmd


Meaning CIP Communications1 Tag Data Link Communi-
cations Start Switch
Global/local Global A
Function Change this variable to TRUE to start tag data links for CIP communications 1.
It automatically changes back to FALSE after tag data link operation starts.

A-6-7 EtherNet/IP Function Module, Category Name: _EIP


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

Variable name _EIP2_TDLinkStartCmd


Meaning CIP Communications2 Tag Data Link Communi- Global/local Global
cations Start Switch
Function Change this variable to TRUE to start tag data links for CIP communications 2.
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.

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 RW Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions

NJ/NX-series CPU Unit Software User’s Manual (W501) A-179


Appendices

Variable name _EIP_TDLinkStopCmd


Meaning Tag Data Link Communications Stop Switch Global/local Global
Function NX-series CPU Units: Change this variable to TRUE to stop tag data links for CIP communications 1.
It automatically changes back to FALSE after tag data link operation stops.

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

Variable name _EIP1_TDLinkStopCmd


Meaning CIP Communications1 Tag Data Link Communi- Global/local Global
cations Stop Switch
Function Change this variable to TRUE to stop tag data links for CIP communications 1.
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.

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

Variable name _EIP2_TDLinkStopCmd


Meaning CIP Communications2 Tag Data Link Communi- Global/local Global
cations Stop Switch
Function Change this variable to TRUE to stop tag data links for CIP communications 2.
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.

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 RW Retained Not retained. Network Publish Published.
Usage in user pro- Possible. Related ---
gram instructions

A-180 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-7 Attributes of CPU Unit Data


The following table shows the attributes of the CPU Unit data including the Retain/Non-retain attribute
in the following cases: power interruption, power on, operating mode change, and major fault level Con-
troller error.
Transfer-

A-7 Attributes of CPU Unit Data


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. PRO- Supported.
POUs and user program (with non- before ported. GRAM/ Online edit-
User pro-
execution ID in user pro- volatile power inter- RUN mode ing
gram
gram memory). ruption. (online edit-
ing)
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
A
Task (with non- before ported. GRAM ported.
Task Settings
Setup volatile power inter- mode
memory). ruption.
Retained Same as Retained. Retained. Not sup- Retained. PRO- Not sup-
Device vari- (with non- before ported. GRAM ported.
Variable able volatile power inter- mode
tables memory). ruption.
Variables (but not Retained Same as Retained. Retained. Not sup- Retained. PRO- Supported.
variable (with non- before ported. GRAM/
User-defined Online edit-
values) volatile power inter- RUN mode
variables ing
memory). ruption. (online edit-
ing)
Retained Same as Retained. Retained. Not sup- Retained. PRO- Supported.
(with non- before ported. GRAM/ Online edit-
User-defined
Data type volatile power inter- RUN mode ing
data types
memory). ruption. (online edit-
ing)
Retained Same as Retained. Retained. Not sup- Retained. PRO- Supported.
CPU Unit (with non- before ported. GRAM/
name volatile power inter- RUN mode
memory). ruption.
Controller name
Retained Same as Retained. Retained. Supported Not PRO- Supported.
Built-in Ether-
(with non- before retained. GRAM/
Net/IP port
volatile power inter- RUN mode
name
memory). ruption.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-181


Appendices

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,
Control- and IP Router
ler Setup Tables
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
FINS Set- tings, memory). ruption.
tings FINS/TCP Set-
tings, FINS
Routing
Tables
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.
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.

A-182 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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

A-7 Attributes of CPU Unit Data


RUN mode occurs
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.
Data in CJ- Retained --- Retained. Retained. Supported. Not Depends
series Units,
such as proto-
(in CJ-
series
retained. on the Unit.
A
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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-183


Appendices

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
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
Retained Same as Retained. Retained. Supported. Not Supported.
Event System log (with Bat- before retained.
Logs
logs User event log tery*1). power inter-
ruption.
Retained With Bat- Retained Retained Supported. Not RUN/PRO- Supported.
(with Bat- tery: (continued). (continued). retained. GRAM
tery). Retained mode
Depends on the specifica- (contin-
Internal
tions of each system- ued), With-
clock
defined variable. out Battery:
Not predict-
able (may
stop).
Retained Same as Retained Retained Supported. Not Not sup-
(with Bat- before (continued). (continued). retained. ported.
Absolute encoder home offset
tery*1). power inter-
ruption.

*1For the NX1P2 CPU Units, data is retained in the non-volatile memory.
*2For the NX1P2 CPU Units, the value is 16#0000 if the Battery-related error detection is set to Do not use.

A-184 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-8 Contents of Memory Used for


CJ-series Units

A-8 Contents of Memory Used for CJ-series Units


You can specify addresses in the memory used for CJ-series Units for AT specifications for variables.
Details on each area are provided below.

Precautions for Correct Use


• You cannot use memory for CJ-series Units with the NX701 CPU Units.
• Refer to the NX-series NX1P2 CPU Unit Built-in I/O and Option Board User's Manual (Cat. No.
W579) for how to use memory for CJ-series Units with the NX1P2 CPU Units.

A-8-1 CIO Area

A
I/O Bits

A-8-1 CIO Area


 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.

CPU Bus Unit Area


 Description
The bits in this area are allocated to control and status information for CJ-series CPU Bus Units.
Each Unit is allocated 25 words based on its unit number. Data in this area is cleared when power is
cycled or when the operating mode is changed between PROGRAM and RUN mode.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-185


Appendices

 Addresses
Addresses Word addresses Bit addresses Words per Unit
Range CIO 1500 to CIO 1899 CIO 1500.00 to CIO 1899.15 25 words

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.

Precautions for Correct Use


You can access the CPU Bus 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. You should use AT specifications for the CIO Area only when you specify
addresses for some of the Special Units.

Special I/O Unit Area


 Description
The bits in this area are allocated to control and status information for CJ-series Special I/O Units.
Each Unit is allocated 10 words based on the unit number for up to a total of 96 Units (unit numbers
0 to 95). Data in this area is cleared when power is cycled or when the operating mode is changed
between PROGRAM and RUN mode.

 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.

A-186 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

DeviceNet Area

A-8 Contents of Memory Used for CJ-series Units


 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
A

You can allocate memory in the DeviceNet Area even if you use fixed allocations to use the remote

A-8-2 Internal I/O Area


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.

CIO Area Work Areas


 Description
You use the bits in these areas only in programming. You cannot use them to input or output data
through external I/O terminals. If you need work bits, you should normally use bits in this area. Data
in this area is cleared when power is cycled or when the operating mode is changed between PRO-
GRAM and RUN mode.

 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

A-8-2 Internal I/O Area


 Description
You use the bits in these areas only in programming. You cannot use them to input or output data
through external I/O terminals. If you need work bits, you should normally use bits in this area. Data
in this area is cleared when power is cycled or when the operating mode is changed between PRO-
GRAM and RUN mode.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-187


Appendices

 Addresses
Addresses Word addresses Bit addresses
Range W000 to W511 W000.00 to W511.15

A-8-3 Holding Area


 Description
You use the words and bits in this area only in programming. The status of the words and bits in this
area are retained during power interruptions or when the operating mode is changed between PRO-
GRAM and RUN mode.

 Addresses
Addresses Word addresses Bit addresses
Range H0 to H511 H0.00 to H511.15

A-8-4 DM 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
Range D0 to D32767 D0.00 to D32767.15

DM Area Words for Special Units


 Description
The following words in the DM Area are allocated to initial settings for Special Units.

 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

A-188 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

CJ-series CPU Bus Units


Word addresses Unit Number

A-8 Contents of Memory Used for CJ-series Units


D30000 to D30099 0
D30100 to D30199 1
to to
D31500 to D31599 F

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-8-5 EM Area
A
 Description
This is a general-purpose data area used to read and write 16-bit words. You can also add a bit

A-8-5 EM Area
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

Note The number of banks is given in hexadecimal.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-189


Appendices

A-9 Variable Memory Allocation Methods


You must be aware of the way in which memory is allocated to variables to align the memory locations
of the members of structure or union variables with variables in other devices. Adjustments are neces-
sary mainly when structure variables are used in the following type of communications with other
devices.
• When using EtherNet/IP tag data links or CIP messages to access variables between NJ/NX-series
CPU Units and other CPU Units
• When using structure variables to exchange data with devices other than CPU Units, such as ID Tags

A-9-1 Variable Memory Allocation Rules


The amount of memory and the memory locations that are allocated for a variable depend on the data
type of the variable. The amount of memory and the memory locations that are allocated for array ele-
ments, structure members, and union members depend on the data types, but also on the declarations
that are made for the arrays, structures, and unions.

Data Type Alignment and Memory Allocation Amounts


The data size is determined for each data type. The data size is the minimum amount of memory that is
required to store the value or values of that data type. On the other hand, memory for variables is auto-
matically structured by the Controller for the most efficient access. Therefore, the total amount of mem-
ory that is required for variables is not necessarily the total of the data sizes of the variables. For
example, if WORD and DWORD variables are declared, the total of the data sizes is six bytes, but eight
bytes are allocated in memory, as shown in the following figure.

Memory Variable Table


Bytes Name Data type
Variable A First byte A WORD
First byte + 1 WORD data: 2 bytes
B DWORD
First byte + 2
First byte + 3 Not used: 2 bytes
Variable B First byte + 4
First byte + 5
DWORD data: 4 bytes
First byte + 6
First byte + 7

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.

A-190 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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

A-9 Variable Memory Allocation Methods


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. A
Data type Alignment Amount of memory that is allocated

A-9-1 Variable Memory Allocation Rules


Same as alignment of the data type (Amount of memory that is allocated for the data type of the
Array of the elements elements) × Number of elements*
The largest alignment of all of the The integral multiple of the alignment that is larger than the
members total amount of memory that is allocated when the mem-
Structure
bers are arranged in order at integral multiples of the align-
ment of the data types of the members
The largest alignment of all of the The largest amount of memory that is allocated for any of
Union
members the members

* BOOL arrays are an exception. Refer to Precautions for Correct Use, below, for the amount of memory that is
allocated for BOOL arrays.

Precautions for Correct Use


Amount of Memory That Is Allocated for BOOL Arrays
Two bytes are allocated in memory for individual BOOL variables, BOOL structure members,
and BOOL union variables. However, for a BOOL array, two bytes of memory are not allocated
for each element. One bit is allocated in order for each element. For the entire array, a multiple of
two bytes of memory is allocated (including unused bits).

Memory Variable Table


Bytes Name Data type
Variable A First byte A BOOL
Two bytes are allocated.
First byte + 1 B ARRAY[1..5]OF BOOL
Variable B First byte + 2 C ARRAY[0..18]OF BOOL
Two bytes are allocated
First byte + 3
for 5 elements.
Variable C First byte + 4
First byte + 5
Four bytes are allocated
First byte + 6 for 19 elements.
First byte + 7

NJ/NX-series CPU Unit Software User’s Manual (W501) A-191


Appendices

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
Truncate the decimal portion of the result
of the calculation in brackets.

Specific examples of the rules for memory allocation for variables of each data type are given below.

Basic Data Types


 Variables with One-Byte Alignments (e.g., BYTE)
One byte of memory is allocated for the one-byte alignment.
Example: Two consecutive BYTE variables
Memory Variable Table
Bytes Name Data type
First byte Variable A, 1 byte A BYTE
First byte + 1 Variable B, 1 byte B BYTE

 Variables with Two-byte Alignments (e.g., BOOL and WORD)


Two bytes of memory are allocated for the two-byte alignment.
Example: Two consecutive BOOL variables
First byte + Variable Table
(integer multiple of 2) Memory
Name Data type
Bytes
First byte + First byte A BOOL
(integer multiple of 2) Variable A, 2 bytes
First byte + 1 B BOOL
First byte + 2
Variable B, 2 bytes
First byte + 3

 Variables with Four-byte Alignments (e.g., DWORD)


Four bytes of memory are allocated for the four-byte alignment.
The location of the first byte of data in memory is an integer multiple of four bytes. Therefore, if a
variable with a two-byte alignment, such as WORD data, is inserted, two bytes of unused memory
will remain.
Example: Consecutive variables in the following order: DWORD, WORD, and DWORD

First byte + Variable Table


Memory
(integer multiple of 4) Name Data type
Bytes
First byte A DWORD
First byte + 1 Variable A, B WORD
First byte + C DWORD
First byte + 2 4 bytes
(integer multiple of 2)
First byte + 3
First byte + 4 Variable B,
First byte + 5 2 bytes
First byte +
(integer multiple of 4) First byte + 6 Not used.
First byte + 7
First byte + 8
First byte + 9 Variable C,
First byte + 10 4 bytes
First byte + 11

A-192 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Variables with Eight-byte Alignments (e.g., LWORD)


Eight bytes of memory are allocated for the eight-byte alignment.
The location of the first byte of data in memory is an integer multiple of eight bytes. Therefore, if a
variable with a two-byte alignment, such as WORD data, is inserted, six bytes of unused memory
will remain. If a variable with a four-byte alignment, such as DWORD data, is inserted, four bytes of

A-9 Variable Memory Allocation Methods


unused memory will remain.
Example: Consecutive variables in the following order: LWORD, WORD, and LWORD
First byte + Variable Table
(integer multiple of 8) Memory
Name Data type
Bytes
First byte A LWORD
First byte + 1 B WORD
First byte + 2 C LWORD
Variable A,
First byte + 3
8 bytes
First byte + 4
First byte + 5
First byte +
(integer multiple of 2) First byte + 6
First byte + 7
First byte + 8 Variable B,
First byte + 9
First byte + 10
2 bytes
A
First byte + 11
First byte + 12

A-9-1 Variable Memory Allocation Rules


Not used.
First byte + 13
First byte + First byte + 14
(integer multiple of 8)
First byte + 15
First byte + 16
First byte + 17
First byte + 18 Variable C,
First byte + 19 8 bytes
First byte + 20
First byte + 21
First byte + 22
First byte + 23

NJ/NX-series CPU Unit Software User’s Manual (W501) A-193


Appendices

Arrays
A continuous section of memory is allocated for the elements of the array based on the data size of the
data type of the array variable. The alignment of an array is the same as alignment of the data type of
the elements.
Example: Continuous variables in the following order: two BOOL variable, one BOOL array with five
elements, one BOOL array with 19 elements, and one BOOL array with four elements

First byte + Variable Table


Memory
(integer multiple of 2) Name Data type
Bytes
First byte + First byte A BOOL
Variable A,
(integer multiple of 2)
First byte + 1 B BOOL
2 bytes
First byte + C ARRAY[1..5]OF BOOL
First byte + 2 Variable B,
(integer multiple of 2)
First byte + 3 D ARRAY[0..18]OF BOOL
2 bytes
First byte + E ARRAY[5..8]OF BOOL
First byte + 4 Variable C,
(integer multiple of 2)
First byte + 5 2 bytes
First byte + 6
First byte + 7 Variable D,
First byte + First byte + 8 4 bytes
(integer multiple of 2)
First byte + 9
First byte + 10 Variable E,
First byte + 11 2 bytes

Example: INT array with five elements


First byte + Memory Variable Table
(integer multiple of 2) Bytes Name Data type
First byte + A[0] First byte Variable A ARRAY[0..4] OF INT
(integer multiple of 2)
First byte + 1
First byte + A[1] First byte + 2
(integer multiple of 2) First byte + 3
Variable A,
First byte + A[2] First byte + 4 10 bytes
(integer multiple of 2)
First byte + 5
First byte + A[3] First byte + 6
(integer multiple of 2) First byte + 7

A[4] First byte + 8


First byte + 9

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.

Variable Alignment [bytes] Amount of memory that is allocated [bytes]


A 4 8
B 4 8
C 4 16
D 4 16

A-194 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

First byte + Data Type Definitions


(integer multiple of 4) Memory
Name Data type
Bytes
A.a First byte Structure STR_A STRUCT

First byte + 1 a DINT

First byte + 2 b INT

A-9 Variable Memory Allocation Methods


First byte + 3 Variable A, Name Data type
A.b First byte + 4 8 bytes Structure STR_B STRUCT
First byte + 5 c INT
First byte + First byte + 6 d DINT
(integer multiple of 4) Not used.
First byte + 7
Variable Table
B.c First byte + 8
Name Data type
First byte + 9
Variable A Structure STR_A
First byte + 10 Variable B,
Not used. Variable B Structure STR_B
First byte + 11 8 bytes
Variable C ARRAY[0..1] OF STR_A
B.d First byte + 12
Variable D ARRAY[0..1] OF STR_B
First byte + 13
First byte +
(integer multiple of 4) First byte + 14
First byte + 15
C[0].a First byte + 16
First byte + 17
First byte + 18 A
First byte + 19
C[0].b First byte + 20

A-9-1 Variable Memory Allocation Rules


First byte + 21
First byte + 22 Variable C,
Not used.
First byte + 23 16 bytes
C[1].a First byte + 24
First byte + 25
First byte + 26
First byte + 27
C[1].b First byte + 28
First byte + 29
First byte +
First byte + 30
(integer multiple of 4) Not used.
First byte + 31
D[0].c First byte + 32
First byte + 33
First byte + 34
Not used.
First byte + 35
D[0].d First byte + 36
First byte + 37
First byte + 38 Variable D,
First byte + 39 16 bytes
D[1].c First byte + 40
First byte + 41
First byte + 42
Not used.
First byte + 43
D[1].d First byte + 44
First byte + 45
First byte + 46
First byte + 47

NJ/NX-series CPU Unit Software User’s Manual (W501) A-195


Appendices

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.

Variable Alignment [bytes] Amount of memory that is allocated [bytes]


E 2 4
F 2 4
G 2 8
H 2 8

Data Type Definitions


Memory
First byte + Name Data type
Bytes
(integer multiple of 2)
E.a[0] to E.a[7] First byte Structure STR_C STRUCT
First byte + 1 Not used. Variable E, a ARRAY[0..7] OF BOOL
E.b First byte + 2 4 bytes b BYTE
First byte +
First byte + 3 Not used.
(integer multiple of 2) Name Data type
F.c First byte + 4
Structure STR_D STRUCT
First byte + 5 Not used. Variable F, c BYTE
F.d[0] to F.d[7] First byte + 6 4 bytes
First byte + d ARRAY[0..7] OF BOOL
First byte + 7 Not used.
(integer multiple of 2) Variable Table
G[0].a[0] to G[0].a[7] First byte + 8
Name Data type
First byte + 9 Not used.
G[0].b Variable E Structure STR_C
First byte + 10
Variable F Structure STR_D
First byte + 11 Not used. Variable G,
G[1].a[0] to G[1].a[7] Variable G ARRAY[0..1] OF STR_C
First byte + 12 8 bytes
Variable H ARRAY[0..1] OF STR_D
First byte + 13 Not used.
G[1].b First byte + 14
First byte +
First byte + 15 Not used.
(integer multiple of 2)
H[0].c First byte + 16
First byte + 17 Not used.
H[0].d[0] to H[0].d[7] First byte + 18
First byte + 19 Not used. Variable H,
H[1].c First byte + 20 8 bytes
First byte + 21 Not used.
H[1].d[0] to H[1].d[7] First byte + 22
First byte + 23 Not used.

A-196 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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.

A-9 Variable Memory Allocation Methods


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.

Variable Alignment [bytes] Amount of memory that is allocated [bytes]


A 4 4
B 4 4
C 4 8
D 4 8

First byte + Data Type Definitions


(integer multiple of 4) Memory
Name Data type
Bytes
A.a A.b First byte Union UNI_A UNION
a DWORD
First byte +
First byte + 1
First byte + 2
Variable A,
b WORD A
(integer multiple of 4) 4 bytes
First byte + 3 Name Data type
B.c B.d First byte + 4

A-9-1 Variable Memory Allocation Rules


Union UNI_B UNION
First byte + 5 c WORD
First byte + Variable B,
First byte + 6 d DWORD
(integer multiple of 4) 4 bytes
First byte + 7
Variable Table
C[0].a C[0].b First byte + 8
Name Data type
First byte + 9
Variable A Union UNI_A
First byte + 10
Variable C, Variable B Union UNI_B
First byte + 11
8 bytes Variable C ARRAY[0..1] OF UNI_A
C[1].a C[1].b First byte + 12
Variable D ARRAY[0..1] OF UNI_B
First byte + 13
First byte +
First byte + 14
(integer multiple of 4)
First byte + 15
D[0].c D[0].d First byte + 16
First byte + 17
First byte + 18
Variable D,
First byte + 19
8 bytes
D[1].c D[1].d First byte + 20
First byte + 21
First byte + 22
First byte + 23

NJ/NX-series CPU Unit Software User’s Manual (W501) A-197


Appendices

A-9-2 Important Case Examples


When you exchange structure variable data between an NJ/NX-series CPU Unit and a remote device,
you must align the memory configuration of the structure variable members with those of the remote
device. This section describes what to do in either the NJ/NX-series CPU Unit or in the remote device.

Additional Information

This is not necessary when you exchange data between NJ/NX-series CPU Units.

Aligning the Memory Configuration with a Remote Device


There are two methods that you can use to align the memory configuration with a remote device.
For example, the differences in the memory configuration for structure variables between an NJ/NX-
series CPU Unit and a CJ-series CPU Unit are shown below.
This section describes how to align the memory configuration for these Units.

Data Type Definitions Data Type Definitions

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

 Method 1: Changing the Memory Configuration of the Structure Variable in


the NJ/NX-series CPU Unit
With an NJ/NX-series CPU Unit, you can specify member offsets to change the memory configura-
tion of the members of a structure variable. You can change the memory configuration of the mem-
bers of a structure variable in the NJ/NX-series CPU Unit so that it is the same as the memory
configuration in a remote device that the CPU Unit will communicate with. Specify the member off-
sets for a structure variable when you register the structure data type.
To communicate with a CJ-series CPU Unit, you can set the offset type to CJ to automatically use
the CJ-series memory structure. You can set the offset type to User to freely set your own offsets.

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.

Sysmac Studio version


Unit version of CPU Unit
1.01 or lower 1.02 1.03 or higher
1.01 or later Not possible. Possible.* Possible.
1.00 Not possible. Not possible. Not possible.

* You cannot select the memory offset type. You can set member offsets.

A-198 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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

A-9 Variable Memory Allocation Methods


the CJ-series CPU Unit is changed to match the memory configuration of the structure variable in
the NJ/NX-series CPU Unit.

A-9-2 Important Case Examples

NJ/NX-series CPU Unit Software User’s Manual (W501) A-199


Appendices

Data Type Definitions NJ/NX-series Structure Data Type Definitions


CJ-series Structure
Name Data type Variable NJ_X Name Data type 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
Communications is
Variable Table First byte + 6 Not used. Variable Table First byte + 6 c
not possible
Name Data type First byte + 8 c because the memory Name Data type
Variable NJ_X Structure Y configuration is not Variable CJ_X Structure Y
the same.

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.

(1) Offset type is set to CJ.

(3) Bit Offset


Set the location of the first bit of the member
(2) Byte Offset
Set the location of the first byte of the
member from the beginning of the structure
(1) Offset Type
Specify User.

Memory Bytes Memory Bytes


First byte First byte
(2) Byte Offset
First byte + 1 First byte + 1 Variable c starts from the 6th
Variable a Variable a
First byte + 2 First byte + 2 byte from the start of the
First byte + 3 First byte + 3 structure.
First byte + 4 First byte + 4
Variable b Variable b
First byte + 5 First byte + 5
First byte + 6 First byte + 6
Not used.
First byte + 7 First byte + 7
The location of Variable c
First byte + 8 First byte + 8
variable c changes
First byte + 9 First byte + 9
Variable c according to the
First byte + 10 offsets. First byte + 10
First byte + 11 First byte + 11

(3) Bit Offset


Variable c starts from the
Set a byte offset of 6 and a bit offset 0th bit from the start of the
of 0 (no offset) for variable c.

A-200 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Method 2: Changing the Memory Configuration of the Structure Variable in


the Remote Device
You can insert a member into the structure variable of the remote device to change it to match the
memory configuration of the structure variable in the NJ/NX-series CPU Unit. Both the memory con-
figuration and the data types must be the same between the two structure variables. You therefore

A-9 Variable Memory Allocation Methods


need to create the same members in both the remote device and the NJ/NX-series CPU Unit.
Example: The following example shows how the memory configuration of the structure variable in
the CJ-series CPU Unit is changed to match the memory configuration of the structure variable in
the NJ/NX-series CPU Unit.
Data Type Definitions Data Type Definitions
NJ/NX-series Structure Variable NJ_X CJ-series Structure Variable CJ_X
Name Data type Name Data type
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 Name Data type
Variable NJ_X Structure Y c Variable CJ_X Structure Y

A
Make the following changes to align the memory
configurations in the NJ/NX-series and CJ-series CPU Units.

A-9-2 Important Case Examples


Data Type Definitions Data Type Definitions
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
b2 INT First byte + 4 b b2 INT First byte + 4 b
c DINT First byte + 6 b2 c DINT First byte + 6 b2
Variable Table First byte + 8 c Variable Table First byte + 8 c
Name Data type Name Data type
Variable NJ_X Structure Y Variable CJ_X Structure Y

(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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-201


Appendices

A-10 Registering a Symbol Table on the


CX-Designer
When you connect the NJ/NX-series Controller to an NS-series PT, you can use variables on the CX-
Designer to set addresses for the functional objects. The variables are managed in a symbol table. This
section shows how to copy a table of variables from a Microsoft Excel spreadsheet to register them all
at the same time in a symbol table. Refer to the CX-Designer User’s Manual (Cat. No. V099) for
detailed information on the CX-Designer.

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.

Address I/O com-


Host Name Type Tag
type/address ment
HOST3 _Card1BkupCmd.ExecBkup BOOL TRUE
HOST3 _Card1BkupCmd.CancelBkup BOOL TRUE
HOST3 _Card1BkupCmd.ExecVefy BOOL TRUE
HOST3 _Card1BkupCmd.CancelVefy BOOL TRUE
HOST3 _Card1BkupCmd.DirName STRING(64) TRUE
HOST3 _Card1BkupSta.Done BOOL TRUE
HOST3 _Card1BkupSta.Active BOOL TRUE
HOST3 _Card1BkupSta.Err BOOL TRUE
HOST3 _Card1VefySta.Done BOOL TRUE
HOST3 _Card1VefySta.Active BOOL TRUE
HOST3 _Card1VefySta.VefyRslt BOOL TRUE
HOST3 _Card1VefySta.Err BOOL TRUE
HOST3 _BackupBusy BOOL TRUE
HOST3 _Card1PrgTransferCmd.Exec BOOL TRUE
HOST3 _Card1PrgTransferCmd.DirName STRING(64) TRUE
HOST3 _Card1PrgTransferCmd.Password STRING(33) TRUE
HOST3 _Card1PrgTransferCmd.TargetUserProgram BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetIPAdr BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetVariable BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetMemory BOOL TRUE
HOST3 _Card1PrgTransferSta.Done BOOL TRUE
HOST3 _Card1PrgTransferSta.Active BOOL TRUE
HOST3 _Card1PrgTransferSta.Err BOOL TRUE
HOST3 _Card1RestoreCmd.Exec BOOL TRUE
HOST3 _Card1RestoreCmd.DirName STRING(64) TRUE
HOST3 _Card1RestoreCmd.Password STRING(33) TRUE
HOST3 _Card1RestoreSta.Done BOOL TRUE
HOST3 _Card1RestoreSta.Active BOOL TRUE
HOST3 _Card1RestoreSta.Err BOOL TRUE
HOST3 _Card1RestoreCmdTargetUserProgram BOOL TRUE
HOST3 _Card1RestoreCmdTargetIPAdr BOOL TRUE
HOST3 _Card1RestoreCmdTargetVariable BOOL TRUE
HOST3 _Card1RestoreCmdTargetMemory BOOL TRUE
HOST3 _Card1RestoreCmdTargetUnitConfig BOOL TRUE
HOST3 _Card1RestoreCmdTargetAbsEncoder BOOL TRUE

A-202 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

2 Start the CX-Designer and open the Symbol Table Dialog Box.

A-10 Registering a Symbol Table on the CX-Designer


3 Copy the shaded portion of the Microsoft Excel spreadsheet.
Always copy all of the columns that are shown below.

Address I/O com-


Host Name Type Tag
type/address ment A
HOST3 _Card1BkupCmd.ExecBkup BOOL TRUE
HOST3 _Card1BkupCmd.CancelBkup BOOL TRUE
HOST3 _Card1BkupCmd.ExecVefy BOOL TRUE
HOST3 _Card1BkupCmd.CancelVefy BOOL TRUE
HOST3 _Card1BkupCmd.DirName STRING(64) TRUE
HOST3 _Card1BkupSta.Done BOOL TRUE
HOST3 _Card1BkupSta.Active BOOL TRUE
HOST3 _Card1BkupSta.Err BOOL TRUE
HOST3 _Card1VefySta.Done BOOL TRUE
HOST3 _Card1VefySta.Active BOOL TRUE
HOST3 _Card1VefySta.VefyRslt BOOL TRUE
HOST3 _Card1VefySta.Err BOOL TRUE
HOST3 _BackupBusy BOOL TRUE
HOST3 _Card1PrgTransferCmd.Exec BOOL TRUE
HOST3 _Card1PrgTransferCmd.DirName STRING(64) TRUE
HOST3 _Card1PrgTransferCmd.Password STRING(33) TRUE
HOST3 _Card1PrgTransferCmd.TargetUserProgram BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetIPAdr BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetVariable BOOL TRUE
HOST3 _Card1PrgTransferCmd.TargetMemory BOOL TRUE
HOST3 _Card1PrgTransferSta.Done BOOL TRUE
HOST3 _Card1PrgTransferSta.Active BOOL TRUE
HOST3 _Card1PrgTransferSta.Err BOOL TRUE
HOST3 _Card1RestoreCmd.Exec BOOL TRUE
HOST3 _Card1RestoreCmd.DirName STRING(64) TRUE
HOST3 _Card1RestoreCmd.Password STRING(33) TRUE
HOST3 _Card1RestoreSta.Done BOOL TRUE
HOST3 _Card1RestoreSta.Active BOOL TRUE
HOST3 _Card1RestoreSta.Err BOOL TRUE
HOST3 _Card1RestoreCmdTargetUserProgram BOOL TRUE
HOST3 _Card1RestoreCmdTargetIPAdr BOOL TRUE
HOST3 _Card1RestoreCmdTargetVariable BOOL TRUE
HOST3 _Card1RestoreCmdTargetMemory BOOL TRUE
HOST3 _Card1RestoreCmdTargetUnitConfig BOOL TRUE
HOST3 _Card1RestoreCmdTargetAbsEncoder BOOL TRUE

NJ/NX-series CPU Unit Software User’s Manual (W501) A-203


Appendices

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.

A-204 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-11 Enable/Disable EtherCAT Slaves and


Axes

A-11 Enable/Disable EtherCAT Slaves and Axes


You can enable and disable EtherCAT slaves and axes using programming instructions. You can use
this for the following types of applications.
• Managing more than one machine with different EtherCAT slave configurations and axis composi-
tions with one project on the Sysmac Studio.
• Leaving one production line running while you change the EtherCAT slave configuration or axis com-
position of another line.
This section describes the instructions and system-defined variables that are used and provides some
application examples.

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

A-11-1 Project Settings When Using EtherCAT Slaves and Axes


A-11-1 Project Settings When Using EtherCAT Slaves and Axes
When you turn ON the power supply or download the project, disable in advance any EtherCAT slaves
that may not be installed in the EtherCAT network. Also, set any axes for those EtherCAT slaves to
unused axes. If any EtherCAT slaves that are not installed on the EtherCAT network are enabled or if
any of their axes are set to used axes, an error will occur when operation is started.

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-208.
• You can disable an EtherCAT slave to enable removing it or installing it on the EtherCAT net-
work.

A-11-2 Using Instructions to Enable/Disable EtherCAT Slaves and Axes


You can use instructions in the user program to enable and disable EtherCAT slaves and axes. Sepa-
rate instructions are used to enable and disable EtherCAT slaves and to enable and disable axes. Both
instructions are given in the following table.

Item changed Instruction


EtherCAT slaves EC_ChangeEnableSetting (Enable/Disable EtherCAT Slave) instruction
Axes MC_ChangeAxisUse (Change Axis Use) instruction

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-205


Appendices

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.

A-11-3 System-defined Variables That Indicate EtherCAT Slave or Axis


Status
You can check the values of system-defined variables to get the current status of EtherCAT slaves and
axes. The system-defined variables for these are given below.

Accessed status System-defined variable name


EtherCAT slaves _EC_DisableSlavTbl[] (Disabled Slave Table)
Axes _MC_AX[].Cfg.AxEnable (Axis Use)*1
*1 You can also use _MC1_AX[].Cfg.AxEnable and _MC2_AX[].Cfg.AxEnable with the NX701
CPU Unit.

_EC_DisableSlavTbl[] (Disabled Slave Table)


The _EC_DisableSlavTbl[] (Disabled Slave Table) system-defined variable tells whether each Ether-
CAT slave is currently disabled. The node address is specified for the array subscript. The meanings of
the values in _EC_DisableSlavTbl[] (Disabled Slave Table) are given below.

Value Meaning
TRUE The EtherCAT slave with the specified node address is disabled.
FALSE The EtherCAT slave with the specified node address is enabled.

_MC_AX[].Cfg.AxEnable (Axis Use)


The _MC_AX[].Cfg.AxEnable (Axis Use) system-defined variable tells whether each axis is defined and
whether each axis is used. The axis number is specified for the array subscript. The meanings of the
values in _MC_AX[].Cfg.AxEnable (Axis Use) are given below.

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.

A-206 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-11-4 Enabling/Disabling Execution of Program


There are certain programs associated with the EtherCAT slaves and axes, which are enabled or dis-

A-11 Enable/Disable EtherCAT Slaves and Axes


abled. These associated programs must be enabled or disabled as the EtherCAT slaves and axes are
enabled or disabled. To enable or disable the program, use the following instructions in the user pro-
gram.
Function Instruction
Enable program PrgStart instruction
Disable program PrgStop instruction
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502-E1-10 or later) for the
detailed specifications of the PrgStart instruction and PrgStop instruction.

Precautions for Correct Use


When you want to disable the program, first disable the EtherCAT slave and axis which the pro-
gram is associated with, and then disable the program.

Version Information A
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.

A-11-4 Enabling/Disabling Execution of Program


A-11-5 Checking Enabled/Disabled Program
You can use the PrgStatus instruction to check the program is enabled or disabled that is associated
with the EtherCAT slave and axis that are enabled and disabled.
Refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502-E1-10 or later) for the
detailed specifications of the PrgStatus instruction.

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.

A-11-6 Settings with the Sysmac Studio


You can also enable/disable the EtherCAT slaves and axes and set to enable/disable the program at
the start of operation using the Sysmac Studio. Some applications require that EtherCAT slave status,
axis status and program status at the start of operation are set in advance with the Sysmac Studio.

Enabling/Disabling EtherCAT Slaves with Sysmac Studio


Use the following procedure to enable an EtherCAT slave on the Sysmac Studio.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-207


Appendices

3 Set the value of Enable/Disable Settings to Enabled on the Parameter Settings Area for the
EtherCAT slave.

Enabling/Disabling Axis with Sysmac Studio


Use the following procedure to enable an axis on the Sysmac Studio.

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.

2 Right-click MC_Axis000(0) and select Edit from the menu.


The Axis Basic Settings Display appears.

3 Set Axis Use to Used Axis.

Running/Stopping Program at the Start of Operation with Sysmac


Studio
Use the following procedure to execute a program at the start of operation on the Sysmac Studio.

1 Right-click Task Settings under Configurations and Setup and select Edit from the menu.
The Task Settings Tab Page is displayed.

2 Click the Program Assignment Settings Button.


The Program Assignment Settings Display appears.

3 Set Initial Status of the program to Run on the Program Assignment Settings Display.

A-11-7 Examples of Applications of Enabling/Disabling EtherCAT


Slaves and Axes
This section provides concrete examples of applications in which EtherCAT slaves and axes are
enabled and disabled.

Application 1: Centralized Management of Machines with Different


EtherCAT Slave Configuration and Axis Composition
Assume that the EtherCAT slaves and axis compositions for the NJ-series Controllers are different for
machines 1 and 2 as shown below. These two machines are centrally managed using one Sysmac Studio proj-
ect.
EtherCAT Slave Configuration and EtherCAT Slave Configuration and
Axis Composition of Machine 1 Axis Composition of Machine 2

CPU CPU
Unit Unit

EtherCAT EtherCAT

A B C A B C D

EtherCAT slaves, axes EtherCAT slaves, axes Sensor

A-208 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

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.

A-11 Enable/Disable EtherCAT Slaves and Axes


EtherCAT Installed in Enable/disable Axis Use
Associated programs
slave EtherCAT network setting parameter setting
A, B, and C Installed. Enabled. Used Axis Run at the start of opera-
tion.
D Not installed. Disabled. Unused Axis Stop at the start of opera-
tion.

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.

A-11-7 Examples of Applications of Enabling/Disabling EtherCAT Slaves and Axes


Yes
Machine 1?

No

The EC_ChangeEnableSetting instruction is executed to enable


the slave for node D and the MC_ChangeAxisUse instruction is
executed to change the axis for node D to a used axis.
The program associated with node D is executed by the
PrgStart instruction.

Operation started.

Application 2: Changing the EtherCAT Slave Configuration and Axis


Composition during Operation
In the following figure, production line 1 is left running while the EtherCAT slaves and axis composition
on production line 2 are changed.

CPU CPU
Unit Unit

Production line 1 is left running


EtherCAT while the EtherCAT slaves and EtherCAT
axis composition on production
line 2 are changed.
A B Production line 1 A B Production line 1

EtherCAT slaves, axes EtherCAT slaves, axes

Production line 2 F G Production line 2


C D E

EtherCAT slaves, axes EtherCAT slaves, axes

NJ/NX-series CPU Unit Software User’s Manual (W501) A-209


Appendices

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.

1 Stop production line 4.

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.

5 Remove EtherCAT slaves C, D, and E from production line 4.

6 Install EtherCAT slaves F and G on production line 4.

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.

Precautions for Correct Use


When you want to disable the program, first disable the EtherCAT slave and axis which the pro-
gram is associated with, and then disable the program.

A-210 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-12 Size Restrictions for the User


Program

A-12 Size Restrictions for the User Program


There are size restrictions for the user program due to the limitations of the memory capacity in the
CPU Unit and other factors. If you exceed these restrictions, errors will occur during operation. This
section describes each of the size restrictions of a user program that is created in a CPU Unit.
You can check the approximate sizes of the user program and variables with the memory display func-
tions of the Sysmac Studio.
Be careful not to exceed these restrictions when you create the user program. The restrictions that are
given in this section, however, are only reference values for use as guidelines. We recommend that you
ensure ample leeway for the restrictions to allow for the possibility of future user program expansion as
well as for other reasons.

Precautions for Correct Use


Errors can occur during online editing even if the user program size restrictions are not
exceeded. This is because even if you change the user program with online editing, other data A
that is allocated in the memory of the CPU Unit may remain. If errors occur, change the Control-
ler to PROGRAM mode and transfer the user program to the Controller again to reset the errors.

A-12-1 User Program Object Restrictions


A-12-1 User Program Object Restrictions
This section describes the restrictions to user program objects. There are restrictions for the following
objects.
• POU
• Variables
• Data type definitions
• Constants (literals)

POU Restrictions
There are restrictions both on POU definitions and POU instances.

 POU Definition Restrictions


POU definitions are subject to the following restrictions.

CPU Unit model


Restriction NX701- NX1P2- NJ501- NJ301- NJ101-
    
Maximum number of programs 1,000 500 500 500 500
Maximum value of the following: Num- 6,000 450 3,000 750 450
ber of function block definitions + Num-
ber of function definitions + Number of
ladder diagram sections
Maximum total number of input, output, 64 64 64 64 64
and in-out variables in function block
and function definitions

NJ/NX-series CPU Unit Software User’s Manual (W501) A-211


Appendices

 POU Instance Restrictions


POU instances are subject to the following restrictions. The maximum number of POU instances
depends on the model and unit version of the CPU Unit and the version of the Sysmac Studio.

Maximum Number of POU Instances for the NX701-

CPU Unit model


Restriction
NX701-
Maximum number of POU instances 48,000

Maximum Number of POU Instances for the NX1P2-

CPU Unit model


Restriction
NX1P2-
Maximum number of POU instances 1,800

Maximum Number of POU Instances for the NJ501-

Version CPU Unit model


Restriction
Sysmac Studio NJ501-
Maximum number of POU instances 1.05 or lower 6,000
1.06 or higher 9,000

Maximum Number of POU Instances for the NJ301-

Unit version/version CPU Unit model


Restriction
CPU Unit Sysmac Studio NJ301-
Maximum number of POU instances --- 1.04 or lower 1,500
1.03 or earlier 1.05 or higher 2,400
1.04 or later 3,000

Maximum Number of POU Instances for the NJ101-

CPU Unit model


Restriction
NJ101-
Maximum number of POU instances 1,800

Refer to Number of POU Instances on page A-215 for information on counting POU instances.

A-212 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Restrictions to Variables
There are restrictions to both variable usage and variable definitions.

A-12 Size Restrictions for the User Program


 Restrictions to Variable Usage
The usage of variables is subject to the following restrictions.

CPU Unit model


Restriction NX701- NX1P2- NJ501- NJ301- NJ101-
    
Maximum total size in Mbytes of vari- 256 2*2 4 2 2
ables without a Retain attribute*1
Maximum total size*1 in Mbytes of 4 0.032*2 2 0.5 0.5
variables with a Retain attribute
Maximum number of variables*2 with- 360,000 90,000 90,000 22,500 22,500
out a Retain attribute
Maximum number of variables*3 with 40,000 5,000 10,000 *4 5,000
a Retain attribute A
Maximum number of network vari- 40,000 27,500 40,000 27,500 27,500
ables

A-12-1 User Program Object Restrictions


*1 The data size of each variable depends on its data type. Refer to 6-3-5 Data Types for the sizes of the data
types.
*2 Memory for CJ-series Units is included.
*3 Refer to Number of Variables without a Retain Attribute on page A-215 for information on counting vari-
ables.
*4 Refer to Number of Variables with a Retain Attribute on page A-215 for information on counting variables.
*5 The restriction depends on the Sysmac Studio version and the unit version of the CPU Unit as follows: Sys-
mac Studio version 1.05 or higher and CPU Unit with unit version 1.04 or later: 5,000
Other combinations: 2,500

 Restrictions to Variable Definitions


Variable definitions are subject to the following restrictions.

CPU Unit model


Restriction NX701- NX1P2- NJ501- NJ301- NJ101-
    
Maximum number of elements per array 65,535 65,535 65,535 65,535 65,535
Maximum number of dimensions in an 3 3 3 3 3
array
Maximum size in MB of an array 8 1 4 2 2
Maximum value of a subscript (element 65,535 65,535 65,535 65,535 65,535
number) for an array
Maximum size in bytes*1 of a string vari- 1,986 1,986 1,986 1,986 1,986
able
*1 The NULL character at the end must be counted. Therefore, there are 1,985 single-byte characters in a
string that has a size of 1,986 bytes.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-213


Appendices

Restrictions to Data Type Definitions


Data type definitions are subject to the following restrictions.

CPU Unit model


Restriction NX701- NX1P2- NJ501- NJ301- NJ101-
    
Maximum number*1 of data type definitions 8,000 1,000 2,000 1,000 1,000
Maximum number of levels in a structure 8 8 8 8 8
definition
Maximum number of members in a structure 2,048 2,048 2,048 2,048 2,048
definition
Maximum size in MB of a structure variable 8 1 4 2 2
Maximum number of members in a union 4 4 4 4 4
definition
Maximum number of enumerators in an enu- 2,048 2,048 2,048 2,048 2,048
meration definition
*1 Refer to Number of Data Type Definitions on page A-216 for information on counting data types.

Restrictions to Constants (Literals)


The constants (literals) are subject to the following restrictions.

CPU Unit model


Restriction NX701- NX1P2- NJ501- NJ301- NJ101-
    
Maximum size in bytes of a constant (literal) 1,985 1,985 1,985 1,985 1,985

A-214 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-12-2 Counting User Program Objects


This section describes how to count POU instances, variables with a Retain attribute, variables without
a Retain attribute, and data type definitions. The information in this section is provided only as guide-

A-12 Size Restrictions for the User Program


lines. The methods for counting objects sometimes varies with the unit version of the CPU Unit. Always
use the Sysmac Studio to confirm that user program object sizes are suitable.

Number of POU Instances


POU instances are counted as described below.

 Objects Counted as POU Instances


The following objects are counted as POU instances.
• Programs
• Function block instances (both user-created instances and instructions are included)
• Functions (both user-created instances and instructions are included)

 Precautions in Counting POU Instances A


Observe the following precautions when you count POU instances.
• If n instances of a function block are used for the same function block definition, count them as n

A-12-2 Counting User Program Objects


instances.
• If the same function is used more than once in the same task, count them as one instance regard-
less of the actual number of functions.
• If the same function is used in different tasks, count them as one instance for each task.

Number of Variables without a Retain Attribute


Variables without a Retain attribute are counted as described below.

 Objects Counted as Variables without a Retain Attribute


The following objects are counted as variables without a Retain attribute.
• Global variables without a Retain attribute
• Local variables without a Retain attribute in programs and function block instances (both user-cre-
ated instances and instructions are included)

 Precautions in Counting Variables without a Retain Attribute


Observe the following precautions when you count variables without a Retain attribute.
• Count arrays as one variable each regardless of the number of elements.
• Count function block instances as one variable. Both user-created instances and instructions are
included for function block instances.
• Count arrays of function block instances as one variable each regardless of the number of ele-
ments. However, count one variable for each element of the array for the number of variables
without a Retain attribute that are used in the function block.

Number of Variables with a Retain Attribute


Variables with a Retain attribute are counted as described below.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-215


Appendices

 Objects Counted as Variables with a Retain Attribute


The following objects are counted as variables with a Retain attribute.
• Global variables with a Retain attribute
• Local variables with a Retain attribute in programs and function block instances (both user-cre-
ated instances and instructions are included)

 Precautions in Counting Variables with a Retain Attribute


Observe the following precautions when you count variables with a Retain attribute.
• Count arrays as one variable each regardless of the number of elements.
• Do not count arrays of function block instances. However, count one variable for each element of
the array for the number of variables with a Retain attribute that are used in the function blocks.

Number of Data Type Definitions


Data type definitions are counted as described below.

 Objects Counted as Data Type Definitions


The following objects are counted as data type definitions.
• User-created structure definitions
• User-created union definitions
• User-created enumeration definitions

A-216 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-13 Replacing CPU Units with Unit Version 1.02 or Earlier


A-13 Replacing CPU Units with Unit
Version 1.02 or Earlier
An NJ-series CPU Unit with a unit version of 1.02 or earlier does not support the SD Memory Card
backup functions and Sysmac Studio Controller backup functions. Therefore, the following work is
required to replace a CPU Unit when it fails or to change to a newer version.

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

A-13-1 Uploading the Data from the CPU Unit

A-13-1 Uploading the Data from the CPU Unit


Upload the following three types of data from the old CPU Unit. Each of these must be uploaded sepa-
rately. Use the Sysmac Studio and the Network Configurator.

Data to upload Contents of data Support Software


Project • Unit Configuration and Unit Setup Sysmac Studio
• I/O Map
• Controller Setup (Operation Settings and Built-in Ether-
Net/IP Port Settings)
• Motion Control Setup
• Cam Data Settings
• Event Setup
• Task Settings
• POUs
• Data type definitions and global variable definitions
Present values of vari- • Values of variables with a Retain attribute Sysmac Studio
ables and memory • Values of the Holding, DM, and EM Areas in the memory
for CJ-series Units
• Absolute encoder home offsets
Tag data link tables*1 • Tag data link settings for EtherNet/IP Sysmac Studio
Network Configurator*2
*1 You need to upload tag data link tables only when tag data links are set.
*2 Use the Network Configurator with the Sysmac Studio version 1.09 or lower.

Precautions for Correct Use


The following data in the CPU Unit is not included in the project, present values of variables and
memory, or tag data link tables. Therefore, you must set them again after you replace the CPU Unit.
• Data Trace Settings
• Controller name
• Operation authority verification
• Time zone setting for the built-in clock

NJ/NX-series CPU Unit Software User’s Manual (W501) A-217


Appendices

Uploading the Project


Use the following procedure to upload the project.

1 Start the Sysmac Studio on the computer that is connected to the NJ-series Controller.

2 Click the New Project Button and create a new project.

3 Select the device and version of the CPU Unit to replace.

4 Click the Online Button in the toolbar.

5 Click the Synchronize Button in the toolbar.

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.

7 Click the Recompare Button.


The uploaded project is compared to the project in the Controller.

8 Click the Save Button.


The project is saved in the computer.

A-218 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-13 Replacing CPU Units with Unit Version 1.02 or Earlier


Uploading the Present Values of Variables and Memory
Use the Sysmac Studio’s variable and memory backup function to upload the present values of vari-
ables and memory. Refer to 9-8 Sysmac Studio Variable and Memory Backup Functions for details on
the Sysmac Studio variable and memory backup functions.
Use the following procedure.

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.

A-13-1 Uploading the Data from the CPU Unit

NJ/NX-series CPU Unit Software User’s Manual (W501) A-219


Appendices

Uploading Tag Data Link Tables


The Network Configurator is used with the Sysmac Studio version 1.09 or lower.
Use the following procedure to upload the tag data link tables.

1 Start the Network Configurator on the computer that is connected to the NJ-series Con-
troller.

2 Select Network − Connect from the toolbar.

3 Select Network − Upload from the toolbar.


The following message is displayed: “Uploading all devices parameters form network will start
based on the current document, OK?”

4 Click the Yes Button.

5 Select only the IP address of the connected CPU Unit as the device and click the OK But-
ton.

6 Select File − Save As.


The tag data link tables are uploaded to the computer.

A-13-2 Connecting the New CPU Unit


Remove the old CPU Unit and connect the new CPU Unit. Refer to the NJ-series CPU Unit Hardware
User’s Manual (Cat. No. W500) for details on the connection methods.

Perform the following actions for the new CPU Unit.


• Insert the SD Memory Card that was in the old CPU Unit into the new CPU Unit.
• Set the DIP switch to the same settings as the old CPU Unit.

A-220 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-13 Replacing CPU Units with Unit Version 1.02 or Earlier


A-13-3 Downloading the Data to the CPU Unit
Download the project, present values of variables and memory, and tag data link tables to the new CPU
Unit.

Precautions for Safe Use


Check the operation of the downloaded project for proper execution before you use it for actual
operation.

Downloading the Project


Use the following procedure to download the project.

1 Start the Sysmac Studio on the computer that is connected to the NJ-series Controller.

2 Click the Open Project Button.


A
3 From the project list, select the project that you uploaded from the old CPU Unit.
In the following example, the name of the project that you uploaded from the previous CPU Unit

A-13-3 Downloading the Data to the CPU Unit


is BackupData.

4 Click the Online Button in the toolbar.

5 Click the Synchronize Button in the toolbar.

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.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-221


Appendices

Downloading the Present Values of Variables and Memory


Use the Sysmac Studio’s variable and memory backup function to download the present values of vari-
ables and memory. Refer to 9-8 Sysmac Studio Variable and Memory Backup Functions for details on
the Sysmac Studio variable and memory backup functions.
Use the following procedure.

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.

A-222 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-13 Replacing CPU Units with Unit Version 1.02 or Earlier


Downloading Tag Data Link Tables
The Network Configurator is used with the Sysmac Studio version 1.09 or lower.
Use the following procedure to download the tag data link tables.

1 Start the Network Configurator on the computer that is connected to the NJ-series Con-
troller.

2 Select Network − Connect from the toolbar.

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-13-3 Downloading the Data to the CPU Unit


5 Select Network − Download from the toolbar.
The following message is displayed: “In order to enable new configuration, downloading param-
eters to all devices will start, OK?”

6 Click the Yes Button.


A list of the currently active devices is displayed.

7 Click the Download after changed to Program mode Button.


The tag data link tables are downloaded to the Controller.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-223


Appendices

Precautions for Correct Use


If NJ-1 Rev2 is not displayed as a new device selection in step 4, above, use the
newest version of the Network Configurator.

A-224 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-14 Version Information for NX-series


Controllers

A-14 Version Information for NX-series Controllers


This section describes the relationship between the unit versions of NX-series CPU Units and the Sys-
mac Studio versions, and the functions that are supported for each unit version.

A-14-1 Relationship Between Unit Versions of CPU Units and Sysmac


Studio Versions
This section also describes how the unit versions of NX-series CPU Units correspond to Sysmac Studio
versions. Normally use the corresponding versions.

Unit Versions and Corresponding Sysmac Studio Versions


This following table gives the relationship between the unit versions of NX-series CPU Units and the A
corresponding Sysmac Studio versions.

A-14-1 Relationship Between Unit Versions of CPU Units and Sysmac Studio Versions
Unit version of CPU Unit Corresponding version of Sysmac Studio
Ver.1.14 Ver.1.18
Ver.1.13*1 Ver.1.17*2
Ver.1.12 Ver.1.16
Ver.1.11 Ver.1.15
Ver.1.10 Ver.1.13
*1 There is no NX1P2- CPU Unit with unit version 1.12 or earlier.
*2 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.

Specifications When Not Using the Sysmac Studio Version That


Corresponds to the Unit Version of the CPU Unit
The specifications when you do not use the Sysmac Studio version that corresponds to the unit version
of the NX-series CPU Unit are given in this section.

 Using Sysmac Studio Version 1.12 or Lower


You cannot use the NX-series CPU Unit with Sysmac Studio version 1.12 or lower.

 Using a Lower Version of Sysmac Studio


If you use a lower version of the Sysmac Studio, you can use only the functions of the unit version of
the CPU Unit that corresponds to the Sysmac Studio version.
Example: Unit version of CPU Unit: 1.11
Sysmac Studio version: 1.13
Unit version 1.10 of the CPU Unit corresponds to Sysmac Studio version 1.13. There-
fore, you can use only the functions that are supported by unit version 1.10 of the CPU
Unit. You cannot use functionality that was added for unit version 1.11 or later of the
CPU Unit.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-225


Appendices

 Using a CPU Unit with an Earlier Unit Version


If you use an NX-series CPU Unit with an earlier version, select the unit version of the connected
CPU Unit or an earlier unit version in the Select Device Area of the Project Properties Dialog Box on
the Sysmac Studio. You can use only the functions that are supported by the unit version of the con-
nected CPU Unit.
Example: Unit version of CPU Unit: 1.10
Sysmac Studio version: 1.15
Unit version 1.11 of the CPU Unit corresponds to Sysmac Studio version 1.15. However,
the connected CPU Unit is unit version 1.10, so select version 1.10 as the version in the
Select Device Area of the Project Properties Dialog Box.
If you select version 1.10 as the version in the Select Device Area of the Project Proper-
ties Dialog Box, you can use only the functions that are supported by unit version 1.10
of the CPU Unit. You cannot use functionality that was added for unit version 1.11 or
later of the CPU Unit.

Additional Information

Unit Version Settings for Project Devices


• With Sysmac Studio version 1.02 or higher, you can select the unit version in the Select
Device Area of the relevant dialog boxes.
• You can select any unit version that is the same as or earlier than the unit version of the CPU
Unit. For example, if the unit version of the CPU Unit is 1.11, select either 1.10 or 1.11.
• The Sysmac Studio will treat the CPU Unit as a CPU Unit with the unit version that is selected
for the project device. For example, if you set unit version 1.10 for project device, you can use
only the functionality for unit version 1.10 on the Sysmac Studio.
• You can transfer a project to the Sysmac Studio if the unit version that is set for the project
device is the same as or earlier than the unit version of the destination CPU Unit.
• Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504-E1-03 or later) for
details on the Select Device Area of the relevant dialog boxes.

A-226 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-14-2 Functions That Were Added or Changed for Each Unit Version

A-14 Version Information for NX-series Controllers


This section describes the functions that were added or changed for each unit version of NX-series
CPU Unit.

 Additions and Changes to Functional Specifications


The following table gives the unit version of the CPU Units and the Sysmac Studio version for each
addition or change to the functional specifications.

Addi- Sysmac
Unit ver-
Function tion/cha Studio Reference
sion
nge version
Communi- Communications instructions Change Ver.1.11 Ver.1.15 NJ/NX-series
cations Instructions
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 A
Card
Note Refer to the manuals for the function modules for additions and changes to function module functions for

A-14-2 Functions That Were Added or Changed for Each Unit Version
each unit version of the CPU Units.

 Additions and Changes to Basic Instructions and Motion Control Instructions


The basic instructions and motion control instructions that you can use have increased or changed
for the new unit version of the CPU Unit.
For details, refer to the NJ/NX-series Instructions Reference Manual (Cat. No. W502) and NJ/NX-
series Motion Control Instructions Reference Manual (Cat. No. W508).

 Additions and Changes to Controller Events


The events that can occur have increased or changed for the new unit version of the CPU Unit.
There are also changes in the recovery methods to use when some errors occur.
For details, refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503).

 Additions and Changes to System-defined Variables


The system-defined variables that you can use have increased or changed for the new unit version
of the CPU Unit.
Refer to A-5 System-defined Variables for details.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-227


Appendices

A-15 Version Information for NJ-series


Controllers
This section describes the relationship between the unit versions of NJ-series CPU Units and the Sys-
mac Studio versions, and the functions that are supported for each unit version.

A-15-1 Relationship between Unit Versions of CPU Units and Sysmac


Studio Versions
This section also describes how the unit versions of NJ-series CPU Units correspond to Sysmac Studio
versions. Normally use the corresponding versions.

Unit Versions and Corresponding Sysmac Studio Versions


The following table gives the relationship between unit versions of NJ-series CPU Units and the corre-
sponding Sysmac Studio versions.

Unit version of CPU Unit Corresponding version of Sysmac Studio


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.

A-228 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

Specifications When Not Using the Sysmac Studio Version That


Corresponds to the Unit Version of the CPU Unit

A-15 Version Information for NJ-series Controllers


The specifications when you do not use the Sysmac Studio version that corresponds to the unit version
of the NJ-series CPU Unit are given in this section.

 Using a Lower Sysmac Studio Version


If you use a lower version of the Sysmac Studio, you can use only the functions of the unit version of
the CPU Unit that corresponds to the Sysmac Studio version.
Example: Unit version of CPU Unit: 1.04
Sysmac Studio version: 1.04
Unit version 1.03 of the CPU Unit corresponds to Sysmac Studio version 1.04. There-
fore, you can use only the functions that are supported by unit version 1.03 of the CPU
Unit. You cannot use functionality that was added for unit version 1.04 or later of the
CPU Unit.

A
 Using a CPU Unit with an Earlier Unit Version
If you use an NJ-series CPU Unit with an earlier version, select the unit version of the connected

A-15-1 Relationship between Unit Versions of CPU Units and Sysmac Studio Versions
CPU Unit or an earlier unit version in the Select Device Area of the Project Properties Dialog Box on
the Sysmac Studio. You can use only the functions that are supported by the unit version of the con-
nected CPU Unit.
Example: Unit version of CPU Unit: 1.03
Sysmac Studio version: 1.05
Unit version 1.04 of the CPU Unit corresponds to Sysmac Studio version 1.05. How-
ever, the connected CPU Unit is unit version 1.03, so select version 1.03 or earlier as
the version in the Select Device Area of the Project Properties Dialog Box. If you select
version 1.03 as the version in the Select Device Area of the Project Properties Dialog
Box, you can use only the functions that are supported by unit version 1.03 of the CPU
Unit. You cannot use functionality that was added for unit version 1.04 or later of the
CPU Unit.

Precautions for Correct Use


An error will occur if you perform the following type of operation.
• Create a project on Sysmac Studio version 1.02 or higher with unit version 1.01 or later
selected as the version in the Select Device Area of the Project Properties Dialog Box.
• Upload the project to Sysmac Studio version 1.01.

NJ/NX-series CPU Unit Software User’s Manual (W501) A-229


Appendices

Additional Information

Unit Version Settings for Project Devices


• With Sysmac Studio version 1.02 or higher, you can select the unit version in the Select
Device Area of the relevant dialog boxes.
• You can select any unit version that is the same as or earlier than the unit version of the CPU
Unit. For example, if the unit version of the CPU Unit is 1.01, select either 1.00 or 1.01.
• The Sysmac Studio will treat the CPU Unit as a CPU Unit with the unit version that is selected
for the project device. For example, if you set unit version 1.00 for project device, you can use
only the functionality for unit version 1.00 on the Sysmac Studio.
• You can transfer a project to the Sysmac Studio if the unit version that is set for the project
device is the same as or earlier than the unit version of the destination CPU Unit.
• Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504-E1-03 or later) for
details on the Select Device Area of the relevant dialog boxes.

A-15-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

A-230 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

A-15-3 Functions That Were Added or Changed for Each Unit Version

A-15 Version Information for NJ-series Controllers


This section gives the functions that were added or changed for each unit version of NJ-series CPU
Unit.

 Additions and Changes to Functional Specifications


The following table gives the unit version of the CPU Units and the Sysmac Studio version for each
addition or change to the functional specifications.

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
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 A
trol absolute posi- User’s Manual (Cat.
tioning No. W507)

A-15-3 Functions That Were Added or Changed for Each Unit Version
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)

NJ/NX-series CPU Unit Software User’s Manual (W501) A-231


Appendices

Sysmac
Addition/ Unit
Function Studio Reference
change version
version
Communica- EtherNet/ TCP/IP FTP client Addition 1.08 1.09 NJ/NX-series CPU
tions IP port applications Unit Built-in Ether-
Net/IP Port User’s
Manual (Cat. No.
W506)
EtherCAT port Packet monitoring*1 Addition 1.10 1.12 NJ/NX-series CPU
Unit Built-in EtherCAT
(NJ301-)
Port User’s Manual
(Cat. No. W505)
Communications instructions Change 1.08 1.09 NJ/NX-series Instruc-
1.11 1.15 tions Reference Man-
ual (Cat. No. W502)
Debugging Differential monitoring Addition 1.03 1.04 8-6-5 Differential
function Monitoring
Reliability Self diagnosis Controller Changing lev- Addition 1.03 1.04 8-8 Changing Event
functions errors els Levels
Security Asset protec- Protection Data protec- Addition 1.01 1.02 8-5-4 Data Protection
tion and pre- tion
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.

 Addition of Mountable CJ-series Units


The CJ-series Units that can be mounted have increased for the new unit version of the CPU Unit.
For details, refer to the NJ-series CPU Unit Hardware User’s Manual (Cat. No. W500).

A-232 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

 Additions and Changes to Basic Instructions and Motion Control Instructions


The basic instructions and motion control instructions that you can use have increased or changed

A-15 Version Information for NJ-series Controllers


for the new unit version of the CPU Unit. For details, refer to the NJ/NX-series Instructions Reference
Manual (Cat. No. W502) and NJ/NX-series Motion Control Instructions Reference Manual (Cat. No.
W508).

 Additions and Changes to Controller Events


The events that can occur have increased or changed for the new unit version of the CPU Unit.
There are also changes in the recovery methods to use when some errors occur.
For details, refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503).

 Additions and Changes to System-defined Variables


The system-defined variables that you can use have increased or changed for the new unit version
of the CPU Unit. Refer to A-5 System-defined Variables for details.

A-15-3 Functions That Were Added or Changed for Each Unit Version

NJ/NX-series CPU Unit Software User’s Manual (W501) A-233


Appendices

A-15-4 Performance Improvements for Unit Version Upgrades


This section introduces the functions for which performance was improved for each unit version of NJ-
series CPU Unit and for each Sysmac Studio version.

Performance Sysmac Stu-


Function Unit version
value dio version
Program- Program Quantities Number of 9,000 --- 1.06 or higher
ming capacity POU instances 6,000 --- 1.05 or lower
(NJ501-
)
Number of 3,000 1.04 or later 1.05 or higher
POU instances 1,500 1.04 or lower
(NJ301- 2,400 1.03 or earlier 1.05 or higher
)
1,500 1.04 or lower
Memory Variables Number of vari- 5,000 1.04 or later 1.05 or higher
capacity for with a ables*1 (NJ301- 2,500 1.04 or lower
variables Retain ) 2,500 1.03 or earlier ---
attribute
Motion Number of Maximum number of con- 15 axes 1.06 or later 1.07 or higher
Control controlled axes trolled axes*2*3*4 8 axes (NJ301- Other than the above combi-
(NJ301-) 1200) nation
4 axes (NJ301-
1100)
Maximum number of axes 15 axes 1.06 or later 1.07 or higher
for single-axis control*4*5 8 axes (NJ301- Other than the above combi-
(NJ301-) 1200) nation
4 axes (NJ301-
1100)
Built-in CIP service: Packet interval Can be set for 1.03 or higher ---
Ether- Tag data links each connection.
Net/IP (cyclic commu- 1 to 10,000 ms in
port nications) 1-ms increments
Can be set for 1.02 or lower
each connection.
10 to 10,000 ms in
1-ms increments
Permissible communica- 3,000 pps*6 1.03 or higher ---
tions band (including heart-
beat)
1,000 pps (includ- 1.02 or lower
ing heartbeat)
Number of TCP sockets 30 1.03 or higher ---
16 1.02 or lower
Built-in Communications cycle*7 500, 1,000, 2,000, 1.03 or higher ---
EtherCAT (NJ301-) or 4,000 µs
port 1,000, 2,000, or 1.02 or lower
4,000 µs
*1 The performance improvement applies only to an NJ301- CPU Unit. The maximum number of vari-
ables with a Retain attributes for the NJ501- is 10,000.
*2 This is the total for all axis types.
*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.

A-234 NJ/NX-series CPU Unit Software User’s Manual (W501)


Appendices

*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

A-15 Version Information for NJ-series Controllers


*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.

A-15-4 Performance Improvements for Unit Version Upgrades

NJ/NX-series CPU Unit Software User’s Manual (W501) A-235


Appendices

A-236 NJ/NX-series CPU Unit Software User’s Manual (W501)


Index

NJ/NX-series CPU Unit Software User’s Manual (W501) Index-1


Index

Index
A _Card1RestoreCmd (SD Memory Card Restore Command)
................................................................................A-122
accessing I/O with variables ........................................ 2-14 _Card1RestoreSta (SD Memory Card Restore Status)
Accessing Task ............................................................ 4-10 ..................................................................................A-61
accessing tasks ........................................................... 5-94 _Card1VefySta .................................... A-59, A-119, A-120
_TaskName_Active ................................... 5-8, A-55, A-113 Carry Flag .................................................6-8, A-63, A-126
_AlarmFlag ...................................................... A-56, A-115 changing event levels .................................................. 8-83
algorithms ........................................................... 6-10, 6-17 changing present values .............................................. 8-52
All Tag Data Link Communications Status ..................A-99 CIP Communications Error .............................. A-86, A-158
Always FALSE Flag ......................................... A-63, A-126 CIP Communications1 Error ........................................A-86
Always TRUE Flag .......................................... A-63, A-126 CIP Communications1 Identity Error ...........................A-91
array specification ............................................... 6-33, 6-50 CIP Communications1 Multiple Switches ON Error ....A-95
assumed causes ............................................ 12-20, 12-23 CIP Communications1 Tag Data Link Communications
AT Specification ........................................................... 6-56 Error ..........................................................................A-93
Axes Group Error Status ................................. A-75, A-143 CIP Communications1 Tag Data Link Connection Failed
Axes Group Variables ...............................3-18, A-75, A-76 ..................................................................................A-93
Axis Error Status ............................................. A-75, A-143 CIP Communications1 Tag Data Link Setting Error .....A-92
Axis Variables ........................................... 3-18, A-76, A-77 CIP Communications1 Tag Name Resolution Error ....A-94
CIP Communications2 Error ........................................A-87
B CIP Communications2 Identity Error ...........................A-91
CIP Communications2 Multiple Switches ON Error ....A-95
CIP Communications2 Tag Data Link Communications
backing up data ............................................................. 9-3
Error ..........................................................................A-93
Backup Function Busy Flag ............................. A-62, A-125
CIP Communications2 Tag Data Link Connection Failed
_BackupBusy .................................................. A-62, A-125
..................................................................................A-93
basic data types .......................................................... 6-30
CIP Communications2 Tag Data Link Setting Error .....A-92
Basic Ethernet Setting Error ........................................A-88
CIP Communications2 Tag Name Resolution Error ....A-95
Basic I/O Unit Information ............................... A-71, A-137
_CJB_CBU00InitSta to _CJB_CBU15InitSta
Basic I/O Units ....................................................4-15, 8-22
.............................................................8-24, A-71, A-137
Basic Input Unit Input Response Times . 8-23, A-70, A-136
_CJB_CBU00Restart to _CJB_CBU15Restart
basic settings ................................................................. 4-4
.............................................................8-24, A-71, A-138
basic system configurations ............................1-5, 1-7, 1-9
_CJB_ErrSta ................................................... A-70, A-135
bit strings ..................................................................... 6-31
_CJB_InRespTm ....................................8-23, A-70, A-136
Boolean ....................................................................... 6-31
_CJB_IOUnitInfo .............................................. A-71, A-137
BOOTP Server Error ...................................................A-90
_CJB_MaxRackNo .......................................... A-70, A-135
Built-in EtherCAT Error .................................... A-78, A-147
_CJB_MaxSlotNo ............................................ A-70, A-135
Built-in EtherNet/IP Error ................................. A-83, A-156
_CJB_MstrErrSta ............................................ A-70, A-136
bus bars ....................................................................... 6-87
_CJB_SCU00P1ChgSta to _CJB_SCU00P2ChgSta
..................................................................................A-71
C
_CJB_SCU00P1ChgSta, _CJB_SCU00P2ChgSta to
_CJB_SCU15P1ChgSta, _CJB_SCU15P2ChgSta
_Card1Access ........................................8-30, A-57, A-116
................................................................................A-139
_Card1BkupCmd ................................. A-58, A-117, A-118
_CJB_SCU15P1ChgSta to _CJB_SCU15P2ChgSta
_Card1BkupSta ............................................... A-59, A-119
..................................................................................A-71
_Card1Deteriorated ................................ 8-30, A-57, A-117
_CJB_SIO00InitSta to _CJB_SIO95InitSta
_Card1Err ............................................... 8-30, A-57, A-116
.............................................................8-24, A-71, A-137
_Card1PowerFail .................................... 8-30, A-57, A-117
_CJB_SIO00Restart to _CJB_SIO95Restart
_Card1PrgRestoreCmd (SD Memory Card Restore
.............................................................8-24, A-71, A-138
Command) ................................................................A-60
_CJB_UnitErrSta ............................................. A-70, A-136
_Card1PrgTransferCmd (SD Memory Card Program
CJ-series Unit configuration .......................................... 1-9
Transfer Command) ...................................... A-59, A-120
Clearing All Memory ...................................................... 8-3
_Card1PrgTransferSta (SD Memory Card Program Transfer
clock .............................................................................. 8-3
Status) .............................................. A-60, A-122, A-123
clock data ...................................................................... 8-4
_Card1Protect ........................................8-30, A-57, A-116
Common Error Status ...................................... A-75, A-143
_Card1Ready ......................................... 8-30, A-57, A-116
Common Variable ............................................ A-75, A-144

Index-2 NJ/NX-series CPU Unit Software User’s Manual (W501)


Index

communications .......................................................... 10-5 date and time .............................................................. 6-32


Communications Controller Error ........... A-78, A-88, A-148 dates ........................................................................... 6-31
Communications Error Slave Table ................. A-79, A-151 debug programs ............................................................ 7-6
Communications Port Error ........ A-78, A-84, A-147, A-156 derivative data types ................................................... 6-33
Communications Port1 Error ....................................... A-85 device variables ................................................. 2-12, 3-10
Communications Port2 Error ....................................... A-85 _DeviceOutHoldCfg ........................................ A-64, A-129
Condition Flags ......................................................... 6-132 _DeviceOutHoldStatus .................................... A-64, A-129
connecting lines .......................................................... 6-88 Diagnosis/Statistics Log Busy ......................... A-82, A-155
constants ..................................................................... 6-82 Diagnosis/Statistics Log Cycle ........................ A-82, A-155
Controller Error Status .................................... A-56, A-115 Diagnosis/Statistics Log Enable ...................... A-82, A-155
Controller errors .......................................................... 8-74 Diagnosis/Statistics Log Error ......................... A-82, A-155
Controller events ......................................................... 8-69 differential monitoring .................................................. 8-62
Controller information .................................................. 8-74 Disabled Slave Table ....................................... A-81, A-153
Controller Setup ............................................................ 4-4 Disconnected Slave Table ............................... A-81, A-152
CPU Bus Unit Initializing Flags .............. 8-24, A-71, A-137 DNS Server Connection Error ..................................... A-96
CPU Bus Unit Restart Bits ..................... 8-24, A-71, A-138 DNS Setting Error ....................................................... A-90
CPU Unit durations ..................................................................... 6-31
name ..................................................................... 8-45
resetting ................................................................ 12-5 E
watchdog timer error ............................................. 12-5
CPU Unit High Temperature Flag ............................... A-64 _EC_CommErrTbl ........................................... A-79, A-151
CPU unit names .......................................................... 8-45 _EC_CycleExceeded .................................................. A-79
_CurrentTime .................................................. A-55, A-113 _EC_DisableSlavTbl ....................................... A-81, A-153
CX-Designer symbol table registration ..................... A-202 _EC_DisconnSlavTbl ...................................... A-81, A-152
_EC_EntrySlavTbl ........................................... A-81, A-151 I
D _EC_ErrSta ..................................................... A-78, A-147
_EC_InData1Invalid .................................................... A-82
data formats _EC_InData2Invalid .................................................... A-82
bit strings ............................................................... 6-35 _EC_InDataInvalid .......................................... A-81, A-154
real numbers ......................................................... 6-35 _EC_IndataInvalidErr ...................................... A-79, A-150
text strings ............................................................. 6-35 _EC_LanHwErr ............................................... A-78, A-148
data protection ............................................................ 8-40 _EC_LinkOffErr ............................................... A-78, A-148
data tracing ................................................................. 8-56 _EC_LinkStatus .............................................. A-81, A-153
continuous tracing ................................................. 8-56 _EC_MacAdrErr .............................................. A-78, A-148
operation ............................................................... 8-59 _EC_MBXSlavTbl ........................................... A-81, A-152
specifications ......................................................... 8-57 _EC_MsgErr ................................................... A-79, A-150
triggered tracing .................................................... 8-56 _EC_MstrErr ................................................... A-78, A-147
data types ................................................................... 6-30 _EC_NetCfgCmpErr ....................................... A-78, A-149
BOOL .................................................................... 6-31 _EC_NetCfgErr ............................................... A-78, A-148
BYTE ..................................................................... 6-31 _EC_NetTopologyErr ...................................... A-78, A-149
converting .............................................................. 6-39 _EC_PDActive ................................................ A-81, A-153
DATE ..................................................................... 6-31 _EC_PDCommErr ........................................... A-78, A-149
DINT ...................................................................... 6-31 _EC_PDSendErr ............................................. A-79, A-149
DWORD ................................................................. 6-31 _EC_PDSlavTbl .............................................. A-81, A-152
INT ........................................................................ 6-31 _EC_PDTimeoutErr ........................................ A-78, A-149
LINT ...................................................................... 6-31 _EC_PktMonStop ........................................... A-81, A-153
LREAL ................................................................... 6-31 _EC_PktSaving ............................................... A-81, A-153
LWORD ................................................................. 6-31 _EC_PortErr .................................................... A-78, A-147
REAL ..................................................................... 6-31 _EC_RegSlavTbl ............................................. A-81, A-151
SINT ...................................................................... 6-31 _EC_SlavAdrDupErr ....................................... A-79, A-149
specifications ......................................................... 6-33 _EC_SlavAppErr ............................................. A-79, A-150
STRING ................................................................. 6-32 _EC_SlavEmergErr ......................................... A-79, A-150
TIME ...................................................................... 6-31 _EC_SlavErr ................................................... A-78, A-147
TIME_OF_DAY ...................................................... 6-32 _EC_SlavErrTbl .............................................. A-78, A-148
UDINT ................................................................... 6-31 _EC_SlavInitErr .............................................. A-79, A-150
UINT ...................................................................... 6-31 _EC_StatisticsLogBusy (Diagnosis/Statistics Log Busy)
ULINT .................................................................... 6-31 ..................................................................... A-82, A-155
USINT ................................................................... 6-31 _EC_StatisticsLogCycleSec (Diagnosis/Statistics Log
WORD ................................................................... 6-31 Cycle) ........................................................... A-82, A-155

NJ/NX-series CPU Unit Software User’s Manual (W501) Index-3


Index

_EC_StatisticsLogEnable (Diagnosis/Statistics Log Enable) ENO ....................................................................6-12, 6-20


...................................................................... A-82, A-155 enumerations ............................................................... 6-48
_EC_StatisticsLogErr (Diagnosis/Statistics Log Error) Error .................................................................. A-66, A-67
...................................................................... A-82, A-155 errors
_EIP1_BootpErr ..........................................................A-90 checking for non-fatal errors ................................ 12-12
_EIP1_CipErr ..............................................................A-86 indicators ............................................................. 12-13
_EIP1_EtnCfgErr .........................................................A-88 instructions that read error status ........................ 12-14
_EIP1_IdentityErr ........................................................A-91 system-defined variables ..................................... 12-15
_EIP1_IPAdrCfgErr ......................................................A-89 table ..................................................................... 12-19
_EIP1_IPAdrDupErr .....................................................A-90 Troubleshooter of an HMI .................................... 12-14
_EIP1_LanHwErr .........................................................A-88 troubleshooting with Sysmac Studio .................... 12-13
_EIP1_MacAdrErr .......................................................A-87 _ErrSta ............................................................ A-56, A-115
_EIP1_MultiSwONErr ..................................................A-95 EtherCAT Communications Cycle Exceeded ..............A-79
_EIP1_PortErr .............................................................A-85 EtherCAT Master Function Module
_EIP1_TagAdrErr ........................................................A-94 initial settings ......................................................... 4-24
_EIP1_TDLinkCfgErr ...................................................A-92 EtherCAT Message Error ................................ A-79, A-150
_EIP1_TDLinkErr ........................................................A-93 EtherCAT network configuration ......................1-5, 1-7, 1-9
_EIP1_TDLinkOpnErr ..................................................A-93 EtherNet/IP Function Module
_EIP2_BootpErr ..........................................................A-91 initial settings ......................................................... 4-25
_EIP2_CipErr ..............................................................A-87 event codes ...........................................8-70, 12-20, 12-23
_EIP2_EtnCfgErr .........................................................A-89 event levels .........................................................8-71, 12-7
_EIP2_IdentityErr ........................................................A-91 event log categories .................................................... 8-70
_EIP2_IPAdrCfgErr ......................................................A-89 Event Log Settings ........................................................ 4-5
_EIP2_IPAdrDupErr .....................................................A-90 event logs .................................................................... 8-67
_EIP2_LanHwErr .........................................................A-88 event names ...................................................12-20, 12-23
_EIP2_MacAdrErr .......................................................A-88 Event Setting Table ...................................................... 8-78
_EIP2_MultiSwONErr ..................................................A-95 event sources .............................................................. 8-69
_EIP2_PortErr .............................................................A-85 event tasks ................................................5-21, 5-39, 5-58
_EIP2_TagAdrErr ........................................................A-95 ActEventTask instruction ......................5-22, 5-39, 5-59
_EIP2_TDLinkCfgErr ...................................................A-92 parameters ............................................................. 5-93
_EIP2_TDLinkErr ........................................................A-93 when condition expressions for variables are met
_EIP2_TDLinkOpnErr ..................................................A-93 ..........................................................5-24, 5-41, 5-61
_EIP_BootpErr ............................................................A-90 _TaskName_ExceedCount .......................5-9, A-56, A-115
_EIP_CipErr .................................................... A-86, A-158 _TaskName_Exceeded ............................5-9, A-56, A-114
_EIP_DNSCfgErr .........................................................A-90 Exclusive Control of File Access in
_EIP_DNSSrvErr .........................................................A-96 SD Memory Cards ................................................. 8-33
_EIP_ErrSta .................................................... A-83, A-156 _TaskName_ExecCount ...........................5-9, A-55, A-114
_EIP_EtnCfgErr ...........................................................A-88 Execute Backup Flag .................................................A-117
_EIP_EtnOnlineSta .....................................................A-98 external variables ...............................................6-12, 6-20
_EIP_IdentityErr ..........................................................A-91
_EIP_IPAdrCfgErr ........................................................A-89 F
_EIP_IPAdrDupErr .......................................................A-90
_EIP_IPRTblErr ...........................................................A-91 fatal errors ................................................................... 12-5
_EIP_LanHwErr ...........................................................A-88 FINS/TCP Connection Status .......................... A-63, A-128
_EIP_MacAdrErr .........................................................A-87 _FINSTCPConnSta ......................................... A-63, A-128
_EIP_MultiSwONErr ....................................................A-95 First Program Period Flag .........................................A-127
_EIP_NTPSrvErr .........................................................A-95 First RUN Period Flag ..............................6-8, A-63, A-127
_EIP_PortErr ................................................... A-84, A-156 forced refreshing .......................................................... 8-47
_EIP_TagAdrErr ..........................................................A-94 FramingErr ...................................................................A-68
_EIP_TcpAppCfgErr ....................................................A-95 FTP Client Communication Instructions ...................... 8-28
_EIP_TcpAppErr .........................................................A-87 FTP server ................................................................... 8-29
_EIP_TDLinkAllRunSta ...............................................A-99 fully qualified names .................................................. 6-140
_EIP_TDLinkCfgErr .....................................................A-92 FUN instructions ........................................................ 6-132
_EIP_TDLinkErr ..........................................................A-93 function block instructions ......................................... 6-131
_EIP_TDLinkOpnErr ....................................................A-92 function blocks
_EIP_TDLinkRunSta ...................................................A-99 accessing variables from outside the function block
Emergency Message Detected ....................... A-79, A-150 ............................................................................ 6-16
EN ...................................................................... 6-12, 6-20 array specifications for instances ........................... 6-14
enabling/disabling EtherCAT slaves and axes ...........A-205 calling from ST ....................................................... 6-10

Index-4 NJ/NX-series CPU Unit Software User’s Manual (W501)


Index

creating ................................................................... 6-8 instruction errors ....................................................... 6-137


definitions and instances ....................................... 6-13 instruction options ..................................................... 6-131
details ...................................................................... 6-8 instructions
execution conditions .............................................. 6-15 GetMyTaskStatus .................................................... 5-8
instances ............................................................... 6-13 Lock ......................................................................... 5-8
instruction names .................................................... 6-9 ResetUnit ............................................................... 8-23
names ..................................................................... 6-9 Unlock ..................................................................... 5-8
parameters ............................................................ 6-10 Insufficient System Service Time Error ..................... 5-106
structure .................................................................. 6-9 integers ....................................................................... 6-31
using or omitting EN and ENO .............................. 6-22 internal variables ................................................ 6-11, 6-20
variable designations ............................................. 6-11 IP Address Duplication Error ....................................... A-90
functions IP Address Setting Error ............................................. A-89
details .................................................................... 6-17 IP Route Table Error .................................................... A-91
expressing in ST .................................................... 6-18 isDetect ....................................................................... A-66
instruction names .................................................. 6-17
names ................................................................... 6-17 L
operation for parameter errors .............................. 6-23
operation when parameters are omitted ................ 6-23 ladder diagram language ............................................ 6-87
parameters ............................................................ 6-18 ladder diagrams
structure ................................................................ 6-17 completion ............................................................. 6-88
variable designations ............................................. 6-19 connecting functions and function blocks .............. 6-89
controlling execution .............................................. 6-88
G order of execution .................................................. 6-88
Largest Rack Number ..................................... A-70, A-135
global variables ........................................................... 6-28 Largest Slot Number ....................................... A-70, A-135 I
Largest Unit Number ................................................. A-140
H Last Task Execution Time ........................ 5-8, A-55, A-113
_TaskName_LastExecTime ..................... 5-8, A-55, A-113
Hardware revision ..................................................... A-128 Link OFF Error ................................................ A-78, A-148
hardware revision ........................................................ A-64 Link Status ...................................................... A-81, A-153
_HardwareRevision (Hardware Revision) ....... A-64, A-128 literals .......................................................................... 6-82
local variable tables ............................................ 6-10, 6-18
I local Variables ............................................................. 6-28
Low Battery Flag ......................................................... A-64
I/O Bus Error Status ........................................ A-70, A-135 Low FAN Revolution Flag ............................................ A-64
I/O Bus Master Error Status ............................ A-70, A-136
I/O Bus Unit Error Status ................................ A-70, A-136 M
I/O Control Task Settings .............................................. 4-9
I/O ports MAC Address Error ................................A-78, A-87, A-148
names ..................................................................... 3-9 master control ........................................................... 6-149
I/O refresh operation ................................................... 5-82 Master Error .................................................... A-78, A-147
I/O Refreshing Timeout Error .................................... 5-106 _TaskName_MaxExecTime ..................... 5-8, A-55, A-114
Identity Error ............................................................... A-91 Maximum Task Execution Time ............... 5-8, A-55, A-114
implicit casts .............................................................. 6-123 MC Test Run ................................................................. 7-9
Initial Status for Programs at the Start of Operation ... 5-90 _MC1_AX .................................................................... A-77
Initial Status of Program ................................................ 4-9 _MC1_GRP ................................................................. A-76
inline ST ...................................................................... 6-92 _MC2_AX .................................................................... A-77
in-out variables ................................................... 6-11, 6-19 _MC2_GRP ................................................................. A-76
Input Data Invalid ............................................ A-81, A-154 _MC_AX_ErrSta ............................................. A-75, A-143
Input Data1 Invalid ...................................................... A-82 _MC_COM ...................................................... A-75, A-144
Input Data2 Invalid ...................................................... A-82 _MC_ComErrSta ............................................. A-75, A-143
Input Process Data Invalid Error ............................... A-150 _MC_ErrSta .................................................... A-75, A-143
input variables .................................................... 6-11, 6-19 _MC_GRP_ErrSta .......................................... A-75, A-143
inputs Message Communications Enabled Slave Table
program inputs ...................................................... 6-88 ...................................................................... A-81, A-152
instance name ............................................................... 6-9 _TaskName_MinExecTime ...................... 5-8, A-55, A-114
instance names ........................................................... 6-17 Minimum Task Execution Time ................ 5-8, A-55, A-114
Instruction Error Flag .................... 6-8, 6-137, A-63, A-127 Motion Control Function Module
Instruction Errors ....................................................... 6-133 initial settings ......................................................... 4-22

NJ/NX-series CPU Unit Software User’s Manual (W501) Index-5


Index

Motion Control Function Module Error Status . A-75, A-143 P


Motion Control Period Exceeded ............................... 5-105
Multiple Switches ON Error .........................................A-95 Packet Monitoring Stopped ............................. A-81, A-153
parameters for priority-16, priority-17, and priority-18
N periodic tasks ............................................................ 5-92
ParityErr .......................................................................A-68
names P_CY ...........................................................................A-63
restrictions ............................................................. 6-80 Period/Execution Condition ........................................... 4-8
namespace declarations ........................................... 6-141 periodic tasks .....................................................5-19, 5-56
namespaces .............................................................. 6-139 periodic tasks that control I/O .......................5-20, 5-57
Network Communications Instruction Enabled Flag periodic tasks that do not control I/O ............5-19, 5-56
...................................................................... A-63, A-128 P_First_Run .............................................6-8, A-63, A-127
Network Configuration Error ............................ A-78, A-149 P_First_RunMode ........................................... A-63, A-127
Network Configuration Information Error ......... A-78, A-148 PLC Function Module
Network Configuration Verification Error ......... A-78, A-149 initial settings ........................................................... 4-4
Network Configurations ................................................. 1-8 PLC Function Module Error Status .................. A-65, A-131
network configurations ................................................ 1-10 _PLC_ErrSta ................................................... A-65, A-131
Network Connected Slave Table ..................... A-81, A-151 _PLC_OptBoardSta ....................................... A-131, A-132
non-fatal errors ............................................................ 12-7 _PLC_OptSerialErrSta .................................... A-66, A-132
NTP Server Connection Error .....................................A-95 _PLC_TraceSta[0..3] ..................................... A-130, A-131
Number of Used Ports ..................................... A-63, A-127 _PLC_TraceSta[0..3].IsComplete ...................... 8-61, A-65
NX Bus Function Module Error Status ......................A-141 _PLC_TraceSta[0..3].IsStart .............................. 8-61, A-65
NX Bus Function Module Master Error Status ..........A-141 _PLC_TraceSta[0..3].IsTrigger .......................... 8-61, A-65
NX Bus Function Module Unit Error Status ...............A-142 _PLC_TraceSta[0..3].ParamErr ......................... 8-61, A-65
NX Unit Configuration .................................................... 1-7 P_Off ............................................................... A-63, A-126
NX Unit Error Status ..................................................A-142 P_On ............................................................... A-63, A-126
NX Unit I/O Data Active Status ..................................A-140 Port1 Basic Ethernet Setting Error ..............................A-88
NX Unit Message Enabled Status .............................A-140 Port1 BOOTP Server Error ..........................................A-90
NX Unit Registration Status .......................................A-141 Port1 Communications Controller Error .......................A-88
_NXB_ErrSta ...............................................................A-73 Port1 IP Address Duplication Error .............................A-90
_NXB_MaxUnitNo .......................................................A-72 Port1 IP Address Setting Error ....................................A-89
_NXB_MstrErrSta ........................................................A-73 Port1 MAC Address Error ............................................A-87
_NXB_UnitErrFlagTbl ..................................................A-74 Port2 Basic Ethernet Setting Error ..............................A-89
_NXB_UnitErrStaTbl ...................................................A-73 Port2 BOOTP Server Error ..........................................A-91
_NXB_UnitIOActiveTbl ................................................A-72 Port2 Communications Controller Error .......................A-88
_NXB_UnitMsgActiveTbl .............................................A-72 Port2 IP Address Duplication Error .............................A-90
_NXB_UnitRegTbl .......................................................A-72 Port2 IP Address Setting Erro .....................................A-89
Port2 MAC Address Error ............................................A-88
O _Port_isAvailable ............................................. A-63, A-128
_Port_numUsingPort ....................................... A-63, A-127
offline debugging ........................................................... 7-3 POUs
Online ..........................................................................A-98 function blocks ......................................................... 6-6
online editing ............................................................... 8-54 functions .................................................................. 6-6
operation authority verification .................................... 8-42 programs .................................................................. 6-6
Operation Settings ......................................................... 4-5 restrictions ............................................................. 6-24
Operation Settings Tab Page ......................................... 4-4 POUs (program organization units) ............................... 6-5
Option Board Error ....................................................A-132 Power Interruption Count ................................. A-62, A-126
Option Board Mounted ..............................................A-131 Power Supply Unit
Option Board Normal Operation ................................A-132 incorrect model ...................................................... 12-5
Option Board Status ..................................................A-131 _PowerOnCount .............................................. A-62, A-126
output variables .................................................. 6-11, 6-19 _PowerOnHour ................................................ A-62, A-125
outputs P_PRGER ....................................................... A-63, A-127
program outputs ..................................................... 6-88 primary periodic task .................................5-17, 5-37, 5-55
overall project file protection ........................................ 8-39 parameters ............................................................. 5-91
OverRun ......................................................................A-69 priority-5 periodic task ................................................. 5-18
overview of CPU Unit data .......................................... 2-34 Process Data Communicating Slave Table ...... A-81, A-152
Process Data Communications Error .............. A-78, A-149
Process Data Communications Status ............ A-81, A-153
Process Data Reception Timeout Error ........... A-78, A-149

Index-6 NJ/NX-series CPU Unit Software User’s Manual (W501)


Index

Process Data Transmission Error ................... A-79, A-149 Serial Communications Unit 0, Port 1/2 Settings Changing
Program Assignment Settings ...................................... 4-9 Flags ............................................................ A-71, A-139
Program Execution Order ............................................. 4-9 Serial Communications Units 1 to 15, Port 1/2 Settings
programming languages ............................................. 6-87 Changing Flags ............................................ A-71, A-139
programs ....................................................................... 6-7 serial IDs ............................................................ 8-45, 8-46
execution conditions ................................................ 6-8 Setting Change during RUN Mode ................................ 4-6
Settings for Exclusive Control of Variables in Tasks
R ............................................................. 4-10, 5-94, 5-101
Settings for Variable Access Time ............................ 5-102
range specification ............................................. 6-33, 6-54 short names .............................................................. 6-140
real numbers ............................................................... 6-31 simulation ...................................................................... 7-3
refreshing tasks ........................................................... 5-94 simulation programs ...................................................... 7-6
Registered Slave Table ................................... A-81, A-151 simulation speed ........................................................... 7-7
restoring data ................................................................ 9-3 Slave Application Error .................................... A-79, A-150
retain condition ............................................................ 6-69 Slave Error ...................................................... A-78, A-147
_RetainFail ...................................................... A-62, A-126 Slave Error Table ............................................. A-78, A-148
Retention Failure Flag ..................................... A-62, A-126 Slave Initialization Error .................................. A-79, A-150
return values ...................................................... 6-20, 6-21 Slave Node Address Duplicated Error ............ A-79, A-149
Run ............................................................................. A-66 software configuration ................................................... 2-4
RUN output ................................................................... 8-6 software operation ........................................................ 2-5
Special I/O Unit Initializing Flags ........... 8-24, A-71, A-137
S Special I/O Unit Restart Bits .................. 8-24, A-71, A-138
Special Units ...................................................... 4-15, 8-23
Saving Packet Data File .................................. A-81, A-153 initial settings ......................................................... 4-20
SD Memory Card specifications I
exclusive control of file access .............................. 8-33 function .................................................................. A-10
self-diagnosis ........................................................ 8-31 general .................................................................... A-3
SD Memory Card Access Flag .............. 8-30, A-57, A-116 performance ............................................................ A-3
SD Memory Card Backup Commands ............ A-58, A-117 specifying structure member offsets ........................... 6-42
SD Memory Card Backup Status .................... A-59, A-118 ST language ................................................................ 6-93
SD Memory Card Error Flag .................. 8-30, A-57, A-116 assignment .......................................................... 6-100
SD Memory Card Life Warning Flag ...... 8-30, A-57, A-117 CASE ................................................................... 6-106
SD Memory Card Power Interruption Flag EXIT .................................................................... 6-116
............................................................ 8-30, A-57, A-117 expressions ........................................................... 6-94
SD Memory Card Program Transfer Command FOR ..................................................................... 6-108
............................................................ 9-35, A-59, A-120 function block calls .............................................. 6-117
SD Memory Card Program Transfer Setting ................. 4-5 function calls ........................................................ 6-120
SD Memory Card program transfer status IF with multiple conditions ................................... 6-103
..........................................................A-60, A-122, A-123 IF with one condition ........................................... 6-101
SD Memory Card Ready Flag ................ 8-30, A-57, A-116 operators ............................................................... 6-97
SD Memory Card Restore Command ....................... A-122 REPEAT .............................................................. 6-114
SD Memory Card Restore status ................................ A-61 RETURN ............................................................. 6-101
SD Memory Card Restorer Command ........................ A-60 statement keywords ............................................... 6-95
SD Memory Card Setting .............................................. 4-5 structure ................................................................ 6-94
SD Memory Card Verify Status ....................... A-59, A-119 syntax errors ........................................................ 6-136
SD Memory Card Write Protected Flag . 8-30, A-57, A-116 WHILE ................................................................. 6-112
SD Memory Cards starting and stopping the Simulator .............................. 7-3
file operations from the Sysmac Studio ................. 8-29 structures .................................................................... 6-40
life expiration detection .......................................... 8-29 Support Software ............................1-5, 1-6, 1-7, 1-8, 1-10
operation instructions ............................................ 8-28 synchronizing sequence control and motion control ... 2-33
operations .............................................................. 8-25 System Service Monitoring Settings ............................. 4-5
specifications ......................................................... 8-26 system services .......................................................... 5-79
Security Setting ............................................................. 4-6 System Time ................................................... A-55, A-113
_SelfTest_HighTemperature ........................................ A-64 system-defined events ................................................ 8-69
_SelfTest_LowBattery ................................................. A-64 system-defined variables ............................................ 6-27
_SelfTest_LowFanRevolution ...................................... A-64 Auxiliary Area bits for CJ-series Units ....... A-71, A-137
semi-user-defined variables ........................................ 6-27 clock .................................................................... A-113
sequence control and motion control .......................... 2-27 communications ........................................ A-63, A-127
sequence control system ............................................ 2-29 debugging .................................................. A-65, A-130

NJ/NX-series CPU Unit Software User’s Manual (W501) Index-7


Index

errors ....................................A-56, A-65, A-115, A-131 time of day ................................................................... 6-32


EtherCAT Communications Diagnosis/Statistics Log Total Power ON Time ....................................... A-62, A-125
..........................................................................A-155 Trace Busy Flag ......................................8-61, A-65, A-130
EtherCAT communications errors ........................A-147 Trace Completed Flag ............................8-61, A-65, A-130
EtherCAT communications status ........................A-151 Trace Parameter Error Flag ....................8-61, A-65, A-131
EtherNet/IP communications errors .....................A-156 Trace Trigger Monitor Flag ......................8-61, A-65, A-130
I/O bus errors ............................................. A-70, A-135 troubleshooting .......................................................... 12-16
I/O bus status ............................................. A-70, A-135
meanings of error status bits ...............................A-110 U
motion control functions .......................................A-143
NX Bus Function Module Errors ..........................A-141 unions .......................................................................... 6-46
NX Bus Function Module Status ................ A-72, A-140 Unit Version .................................................................A-64
Option Boards ........................................................A-66 _UnitVersion .................................................... A-64, A-128
power supply .............................................. A-62, A-125 Update Variable ........................................................... 4-10
programming .............................................. A-63, A-126 user program execution IDs ......................................... 8-35
SD Memory Cards ..................................... A-57, A-116 user program transfer with no restoration information . 8-38
tasks ....................................................................A-113 User-defined Error Status ................................ A-56, A-115
user-defined errors ...................................................... 8-76
T user-defined events ..................................................... 8-69
user-defined information .............................................. 8-76
Tag Data Link Communications Error ..........................A-93 user-defined variables ................................................. 6-27
Tag Data Link Communications Status .......................A-99
Tag Data Link Connection Failed .................................A-92 V
Tag Data Link Setting Error .........................................A-92
Tag Name Resolution Error .........................................A-94 values of retain variables after newly creations or changes
Task Active Flag .......................................5-8, A-55, A-113 of POU names .......................................................... 6-69
task design Variable Access Time .................................................... 4-8
example ............................................................... 5-111 variable attributes
task exclusive control instructions ............................... 5-97 AT Specification ..................................................... 6-56
Task Execution Count ...............................5-9, A-55, A-114 Constant ................................................................ 6-61
task execution status Edge ...................................................................... 6-63
monitoring ............................................................ 5-107 Initial Value ............................................................ 6-59
Task Execution Status Monitor .................................... 4-11 Network Publish ..................................................... 6-62
Task Execution Time Monitor ...........................4-11, 5-108 Retain .................................................................... 6-58
Task Execution Timeout ............................................ 5-105 Variable Name ....................................................... 6-56
Task Execution Timeout Time ....................................... 4-8 variable memory allocation
task execution times .................................................. 5-111 rules .....................................................................A-190
Task Name .............................................................4-7, 4-9 variable names ............................................................ 6-56
Task Period Exceeded ............................................... 5-104 restrictions ............................................................. 6-80
Task Period Exceeded Count ...................5-9, A-56, A-115 variable values
Task Period Exceeded Error Detection .......................... 4-8 ensuring concurrency ............................................ 5-94
Task Period Exceeded Flag ......................5-9, A-56, A-114 variable values when data types of retained variables are
task real processing time ........................................... 5-110 changed .................................................................... 6-72
Task Settings ................................................................. 4-7 variables
Task Type ...................................................................... 4-7 attributes ................................................................ 6-29
tasks outline .................................................................... 6-27
assigning tasks to programs .................................. 5-90 types ...................................................................... 6-27
monitoring task execution status and task execution verifying data ................................................................. 9-3
times ................................................................. 5-107 version information ....................................................A-228
order of program execution .................................... 5-90
outline ...................................................................... 5-6 W
POUs that you can assign to tasks ........................ 5-90
processing of tasks and system services ..... 5-17, 5-55 write protection ............................................................ 8-44
synchronizing variable access with task execution
.......................................................................... 5-100
task execution priority ..........................5-13, 5-34, 5-50
TCP Application Communications Error ......................A-87
TCP/IP Setting Error ....................................................A-95
text strings ................................................................... 6-32

Index-8 NJ/NX-series CPU Unit Software User’s Manual (W501)


OMRON Corporation Industrial Automation Company Authorized Distributor:
Kyoto, JAPAN
Contact: www.ia.omron.com
Regional Headquarters
OMRON EUROPE B.V. OMRON ELECTRONICS LLC
Wegalaan 67-69, 2132 JD Hoofddorp 2895 Greenspoint Parkway, Suite 200
The Netherlands Hoffman Estates, IL 60169 U.S.A.
Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787

OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. © OMRON Corporation 2011-2017 All Rights Reserved.
No. 438A Alexandra Road # 05-05/08 (Lobby 2), Room 2211, Bank of China Tower, In the interest of product improvement,
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-20 0617

You might also like