All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other
countries for OMRON factory automation products.
• Microsoft, Windows, Windows Vista, Excel, and Visual Basic are either registered trademarks or trademarks of
Microsoft Corporation in the United States and other countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
• 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
Thank you for purchasing an NJ/NX-series CPU Unit or an NY-series Industrial PC.
This manual contains information that is necessary to use the function blocks in the EtherCAT 1S
Series Library. (“Function block” is sometimes abbreviated as “FB”.) 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.
This manual provides function block specifications. It does not describe application restrictions or combination restrictions for Controllers, Units, and components.
Refer to the user’s manuals for all of the products in the application before you use any of the products.
Keep this manual in a safe place where it will be available for reference during operation.
Features of the Library
The EtherCAT 1S Series Library is used to initialize the absolute encoder, back up and restore the
parameters for an OMRON 1S-series Servo Drive with built-in EtherCAT communications.
You can use this library to reduce manpower of programming when implementing the processing for a
Servo Drive.
Introduction
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical systems(an electrical engineer or the equivalent).
• Personnel in charge of introducing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of installing and maintaining FA systems.
• Personnel in charge of managing FA systems and facilities.
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
For the model numbers and versions of an NJ/NX-series CPU Unit, NY-series Industrial PC, and the
Sysmac Studio that this library supports, refer to Sysmac Library Version Information in the SYS-
Sysmac Library Catalog (Cat. No. P102). This catalog can be downloaded from the
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
1
Manual Structure
Precautions for Safe Use
Precautions for Correct Use
Additional Information
Version Information
Manual Structure
Special Information
Special information in this manual is classified as follows:
Precautions on what to do and what not to do to ensure safe usage of the product.
Precautions on what to do and what not to do to ensure proper operation and performance.
Additional information to read as required.
This information is provided to increase understanding or make operation easier.
Information on differences in specifications and functionality for CPU Units and Industrial PCs
with different unit versions and for different versions of the Sysmac Studio are given.
Note References are provided to more detailed or related information.
2
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Manual Structure
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Features of the Library................................................................................................................................. 1
Special Information......................................................................................................................................2
Precautions for Correct Use..................................................................................10
Related Manuals ..................................................................................................... 11
Revision History .....................................................................................................14
Procedure to Use Sysmac Libraries .............................................................................................. 15
Procedure to Use Sysmac Libraries Installed Using the Installer .............................................................. 16
Procedure to Use Sysmac Libraries Uploaded from a CPU Unit or an Industrial PC................................ 20
Common Specifications of Function Blocks ................................................................................ 23
Common Variables .................................................................................................................................... 24
Referring to Library Information ................................................................................................................. 92
Referring to Function Block and Function Source Codes .......................................................................... 95
Objects to Back up and Restore................................................................................................................ 96
4
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
CONTENTS
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
5
Terms and Conditions Agreement
Terms and Conditions Agreement
Warranty, Limitations of Liability
Warranties
Exclusive Warranty
Omron’s exclusive warranty is that the Products will be free from defects in materials and workmanship for a period of twelve months from the date of sale by Omron (or such other period expressed in
writing by Omron). Omron disclaims all other warranties, express or implied.
Limitations
OMRON MAKES NO WARRANTY OR REPRESENTATION, EXPRESS OR IMPLIED, ABOUT
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OF
THE PRODUCTS. BUYER ACKNOWLEDGES THAT IT ALONE HAS DETERMINED THAT THE
PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE.
Omron further disclaims all warranties and responsibility of any type for claims or expenses based
on infringement by the Products or otherwise of any intellectual property right.
Buyer Remedy
Omron’s sole obligation hereunder shall be, at Omron’s election, to (i) replace (in the form originally
shipped with Buyer responsible for labor charges for removal or replacement thereof) the non-complying Product, (ii) repair the non-complying Product, or (iii) repay or credit Buyer an amount equal
to the purchase price of the non-complying Product; provided that in no event shall Omron be
responsible for warranty, repair, indemnity or any other claims or expenses regarding the Products
unless Omron’s analysis confirms that the Products were properly handled, stored, installed and
maintained and not subject to contamination, abuse, misuse or inappropriate modification. Return of
any Products by Buyer must be approved in writing by Omron before shipment. Omron Companies
shall not be liable for the suitability or unsuitability or the results from the use of Products in combination with any electrical or electronic components, circuits, system assemblies or any other materials or substances or environments. Any advice, recommendations or information given orally or in
writing, are not to be construed as an amendment or addition to the above warranty.
See http://www.omron.com/global/ or contact your Omron representative for published information.
Limitation on Liability; Etc
OMRON COMPANIES SHALL NOT BE LIABLE FOR SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, LOSS OF PROFITS OR PRODUCTION OR COMMERCIAL LOSS IN ANY
WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED IN CONTRACT,
WARRANTY, NEGLIGENCE OR STRICT LIABILITY.
Further, in no event shall liability of Omron Companies exceed the individual price of the Product on
which liability is asserted.
6
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Application Considerations
Suitability of Use
Omron Companies shall not be responsible for conformity with any standards, codes or regulations
which apply to the combination of the Product in the Buyer’s application or use of the Product. At
Buyer’s request, Omron will provide applicable third party certification documents identifying ratings
and limitations of use which apply to the Product. This information by itself is not sufficient for a complete determination of the suitability of the Product in combination with the end product, machine, system, or other application or use. Buyer shall be solely responsible for determining appropriateness of
the particular Product with respect to Buyer’s application, product or system. Buyer shall take application responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY OR IN LARGE QUANTITIES WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE
HAS BEEN DESIGNED TO ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS
PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
Terms and Conditions Agreement
Programmable Products
Omron Companies shall not be responsible for the user’s programming of a programmable Product, or
any consequence thereof.
Disclaimers
Performance Data
Data presented in Omron Company websites, catalogs and other materials is provided as a guide for
the user in determining suitability and does not constitute a warranty. It may represent the result of
Omron’s test conditions, and the user must correlate it to actual application requirements. Actual performance is subject to the Omron’s Warranty and Limitations of Liability.
Change in Specifications
Product specifications and accessories may be changed at any time based on improvements and other
reasons. It is our practice to change part numbers when published ratings or features are changed, or
when significant construction changes are made. However, some specifications of the Product may be
changed without any notice. When in doubt, special part numbers may be assigned to fix or establish
key specifications for your application. Please consult with your Omron’s representative at any time to
confirm actual specifications of purchased Product.
Errors and Omissions
Information presented by Omron Companies has been checked and is believed to be accurate; however, no responsibility is assumed for clerical, typographical or proofreading errors or omissions.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
7
Safety Precautions
WARNING
Caution
Indicates a potentially hazardous situation which, if not
avoided, could result in death or serious injury. Additionally, there may be severe property damage.
Indicates a potentially hazardous situation which, if not
avoided, may result in minor or moderate injury, or
property damage.
Safety Precautions
Definition of Precautionary Information
The following notation is used in this user’s manual to provide precautions required to ensure safe
usage of an NJ/NX-series Controller and an NY-series Industrial PC.
The safety precautions that are provided are extremely important to safety. Always read and heed the
information provided in all safety precautions.
The following notation is used.
Symbols
The circle and slash symbol indicates operations that you must not do.
The specific operation is shown in the circle and explained in text.
This example indicates prohibiting disassembly.
The triangle symbol indicates precautions (including warnings).
The specific operation is shown in the triangle and explained in text.
This example indicates a precaution for electric shock.
The triangle symbol indicates precautions (including warnings).
The specific operation is shown in the triangle and explained in text.
This example indicates a general precaution.
The filled circle symbol indicates operations that you must do.
The specific operation is shown in the circle and explained in text.
This example shows a general precaution for something that you must
do.
8
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Cautions
Safety Precautions
Caution
Read all related manuals carefully before you use this library.
Emergency stop circuits, interlock circuits, limit circuits, and similar safety measures
must be provided in external control circuits.
Check the user program, data, and parameter settings for proper execution before
you use them for actual operation.
The Sysmac Library and manuals are assumed to be used by personnel that is
given in Intended Audience in this manual. Otherwise, do not use them.
The sample programming shows only the portion of a program that uses the function or function block from the library.
When using sample programming in actual devices, also program safety circuits,
device interlocks, I/O with other devices, and other control procedures.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
9
Precautions for Correct Use
Precautions for Correct Use
Using the Library
• When you use the library, functions or function blocks that are not described in the library manual
may be displayed on the Sysmac Studio. Do not use functions or function blocks that are not
described in the manual.
• Do not change the names and the contents of any object list.
• Setting the NoProductChk input variable to TRUE allows you to execute restore even when the product code in the backup data differs from the product code of the restore destination. Make sure that
the restore destination is a 1S-series Servo Drive before you attempt to restore the parameters.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the EtherCAT communications until the processing for this function block ends normally or ends in an error.
• After completion of Restore_1S function block, cycle the control power supply to the 1S-series Servo
Drive to apply the restored parameters.
• When the model which was backed up differs from the model to be restored, confirm that the restore
can be performed with the object list which was backed up, and then change NoproductChk of this
function block to TRUE.
• Confirm that the models to be backed up are applicable models and versions before you perform the
backup.
Using Sample Programming
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
10
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Related Manuals
Related Manuals
The following are the manuals related to this manual. Use these manuals for reference.
NY-series IPC Machine
Controller Industrial
Panel PC Hardware
User’s Manual
W535NX701-Learning the basic specifi-
cations of the NX-series
NX701 CPU Units, including introductory information,
designing, installation, and
maintenance. Mainly hardware information is provided
W593NX102-Learning the basic specifi-
W578NX1P2-Learning the basic specifi-
W500NJ501-
NJ301-
NJ101-
W557NY532-Learning the basic specifi-
cations of the NX102 CPU
Units, including introductory
information, designing,
installation, and maintenance. Mainly hardware
information is provided.
cations of the NX-series
NX1P2 CPU Units, including introductory information,
designing, installation, and
maintenance. Mainly hardware information is provided
Learning the basic specifications of the NJ-series
CPU Units, including introductory information, designing, installation, and
maintenance.
Mainly hardware information is provided
cations of the NY-series
Industrial Panel PCs,
including introductory information, designing, installation, and maintenance.
Mainly hardware information is provided
An introduction to the entire NX701 CPU Unit
system is provided along with the following information on the CPU Unit.
Features and system configuration
Overview
Part names and functions
General specifications
Installation and wiring
Maintenance and inspection
An introduction to the entire NX102 system is
provided along with the following information on
the CPU Unit.
Features and system configuration
Introduction
Part names and functions
General specifications
Installation and wiring
Maintenance and Inspection
An introduction to the entire NX1P2 CPU Unit
system is provided along with the following information on the CPU Unit.
Features and system configuration
Overview
Part names and functions
General specifications
Installation and wiring
Maintenance and Inspection
An introduction to the entire NJ-series system is
provided along with the following information on
the CPU Unit.
Features and system configuration
Overview
Part names and functions
General specifications
Installation and wiring
Maintenance and inspection
An introduction to the entire NY-series system is
provided along with the following information on
the Industrial Panel PC.
Features and system configuration
Introduction
Part names and functions
General specifications
Installation and wiring
Maintenance and inspection
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
cations of the NY-series
Industrial Box PCs, including introductory information,
designing, installation, and
maintenance. Mainly hardware information is provided
W501NX701-
NX102-
NX1P2-
NJ501-
NJ301-
NJ101-
W558NY532-
NY512-
W502NX701-
NX102-
NX1P2-
NJ501-
NJ301-
NJ101-
W560NY532-
NY512-
W507NX701-
NX102-
NX1P2-
NJ501-
1-
NJ30
1-
NJ10
W559NY532-
NY512-
W508NX701-
NX102-
NX1P2-
NJ501-
NJ301-
NJ101-
W561NY532-
NY512-
O030NJ501-5300
NY532-5400
Learning how to program
and set up an NJ/NX-series
CPU Unit.
Mainly software information is provided
Learning how to program
and set up the Controller
functions of an NY-series
Industrial PC
Learning detailed specifications on the basic instructions of an NJ/NX-series
CPU Unit
Learning detailed specifications on the basic instructions of an NY-series
Industrial PC
Learning about motion control settings and programming concepts of an
NJ/NX-series CPU Unit.
Learning about motion control settings and programming concepts of an
NY-series Industrial PC.
Learning about the specifications of the motion control instructions of an
NJ/NX-series CPU Unit.
Learning about the specifications of the motion control instructions of an
NY-series Industrial PC.
Performing numerical control with NJ/NY-series Controllers.
An introduction to the entire NY-series system is
provided along with the following information on
the Industrial Box PC.
Features and system configuration
Introduction
Part names and functions
General specifications
Installation and wiring
Maintenance and inspection
The following information is provided on a Controller built with an NJ/NX-series CPU Unit.
CPU Unit operation
CPU Unit features
Initial settings
Programming based on IEC 61131-3 language
specifications
The following information is provided on
NY-series Machine Automation Control Software.
Controller operation
Controller features
Controller settings
Programming based on IEC 61131-3 language
specifications
The instructions in the instruction set (IEC
61131-3 specifications) are described.
The instructions in the instruction set (IEC
61131-3 specifications) are described.
The settings and operation of the CPU Unit and
programming concepts for motion control are
described.
The settings and operation of the Controller and
programming concepts for motion control are
described.
The motion control instructions are described.
The motion control instructions are described.
Describes the functionality to perform the numerical control. Use this manual together with the
NJ/NY-series G code Instructions
Reference Manual (Cat. No. O031) when pro-
gramming.
12
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
AC Servomotors/Servo
Drivers 1S-series with
Built-in EtherCAT
Communications User’s
Manual
O031NJ501-5300
NY532-5400
W504SYSMAC
-SE2
O032SYSMAC
-RTNC0D
I586R88M-1
R88D-1SN-ECT
I621R88M-1A
R88D-1SAN-ECT
Learning about the specifications of the G code/M
code instructions.
Learning about the operating procedures and functions of the Sysmac Studio.
Learning an introduction of
the CNC Operator and how
to use it.
Learning how to use the
Servomotors/Servo Drives
with built-in EtherCAT Communications.
The G code/M code instructions are described.
Use this manual together with the NJ/NY-series NC Integrated Controller User’s Manual (Cat. No.
O030) when programming.
Describes the operating procedures of the Sysmac Studio.
An introduction of the CNC Operator, installation
procedures, basic operations, connection operations, and operating procedures for main functions are described.
Describes the hardware, setup methods and
functions of the Servomotors/Servo Drives with
built-in EtherCAT Communications.
Related Manuals
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
13
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.
Revision codeDateRevised content
01July 2016Original production
02November 2016 Changed the manual name.
03March 2017Compatible with R88D-1SN
04January 2019• Added compatible models.
05April 2019• Added compatible models.
06July 2019Added following function blocks:
07October 2020Compatible with R88D-1SN
W571-E1-07
• Compatible with R88D-1SN
• Compatible with 1S Series other than R88D-1SN
• MotorSetup_1S
•Restart_1S
• EasyTuning_1S
Revision code
-ECT Version 1.1
-ECT Version 1.2
-ECT Version 1.4
-ECT
14
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Procedure to Use Sysmac Libraries
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
15
Procedure to Use Sysmac Libraries Installed Using the Installer
Version Information
Precautions for Correct Use
Procedure to Use Sysmac Libraries Installed Using the Installer
This section describes the procedure to use Sysmac Libraries that you installed using the installer.
There are two ways to use libraries.
• Using newly installed Sysmac Libraries
• Using upgraded Sysmac Libraries
To use Sysmac Libraries, you need the Sysmac Studio version 1.14 or higher.
Using Newly Installed Libraries
1Start the Sysmac Studio and open or create a new project in which you want to use Sysmac
Libraries.
If you create a new project, be sure to configure the settings as follows to enable the use of
Sysmac Libraries. If you do not configure the following settings, you cannot proceed to the step
2 and later steps.
• Set the project type to Standard Project or Library Project.
• Set the device category to Controller.
• Set the device version to 1.01 or later.
16
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Procedure to Use Sysmac Libraries Installed Using the Installer
Precautions for Correct Use
Device
Drug & Drop
2Select Project – Library – Show References.
If you have more than one registered device in the project, make sure that the device selected
currently is an NJ/NX-series CPU Unit or an NY-series Industrial PC. If you do not select an
NJ/NX-series CPU Unit or an NY-series Industrial PC as the device, Library References does
not appear in the above menu. When the device selected currently is an NJ/NX-series CPU
Unit or an NY-series Industrial PC, the device icon is displayed in the Multiview Explorer.
3Add the desired Sysmac Library to the list and click the OK Button.
The Sysmac Library file is read into the project.
Now, when you select the Ladder Editor or ST Editor, the function blocks and functions included
in a Sysmac Library appear in the Toolbox.
For the procedure for adding and setting libraries in the above screen, refer to the Sysmac Stu-dio Version 1 Operation Manual (Cat. No. W504).
4Insert the Sysmac Library’s function blocks and functions into the circuit using one of the follow-
ing two methods.
• Select the desired function block or function in the Toolbox and drag and drop it onto the programming editor.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
17
Procedure to Use Sysmac Libraries Installed Using the Installer
Precautions for Correct Use
Precautions for Correct Use
Device
• Right-click the programming editor, select Insert Function Block in the menu, and enter the
fully qualified name (\\name of namespace\name of function block).
After you upgrade the Sysmac Studio, check all programs and make sure that there is no error
of the program check results on the Build Tab Page.
Select Project
–Check All Programs from the Main Menu.
Using Upgraded Libraries
1Start the Sysmac Studio and open a project in which any old-version Sysmac Library is
included.
2Select Project – Library – Show References.
If you have more than one registered device in the project, make sure that the device selected
currently is an NJ/NX-series CPU Unit or an NY-series Industrial PC. Otherwise, Library References does not appear in the above menu. When the device selected currently is an
NJ/NX-series CPU Unit or an NY-series Industrial PC, the device icon is displayed in the
Multiview Explorer.
3Select an old-version Sysmac Library and click the Delete Reference Button.
18
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Procedure to Use Sysmac Libraries Installed Using the Installer
4Add the desired Sysmac Library to the list and click the OK Button.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
19
Procedure to Use Sysmac Libraries Uploaded from a CPU Unit or an Industrial PC
Version Information
Procedure to Use Sysmac Libraries Uploaded from a CPU Unit or
an Industrial PC
You can use Sysmac Libraries uploaded from a CPU Unit or an Industrial PC to your computer if they
are not installed.
The procedure to use uploaded Sysmac Libraries from a CPU Unit or an Industrial PC is as follows.
To use Sysmac Libraries, you need the Sysmac Studio version 1.14 or higher.
1Start the Sysmac Studio and create a new project in which you want to use Sysmac Libraries.
2Connect the computer to the CPU Unit or the Industrial PC and place it online.
3Upload POUs in which any Sysmac Library is used to the computer.
Now, when you select the Ladder Editor or ST Editor, the function blocks and functions included
in the Sysmac Library used in the uploaded POUs appear in the Toolbox.
4Insert the Sysmac Library’s function blocks and functions into the circuit using one of the follow-
ing two methods.
• Select the desired function block or function in the Toolbox and drag and drop it onto the Ladder Editor.
20
Drug & Drop
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Procedure to Use Sysmac Libraries Uploaded from a CPU Unit or an Industrial PC
Precautions for Correct Use
• Right-click the programming editor, select Insert Function Block in the menu, and enter the
fully qualified name (\\name of namespace\name of function block).
• The Sysmac Studio installs library files of the uploaded Sysmac Stutio to the specified folder
on the computer if they are not present. However, the Sysmac Studio does not install library
files to the specified folder on the computer if they are present.
The specified folder here means the folder in which library files are installed by the installer.
• Note that uploading Sysmac Libraries from a CPU Unit or an Industrial PC does not install
the manual and help files for the Sysmac Libraries, unlike the case where you install then
using the installer. Please install the manual and help files using the installer if you need
them.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
21
Procedure to Use Sysmac Libraries Uploaded from a CPU Unit or an Industrial PC
22
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Common Specifications of Function Blocks
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
23
Common Variables
Common Variables
This section describes the specifications of variables (EN, Execute, Enable, Abort, ENO, Done, CalcRslt, Enabled, Busy, CommandAborted, Error, ErrorID, and ErrorIDEx) that are used for more than
one function or function block. The specifications are described separately for functions, for execute-type function blocks, and for enable-type function blocks.
Definition of Input Variables and Output Variables
Common input variables and output variables used in functionsandfunction blocks are as follows.
Function/function
Var iabl eI/O
ENInputBOOLOKExecuteThe processing is executed while the
ExecuteOKExecuteThe processing is executed when the
EnableOKRunThe processing is executed while the
AbortBOOLOKAbortThe processing is aborted.
Data
type
block type to use
Execute-
type
Enable-
type
MeaningDefinitionFunction block
Function
variable is TRUE.
variable changes to TRUE.
variable is TRUE.
You can select the aborting method.
24
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Common Variables
Function/function
VariableI/O
ENOOutput BOOLOKDoneThe variable changes to TRUE when the
DoneBOOLOKDoneThe variable changes to TRUE when the
BusyBOOLOKOKExecutingThe variable is TRUE when the process-
CalcRsltLREALOKCalculation
EnabledBOOLOKEnabledThe variable is TRUE when the output is
Command
Aborted
ErrorBOOLOKOKErrorThis variable is TRUE while there is an
ErrorIDWORDOKOKError CodeAn error code is output.
ErrorIDExDWORDOKOKExpansion
Data
type
BOOLOKCommand
block type to use
Execute-
type
Enable-
type
Function
MeaningDefinitionFunction block
Result
Aborted
Error Code
processing ends normally.
It is FALSE when the processing ends in
an error, the processing is in progress, or
the execution condition is not met.
processing ends normally.
It is FALSE when the processing ends in
an error, the processing is in progress, or
the execution condition is not met.
ing is in progress.
It is FALSE when the processing is not in
progress.
The calculation result is output.
enabled. It is used to calculate the control amount for motion control, temperature control, etc.
The variable changes to TRUE when the
processing is aborted.
It changes to FALSE when the processing is re-executed the next time.
error.
It is FALSE when the processing ends
normally, the processing is in progress,
or the execution condition is not met.
An expansion error code is output.
Execute-type Function Blocks
• Processing starts when Execute changes to TRUE.
• When Execute changes to TRUE, Busy also changes to TRUE. When processing is completed normally, Busy changes to FALSE and Done changes to TRUE.
• When continously executes the function blocks of the same instance, change the next Execute to
TRUE for at least one task period after Done changes to FALSE in the previous execution.
• If the function block has a CommandAborted (Instruction Aborted) output variable and processing is
aborted, CommandAborted changes to TRUE and Busy changes to FALSE.
• If an error occurs in the function block, Error changes to TRUE and Busy changes to FALSE.
• For function blocks that output the result of calculation for motion control and temperature control,
you can use the BOOL input variable Abort to abort the processing of a function block. When Abort
changes to TRUE, CommandAborted changes to TRUE and the execution of the function block is
aborted.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
25
Common Variables
Busy
Done
CommandAborted
Error
16#00000000
16#0000
ErrorID
ErrorIDEx
Execute
Busy
Abort
CommandAborted
Error
16#00000000
16#0000
ErrorID
ErrorIDEx
Execute
In-out variables
Input variables
• If Execute is TRUE and Done, CommandAborted, or Error changes to TRUE, Done, CommandAborted, and Error changes to FALSE when Execute is changed to FALSE.
• If Execute is FALSE and Done, CommandAborted, or Error changes to TRUE, Done,CommandAborted, and Error changes to TRUE for only one task period.
• If an error occurs, the relevant error code and expansion error code are set in ErrorID (Error Code)
and ErrorIDEx (Expansion Error Code). The error codes are retained even after Error changes to
FALSE, but ErrorID is set to 16#0000 and ErrorIDEx is set to 16#0000 0000 when Execute changes
to TRUE.
Abcd_instance
Abcd
InOut_ValInOut_Val
ExecuteDone
Busy
CommandAborted
Error
ErrorID
ErrorIDEx
In-out variables
Output variables
Timing Charts
This section provides timing charts for a normal end, aborted execution, and errors.
Normal End
Canceled Execution
26
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Aborted Execution
Busy
Done
CommandAborted
Error
16#00000000
16#0000
ErrorID
ErrorIDEx
Execute
Busy
Done
CommandAborted
Error
16#000016#0000
ErrorID
16#0000000016#00000000ErrorIDExErrorIDEx
ErrorIDEx
Execute
ErrorIDErrorIDErrorIDErrorID
Errors
Common Variables
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
27
Common Variables
Busy
Enabled
Error
16#00000000
16#0000
ErrorID
ErrorIDEx
Enable
CalcRslt
Retained
Retained
Enable-type Function Blocks
• Processing is executed while Enable is TRUE.
• When Enable changes to TRUE, Busy also changes to TRUE. Enabled is TRUE during calculation of
the output value.
• If an error occurs in the function block, Error changes to TRUE and Busy and Enabled change to
FALSE. When Enable changes to FALSE, Enabled, Busy, and Error change to FALSE.
Abcd_instance
In-out variables
Input variables
InOut_ValInOut_Val
EnableEnabled
Abcd
CalcRslt
Busy
Error
ErrorID
ErrorIDEx
In-out variables
Output variables
• If an error occurs, the relevant error code and expansion error code are set in ErrorID (Error Code)
and ErrorIDEx (Expansion Error Code). The error codes are retained even after Error changes to
FALSE, but ErrorID is set to 16#0000 and ErrorIDEx is set to 16#0000 0000 when Enable changes to
TRUE.
• For function blocks that calculate the control amount for motion control, temperature control, etc.,
Enabled is FALSE when the value of CalcRslt (Calculation Result) is incorrect. In such a case, do not
use CalcRslt. In addition, after the function block ends normally or after an error occurs, the value of
CalcRslt is retained until Enable changes to TRUE. The control amount will be calculated based on
the retained CalcRslt value, if it is the same instance of the function block that changed Enable to
TRUE. If it is a different instance of the function block, the control amount will be calculated based on
the initial value.
Timing Charts
This section provides timing charts for a normal end and errors.
Normal End
28
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Errors
Busy
Enabled
Error
16#000016#000016#0000
ErrorID
ErrorIDEx
Enable
ErrorIDErrorIDErrorIDErrorID
16#00000000
16#00000000
ErrorIDErrorIDErrorIDErrorID
16#0000
CalcRslt
Retained
Retained
Common Variables
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
29
Precautions
Precautions
This section provides precautions for the use of this function block.
Nesting
You can nest calls to this function block for up to four levels.
For details on nesting, refer to the software user’s manual.
Instruction Options
You cannot use the upward differentiation option for this function block.
Re-execution of Function Blocks
Execute-type function blocks cannot be re-executed by the same instance.
If you do so, the output value will be the initial value.
For details on re-execution, refer to the motion control user’s manual.
30
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Individual Specifications of
Function Blocks
Function block nameNamePage
InitEncoder_1S1S-series Servo Drive
Absolute Encoder Initialize
Backup_1S1S-series Servo Drive
Parameter Backup
Restore_1S1S-series Servo Drive
Parameter Restore
MotorSetup_1S1S-series Servo Drive
Motor Replacement Detected
Restart_1S1S-series Servo Drive
Function Block Restarts
EasyTuning_1S1S-series Servo Drive
Easy tuning
P. 3 2
P. 4 1
P. 5 5
P. 6 4
P. 7 3
P. 7 8
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
31
InitEncoder_1S
TimeOut
NodeAdr
Execute
InitEncoder_1S_instance
\\OmronLib\EC_1S
\InitEncoder_1S
Error
ErrorID
ErrorIDEx
Busy
Done
InitEncoder_1S
The InitEncoder_1S function block initializes the absolute encoder (clears the multi-rotation counter for
Function block
InitEncoder_1S1S-series Servo
the absolute encoder) for a 1S-series Servo Drive.
Library file nameOmronLib_EC_1S_V2_0.slr
NamespaceOmronLib\EC_1S
Function block and function number00042
Source code published/not publishedNot published
Function block and function version1.00
Compatible Models
ItemNameModel numbersVe r sion
Device1S-series Servo Drive
R88D-1SN-ECT
R88D-1SAN-ECT
Version 1.00 or later
32
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
InitEncoder_1S
Variables
NameMeaningI/ODescriptionValid rangeUnitDefault
TRUE: Executes the instruction.
ExecuteExecuteInput
FALSE: Does not execute the
instruction.
NodeAdr
Slave Node
Address
Input
TimeOutTimeout timeInput
Node address of the Servo Drive
to initialize
0: 2.0 s
1 to 65535: 0.1 to 6553.5 s
TRUE: Normal end
DoneDoneOutput
FALSE: Error end, execution in
progress, or execution condition
not met
TRUE: Execution processing is in
BusyExecutingOutput
progress.
FALSE: Execution processing is
not in progress.
TRUE: Error end
ErrorErrorOutput
FALSE: Normal end, execution in
progress, or execution condition
not met
This is the error ID for an error
ErrorIDError CodeOutput
end.
The value is WORD#16#0 for a
normal end.
This is the error ID for an Expan-
ErrorIDEx
Expansion Error
Code
Output
sion Unit Hardware Error.
The value is DWORD#16#0 for a
normal end.
*1. The valid range is 1 to 192 for NJ-series CPU Units.
*2. For details, refer to Troubleshooting on page 37
TRUE or
FALSE
1 to 512
*1
---FALSE
---1
0 to 655350.1 s
TRUE or
FALSE
TRUE or
FALSE
TRUE or
FALSE
*2
*2
------
------
------
------
------
0
(2.0 s)
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Execute
Done
Busy
Error
ErrorID
ErrorIDEx
#0000
#00000000#00000000#00000000#00000000
#0000#0000#0000
Execute
Done
Busy
Error
ErrorID
ErrorIDEx
#0000
#00000000ErrorIDEx#00000000ErrorIDEx
ErrorID#0000ErrorID
Function
This function block initializes the absolute encoder (clears the multi-rotation counter for the absolute
encoder) for the specified Servo Drive. When the Servo Drive changes to a Fault state (Error No. 27)
after the initialization is completed, cycle the control power supply to the Servo Drive.
After sending the initialization command to the Servo Drive, the command part waits for the response
for the time specified with TimeOut (Timeout). The value of ErrorIDEx is 0 for a normal end.
Timing Charts
The following figures show the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• Done changes to TRUE when the initialize process is ended.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
•If Execute changes to FALSE before execution of the function block is ended, Done and Error are
•If Execute remains TRUE even after execution of the function block is ended, the output values of
InitEncoder_1S
Busy (Executing) changes to FALSE.
You can find out the cause of the error by accessing the values output to ErrorID (Error Code) and
ErrorIDEx (Expansion Error Code).
TRUE only for one task period after execution of the function block is ended.
Done and Error are held.
Timing Chart for Normal End
Timing Chart for Error End
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
35
InitEncoder_1S
Related System-defined Variables
NameMeaningData typeDescription
Message Communica-
_EC_MBXSlavTbl
*1. The valid is 192 for NJ-series CPU Units.
tions Enabled Slave
Ta bl e
Additional Information
This function block initializes absolute encoders by writing 6a64 6165 hex to the object of servo parameter Index:4510 hex Subindex:F1 hex (Absolute Encoder Setup) with SDO mailbox communications.
Array[1..512
*1
] OF BOOL
This table indicates the slaves that
can perform message communications. Slaves are given in the table in
the order of slave node addresses.
TRUE: Message communications
are possible.
FALSE: Message communications
are not possible.
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of Execute changes to FALSE or the execution time exceeds the task period. The value of Done changes to
TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes one EC_CoESDOWrite instruction or one EC_CoESDORead instruction within the part. Refer to the EC_CoESDOWrite instruction in the instructions reference manual
for the maximum number of instructions that can be executed at the same time.
• After completion of the function block, the 1S-series Servo Drive changes to a Fault state. Cycle the
control power supply to the Servo Drive.
• Execute the function block while the Servo is OFF.
• If the Servo Drive is assigned to the Motion Control Function Module, make sure that the Axis Disabled (_MC_AX[***].Status.Disabled) in the Axis Variable is TRUE before you execute the function
block.
• Make sure that the Servo Drive is a compatible model before executing this function block.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the EtherCAT communications until the processing for this function block ends normally or ends in an error.
• Sample programming shows only the portion of a program that uses the function or function block
from the library.
• When using sample programming in actual devices, also program safety circuits, device interlocks,
I/O with other devices, and other control procedures.
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
• An error will occur in the following cases. Error will change to TRUE.
a) The EtherCAT master is not in a state that allows message communications.
b) The slave specified with NodeAdr does not exist.
c) The slave specified with NodeAdr is not in a state that allows communications.
d) The slave is not in a state that allows writing of parameters.
e) The number of EtherCAT communications instructions such as EC_CoESDOWrite exceeded the
maximum number of instructions that can be executed at the same time.
36
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
InitEncoder_1S
Troubleshooting
Error code
16#000016#00000000Normal End-----16#040016#00000000Input Value Out
16#180016#00000000EtherCAT Com-
16#180116#00000000EtherCAT Slave
16#180216#00000000EtherCAT Time-
16#180316#00000000Reception Buf-
16#1804SDO Abort
16#180816#00000000Communica-
16#3C2C16#00000001VendorID Not
*1. An SDO abort code is shown here. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort
codes.
Expansion
error code
StatusDescriptionCorrection
of Range
munications
Error
Does Not
Respond
out
fer Overflow
SDO Abort ErrorThe cause of this error
*1
Code
tions Resource
Overflow
Matched
16#00000003Initialization Fail-
ure
16#00000004Unsupported
Device
The value of NodeAdr is out
of range.
The EtherCAT network is
not in a usable status.
The target slave does not
exist.
The target slave is not in an
operating condition.
Communications with the
target slave timed out.
The receive data from an
EtherCAT slave overflowed
the receive buffer.
depends on the specifications of the EtherCAT slave.
More than 32 EtherCAT
communications instructions were executed at the
same time.
The device is not supported
by this function block (A
non-OMRON device is
specified).
The encoder initialization
was not completed within
one minute.
The device is not supported
by this function block.
Set the value of NodeAdr cor-
rectly.
Check the operation status of the
EtherCAT network by checking
the status of the EtherCAT master. Use this information to correct
the cause of the problem.
Specify an existing node address.
Check the status of the target EtherCAT slave. Make sure that the
target slave is in a usable status.
Check the operating status of the
target slave and correct the cause
of the problem.
Set the size of the reception buffer
to a value larger than the size of
the receive data from the slave.
Refer to the manual for the EtherCAT slave and correct the problem.
Correct the user program so that
no more than 32 EtherCAT communications instructions are executed at the same time.
Check that the specified device is
a 1S-series Servo Drive.
Execute the function block again.
The encoder was located near the
position of one rotation at the start
of the initialization and fell in a
state of a multi-rotation due to
vibration etc. This may be
assumed as an initialization failure when the Servo Drive checks
the completion of the initialization.
Replace the 1S-series Servo
Drive.
Check that the specified device is
a 1S-series Servo Drive.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
37
InitEncoder_1S
Sample Programming
Conditions
This sample programming initializes the absolute encoder for a Servo Drive.
• The target Servo Drive is Node 1.
• The target Servo Drive is assigned to axis 0 in the Motion Control Function Module.
• The timeout time is 2 s (default).
Processing
1Make sure that the target slave is in a state that allows communications, that axis 0 is disabled,
*1. N = 192 for NJ501, NJ301 and NJ101. N = 512 for NX701.
Message Communications Enabled Slave
Table
Value of Trigger from previous task
// Detect when Trigger changes to TRUE.
IF ( (Trigger=TRUE) AND (LastTrigger=FALSE) AND (_EC_MBXSlavTbl[1]=TRUE) AND
MC_Axis000.Status.Disabled=TRUE) AND(InitEncoderBusy=FALSE) ) THEN
OperatingStart:=TRUE;
Operating :=TRUE;
END_IF;
LastTrigger:=Trigger;
// Initialize InitEncoder_1S instruction.
IF (OperatingStart=TRUE) THEN
INITENCODER_1S_instance(
Execute :=FALSE);
OperatingStart:=FALSE;
END_IF;
// Execute Backup_1S instruction.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
39
InitEncoder_1S
IF (Operating=TRUE) THEN
INITENCODER_1S_instance(
Execute :=TRUE,
NodeAdr:=UINT#1,
TimeOut:=UINT#0,
Busy=>InitEncoderBusy);
IF (INITENCODER_1S_instance.Done=TRUE) THEN
// Processing after normal end.
Operating:=FALSE;
END_IF;
IF (INITENCODER_1S_instance.Error=TRUE) THEN
// Processing after error end.
Operating:=FALSE;
END_IF;
END_IF;
40
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Backup_1S
NodeAdr
DirName
OverWrite
TimeOut
Execute
Backup_1S_instance
\\OmronLib\EC_1S
\Backup_1S
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
Done
The Backup_1S function block backs up the parameters for a 1S-series Servo Drive and stores them
Function block
Backup_1S1S-series Servo
as a backup file on the SD Memory Card inserted in the Controller.
Library file nameOmronLib_EC_1S_V2_0.slr
NamespaceOmronLib\EC_1S
Function block and function number00043
Source code published/not publishedNot published
Function block and function version1.00
Compatible Models
ItemNameModel numbersVer sion
Device1S-series Servo DriveR88D-1SN-ECTVersion 1.00 or later
R88D-1SAN-ECT
SD Memory CardHMC-SD
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
41
Backup_1S
Variables
NameMeaningI/ODescriptionVa lid ra ngeUnitDefault
TRUE: Executes the instruction.
ExecuteExecuteInput
FALSE: Does not execute the
instruction.
NodeAdr
Slave Node
Address
InputSpecifies the node address.
Specifies the directory on the SD
DirNameDirectory NameInput
Memory Card. The backup file(s)
stored in this directory will be
restored.
OverWriteOverwrite EnableInput
TimeOutTimeout TimeInput
TRUE: Enables overwrite.
FALSE: Prohibits overwrite.
0: 2.0 s
1 to 65535: 0.1 to 6553.5 s
TRUE: Normal end
DoneDoneOutput
FALSE: Error end, execution in
progress, or execution condition
not met
TRUE: Execution processing is in
BusyExecutingOutput
progress.
FALSE: Execution processing is
not in progress.
This flag is TRUE when an SDO
communications command is
sent to a 1S-series Servo Drive.
SdoBusy
Processing Sdo
Communications
Output
TRUE: Error end
ErrorErrorOutput
FALSE: Normal end, execution in
progress, or execution condition
not met
This is the error ID for an error
ErrorIDError CodeOutput
end.
The value is WORD#16#0 for a
normal end.
This is the error ID for an Expan-
ErrorIDEx
Expansion Error
Code
Output
sion Unit Hardware Error.
The value is DWORD#16#0 for a
normal end.
*1. The valid range is 1 to 192 for NJ-series CPU Units.
*2. If DirName is omitted, this specifies the root directory on the SD Memory Card.
*3. You can use it to identify that communications processing is in progress.
*4. For details, refer to Troubleshooting on page 48.
TRUE or
FALSE
1 to 512
*1
40 bytes max.---
TRUE or
FALSE
0 to 655350.1 s
TRUE or
FALSE
TRUE or
FALSE
TRUE or
FALSE
*3
TRUE or
FALSE
*4
*4
---FALSE
---1
''
---FALSE
0
(2.0 s)
------
------
------
------
------
------
*2
42
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
43
Backup_1S
Function
• The Backup_1S function block reads parameters for the 1S-series Servo Drive at the node address
• To use this function block, you need to create in advance a directory named OM_ObjList\Drive in the
• Object lists that are provided by OMRON are installed in ‘C:\OMRON\Data\Attachement’ when
• A backup file is binary data that has the name “BackupFile_Node
• If the directory specified with DirName (Directory Name) does not exist, the function block creates a
specified with NodeAdr (Node Address) when Execute changes to TRUE and creates a backup file in
the directory specified with DirName (Directory Name) on the SD Memory Card.
root directory on the SD Memory Card and store object lists provided by OMRON in it. Be sure to
store all the object lists. Then, access the object lists to back up the parameters with this function
block.
installing libraries. Uncompress a ZIP file for an applicable series and store the files in the SD Memory Card.
.Bin”. Here, is a
slave node address in decimal (e.g., 00001 for Node 1).
new directory with the specified directory name. If DirName (Directory Name) is omitted, the function
block assumes that the root directory on the SD Memory Card is specified.
CPU Unit or Industrial PC
1S-series
Servo Drive
Parameters
SD Memory Card
Root directory
Directory: OM_ObjList
Directory: Drive
ObjList_R88D-1SN01H-ECT_Rev00010000.bin
. . . . .
EtherCAT
Directory: DirName
BackupFile_Node00001.bin
Node1 Node10Node100
44
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Backup_1S
Execute
Done
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
#0000
#00000000#00000000#00000000#00000000
#0000#0000#0000
Execute
Done
Done
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
#0000
#00000000ErrorIDEx#00000000ErrorIDEx
ErrorID#0000ErrorID
Procedure
1Create a directory named OM_ObjList\Drive in the root directory on the SD Memory Card and
store all the object lists provided by OMRON in it.
2Execute the function block.
For NodeAdr (Slave Node Address), specify the node address of the backup target slave.
If necessary, set DirName (Directory Name) and TimeOut (Timeout Time).
3A backup file is created in the directory specified with DirName (Directory Name) when execu-
Timing Charts
The following figures show the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• When backup file creation is ended, Done changes to TRUE.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
•If Execute changes to FALSE before execution of the function block is ended, Done and Error are
•If Execute remains TRUE even after execution of the function block is ended, the output values of
tion of the function block is ended.
Busy (Executing) changes to FALSE.
You can find out the cause of the error by accessing the values output to ErrorID (Error Code) and
ErrorIDEx (Expansion Error Code).
TRUE only for one task period after execution of the function block is ended.
Done and Error are held.
Timing Chart for Normal End
Timing Chart for Error End
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
45
Backup_1S
Related System-defined Variables
NameMeaningData typeDescription
_Card1Ready
_EC_MBXSlavTbl
*1. The valid is 192 for NJ-series CPU Units.
SD Memory Card
Ready Flag
Message Communications Enabled Slave
Ta bl e
BOOL
Array[1..512
*1
] OF BOOL
TRUE when the SD Memory Card is
recognized. It is FALSE when the SD
Memory Card is not recognized.
TRUE: Can be used.
FALSE: Cannot be used.
This table indicates the slaves that
can perform message communications. Slaves are given in the table in
the order of slave node addresses.
TRUE: Message communications
are possible.
FALSE: Message communications
are not possible.
Additional Information
• An object list is binary data that stores, by the revision number of EtherCAT slaves, SDO parameter
information (Index, Subindex, and Complete Access) for the backup target parameters.
• For information on the characters that can be used in DirName, refer to Specifications of Supported SD Memory Cards, Folders, and Files in the software user’s manual.
• In backup or restore processing, the value of SdoBusy is TRUE when data objects are being sent.
The value of SdoBusy is FALSE when data objects are not being sent due to the internal processing
of the function block.
• If you turn OFF the power supply to the 1S-series Servo Drive when replacing a 1S-series Servo
Drive or when applying the restored parameters, an EtherCAT slave communications error will occur.
• The EtherCAT slave communications error does not occur, if you perform EtherCAT slave disconnection before turning OFF the power supply to the 1S-series Servo Drive.
• Refer to Objects to Back up and Restore on page 96 for details on the objects to back up and restore.
46
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of Execute changes to FALSE or the execution time exceeds the task period. The value of Done changes to
TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes one EC_CoESDORead instruction within the part. Refer to the
EC_CoESDORead instruction in the instructions reference manual for the maximum number of
instructions that can be executed at the same time.
• This function block executes one FileWriteVar instruction within the part. Refer to the FileWriteVar instruction in the instructions reference manual for the maximum number of instructions that can be
executed at the same time.
• Do not change the names and the contents of any object list.
• If the Servo Drive is assigned to the Motion Control Function Module, make sure that the Axis Disabled (_MC_AX[***].Status.Disabled) in the Axis Variable is TRUE before you execute the function
block.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the EtherCAT communications until the processing for this function block ends normally or ends in an error.
• Sample programming shows only the portion of a program that uses the function or function block
from the library.
• When using sample programming in actual devices, also program safety circuits, device interlocks,
I/O with other devices, and other control procedures.
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
• An error will occur in the following cases. Error will change to TRUE.
a) No object list exists.
b) The EtherCAT master is not in a state that allows message communications.
c) The slave specified with NodeAdr does not exist.
d) The slave specified with NodeAdr is not in a state that allows communications.
e) The slave is not in a state that allows reading of parameters.
f) The number of EtherCAT communications instructions such as EC_CoESDORead exceeded the
maximum number of instructions that can be executed at the same time.
h) The number of SD Memory Card related instructions such as FileWriteVar exceeded the maxi-
mum number of instructions that can be executed at the same time.
Backup_1S
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
47
Backup_1S
Troubleshooting
Error code
16#000016#00000000Normal End-----16#040016#00000000Input Value Out
16#140016#00000000SD Memory
16#140116#00000000SD Memory
16#140216#00000000SD Memory
16#140316#00000000File Does Not
16#140516#00000000File Already in
16#140916#00000000That File Name
16#140A16#00000000Write Access
16#140B16#00000000Too Many Files
Expansion
error code
StatusDescriptionCorrection
of Range
The value of NodeAdr is out of
range.
The directory name specified
Set the value of NodeAdr correctly.
Set DirName correctly.
with DirName contains one or
more characters that cannot be
used.
The directory name specified
with DirName is too long.
Check the length of the direc-
tory name specified with Dir-
Name and set it to within the
valid range.
Insert an SD Memory Card cor-
rectly.
Replace the SD Memory Card
with one that operates nor-
Card Access
Failure
An SD Memory Card is either
not inserted or is not inserted
properly.
The SD Memory Card is broken.
mally.
The SD Memory Card slot is
broken.
If this error persists even after
making the above two correc-
tions, replace the CPU Unit or
the Industrial PC.
Remove write protection from
the SD Memory Card. Slide the
small switch on the side of the
Card Write-protected
An attempt was made to write
to a write-protected SD Memory Card.
SD Memory Card from the
LOCK position to the writable
position.
Card Insufficient
Capacity
The SD Memory Card ran out
of free space.
Replace the SD Memory Card
for one with sufficient available
capacity.
Object lists are not stored.Check the SD Memory Card
Exist
and store correct object lists on
it.
Correct the user program so
that this function block is exe-
cuted only when the Busy out-
put variable for all other
Use
An instruction attempted to
read or write a file already
being accessed by another
instruction.
instructions for the same file is
FALSE.
Change the directory in which
to store the backup file. Or,
delete the existing backup file
Already Exists
The backup file exists on the
SD Memory Card when Over-Write is FALSE.
in advance.
Remove write protection from
the file or directory specified for
the function block. Or, change
Denied
The file or directory specified
for the function block to write is
write-protected.
the file name of the file to write.
Correct the user program to
decrease the number of open
files.
Open
The maximum number of open
files was exceeded when opening a file for the function block.
48
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Backup_1S
Error code
16#140E16#00000000SD Memory
16#180016#00000000EtherCAT Com-
16#180116#00000000EtherCAT Slave
16#180216#00000000EtherCAT Time-
16#180316#00000000Reception Buf-
16#1804SDO Abort
16#180816#00000000Communica-
16#3C2D16#00000001VendorID Not
*1. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort codes.
Expansion
error code
*1
Code
16#00000002ProductCode
16#00000003Unsupported
StatusDescriptionCorrection
Card Access
Failed
munications
Error
Does Not
Respond
out
fer Overflow
SDO Abort ErrorThe cause of this error
tions Resource
Overflow
Matched
Not Matched
Device
The SD Memory Card is broken.
The SD Memory Card slot is
broken.
The EtherCAT network is not in
a usable status.
The target slave does not exist. Specify an existing node
The target slave is not in an
operating condition.
Communications with the target
slave timed out.
The receive data from an EtherCAT slave overflowed the
receive buffer.
depends on the specifications
of the EtherCAT slave.
More than 32 EtherCAT communications instructions were
executed at the same time.
The VendorID in object lists
does not match the VendorID of
the backup target node.
The ProductCode in object lists
does not match the ProductCode of the backup target
node.
The device is not supported by
this function block.
Replace the SD Memory Card.
If this error occurs even after
making the above correction,
replace the CPU Unit or the
Industrial PC.
Check the operation status of
the EtherCAT network by
checking the status of the EtherCAT master. Use this information to correct the cause of
the problem.
address.
Check the status of the target
EtherCAT slave. Make sure
that the target slave is in a
usable status.
Check the operating status of
the target slave and correct the
cause of the problem.
Set the size of the reception
buffer to a value larger than the
size of the receive data from
the slave.
Refer to the manual for the EtherCAT slave and correct the
problem.
Correct the user program so
that no more than 32 EtherCAT
communications instructions
are executed at the same time.
Use object lists that match the
VendorID of the backup target
node.
Use object lists that match the
ProductCode of the backup target node.
Check that the specified device
is a 1S-series Servo Drive.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
49
Backup_1S
Sample Programming
This sample programming backs up and then restores parameters for a Servo Drive.
Conditions
• The target 1S-series Servo Drive is Node 1.
• The target 1S-series Servo Drive is assigned to axis 0 in the Motion Control Function Module.
• The backup file is created in the TestDir directory.
• The backup file is write-protected (default).
• The timeout time is 2 s (default).
Backup Processing
1Make sure that the target slave is in a state that allows communications, that axis 0 is disabled,
that the same instance is not being executed, and that parameters are not being restored to the
same node.
2Execute BACKUP_1S_instance.
Restore Processing
1Make sure that the Servo is OFF for axis 0 and disconnect the target slave from the network.
2Turn OFF the power supply to the target slave and replace the target slave.
3Connect the target slave to the network again.
4Make sure that the target slave is in a state that allows communications, that axis 0 is disabled,
that the same instance is not being executed, and that parameters are not being backed up from
the same node.
5Execute RESTORE_1S_instance.
6After completion of the restore processing, disconnect the target slave from the network, cycle
the control power supply to the target slave, and connect the target slave to the network again.
50
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
BackupOperatingBOOLFALSEBackup processing
RestoreOperatingBOOLFALSERestore processing
BackupOperatingStartBOOLFALSEBackup processing started
RestoreOperatingStartBOOLFALSERestore processing started
Value of BackupTrigger from
previous task
Value of RestoreTrigger from
previous task
External Variables
VariableData typeConstantComment
_EC_MBXSlavTbl
ARRAY[1..N
*1
] OF BOOL
_Card1ReadyBOOLSD Memory Card Ready Flag
*1. N = 192 for NJ501, NJ301 and NJ101. N = 512 for NX701.
// Backup and Resotre parameters setting.
IF InitTrigger=FALSE THEN
TargetSlave:=UINT#1;
TargetDirectory:='TestDir';
TargetTimeOut:=UINT#0;
InitTrigger:=TRUE;
END_IF;
// Detect when BackupTrigger changes to TRUE.
IF ( (BackupTrigger=TRUE) AND (BackupLastTrigger=FALSE) AND (_EC_MBXSlavTbl[TargetSlave]=TRUE) AND
(_Card1Ready=TRUE) AND (BackupBusy=FALSE) AND
(RestoreBusy=FALSE) ) THEN
BackupOperatingStart:=TRUE;
BackupOperating :=TRUE;
END_IF;
BackupLastTrigger:=BackupTrigger;
// Initialize Backup_1S instruction.
IF (BackupOperatingStart=TRUE) THEN
BACKUP_1S_instance(
Execute :=FALSE);
BackupOperatingStart:=FALSE;
END_IF;
// Execute Backup_1S instruction.
IF (BackupOperating=TRUE) THEN
BACKUP_1S_instance(
Message Communications Enabled Slave
Ta bl e
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
53
Backup_1S
Execute :=TRUE,
NodeAdr:=TargetSlave,
DirName:=TargetDirectory,
OverWrite:=FALSE,
TimeOut:=TargetTimeOut,
Busy=>BackupBusy);
IF (BACKUP_1S_instance.Done=TRUE) THEN
// Processing after normal end.
BackupOperating:=FALSE;
END_IF;
IF (BACKUP_1S_instance.Error=TRUE) THEN
// Processing after error end.
BackupOperating:=FALSE;
END_IF;
END_IF;
// Detect when RestoreTrigger changes to TRUE.
IF ( (RestoreTrigger=TRUE) AND (RestoreLastTrigger=FALSE) AND (_EC_MBXSlavTbl[TargetSlave]=TRUE) AND
(_Card1Ready=TRUE) AND (BackupBusy=FALSE) AND
(RestoreBusy=FALSE) ) THEN
RestoreOperatingStart:=TRUE;
RestoreOperating :=TRUE;
END_IF;
RestoreLastTrigger:=RestoreTrigger;
// Initialize Restore_1S instruction.
IF (RestoreOperatingStart=TRUE) THEN
RESTORE_1S_instance(
Execute :=FALSE);
RestoreOperatingStart:=FALSE;
END_IF;
// Execute Restore_1S instruction.
IF (RestoreOperating=TRUE) THEN
RESTORE_1S_instance(
Execute :=TRUE,
NodeAdr:=TargetSlave,
DirName:=TargetDirectory,
NoProductChk:=FALSE,
TimeOut:=TargetTimeOut,
Busy=>RestoreBusy);
IF (RESTORE_1S_instance.Done=TRUE) THEN
// Processing after normal end.
RestoreOperating:=FALSE;
END_IF;
IF (RESTORE_1S_instance.Error=TRUE) THEN
// Processing after error end.
RestoreOperating:=FALSE;
END_IF;
END_IF;
54
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Restore_1S
TimeOut
NodeAdr
DirName
NoProductChk
Execute
Restore_1S_instance
\\OmronLib\EC_1S
\Restore_1S
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
Done
The Restore_1S function block restores the backup file(s) created by the Backup_1S function block on
Function block
Restore_1S1S-series Servo
the SD Memory Card inserted in the Controller to a 1S-series Servo Drive.
Library file nameOmronLib_EC_1S_V2_0.slr
NamespaceOmronLib\EC_1S
Function block and function number00044
Source code published/not publishedNot published
Function block and function version1.00
Compatible Models
ItemNameModel numbersVe rsio n
Device1S-series Servo DriveR88D-1SN-ECTVersion 1.00 or later
R88D-1SAN-ECT
SD Memory CardHMC-SD
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
55
Restore_1S
Variables
NameMeaningI/ODescriptionVa lid ra ngeUnitDefault
TRUE: Executes the instruction.
ExecuteExecuteInput
FALSE: Does not execute the
instruction.
NodeAdr
Slave Node
Address
InputSpecifies the node address.
Specifies the directory on the SD
DirNameDirectory NameInput
Memory Card. The backup file(s)
stored in this directory will be
restored.
Specifies whether or not to execute restore when the product
code in the backup data differs
NoProductChk
Product Code
Check
Input
from the product code of the
restore destination.
TRUE: Executes restore.
FALSE: Prohibits restore.
TimeOutTimeout TimeInput
0: 2.0 s
1 to 65535: 0.1 to 6553.5 s
TRUE: Normal end
DoneDoneOutput
FALSE: Error end, execution in
progress, or execution condition
not met
TRUE: Execution processing is in
BusyExecutingOutput
progress.
FALSE: Execution processing is
not in progress.
This flag is TRUE when an SDO
communications command is
sent to a 1S-series Servo Drive.
SdoBusy
Processing Sdo
Communications
Output
TRUE: Error end
ErrorErrorOutput
FALSE: Normal end, execution in
progress, or execution condition
not met
This is the error ID for an error
ErrorIDError CodeOutput
end.
The value is WORD#16#0 for a
normal end.
This is the error ID for an Expan-
ErrorIDEx
Expansion Error
Code
Output
sion Unit Hardware Error.
The value is DWORD#16#0 for a
normal end.
*1. The valid range is 1 to 192 for NJ-series CPU Units.
*2. If DirName is omitted, this specifies the root directory on the SD Memory Card.
*3. You can use it to identify that communications processing is in progress.
*4. For details, refer to Troubleshooting on page 62.
TRUE or
FALSE
1 to 512
*1
40 bytes max.---
TRUE or
FALSE
0 to 655350.1 s
TRUE or
FALSE
TRUE or
FALSE
TRUE or
FALSE
*3
TRUE or
FALSE
*4
*4
---FALSE
---1
''
---FALSE
0
(2.0 s)
------
------
------
------
------
------
*2
56
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
57
Restore_1S
CPU Unit or Industrial PC
BackupFile_Node00001.bin
BackupFile_Node00010.bin
BackupFile_Node00100.bin
EtherCAT
SD Memory Card
Root directory
Directory: DirName
1S-series
Servo Drive
Node1Node10Node100
Parameters
Function
• When Execute changes to TRUE, the Restore_1S function block restores the backup file(s) in the
• Before you restore a file, use the Backup_1S function block to create one or more backup files.
• The backup file stored at the node address specified with NodeAdr (Node Address) is the restore tar-
• If DirName (Directory Name) is omitted, the function block assumes that the root directory on the SD
• This function block will perform restore if the revision of the backup source device is either the same
• To restore backup data to a node at a different node address from that of the backup source device,
• To restore backup data when the model of the backup source device differs from the model of the
directory specified with DirName (Directory Name) on the SD Memory Card to the 1S-series Servo
Drive specified with NodeAdr (Node Address).
get. For example, if NodeAdr is UINT#1, the file “BackupFile_Node00001.Bin” is the restore target.
Memory Card is specified.
as or older than the revision of the restore destination device. If the revision of the backup source
device is newer than the revision of the restore destination device, an error will occur.
change the node address portion of the backup file name to the node address of the restore destination device.
restore destination device, set NoProductChk to TRUE. This enables you to execute restore even if
you change the model of your Servo Drive. If the parameters in the backup file do not exist in the
restore destination device, an SDO Abort error will occur.
Procedure
58
1Execute the function block.
For NodeAdr (Slave Node Address), specify the node address of the restore target slave.
If necessary, set DirName (Directory Name) and TimeOut (Timeout Time).
2The backup file in the directory specified with DirName (Directory Name) is restored to the
1S-series Servo Drive when execution of the function block is ended.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Restore_1S
Execute
Done
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
#0000
#00000000#00000000# 00000000#00000000
#0000#0000#0000
Execute
Done
Done
Busy
SdoBusy
Error
ErrorID
ErrorIDEx
#0000
#00000000ErrorIDEx#00000000ErrorIDEx
ErrorID#00 00ErrorID
Timing Charts
The following figures show the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• Done changes to TRUE when restore is ended.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
Busy (Executing) changes to FALSE.
You can find out the cause of the error by accessing the values output to ErrorID (Error Code) and
ErrorIDEx (Expansion Error Code).
•If Execute changes to FALSE before execution of the function block is ended, Done and Error are
TRUE only for one task period after execution of the function block is ended.
•If Execute remains TRUE even after execution of the function block is ended, the output values of Done and Error are held.
Timing Chart for Normal End
Timing Chart for Error End
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
59
Restore_1S
Related System-defined Variables
NameMeaningData typeDescription
_Card1Ready
_EC_MBXSlavTbl
*1. The valid is 192 for NJ-series CPU Units.
SD Memory Card
Ready Flag
Message Communications Enabled Slave
Ta bl e
BOOL
Array[1..512
*1
] OF BOOL
TRUE when the SD Memory Card is
recognized. It is FALSE when the SD
Memory Card is not recognized.
TRUE: Can be used.
FALSE: Cannot be used.
This table indicates the slaves that
can perform message communications. Slaves are given in the table in
the order of slave node addresses.
TRUE: Message communications
are possible.
FALSE: Message communications
are not possible.
Additional Information
• For information on the characters that can be used in DirName, refer to Specifications of Supported
SD Memory Cards, Folders, and Files in the software user’s manual.
• In backup or restore processing, the value of SdoBusy is TRUE when data objects are being sent.
The value of SdoBusy is FALSE when data objects are not being sent due to the internal processing
of the function block.
• If you turn OFF the power supply to the 1S-series Servo Drive when replacing a 1S-series Servo
Drive or when applying the restored parameters, an EtherCAT slave communications error will occur.
• The EtherCAT slave communications error does not occur, if you perform EtherCAT slave disconnection before turning OFF the power supply to the 1S-series Servo Drive.
• Refer to Objects to Back up and Restore on page 96 for details on the objects to back up and restore.
60
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of Execute changes to FALSE or the execution time exceeds the task period. The value of Done changes to
TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes one EC_CoESDOWrite instruction or one EC_CoESDORead within the
part. Refer to the EC_CoESDOWrite instruction in the instructions reference manual for the maximum number of instructions that can be executed at the same time.
• This function block executes one FileReadVar instruction within the part. Refer to the FileReadVar instruction in the instructions reference manual for the maximum number of instructions that can be
executed at the same time.
• If the Servo Drive is assigned to the Motion Control Function Module, make sure that the Axis Disabled (_MC_AX[***].Status.Disabled) in the Axis Variable is TRUE before you execute the function
block.
• After completion of Restore_1S function block, cycle the control power supply to the 1S-series Servo
Drive to apply the restored parameters.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the EtherCAT communications until the processing for this function block ends normally or ends in an error.
• Setting the NoProductChk input variable to TRUE allows you to execute restore even when the product code in the backup data differs from the product code of the restore destination. Make sure that
the restore destination is a 1S-series Servo Drive before you attempt to restore the parameters.
• An error will occur in the following cases. Error will change to TRUE.
a) The EtherCAT master is not in a state that allows message communications.
b) The slave specified with NodeAdr does not exist.
c) The slave specified with NodeAdr is not in a state that allows communications.
d) The model specified in the backup file differs from the model of the restore destination device
and NoProductChk is FALSE.
e) The slave is not in a state that allows writing of parameters.
f) The number of EtherCAT communications instructions such as EC_CoESDOWrite exceeded the
maximum number of instructions that can be executed at the same time.
g) SD Memory Card access failed (no SD Memory Card inserted, a file is being accessed, etc.).
h) The number of SD Memory Card related instructions such as FileReadVar exceeded the maxi-
mum number of instructions that can be executed at the same time.
Restore_1S
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
61
Restore_1S
Troubleshooting
Error code
16#000016#00000000Normal End-----16#040016#00000000Input Value Out
16#140016#00000000SD Memory
16#140316#00000000File Does Not
16#140516#00000000File Already in
16#140B16#00000000Too Many Files
16#140E16#00000000SD Memory
16#180016#00000000EtherCAT Com-
16#180116#00000000EtherCAT Slave
Expansion
error code
StatusDescriptionCorrection
of Range
The value of NodeAdr is out of
range.
The directory name specified
Set the value of NodeAdr correctly.
Set DirName correctly.
with DirName contains one or
more characters that cannot be
used.
The directory name specified
with DirName is too long.
Check the length of the direc-
tory name specified with Dir-
Name so that it is within the
valid range.
Insert an SD Memory Card cor-
rectly.
Replace the SD Memory Card
with one that operates nor-
Card Access
Failure
An SD Memory Card is either
not inserted or is not inserted
properly.
The SD Memory Card is broken.
mally.
The SD Memory Card slot is
broken.
If this error persists even after
making the above two correc-
tions, replace the CPU Unit or
the Industrial PC.
Specify the directory in which a
backup file exists specified in
this function block.
Correct the user program so
that this function block is exe-
cuted only when the Busy out-
put variable for all other
Exist
Use
There is no backup file to
restore in the directory specified with DirName.
An instruction attempted to
read or write a file already
being accessed by another
instruction.
instructions for the same file is
FALSE.
Correct the user program to
decrease the number of open
files.
Replace the SD Memory Card.
If this error occurs even after
making the above correction,
Open
Card Access
Failed
The maximum number of open
files was exceeded when opening a file for the function block.
The SD Memory Card is broken.
The SD Memory Card slot is
broken.
replace the CPU Unit or the
Industrial PC.
munications
Error
The EtherCAT network is not in
a usable status.
Check the operation status of
the EtherCAT network by
checking the status of the Eth-
erCAT master. Use this infor-
mation to correct the cause of
the problem.
The target slave does not exist. Specify an existing node
Does Not
Respond
The target slave is not in an
operating condition.
address.
Check the status of the target
EtherCAT slave. Make sure
that the target slave is in a
usable status.
62
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Restore_1S
Error code
16#180216#00000000EtherCAT Time-
16#180316#00000000Reception Buf-
16#1804SDO Abort
16#180816#00000000Communica-
16#3C2E16#00000001Unit Not
*1. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort codes.
Expansion
error code
*1
Code
16#00000002Backup Data
16#00000003Revision Not
16#00000004Unsupported
StatusDescriptionCorrection
out
fer Overflow
SDO Abort ErrorThe cause of this error
tions Resource
Overflow
Matched
Disabled
Matched
Device
Communications with the target
slave timed out.
The receive data from an EtherCAT slave overflowed the
receive buffer.
depends on the specifications
of the EtherCAT slave.
More than 32 EtherCAT communications instructions were
executed at the same time.
The model of the restore destination does not match the
model specified in the backup
file.
The backup file is not created
correctly.
The revision number of the
restore destination is older than
the revision number in the
backup file.
The device is not supported by
this function block.
Check the operating status of
the target slave and correct the
cause of the problem.
Set the size of the reception
buffer to a value larger than the
size of the receive data from
the slave.
Refer to the manual for the EtherCAT slave and correct the
problem.
Correct the user program so
that no more than 32 EtherCAT
communications instructions
are executed at the same time.
Set the model of the restore
destination so that it matches
the model specified in the
backup file.
Create again the backup file
correctly.
Specify the Servo Drive with a
revision number that is either
the same as or newer than the
revision number in the backup
file as the restore destination.
Check that the specified device
is a 1S-series Servo Drive.
Sample Programming
Refer to the sample programming for the following instructions: Backup_1S on page 41.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
63
MotorSetup_1S
ExecuteDone
NodeAdrBusy
TimeOutError
ErrorID
ErrorIDEx
MotorSetup_1S_instance
\\OmronLib\EC_1S\MotorSetup_1S
MotorSetup_1S
The MotorSetup_1S function block resets the Motor Replacement Detected (Error No. 95.05) for a
Function block
MotorSetup_1SReset the Motor
1S-series Servo Drive.
name
Replacement
Detected
Name
FB/
FUN
FBMotorSetup_1S_instance(
Graphic expressionST expression
Execute,
NodeAdr,
TimeOut,
Done,
Busy,
Error,
ErrorID,
ErrorIDEx);
Library Information
ItemDescription
Library file nameOmronLib_EC_1S_V2_0.slr
NamespaceOmronLib\EC_1S
Function block and function number00173
Source code published/not publishedNot published
Function block and function version1.00
Compatible Models
ItemNameModel numbersVe r sion
Device1S-series Servo Drive
R88D-1SN-ECT
R88D-1SAN-ECT
Version 1.00 or later
64
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
MotorSetup_1S
Variables
NameMeaningI/ODescriptionValid rangeUnitDefault
TRUE: Executes the instruction.
ExecuteExecuteInput
FALSE: Does not execute the
instruction.
NodeAdr
Slave Node
Address
Input
TimeOutTimeout TimeInput
Specifies the node address for
resetting.
0: 2.0s
1 to 65535: 0.1 to 6553.5s
TRUE: Normal end
DoneDoneOutput
FALSE: Error end, execution in
progress, or execution condition
not met
TRUE: Execution processing is in
BusyExecutingOutput
progress.
FALSE: Execution processing is
not in progress.
TRUE: Error end
ErrorErrorOutput
FALSE: Normal end, execution in
progress, or execution condition
not met
This is the error ID for an error
ErrorIDError CodeOutput
end.
The value is WORD#16#0 for a
normal end.
This is the error ID for an
ErrorIDEx
Expansion Error
Code
Output
Expansion Unit Hardware Error.
The value is DWORD#16#0 for a
normal end.
*1. The valid range is 1 to 192 for NJ-series CPU Units.
*2. For details, refer to Troubleshooting on page 68
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
65
MotorSetup_1S
Function
This function block resets the Motor Replacement Detected for the specified Servo Drive. Use this
function block when the Motor Replacement Detected (Error Display No. 95.05) occurs because of
replacing a Servo Drive or a Servomotor.
You cannot reset The Motor Replacement Detected only this function block. When this function block
changes done, you need execute the Unit Restart or cycle the control power supply of the Servo Drive.
After sending the reset command to the Servo Drive, this function block waits for the response only for
the time specified with TimeOut (Timeout). It waits that the reset process ends after receiving the
response from the Servo Drive. This function block becomes Normal End when the reset process ends,
Done changes to TRUE.
This function block becomes Error End when the reset process does not end within one minute, Error
changes to TRUE.
Timing Charts
The following figures show the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• Done changes to TRUE when the reset process is ended.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
Busy (Executing) changes to FALSE. You can find out the cause of the error by accessing the values
output to ErrorID (Error Code) and ErrorIDEx (Expansion Error Code).
• If Execute changes to FALSE before execution of the function block is ended, Done and Error are
TRUE only for one task period after execution of the function block is ended.
• If Execute remains TRUE even after execution of the function block is ended, the output values of
Done and Error are held.
Timing Chart for Normal End
Scan
Execute
Busy
Done
Error
ErrorID
ErrorIDEx
1234567891011
#0000
#00000000#00000000#00000000#00000000
Timing Chart for Error End
Scan
Execute
Busy
Done
Error
ErrorID
1234567891011
#0000
#0000#0000#0000
ErrorID#00 00ErrorID
66
ErrorIDEx
#00000000ErrorIDEx#00000000ErrorIDEx
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Additional Information
• This function block resets the Motor Replacement Detected by writing 7465 736d hex to the object of
servo parameter Index: 4410 hex/Subindex:F1 hex (Motor Setup) with SDO mailbox communications.
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of
Execute changes to FALSE or the execution time exceeds the task period. The value of Done
changes to TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes one EC_CoESDOWrite instruction or one EC_CoESDORead
instruction within the part. Refer to the EC_CoESDOWrite instruction in the instructions reference
manual for the maximum number of instructions that can be executed at the same time.
• Execute the function block while the Servo is OFF.
• Make sure that the Servo Drive is a compatible model before executing this function block.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the
EtherCAT communications until the processing for this function block ends normally or ends in an
error.
• Sample programming shows only the portion of a program that uses the function or function block
from the library.
• When using sample programming in actual devices, also program safety circuits, device interlocks,
I/O with other devices, and other control procedures.
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
• An error will occur in the following cases. Error will change to TRUE.
a) The EtherCAT master is not in a state that allows message communications.
b) The slave specified with NodeAdr does not exist.
c) The slave specified with NodeAdr is not in a state that allows communications.
d) The slave is not in a state that allows writing of parameters.
e) The number of EtherCAT communications instructions such as EC_CoESDOWrite and
EC_CoESDORead exceeded the maximum number of instructions that can be executed at the
same time.
MotorSetup_1S
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
67
MotorSetup_1S
Troubleshooting
Error code
16#000016#00000000Normal End-----16#040016#00000000Input Value Out
16#180016#00000000EtherCAT
16#180116#00000000EtherCAT Slave
16#180216#00000000EtherCAT
16#180316#00000000Reception Buffer
16#1804SDO Abort
16#180816#00000000Communications
16#3CEE16#00000001VendorID Not
16#3CEE16#00000003Reset FailureThe Motor Replacement
16#3CEE16#00000004Unsupported
*1. An SDO abort code is shown here. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort
codes.
Expansion
error code
*1
Code
StatusDescriptionCorrection
of Range
Communications
Error
The value of NodeAdr is out
of range.
The EtherCAT network is not
in a usable status.
Set the value of NodeAdr
correctly.
Check the operation status of the
EtherCAT network by checking
the status of the EtherCAT master.
Use this information to correct the
cause of the problem.
Does Not
Respond
The target slave does not
exist.
The target slave is not in an
operating condition.
Specify an existing node address.
Check the status of the target
EtherCAT slave. Make sure that
the target slave is in a usable
status.
Timeout
Communications with the
target slave timed out.
Check the operating status of the
target slave and correct the cause
of the problem.
The receive data from an
Overflow
EtherCAT slave overflowed
the receive buffer.
SDO Abort ErrorThe cause of this error
depends on the
specifications of the
Set the size of the reception buffer
to a value larger than the size of
the receive data from the slave.
Refer to the manual for the
EtherCAT slave and correct the
problem.
EtherCAT slave.
Correct the user program so that
no more than 32 EtherCAT
communications instructions are
executed at the same time.
Check that the specified device is
a 1S-series Servo Drive.
Resource
Overflow
Matched
More than 32 EtherCAT
communications instructions
were executed at the same
time.
The device is not supported
by this function block (A
non-OMRON device is
specified).
Execute the function block again.
Detected resetting was not
completed within one
minute.
Device
The device is not supported
by this function block.
Check that the specified device is
a 1S-series Servo Drive.
68
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Sample Programming
MotorSetup_1S
Conditions
This sample programming resets the Motor Replacement Detected for a Servo Drive.
• The target Servo Drive is Node 1.
• The target Servo Drive is assigned to axis 0 in the Motion Control Function Module.
• The timeout time is 2 s (default).
• The Motor Replacement Detected (Error No. 95.05) has been occurring by replacement of
Servomotor or Servo Drive.
Processing
1Make sure that the Motor Replacement Detected (Error No. 95.05) occurs, the target slave is in
a state that allows communications, that axis 0 is disabled.
2For reset the Motor Replacement Detected, execute MOTORSETUP_1S_instance.
3For restart Servo Drive, execute RESTART_1S_instance.
4For reset the EtherCAT Slave Communications Error, execute ResetECError and
R_TRIG_instance (Clk:=EC_COESDOREAD_instance.Done);
//Read all occurring Minor Faults.
EC_COESDOREAD_instance(
Execute:=Trigger,
NodeAdr:=UINT#1,
SdoObj:=SysmacMinorFault,
ReadDat:=ReadDat);
IF R_TRIG_instance.Q THEN
FOR i:=0 TO 4 BY 1 DO
AryByteTo(ReadDat[2+12*i],UINT#4,_eBYTE_ORDER#_LOW_HIGH,ErrorCodes[i]);
END_FOR;
IsMotorReplacementDetected := ArySearch(
In:=ErrorCodes[0],
Size:=UINT#5,
Key:=UDINT#16#387C0000,
InOutPos:=FoundPos);
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
71
MotorSetup_1S
END_IF;
//Only when the 'Motor Replacement Detected' has occurred, execute the MotorSetup_1S.
MOTORSETUP_1S_instance(
Execute:=R_TRIG_instance.Q AND IsMotorReplacementDetected,
NodeAdr:=UINT#1);
RESTART_1S_instance(
Execute:=MOTORSETUP_1S_instance.Done,
NodeAdr:=UINT#1);
//When the unit restart is complete, execute ResetMCError and ResetECError.
RESETECERROR_instance(Execute:=RESTART_1S_instance.Done);
RESETMCERROR_instance(Execute:=RESETECERROR_instance.Done);
//It is a success if neither ECError nor MCError occurs.
IsSuccess:= NOT GetECError() AND NOT GetMCError();
72
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Restart_1S
ExecuteDone
NodeAdrBusy
TimeOutError
ErrorID
ErrorIDEx
Restart_1S_instance
\\OmronLib\EC_1S\Restart_1S
Restart_1S
Function block
name
Name
Restart_1S1S-series Servo
FB/
FUN
Graphic expressionST expression
FBRestart_1S_instance(
Drive Restart
Library Information
ItemDescription
Library file nameOmronLib_EC_1S_V2_0.slr
NamespaceOmronLib\EC_1S
Function block and function number00174
Source code published/not publishedNot published
Function block and function version1.00
The Restart_1S function block restarts a 1S-series Servo Drive.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Execute
Scan
Busy
Done
Error
ErrorID
ErrorIDEx
#0000
1234567891011
#00000000#00000000#00000000#00000000
#0000#0000#0000
1234567891011
Execute
Scan
Busy
Done
Error
ErrorID
ErrorIDEx
#0000
#00000000ErrorIDEx#00000000ErrorIDEx
ErrorID#00 00ErrorID
Function
This function block executes unit restart for the specified Servo Drive.
Use this function block when you need the Unit Restart such as cases after the absolute encoder initialization or the Motor Replacement Detected resetting.
After sending the unit restart command to the Servo Drive, this function block waits for the response
only for the time specified with TimeOut (Timeout). After the function block receives the response from
the Servo Drive, it waits that the Servo Drive re-start is done. This function block becomes Normal End
when the Unit Restart completes, Done changes to TRUE.
Timing Charts
The following figures show the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• Done changes to TRUE when the Unit Restart completes.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
• If Execute changes to FALSE before execution of the function block is ended, Done and Error are
• If Execute remains TRUE even after execution of the function block is ended, the output values of
Restart_1S
Busy (Executing) changes to FALSE. You can find out the cause of the error by accessing the values
output to ErrorID (Error Code) and ErrorIDEx (Expansion Error Code)
TRUE only for one task period after execution of the function block is ended.
Done and Error are held.
Timing Chart for Normal End
Timing Chart for Error End
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
75
Restart_1S
Additional Information
• This function block restarts Servo Drive by writing 7465 7365 7261 hex to the object of servo parameter Index:2400 hex Subindex:01 hex (Unit Restart) with SDO mailbox communications.
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of
Execute changes to FALSE or the execution time exceeds the task period. The value of Done
changes to TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes one EC_CoESDOWrite instruction or one EC_CoESDORead
instruction within the part. Refer to the EC_CoESDOWrite instruction in the instructions reference
manual for the maximum number of instructions that can be executed at the same time.
• Execute the function block while the Servo is OFF.
• Make sure that the Servo Drive is a compatible model before executing this function block.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the
EtherCAT communications until the processing for this function block ends normally or ends in an
error.
• If the specified Servo Drive is assigned to an Axis Variable, the EtherCAT Slave Communication
Error Occurs after this function block execution. To reset it, execute ResetMCError or MC_Reset.
• After the initialization process completes, the Servo Drive is not in a state that allows message
communications. To start message communications, execute the ResetECError.
• An error will occur in the following cases. Error will change to TRUE.
a) The EtherCAT master is not in a state that allows message communications.
b) The slave specified with NodeAdr does not exist.
c) The slave specified with NodeAdr is not in a state that allows communications.
d) The slave is not in a state that allows writing of parameters.
e) The number of EtherCAT communications instructions such as EC_CoESDOWrite exceeded the
maximum number of instructions that can be executed at the same time.
76
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Restart_1S
Troubleshooting
Error code
16#000016#00000000Normal End-----16#040016#00000000Input Value Out
16#180016#00000000EtherCAT
16#180116#00000000EtherCAT Slave
16#180216#00000000EtherCAT
16#180316#00000000Reception Buffer
16#1804SDO Abort
16#180816#00000000Communications
16#3CEF16#00000001VendorID Not
16#3CEF16#00000004Unsupported
*1. An SDO abort code is shown here. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort
codes.
Expansion
error code
*1
Code
StatusDescriptionCorrection
of Range
Communications
Error
The value of NodeAdr is out
of range.
The EtherCAT network is not
in a usable status.
Set the value of NodeAdr
correctly.
Check the operation status of the
EtherCAT network by checking
the status of the EtherCAT master.
Use this information to correct the
cause of the problem.
Does Not
Respond
The target slave does not
exist.
The target slave is not in an
operating condition.
Specify an existing node address.
Check the status of the target
EtherCAT slave. Make sure that
the target slave is in a usable
status.
Timeout
Communications with the
target slave timed out.
Check the operating status of the
target slave and correct the cause
of the problem.
The receive data from an
Overflow
EtherCAT slave overflowed
the receive buffer.
SDO Abort ErrorThe cause of this error
depends on the
specifications of the
Set the size of the reception buffer
to a value larger than the size of
the receive data from the slave.
Refer to the manual for the
EtherCAT slave and correct the
problem.
EtherCAT slave.
Correct the user program so that
no more than 32 EtherCAT
communications instructions are
executed at the same time.
Check that the specified device is
a 1S-series Servo Drive.
Resource
Overflow
Matched
More than 32 EtherCAT
communications instructions
were executed at the same
time.
The device is not supported
by this function block (A
non-OMRON device is
specified).
Device
The device is not supported
by this function block.
Check that the specified device is
a 1S-series Servo Drive.
Sample Programming
Refer to Sample Programming of MotorSetup_1S on page 64
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
77
EasyTuning_1S
Abort
NodeAdr
TuningCriteria
SaveToEEPROM
Execute
EasyTuning_1S_instance
\\OmronLib\EC_1S_EasyTuning\EasyTuning_1S
TuningResults
Busy
CommandAborted
Error
ErrorID
Done
ErrorIDEx
EasyTuning_1S
The EasyTuning_1S function block tunes an axis by executing the easy tuning for a 1S-series Servo
Library file nameOmronLib_EC_1S_EasyTuning_V1_0.slr
NamespaceOmronLib\EC_1S_EasyTuning
Function block and function number00236
Source code published/not publishedNot published
Function block and function version1.00
Compatible Models
ItemNameModel numbersVe r sion
Device1S-series Servo Drive
R88D-1SN-ECT
R88D-1SAN-ECT
Version 1.00 or later
78
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
EasyTuning_1S
Variables
NameMeaningI/ODescriptionValid rangeUnitDefault
TRUE: Executes the instruction.
ExecuteExecuteInput
FALSE: Does not execute the
instruction.
NodeAdr
Tuning
Criteria
Slave Node
Address
Input
Tuning criteriaInput
Node address of the Servo Drive
to tune gain parameters
Tuning methods and criteria
inputs
TRUE: Saves results to
SaveToEE
PROM
Save to EEPROM Input
EEPROM.
FALSE: Does not save results to
EEPROM.
TRUE: Aborts the execution.
AbortAbortInput
FALSE: Does not abort the
execution.
TRUE: Normal end
DoneDoneOutput
FALSE: Error end, execution in
progress, or execution condition
not met
FALSE: Normal end, execution in
progress, or execution condition
not met
This is the error ID for an error
ErrorIDError CodeOutput
end.
The value is WORD#16#0 for a
normal end.
This is the error ID for an
ErrorIDEx
Expansion Error
Code
Output
Expansion Unit Hardware Error.
The value is DWORD#16#0 for a
normal end.
*1. The valid range is 1 to 192 for NJ-series CPU Units.
*2. For details, refer to Troubleshooting on page 87
Depends on
data type.
1 to 512
*1
---FALSE
---1
---------
Depends on
data type.
Depends on
data type.
Depends on
data type.
Depends on
data type.
---FALSE
---FALSE
---
---
Depends on
data type.
Depends on
data type.
*2
*2
---
---
---
---
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
79
EasyTuning_1S
Structures
The data type of the TuningCriteria input variable to this function block is
OmronLib\EC_1S_EasyTuning\sTUNING_CRITERIA. The table below gives the specifications.
NameMeaningDescriptionData Type
TuningCriteriaTuning criteriaOmronLib\EC_1S_
EstimateInertia
Ratio
Compensate
Friction
Compensate
UnbalancedLoad
AdjustNotchFilterAdjust Notch
ObtainBest
StabilizationTime
Update
Estimated
Inertia Ratio
Update
Compensate
Friction
Update
Compensate
Unbalanced
Load
Filter
Obtain Best
Stabilization
Time
TRUE: The amount of load inertia is
automatically estimated and the
setting of Inertia Ratio (3001 hex - 01
hex) is updated based on the result.
FALSE: The Drive's present setting of
Inertia Ratio (3001 hex - 01 hex) is
maintained.
TRUE: The load friction is
automatically estimated and the torque
compensation settings (Viscous
Friction Coefficient (3310 hex - 01
hex), Positive Dynamic Friction
Compensation (3310 hex - 03 hex),
and Negative Dynamic Friction
Compensation (3310 hex - 04 hex))
are updated based on the result.
FALSE: The torque compensation
values (Viscous Friction Coefficient
(3310 hex - 01 hex), Positive Dynamic
Friction Compensation (3310 hex - 03
hex), and Negative Dynamic Friction
Compensation (3310 hex - 04 hex))
are set to 0 to disable the friction
compensation.
TRUE: The amount of unbalanced
load is automatically estimated and
the setting of the torque compensation
value (Unbalanced Load
Compensation (3310 hex - 02 hex))
are updated based on the result.
FALSE: The torque compensation
value (Unbalanced Load
Compensation (3310 hex - 02 hex)) is
set to 0 to disable the friction
compensation.
TRUE: The resonance frequency of
the load is automatically estimated
and the settings of Notch Filters (3321
hex to 3324 hex) are updated based
on the result. After the tuning,
Adaptive Notch Filter (3320 hex - 01
hex) is set to Disabled. FALSE: The
Drive's present settings of Adaptive
Notch Filter (3320 hex - 01 hex) and
Notch Filters (3321 hex to 3324 hex)
are maintained.
TRUE: Although vibration occurs while
auto tuning is being performed, the
function block automatically sets the
stabilization time as short as possible
within the range that does not cause
micro vibration in the Drive.
FALSE: Set the stabilization time that
is applied as the tuning completion
condition.
EasyTuning\
sTUNING_
CRITERIA
BOOLDepends
BOOLDepends
BOOLDepends
BOOLDepends
BOOLDepends
Valid
range
------
on data
type
on data
type.
on data
type.
on data
type.
on data
type.
UnitDefault
---TRUE
---TRUE
---TRUE
---TRUE
---FALSE
80
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
EasyTuning_1S
NameMeaningDescriptionData Type
StabilizationTimeStabilization
Time Criterion
VibrationLevelVibration
Detection
Level Criterion
PositionWindowPosition
Window
FocusOnOvershoot Focus on
Overshoot
LinearMovement
Interpolation
Linear
Movement
Interpolation
Stabilization Time Criterion if
ObtainBestStabilizationTime is FALSE.
This parameter is not used if
ObtainBestStabilizationTime is TRUE.
Adjust the gain so that the torque
vibration does not exceed this setting
value. Set the percentage to the rated
torque of the motor.
Set the in-position width used for
measuring the stabilization time. This
setting value is applied to the
Positioning Completion Notification Positioning Window (3B51 hex - 01
hex).
TRUE: Focus on overshoot
suppression
Priority is given to suppression of
overshoot in the tuning.
FALSE: Focus on positioning
Priority is given to reducing the
stabilization time. Depending on the
device and tuning conditions,
overshoot may occur.
TRUE: Linear
1st order interpolation is applied.
FALSE: Smooth
2nd order interpolation is applied.
*1
UINTDepends
REAL0 to 500%1
UDINT1 to
BOOLDepends
BOOLDepends
*1. Available in R88D-1SAN-ECT or R88D-1SN-ECT Version 1.2 and later.
Valid
range
on data
type.
21474836
47
on data
type.
on data
type.
UnitDefault
ms100
---FALSE
---TRUE
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
81
EasyTuning_1S
The data type of the TuningResults input variable to this function block is
OmronLib\EC_1S_EasyTuning\sTUNING_RESULTS. The table below gives the specifications.
NameMeaningDescriptionData Type
TuningResultsOmronLib\EC_1S_
EasyTuning\sTUNI
NG_RESULTS
TuningStepTuning StepNumber of current Tuning step.USINT
AllTrialsAll TrialsAll measurement results.ARRAY[0..32] OF
OmronLib\EC_1S_
EasyTuning\
sTRIALS
Stabilization
Time
OvershootOvershootGives the overshoot.REALDepends
Speed
Proportional
Gain1
Position
Proportional
Gain1
Estimated
InertiaRatio
Estimated
Unbalanced
Load
Estimated
Dynamic
Friction
Estimated
ViscousFriction
CommandTimeCommand
TactTimeTact TimeGives the tact time.UDINTDepends
Command
Speed
MotorSpeedMotor SpeedGives the motor Velocity.UDINTDepends
NotchFilter
Frequency3
NotchFilter
Frequency4
FinalTrialFinal TrialGives the adopted trial number. Refer-
*1. For details, refer to TuningStep on page 84.
Stabilization
Time
Speed Proportional Gain 1
Position Proportional Gain
1
Estimated Inertia Ratio
Estimated
Unbalanced
Load
Estimated Viscous Friction
Estimated Viscous Friction
Time
Command
Speed
t
ch Filter
No
Frequency 3
Notch Filter
Frequency 4
Gives the stabilization time.UDINTDepends
Gives the 1st velocity proportional
gain.
Gives the 1st position proportional
gain.
Gives the Inertia Ratio Estimate Value. UDINTDepends
Gives the Unbalanced Load Estimate
Value.
Gives the Dynamic Friction Compensation Estimate Value.
Gives the Viscous Friction Estimate
Value.
Gives the command time.UDINTDepends
Gives the command Velocity.UDINTDepends
Gives the notch frequency of the 3rd
resonance suppression notch filter.
Gives the notch frequency of the 4th
resonance suppression notch filter.
ence only while Done is TRUE.
REALDepends
REALDepends
REALDepends
REALDepends
REALDepends
REAL50 to 5000 Hz0
REAL50 to 5000 Hz0
USINTDepends
Valid
range
---------
*1
------
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
on data
type.
UnitDefault
0
0
0
Hz0
Hz0
%0
%0
%0
%0
ms0
ms0
r/min0
r/min0
---0
82
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Bo
Name
ole
an
BOOL
Bit stringsIntegers
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
ExecuteOK
NodeAdrOK
TuningCriteriaStructure sTUNING_CRITERIA
SaveToEEPROM
OK
AbortOK
DoneOK
TuningResultsStructure sTUNING_RESULTS
BusyOK
Command
Aborted
OK
ErrorOK
ErrorIDOK
ErrorIDExOK
LINT
Real
num-
bers
REAL
EasyTuning_1S
Times, durations,
dates, and text strings
LREAL
TIME
DATE
TOD
DT
STRING
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
83
EasyTuning_1S
Function
• This function block perform the easy tuning for the 1S-series Servo Drive at the node address
specified with NodeAdr (Node Address). You can obtain a result equivalent to that of the easy tuning
performed in Setting and Tuning Wizard on Sysmac Studio. Use this function block if you want to
perform the easy tuning without Sysmac Studio.However, this function block does not support a
damping control. If you need the damping control, use Sysmac Studio.
• To perform a tuning with this function block, you need to operate an axis by motion control
instructions. Execute motion control instructions intermittently until Done changes to TRUE. The
motion control instruction must fulfill the following conditions. Otherwise, errors may occur or you
obtain invalid tuning results.
a) Instruction type: Positioning
b) Time from a motion control start to a positioning completion: Within 10 seconds
c) Time from a positioning completion to the next motion control start: 100ms or more
• You can abort tuning process by changing the value of Abort to TRUE. If this function block is
re-executed after the aborting, the tuning process performed all over again. If you need re-execute
this function block, make sure Abort is FALSE before change the value of Execute to TRUE.
• Specify parameters for tuning, using TuningCriteria.
• You can select if the tuning results are saved in a Servo Drive with SaveToEEPROM (Save to
EEPROM).
a) If an input value is TRUE, the results are saved to the EEPROM of the Servo Drive at the timing
when the value of Done changes to TRUE. If the value of CommandAborted or Error is TRUE,
the results are not saved.
b) If an input value is FALSE, the tuning results are not saved to the EEPROM of the Servo Drive. If
you cut off the power supply or execute the Unit Restart to the Servo Drive without saved, the
results are lost. If you need to save the tuning results manually, execute Store Parameters by
writing 6576 6173 hex to Index:1010 hex/Subindex:01 hex (Store Parameters) with EC_CoESDOWrite.
• TuningResults gives the tuning progress status and the final result.
a) TuningStep gives the tuning progress status. When you attempt to know the meaning of the Tun-
ingStep, refer to TuningStep that will be mentioned later.
b) AllTrials gives the latest 33 tuning results. When the function block performs the 34th tuning, the
oldest result is removed. Member variable of AllTrials is the same parameter as that of Auto Tune
Monitor given in an easy tuning of Sysmac Studio. When you attempt to know the meaning of the
parameter, refer to Easy Tuning (Single Drive) of SYSMAC-SE2
Functions Operation Manual (I589-E1).
c) FinalTrial gives the element number in AllTrials that is adopted tuning result.
Sysmac Studio Drive
84
TuningStep
TuningStep of output variable show the following meanings.
StepDescription
0Tuning not started yet
1Waiting the positioning command
10Estimating Load Characteristics
20Tuning gain and filter settings
30Boosting feed-forward gains
40Completed successfully
45Canceled execution by user
50Stopped execution due to error
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
EasyTuning_1S
Execute
Scan
Abort
Done
Busy
CommandAborted
Error
ErrorID
ErrorIDEx
1234567891011
#0000#0000#0000#0000
#00000000#00000000#00000000#00000000
Execute
Scan
Abort
Done
Busy
CommandAborted
Error
ErrorID
ErrorIDEx
1234567891011
#0000#0000
#00000000#00000000
Timing Charts
The following figures shows the timing charts for the function block.
• Busy (Executing) changes to TRUE when Execute changes to TRUE.
• Done changes to TRUE when the tuning process is succeeded.
• If the value of Abort is changed from FALSE to TRUE, the tuning process is stopped and
CommandAborted changes to TRUE.
• If an error occurs when execution of the function block is in progress, Error changes to TRUE and
Busy (Executing) changes to FALSE.
You can find out the cause of the error by accessing the values output to ErrorID (Error Code) and
ErrorIDEx (Expansion Error Code).
• If Execute changes to FALSE before execution of the function block is ended, Done and Error are
TRUE only for one task period after execution of the function block is ended.
• If Execute remains TRUE even after execution of the function block is ended, the output values of
Done and Error are held.
Timing Chart for Normal End
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Timing Chart for Canceled Execution
85
EasyTuning_1S
A
Timing Chart for Error End
Scan
Execute
bort
Done
Busy
CommandAborted
Error
1234567891011
ErrorID
ErrorIDEx
#00000000ErrorIDEx#00000000ErrorIDEx
Precautions for Correct Use
• Execution of this function block will be continued until processing is ended even if the value of Execute changes to FALSE or the execution time exceeds the task period. The value of Done changes to
TRUE when processing is ended. Use this to confirm normal ending of processing.
• This function block executes four EtherCAT communications instructions at maximum within the part.
EtherCAT communications instructions have concurrent executions restriction. Create a user program not to violate this restriction. Refer to the EC_CoESDOWrite instruction in the instructions reference manual for the maximum number of instructions that can be executed at the same time.
• Do not use or open the screens of Sysmac Studio drive functions when you use this function block.
• Make sure that the Servo Drive is a compatible model before executing this function block.
• Do not attempt to turn OFF the power supply to the Controller and EtherCAT slaves or stop the EtherCAT communications until the processing for this function block ends normally or ends in an error.
• Sample programming shows only the portion of a program that uses the function or function block
from the library.
• When using sample programming in actual devices, also program safety circuits, device interlocks,
I/O with other devices, and other control procedures.
• Create a user program that will produce the intended device operation.
• Check the user program for proper execution before you use it for actual operation.
• An error will occur in the following cases. Error will change to TRUE.
a) The EtherCAT master is not in a state that allows message communications.
b) The slave specified with NodeAdr does not exist.
c) The slave specified with NodeAdr is not in a state that allows communications.
d) The slave is not in a state that allows writing of parameters.
e) The number of EtherCAT communications instructions such as EC_CoESDOWrite exceeded the
maximum number of instructions that can be executed at the same time.
#0000ErrorID#0000ErrorID
86
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
the receive buffer.
SDO Abort ErrorThe cause of this error
depends on the
specifications of the
EtherCAT slave.
More than 32 EtherCAT
Resource
Overflow
communications instructions
were executed at the same
time.
The value of VibrationLevel
value Out of
is out of range.
Range
The value of
value Out of
Range
PositionWindow is out of
range.
The specified Servo Drive
Interpolation is
not Supported
does not support the 2nd
order interpolation.
Failed in estimating load
Characteristic
characteristics.
Estimation
Failure
The specified servo drive
Detected
detected warning or error.
Vibration was detected.Increase the StabilizationTime.
Detected
Torque saturation was
Saturation
detected.
Detected
EasyTuning_1S
Check the operation status of the
EtherCAT network by checking
the status of the EtherCAT master.
Use this information to correct the
cause of the problem.
Specify an existing node address.
Check the status of the target
EtherCAT slave. Make sure that
the target slave is in a usable
status.
Check the operating status of the
target slave and correct the cause
of the problem.
Set the size of the reception buffer
to a value larger than the size of
the receive data from the slave.
Refer to the manual for the
EtherCAT slave and correct the
problem.
Correct the user program so that
no more than 32 EtherCAT
communications instructions are
executed at the same time.
Set the value of VibrationLevel
correctly.
Set the value of PositionWindow
correctly.
When setting FALSE: Smooth to
LinearMovementInterpolation, use
R88D-1SAN-ECT or
R88D-1SN-ECT Version 1.2
and later.
Check that the error is not applied
to Conditions that interfere with
the Load Characteristic Estimation
function, referring to instruction
manual for the target Servo Drive.
Remove the cause of the warning
and errors.
Reduce motor acceleration /
deceleration.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
87
EasyTuning_1S
Error code
16#3D1F16#00000009VendorID Not
16#3D1F16#0000000AUnsupported
16#3D1F16#0000000BCriteria Not
*1. An SDO abort code is shown here. Refer to SDO Abort Codes in the instructions reference manual for a list of SDO abort
codes.
Expansion
error code
StatusDescriptionCorrection
Check that the specified device is
a 1S-series Servo Drive.
Check that the specified device is
a 1S-series Servo Drive.
Matched
Device
Found
The device is not supported
by this function block (A
non-OMRON device is
specified).
The device is not supported
by this function block.
The criteria cannot be found. Relieve the TuningCriteria.
Sample Programming
This sample programming executes Easy Tuning for a Servo Drive.
Conditions
• The target Servo Drive is Node 1.
• The target Servo Drive is assigned to axis 0 in the Motion Control Function Module.
Processing
1Make sure that the Sysmac Studio drive functions are not used and not displayed its screens.
2Make sure that the target slave is in a state that allows communications.
3Execute EASYTUNING_1S_instance to start Easy Tuning.
4Check that Busy of EASYTUNING_1S_instance changes to TRUE and execute
MC_POWER_instance and MC_MOVE_RELATIVE_instance.
5Reverse movement starts in three seconds after Done of MC_MOVE_RELATIVE_instance
changes to TRUE.
6Check that Done of EASYTUNING_1S_instance changes to TRUE.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
89
EasyTuning_1S
Global Variables
MC_Axis000_sAXIS_REFMC://_MC_AX[0]
//First, make "EasyTuning_1S" Busy by setting "StartTuning" to TRUE.
EASYTUNING_1S_instance(
Execute:=StartTuning,
NodeAdr:=MC_Axis000.Cfg.NodeAddress
);
//Next, start Axis operation by setting "StartMove" to TRUE.
MC_POWER_instance(
Axis:=MC_Axis000,
Enable:=StartMove
);
MC_MOVERELATIVE_instance(
Axis:=MC_Axis000,
Execute:=MC_POWER_instance.Status AND (NOT TON_instance.Q),
Distance:=Distance,
Velocity:=Velocity,
Acceleration:=Acceleration,
Deceleration:=Deceleration
);
//After completing the positioning operation, wait for a while and start the next
axis operation.
TON_instance(
In:=MC_MOVERELATIVE_instance.Done,
PT:=TIME#3s
);
IF TON_instance.Q THEN
Distance := Distance * -1;
END_IF;
NameData typeDefaultATConstantComment
90
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Appendix
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
91
Referring to Library Information
Referring to Library Information
When you make an inquiry to OMRON about the library, you can refer to the library information to identify the library to ask about.
The library information is useful in identifying the target library among the libraries provided by OMRON
or created by the user.
The library information consists of the attributes of the library and the attributes of function blocks and
functions contained in the library.
• Attributes of libraries
Information for identifying the library itself
• Attributes of function blocks and functions
Information for identifying the function block and function contained in the library
Use the Sysmac Studio to access the library information.
Attributes of Libraries, Function Blocks and Functions
The following attributes of libraries, function blocks and functions are provided as the library information.
Attributes of Libraries
*1
No.
(1)Library file nameThe name of the library file
(2)Library versionThe version of the library
(3)AuthorThe name of creator of the library
(4)Comment
*1. These numbers correspond to the numbers shown on the screen images in the next section, Referring
to Attributes of Libraries, Function Blocks and Functions on page 93.
*2. It is provided in English and Japanese.
Attributes of Function Blocks and Functions
*1
No.
(5)FB/FUN nameThe name of the function block or function
(6)Name spaceThe name of name space for the function block or function
(7)FB/FUN versionThe version of the function block or function
(8)AuthorThe name of creator of the function block or function
(9)FB/FUN numberThe function block number or function number
(10)Comment
*1. These numbers correspond to the numbers shown on the screen images in the next section, Referring
to Attributes of Libraries, Function Blocks and Functions on page 93.
*2. It is provided in English and Japanese.
AttributeDescription
The description of the library
AttributeDescription
The description of the function block or function
*2
*2
92
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Referring to Library Information
(2)Library version
(1)Library file name
(3)Library author
(4)Library comment
(5)FB/FUN name
(7)FB/FUN version
(8)FB/FUN author
(10)FB/FUN comment
(6)Name
space
Referring to Attributes of Libraries, Function Blocks and Functions
You can refer to the attributes of libraries, function blocks and functions of the library information at the
following locations on the Sysmac Studio.
• Library Reference Dialog Box
• Toolbox Pane
• Ladder Editor
(a) Library Reference Dialog Box
When you refer to the libraries, the library information is displayed at the locations shown below.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
93
Referring to Library Information
(5)
FB/FUN name (6)Name space
(1)
Library file name
(9)
FB/FUN number
(10)
FB/FUN comment
(7)
FB/FUN version
(8)
FB/FUN author
(b) Toolbox Pane
Select a function block and function to display its library information at the bottom of the Toolbox
Pane.
The text “by OMRON” which is shown on the right of the library name (1) indicates that this library
was provided by OMRON.
(c) Ladder Editor
Place the mouse on a function block and function to display the library information in a tooltip.
(6)
Name space (5)FB/FUN name
(9)
FB/FUN number
(10)
FB/FUN comment
94
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
Referring to Function Block and Function Source Codes
Precautions for Correct Use
Referring to Function Block and
Function Source Codes
You can refer to the source codes of function blocks and functions provided by OMRON to customize
them to suit the user’s environment.
User function blocks and user functions can be created based on the copies of these source codes.
The following are the examples of items that you may need to customize.
• Customizing the size of arrays to suit the memory capacity of the user’s Controller
• Customizing the data types to suit the user-defined data types
Note that you can access only function blocks and functions whose Source code published/not published is set to Published in the library information shown in their individual specifications.
Use the following procedure to refer to the source codes of function blocks and functions.
1Select a function block or function in the program.
2Double-click or right-click and select To Lower Layer from the menu.
The source code is displayed.
For function blocks and functions whose source codes are not published, the following dialog
box is displayed in the above step 2. Click the Cancel button.
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)
95
Objects to Back up and Restore
Objects to Back up and Restore
The following table gives the objects to back up and restore. Refer to the AC Servomotors/Servo Drives
1S-series with Built-in EtherCAT Communications User’s Manual (Cat. No. I586) or the AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communications and Safety Functionality User’s
Manual (Cat. No. I621) for details on objects.
Index(Hex)Subindex(Hex)Name
220000Communications Error Setting
220100Sync Not Received Timeout Setting
3000-Basic Functions
01Motor Rotation Direction Selection
03Control Method Selection
3001-Machine
01Inertia Ratio
02Backlash Compensation Selection
03Backlash Compensation Amount
04Backlash Compensation Time Constant
3011-Position Command Filter
01FIR Filter Enable
02FIR Filter Moving Average Time
03IIR Filter Enable
04IIR Filter Cutoff Frequency
011st Frequency
021st Damping Time Coefficient
032nd Frequency
042nd Damping Time Coefficient
053rd Frequency
063rd Damping Time Coefficient
074th Frequency
084th Damping Time Coefficient
3014-Damping Filter 2
011st Frequency
021st Damping Time Coefficient
032nd Frequency
042nd Damping Time Coefficient
053rd Frequency
063rd Damping Time Coefficient
074th Frequency
084th Damping Time Coefficient
3021-Velocity Command Filter
01Acceleration Time
02Deceleration Time
03IIR Filter Enable
04Filter Cutoff Frequency
3031-Velocity Limit in Torque Control
01Velocity Limit Value
96
Sysmac Library Instructions Manual for EtherCAT 1S Series Library (W571)