Omron NX701-1620, NX701-1720, NJ501-1520, NJ501-4320, NJ501-1420 User Manual

...
Machine Automation Controller NJ/NX-series
Database Connection CPU Units
User’s Manual
NX701-1720 NX701-1620 NJ501-1520 NJ501-1420 NJ501-1320 NJ501-4320 NJ101-1020 NJ101-9020
W527-E1-08
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe­less, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.
• 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 SQL Server 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.
• Oracle, Java, and MySQL are registered trademarks of Oracle Corporation and/or its affiliates in the USA and other countries.
• IBM and DB2 are registered trademarks of International Business Machines Corporation in the USA and other countries.
• Firebird is a registered trademark of Firebird Foundation Incorporated.
• PostgreSQL is a registered trademark of PostgreSQL Global Development Group.
Other company names and product names in this document are the trademarks or registered trademarks of their respective companies.
Trademarks
NOTE
Introduction
1
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Introduction
Thank you for purchasing an NJ/NX-series CPU Unit. This manual contains information that is nece ssary to use the Database Connection Service with the NJ/NX -series CPU Unit. Hereinafter the Database Connection S ervice is called “DB Connection Service”. Please read this manual and make su re you understand the functionality and performance of the NJ-series CPU Unit before you attempt to use it in a control system. Keep this manual in a safe place where it will be av ail abl e for reference during operation.
Intended Audience
This manual is intended for the following personnel , who must also have knowledge of electrical systems (an electrical engineer or the equivalent).
• Personnel in charge of introducing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of installing and maintaining FA systems.
• Personnel in charge of managing FA systems and facilities.
For programming, this manual is intended for personnel who understand the programming language
specifications in international standard IEC 61131-3 or Japanese st andard JIS B 3503.
Applicable Products
This manual covers the following products.
NX-series Database Connection CPU Units
NX701-1720
NX701-1620
• NJ-series Database Connection CPU Units
• NJ501-1520
NJ501-1420
• NJ501-1320
NJ501-4320
NJ101-1020
NJ101-9020
Sysmac Studio
• SYSMAC-SE2
NX701-20: Version 1.21 or higher NJ501-20 or NJ101-20: Version 1.14 or higher
Relevant Manuals
2
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Relevant Manuals
The following table provides the relevant m anuals for the NJ-series CPU Units. Read all of the manuals that are relevant to your system configuration and application before you use the NJ-series CPU Unit.
Most operations are performed from Sysmac Studio Automation Software. Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for information on Sysmac Studio.
*1 Refer to the NJ/NX-series Troublesho oting Manual (Cat. No. W503) for the error management concepts and an
overview of the error items. Refer to the manuals that are indicated with tri angles for details on errors for the corresponding Units.
Manual Structure
3
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Manual Structure
Page Structure
The following page structure is used in this manual.
4-9
4 Installation and Wi ring
NJ-seriesCPU Unit Hardware User’s Manual ( W500)
stinUgn
itnuoM3-4
4
stn
enopmoC
rellortnoCg
nitce
n
noC
1-3
-4
4-3 Mounting Units
The Units that make up an NJ-series Controlle r can be connected simply by pressing the Units together and locking the sliders by moving them toward the back of the Units. The End Cover is co nnected in the same way to the Uni t on the far right si de of the Controller.
1 Join the Units so t hat the connect ors fit exactl y.
2 The yellow sliders at the top and bottom of each Uni t lock the Units together. Move the slide rs
toward the back of the Units as shown below until t hey click into place.
Preca ution s for Cor rec t UsePreca ution s for Cor rec t Use
4-3-1 Connecting Controller Comp onents
Connector
Hook
Hook holes
Slider
Lock
Release
Move the sliders toward the back until they lock into place.
Level 1 heading Level 2 heading Level 3 heading
Level 2 heading
A step in a procedure
Manual name
Special information
Level 3 heading
Page tab
Gives the current headings.
Indicates a procedure.
Icons indicate precautions, additional information, or reference information.
Gives the number of the main section.
This illustration is provided only as a sample. It may not literally appear in this manual.
The sliders on the tops and bottoms of t he Power Supply Unit, CPU Unit, I/ O Units, Special I/ O Units, and CPU Bus Units must be completely locked (until they click into place) after connec t ing the adjacent Unit connectors.
Manual Structure
4
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Special Information
Special information in this manual is classified as follows:
Note References are provided to moredetailed orrelated info
rmation.
Precautions for Safe Use
Precautions on what to doand what not to do to ensure safe usage of the product.
Precautions for Correct Use
Precautions on what to do and what not to do to ensure proper operation and performance.
Additional Information
Additional information to read as required. This information is provided to increase understanding or make operation easier.
Version Information
Information on differences in specifications and functionality for CPU Units with different unit versions and for different versions of the Sysmac Studio is given.
Precaution on Terminology
In this manual, “download” refers to transf erring data from Sysmac Studio to the physical Controller and “upload” refers to transferring data from the physical Controller to Sysmac Studio. For Sysmac Studio, synchronization is used to both upload and download data. Here, “sync hronize” means to automatically compare the data for Sysmac Studio on the computer with the data in the physical Controller and transfer the data in the direction that is specified by the user.
Sections in this Manual
5
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Sections in this Manual
1
2
3
4
5
6
7
A
1
2
Introduction to the DB Connection Service
DB Connection Settings
How to Use Operation Logs
Other Functions
Basic Operations and Status Check
Programming the DB Connection Function
Troubleshooting
Appendix A
3
4
5
6
7
A
B
Appendix B
B
I
Index
I
CONTENTS
6
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
CONTENTS
Introduction .................................................................................................................... 1
Intended Audience .................................................................................................. 1
Applicable Products ................................................................................................ 1
Relevant Manuals .......................................................................................................... 2
Manual Structure ............................................................................................................ 3
Page Structure ........................................................................................................ 3
Special Information ................................................................................................. 4
Precaution on Terminology ..................................................................................... 4
Sections in this Manual .................................................................................................. 5
CONTENTS ................................................................................................................... 6
Terms and Conditions Agreement ................................................................................ 11
Warranty, Limitations of Liability ........................................................................... 11
Application Considerations ................................................................................... 12
Disclaimers .......................................................................................................... 12
Safety Precautions ....................................................................................................... 14
Precautions for Safe Use ............................................................................................. 15
Precautions for Correct Use ......................................................................................... 16
Regulations and Standards .......................................................................................... 17
Conformance to EU Directives ............................................................................. 17
Conformance to KC Standards ............................................................................. 18
Conformance to Shipbuilding Standards .............................................................. 18
Software Licenses and Copyrights ....................................................................... 18
Versions ....................................................................................................................... 19
Unit Versions ........................................................................................................ 19
Version Types ....................................................................................................... 19
Checking Versions ................................................................................................ 19
Unit Versions of CPU Units and Sysmac Studio Ver sions ................................... 22
Related Manuals .......................................................................................................... 23
Terminolog
y ................................................................................................................. 25
Revision History ........................................................................................................... 26
1 Introduction to the DB Connection Service ..................................................... 1-1
1-1 Overview and Features ................................................................................. 1-2
1-1-1 Overview .......................................................................................... 1-2
1-1-2 Features ........................................................................................... 1-3
1-2 DB Connection Service Specifications and System ....................................... 1-4
1-2-1 DB Connection Service Specifications ............................................ 1-4
CONTENTS
7
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
1-2-2 DB Connection System.................................................................... 1-7
1-3
Operation Flow of the DB Connection Service
................................................ 1-9
2 DB Connection Settings .................................................................................. 2-1
2-1 Starting Sysmac Studio and Creating a New Project ..................................... 2-2
2-1-1 Starting Sysmac Studio ................................................................... 2-2
2-1-2 Creating a New Project .................................................................... 2-2
2-1-3 Setting the Built-in EtherNet/IP Port ................................................ 2-4
2-1-4 Controller Setup ............................................................................... 2-4
2-2 DB Connection Settings ................................................................................. 2-5
2-2-1 DB Connection Service Settings ..................................................... 2-5
2-2-2 DB Connection Settings .................................................................. 2-8
3 Programming the DB Connection Function .................................................... 3-1
3-1 DB Access Procedure ................................................................................... 3-2
3-2 Creating a Structure Data Type ..................................................................... 3-3
3-2-1 Overview .......................................................................................... 3-3
3-2-2 Specifications of Structure Data Type for DB Access ..................... 3-3
3-2-3 How to Create a Structure Data Type for DB Access ................... 3-12
3-3 Creating a DB Map Variable ........................................................................ 3-15
3-3-1 DB Map Variables and DB Mapping .............................................. 3-15
3-3-2 Registration and Attributes of DB Map Variables .......................... 3-16
3-3-3 Restrictions on DB Map Variables ................................................. 3-17
3-4 Specifying the Table and Applying the Mapping .......................................... 3-18
3-4-1 DB Mapping by Executing a Create DB Map Instruction ............... 3-18
3-4-2 Clearing the Mapping of DB Map Variables .................................. 3-18
3-4-3 Restrictions on DB Mapping .......................................................... 3-19
3-5 Programming and Transfer .......................................................................... 3-22
3-5-1 Programming the DB Connection Service ..................................... 3-22
3-5-2 Displaying DB Connection Instructions on S ysmac Studio ........... 3-23
3-5-3 DB Connection Instruction Set ...................................................... 3-24
3-5-4 System-defined Variables .............................................................. 3-25
3-5-5 Simulation Debugging of DB Connection Instructions ................... 3-26
3-5-6 Transferring the DB Connection Settings and User Program ....... 3-26
3-6 Debugging in Design, Startup, and Operation Phas es ................................ 3-27
3-6-1 Design Phase ................................................................................ 3-27
3-6-2 Startup Phase ................................................................................ 3-27
3-6-3 Operation Phase ............................................................................ 3-27
4 Basic Operations and Status Check ............................................................... 4-1
4-1 Run Mode of DB Connection Service and Start/Stop Procedures ................. 4-2
4-1-1 Run Mode of the DB Connection Service ........................................ 4-2
4-1-2 How to Start/Stop the DB Connection Servic e ................................ 4-2
4-1-3 DB Connection Service is Stopped or Cannot be Started ............... 4-4
4-1-4 Changing the Run Mode of the DB Connection S ervice ................. 4-5
CONTENTS
8
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
4-2 Establishing/Closing a DB Connection .......................................................... 4-6
4-3 Checking the Status of DB Connection Service and each DB Connection ........................ 4-7
4-3-1 Operation Status of the DB Connection Service ............................. 4-7
4-3-2 Checking the Status of the DB Connection Service ........................ 4-8
4-3-3 Connection Status of each DB Connection ................................... 4-11
4-3-4 Checking the Status of each DB Connection ................................ 4-12
5 Other Functions ............................................................................................... 5-1
5-1 Examples of Using Functions ........................................................................ 5-2
5-2 Spool Function .............................................................................................. 5-4
5-2-1 Overview .......................................................................................... 5-4
5-2-2 Spooling System .............................................................................. 5-4
5-2-3 Applicable Instructions and Spooling Execution Conditions ............ 5-4
5-2-4 Memory Area Used by the Spool Function ...................................... 5-6
5-2-5 Spool Function Settings ................................................................... 5-8
5-2-6 How to Resend the SQL Statements Stored in the Spool M emory . 5-9
5-2-7 Clearing the SQL Statements from the Spool Memory ................. 5-10
5-2-8 Relationship with the DB Connection Instruct ions ......................... 5-12
5-2-9 How to Estimate the Number of SQL Statements t hat Can be Spooled
....................................................................................................... 5-14
5-3 DB Connection Service Shutdown Function ................................................ 5-15
5-3-1 Overview ........................................................................................ 5-15
5-3-2 Shutdown System .......................................................................... 5-16
5-3-3 How to Execute the Shutdown Function ........................................ 5-16
5-3-4 How to Check the Shutdown of the DB Connection Service ......... 5-17
5-4 How to Prevent Losing SQL Statements at Power Interrupti on ................... 5-18
5-4-1 Overview ........................................................................................ 5-18
5-4-2 Procedures ..................................................................................... 5-18
5-5 Timeout Monitoring Functions ..................................................................... 5-22
5-5-1 Timeout Monitoring Functions ....................................................... 5-22
5-5-2 Login Timeout ................................................................................ 5-23
5-5-3 Query Execution Timeout .............................................................. 5-23
5-5-4 Communications Timeout .............................................................. 5-24
5-5-5 Instruction Execution Timeout ....................................................... 5-24
5-5-6 Keep Alive Monitoring Time ........................................................... 5-24
5-6 Other Functions ........................................................................................... 5-26
5-6-1 Backup/Restore Function in the DB Connection Service .............. 5-26
5-6-2 Operation Authority Verification in the DB Connection Service ..... 5-28
6 How to Use Operation Logs ............................................................................ 6-1
6-1 Operation Logs .............................................................................................. 6-3
6-2 Execution Log ................................................................................................ 6-4
6-2-1 Overview .......................................................................................... 6-4
6-2-2 Application Procedure ...................................................................... 6-4
6-2-3 Setting the Execution Log ................................................................ 6-5
6-2-4 Checking the Execution Log ............................................................ 6-5
CONTENTS
9
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
6-2-5 Execution Log File Specifications .................................................... 6-5
6-3 Debug Log ................................................................................................... 6-10
6-3-1 Overview ........................................................................................ 6-10
6-3-2 Application Procedure ................................................................... 6-10
6-3-3 Setting the Debug Log ................................................................... 6-11
6-3-4 Starting Recording to Debug Log .................................................. 6-12
6-3-5 Stopping Recording to Debug Log ................................................ 6-13
6-3-6 Checking the Debug Log ............................................................... 6-14
6-3-7 Debug Log File Specifications ....................................................... 6-14
6-4 SQL Execution Failure Log .......................................................................... 6-18
6-4-1 Overview ........................................................................................ 6-18
6-4-2 Application Procedure ................................................................... 6-18
6-4-3 Setting the SQL Execution Failure Log ......................................... 6-18
6-4-4 Checking the SQL Execution Failure Log ..................................... 6-19
6-4-5 SQL Execution Failure Log File Specifications ............................. 6-19
6-5 SD Memory Card Operations ...................................................................... 6-22
6-5-1 Saving Operation Log Files on SD Memory Card ......................... 6-22
6-5-2 Directory Used for DB Connection Service ................................... 6-22
6-5-3 Operation Log Operations in Replacing the SD Memory Card ..... 6-23
6-5-4 Guidelines for SD Memory Card Replacement T i m e .................... 6-23
6-5-5 Replacement Timing of SD Memory Card ..................................... 6-24
6-6 Checking the Operation Logs ...................................................................... 6-25
6-6-1 How to Check the Operation Logs ................................................. 6-25
6-6-2 Checking the Log on the Operation Log Window in Sysmac Studio ................ 6-25
6-6-3 Checking the Log with the SD Memory Card ................................ 6-27
6-6-4 Checking the Log by Transfer using FTP Client Software ............ 6-27
7 Troubleshooting .............................................................................................. 7-1
7-1 Overview of Errors ......................................................................................... 7-2
7-1-1 How to Check for Errors .................................................................. 7-3
7-1-2 Errors Related to the DB Connection Service ................................. 7-5
7-2 Troubleshooting ............................................................................................. 7-7
7-2-1 Error Table ....................................................................................... 7-7
7-2-2 Error Descriptions .......................................................................... 7-15
Appendix A ........................................................................................................... A-1
A-1 DB Connection Instructions and Variables ................................................... A-2
A-1-1 DB Connection Instruction Set ........................................................ A-2
A-1-2 Variables Used in the DB Connection Instructio ns .......................... A-3
DB_Connect (Establish DB Connection) .................................................................... A-6
DB_Close (Close DB Connection) .............................................................................. A-9
DB_CreateMapping (Create DB Map) ...................................................................... A-11
DB_Insert (Insert DB Record) .................................................................................. A-14
DB_Update (Update DB Record) ............................................................................. A-18
CONTENTS
10
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
DB_Select (Retrieve DB Record) ............................................................................. A-34
DB_Delete (Delete DB Record) ................................................................................ A-39
DB_ControlService (Control DB Connection Service) ............................................................. A-54
DB_GetServiceStatus (Get DB Connection Service Status) ..................................................... A-60
DB_GetConnectionStatus (Get DB Connection Status) .......................................................... A-65
DB_ControlSpool (Resend/Clear Spool Data) ................................................................. A-71
DB_PutLog (Record Operation Log) ........................................................................ A-78
DB_Shutdown (Shutdown DB Connection Service) ............................................................... A-84
Appendix B ........................................................................................................... B-1
B-1 Task Design Procedure ................................................................................ B-2
B-1-1 Startup Time of DB Connection Service .......................................... B-2
B-1-2 Reference Values for Execution Time of DB Connection Instructions ................ B-4
B-1-3 How to Measure Execution Time of DB Connect i on Instructions .... B-7
B-1-4 Guideline for System Service Execution Time Rat i o ....................... B-8
B-1-5 Checking the System Service Execution Time Rat i o ...................... B-9
B-2 Execution Time of DB Connection Instructions ........................................................ B-11
B-2-1 Restrictions to Execution Time of DB Connecti on Instructions ..... B-11
B-2-2 Impact of Operation Log Recording on Execution T ime of DB
Connection Instructions ................................................................. B-17
B-2-3 How to Measure DB Response Time ............................................ B-18
B-2-4 Ensuring Equipment Performance (Takt T im e) by Monitoring
Instruction Execution Timeout ....................................................... B-19
B-3 Specifications ............................................................................................. B-20
B-3-1 General Specifications ................................................................... B-20
B-3-2 Performance Specifications ........................................................... B-20
B-3-3 Function Specifications .................................................................. B-20
B-4 Version Information .................................................................................... B-21
B-4-1 Unit Versions and Corresponding DB Connection S ervice
Versions ......................................................................................... B-21
B-4-2 DB Connection Functions That Were Added or Changed for Each Unit Version B-21 B-4-3 Actual Unit Version of CPU Unit and Unit Version Set in the
Sysmac Studio Project ................................................................... B-22
Index
Terms and Conditions Agreement
11
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
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 disclaim s 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 Om ron’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-complyi ng 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, i ndemnity 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 m ust 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 t o 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.
Terms and Conditions Agreement
12
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
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.
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. Thi s information by itself is not sufficient for a complete determination of the suitability of the Product in combination with the end product, machine, system, or other application or use. Buyer shall be solely responsible for determining appropriateness of the particular Product with respect to Buyer’s application, product or system. Buyer shall take application responsibility in all cases.
NEVER USE THE PRODUCT FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR
PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO
ADDRESS THE RISKS, AND THAT THE OMRON PRODUCT(S) IS PROPERLY RATED AND
INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM.
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 c onstitute 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 a pplication. Please consult with your Omron’s representative at any time to confirm act ual specifications of purchased Product.
Terms and Conditions Agreement
13
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
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.
Safety Precautions
14
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Safety Precautions
Refer to the following manuals for safety precautions.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NJ-series CPU Unit Hardware User’s M a nual (Cat. No. W500)
For safety precautions on NJ501-4320, please contact our sales representative and check with the
product specification document or other documentation.
Precautions for Safe Use
15
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Precautions for Safe Use
Refer to the following manuals for precauti ons f or safe use.
• NX-series CPU Unit Hardware User’s M a nual (Cat. No. W535)
• NJ-series CPU Unit Hardware User’s M a nual (Cat. No. W500)
For precautions for safe use on NJ501-4320, please contact our sales representative and check with
the product specification document or other d ocumentation.
Precautions for Correct Use
16
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Precautions for Correct Use
This section describes the precautions for correct use in the DB Connection Service. Refer to the following manuals for other pre cautions for correct use.
• NX-series CPU Unit Hardware User’s Manual (Cat. No. W535)
• NJ-series CPU Unit Hardware User’s M a nual (Cat. No. W500)
For precautions for correct use on NJ501-4320, please contact our sales r epresentative and check
with the product specification document or ot her documentation.
For the NJ-serie s CPU Unit, when the Spool function is enabled, the DB Connection Service uses the following EM Banks according to the CPU Unit model . If the EM banks are used for processes other than the DB Connection Service, the Spool d ata in the EM Banks will be overwritten. Do not use the EM Banks that are used by the DB Connection Service for processes other than the DB Connection Service.
NJ501-20: EM Bank No. 9 to 18 (E9_00000 to E18_32767) NJ101-20: EM Bank No. 1 to 3 (E1_00000 to E3_32767)
Regulations and Standards
17
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Regulations and Standards
Conformance to EU Directives
Applicable Directives
• EMC Directives
• Low Voltage Directive
Concepts
EMC Directive
OMRON devices that comply with EU Directives al so conform to the related EMC standards so that they can be more easily built into other devices or the overall machine. The actual products have been checked for conformity to EMC standards.* Whether the products conform to the standa rds in the system used by the customer, however, must be checked by the customer. EMC-related performance of the OMRON devices that comply with EU Directives will vary depending on the configuration, wiring, and other conditions of the equipment or control panel on which the OMR ON devices are installed. The customer must, therefore, perform the final check to confirm t hat devices and the overall machine conform to EMC standards.
*
Applicable EMC (Electromagnetic Compatibi li ty) standards are as follows:
EMS (Electromagnetic Susceptibility): EN 61131-2 EMI (Electromagnetic Interference): EN 61131-2
Radiated emission: 10-m regulations
Low Voltage Directive
Always ensure that devices operating at voltages of 50 to 1,000 VAC and 75 to 1,500 VDC meet the required safety standards. The applicable di rective is EN 61010-2-201.
Conformance to EU Directives
The NJ/NX-series Controllers comply with EU Directives. T o ensure that the machine or device in which the NJ/NX-series Controller is used complies with EU Directives, the Controller must be installed as follows:
The NJ/NX-series Controller must be installed within a control panel.
You must use the power supply in SELV specific ations for the DC power supplies connected to
DC Power Supply Units and I/O Units.
NJ/NX-series Controllers that comply with EU Directives also conform to the Common Emission Standard. Radiated emission characteristics (10-m regulations) may vary depending on the configuration of the control panel use d, other devices connected to the control panel, wiring, and other conditions. You must therefore confirm that the overall machine or equipment complies with EU Directives.
Regulations and Standards
18
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Conformance to KC Standards
Observe the following precaution if you use NX-series Units in Korea.
Class A Device (Broadcasting Communications Device for Office Use)
This device obtained EMC registration for office use (Class A), and it is intended to be used in places
other than homes. Sellers and/or users need to take note of this.
Conformance to Shipbuilding Standards
Some Database Connection CPU Units comply wit h shipbuilding standards. If you use a Database Connection CPU Unit that complies with shipbui ldi ng standards and the machinery or system in which you use the Database Connection CPU Unit must also comply with the standards, consult with your
OMRON representative. Application conditions are defined according to the installation location.
Application may not be possible for some installation locations.
Usage Conditions for NK and LR Shipbuilding Standards
The NJ-series Controller must be installed wit hi n a control panel.
Gaps in the door to the control panel must be compl etely filled or covered with gaskets or other
material.
The following noise filter must be connected to the power supply line.
Noise Filter
Manufacturer
Model
Cosel Co., Ltd.
TAH-06-683
Software Licenses and Copyrights
This product incorporates certain third part y software. The license and copyright information associated with this software is available at ht tp://www.fa.omron.co.jp/nj_info_e/.
Versions
19
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Versions
Unit Versions
Hardware revisions and unit versions are used t o m anage the hardware and software in NJ/NX-series
Units and EtherCAT slaves. The hardware revision or unit version is updated each time there is a
change in hardware or software specifications. Even when two Units or EtherCAT slaves have the
same model number, they will have functional or performance differences if they have different hardware revisions or unit versions.
Version Types
There are two types of versions. One is unit v ersion and the other is DB Connection Service version. These versions are managed independently. Therefore, only one of them may be upgraded.
Unit Version
This is the version of hardware and software of Units and EtherCAT slaves. The version is upgraded at every specification change in the hardware or sof tware. Therefore, the functionality and performance differ by the versions even in the same model number of Units and EtherCAT slaves.
DB Connection Service Version
This is the version of DB Connection Service implemented in the Database Connection CPU Units. The version is upgraded at every specification change in the DB Connection Service.
Checking Versions
You can check versions on the ID information indications or with Sysmac Studio.
Checking Unit Versions on ID Information Label
The unit version is given on the ID information indi cation on the side of the product. The ID information on an NX-series NX701-20 CPU Unit is shown below.
Versions
20
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
The ID information on an NJ-series NJ501-1520 CPU Unit is shown below.
Versions
21
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Checking Unit Versions with the Sysmac Studio
You can use the Sysmac Studio to check unit versions. The procedure is different for Units and for EtherCAT slaves.
Checking the Unit Version of an NX-series CPU Unit
You can use the Production Information while the Sysmac Studio is online to check the unit version
of a Unit. You can do this for the CPU Unit. For an NX1P2 CPU Unit, you can also check the unit
versions of the NX Units on the CPU Rack and O ption Boards.
1. Right-click CPU Rack under Configurations and Setup - CPU/Expansion Racks in the
Multiview Explorer and select Production Information. The Production Information Dialog Box is displayed.
Checking the Unit Version of an NJ-series CPU Unit
You can use the Production Information while the Sysmac Studio is online to check the unit version of a Unit. You can do this for the CPU Unit, CJ-series Special I/O Units, and CJ-series CPU Bus Units. You cannot check the unit versions of CJ-series Basic I/O Units with the Sysmac Studio. Use the following procedure to check the unit version.
1. Double-click CPU/Expansion Racks under Configurations and Setup in the Multiview Explorer.
Or, right-click CPU/Expansion Racks under Configurations and Setup and select Edit from the menu. The Unit Editor is displayed.
2. Right-click any open space in the Unit Editor and select Production Information.
The Production Information Dialog Box is displayed.
Versions
22
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Changing Information Displayed in Production Information Dialog Box
1. Click the Show Detail or Show Outline Button at the lower right of the Production Information
Dialog Box. The view will change between the production information details and outline.
Outline View Detail View
The information that is displayed is different for the Outline View and Detail View. The Detail View displays both the unit versions and DB Connection Service version. The Outline View displays only the unit versions.
Note The hardware revision is separated by "/" and displayed on the right of the har dware version. The
hardware revision is not displayed for the Unit that the hardware revision is in blank.
Unit Versions of CPU Units and Sysmac Studio Versions
The functions that are supported depend on the unit version of the NJ/NX-series CPU Unit. The version of Sysmac Studio that supports the functions that were added for an upgrade is also required to use those functions. Refer to B-4 Version Information for the relationship between the unit versions of the NJ/NX-series Database Connection CPU Units and the Sysmac Studio versions, and for the functions that are supported by each unit version.
Related Manuals
23
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Related Manuals
The following manuals are related to this manual. U se these manuals for reference.
Manual name
Cat. No.
Model numbers
Application
Description
NX-series CPU Unit
Hardware User’s Manual
W535
NX701-

Learning the
basic specifications of the NX701 CPU Units, including introductory information, designing, installation, and maintenance. Mainly hardware information is
provided.
An introduction to the entire NX701 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
NJ-series CPU Unit
Hardware User’s Manual
W500
NJ501-

NJ301- NJ101-
Learning the
basic specifications of the NJ-series CPU Units, including introductory information, designing, installation, and maintenance. Mainly hardware information is
provided.
An introduction to the entire NJ-series 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
NJ/NX-series CPU Unit
Software User’s Manual
W501
NX701-

NX1P2- NJ501- NJ301- NJ101-
Learning how to
program and set up an NJ/NX-series CPU Unit. Mainly software information is
provided.
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
NJ/NX-series Instructions
Reference Manual
W502
NX701-

NX1P2- NJ501- NJ301- NJ101-
Learning detailed
specifications on the basic instructions of an NJ/NX-series
CPU Unit.
The instructions in the instruction set (IEC
61131-3 specifications) are described.
NJ/NX-series CPU Unit
Motion Control User’s Manual
W507
NX701-

NX1P2- NJ501- NJ301-
NJ101-
Learning about
motion control settings and programming
concepts.
The settings and operation of the CPU Unit and
programming concepts for motion control are described.
NJ/NX-series Motion
Control Instructions Reference Manual
W508
NX701-

NX1P2- NJ501- NJ301-
NJ101-
Learning about
the specifications of the motion control
instructions.
The motion control instructions are described.
NJ/NX-series CPU Unit
Built-in EtherCAT Port User’s Manual
W505
NX701-

NX1P2- NJ501- NJ301-
NJ101-
Using the built-in
EtherCAT port on
an NJ/NX-series CPU Unit.
Information on the built-in EtherCAT port is
provided. This manual provides an introduction and provides information on the configuration, features, and setup.
NJ/NX-series CPU Unit
Built-in EtherNet/IPTM Port User’s Manual
W506
NX701-

NX1P2- NJ501- NJ301-
NJ101-
Using the built-in
EtherNet/IP port on an NJ/NX-series
CPU Unit.
Information on the built-in EtherNet/IP port is
provided. Information is provided on the basic setup, tag data links, and other features.
Related Manuals
24
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Manual name
Cat. No.
Model numbers
Application
Description
NJ/NX-series Database
Connection CPU Units User’s Manual
W527
NX701-20
NJ501-20 NJ101-20
Using the
database connection service with NJ/NX-series
Controllers.
Describes the database connection service.
NJ/NX-series
Troubleshooting Manual
W503
NX701-

NX1P2- NJ501- NJ301- NJ101-
Learning about
the errors that may be detected in an NJ/NX-series
Controller.
Concepts on managing errors that may be
detected in an NJ/NX-series Controller and information on individual errors are described.
Sysmac Studio Version 1
Operation Manual
W504
SYSMAC -SE2

Learning about
the operating procedures and functions of
Sysmac Studio.
Describes the operating procedures of Sysmac
Studio.
Terminology
25
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Terminology
Term
Description
Column
One of the information layers of each DB. Refers to the columns of each table.
DB
Refers to a database in a server.
DB Connection
Refers to a virtual communication path established between CPU Unit and DB.
DB Connection function
Used to connect a CPU Unit to a DB. This function operates on a CPU Unit.
DB Connection Instruction
Refers to special instructions for the DB Connection Service.
DB Connection Service This service provides the DB Connection function to connect a CPU Unit to a DB.
In the ID information indication on the side of the CPU Unit and in Sysmac Studio, this service is
indicated as “DBCon”.
DB Connection Service shutdown
function
Used to shut down the DB Connection Service after automatically saving the Operation Log files
into the SD Memory Card.
DB mapping Means to assign each member of a DB Map Variable to the corresponding column of a table in
the connected DB.
DB Map Variable
Refers to a variable that uses a structure data type for DB access as its data type.
Debug Log One of the Operation Logs. This log is used for recording which SQL statements are executed,
and parameters and execution result of each SQL statements.
EM Area Refers to EM Area of the memory for CJ-series Units. The data in this area are retained even if
the power supply to the CPU Unit is cycled (i.e. ON OFF ON) or the operating mode of the
CPU Unit is changed (i.e. PROGRAM mode ⇔ RUN mode).
Execution Log One of the Operation Logs. This log is used to record the executions of the DB Connection
Service.
Operation Log Used to trace the operations of the DB Connection function on the CPU Unit. There are three
types of Operation Logs; Execution Log, Debug Log, and SQL Execution Failure Log.
Run mode of the DB Connection
Service
Used to switch whether to actually access the DB or to normally end the instructions without
accessing the DB when DB Connection Instructions are executed.
Spool memory
Refers to the memory area for storing the SQL statements in the Spool function.
Spool function Used to store some SQL statements for inserting records into the DB or updating the records in
the DB that could not be executed due to a network failure.
Spool data
Refers to the SQL statements stored in the Spool memory.
Structure data type for DB access Refers to structure data type where all or some of the columns of a specified table are registered
as structure members.
SQL Stands for Structured Query Language, which is one of the languages for DB processing such
as data read/write.
SQL Execution Failure Log One of the Operation Logs. This log is used to record execution failure of SQL statements in the
DB.
SQL statement Refers to the statements that show a specific instruction used for DB operations such as data
read/write.
Table
One of the information layers of each DB, which contains data.
Revision History
26
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Revision History
A manual revision code appears as a suffix to the catalog number on the front and back covers of the
manual.
Revision code
W527
-E1-08
Cat. No.
Revision code
Date
Revised content
01
April 2013
Original production
02 August 2013 Added description of the time specified for timeout of DB
Connection Instructions. P5-10, A-16, A-21, A-37, and A-41
Corrected mistakes.
03 February 2014 Added description of the functions supported by the DB
Connection Service version 1.01 or higher.
04 July 2014 Added NJ501-4320.
Corrected mistakes.
05 November 2015 Added NJ101-20.
Corrected mistakes.
06 December 2015 Added description of the functions supported by the DB
Connection Service version 1.02 or higher.
Corrected mistakes.
07
June 2016
Updated the EtherNet/IP logo.
08
January 2018
Added NX701-20.
1-1
1
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
1
This section provides an introduction to the DB Connect i on Service.
1-1 Overview and Features ................................................................................. 1-2
1-1-1 Overview ...........................................................................................1-2
1-1-2 Features............................................................................................1-3
1-2 DB Connection Service Specifications and System ...................................... 1-4
1-2-1 DB Connection Service Specifications .............................................1-4
1-2-2 DB Connection System ....................................................................1-7
1-3 Operation Flow of the DB Connection Service .............................................. 1-9
Introduction to
the DB Connection Service
1 Introduction to the DB Connection Service
1-2
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
1-1 Overview and Features
This section describes the overview and features of the DB Connection Service.
1-1-1 Overview
The SYSMAC NJ/NX-series Controllers are next-generation machine automation controlle r s t hat provide the functionality and high-speed performan ce that are r equired for m achine cont rol. They provide the safety, reliability, and maintainabil i ty that are required of industrial controllers. The NJ/NX-series Controllers provide the functionality of previous OMRON PLCs, and they also provide the functionality that is required for motion control. Synchronized control of I/O devices on high-speed EtherCAT can be applied to safety devices, vision systems, motion equipment, discrete I/O, and more. OMRON offers the new Sysmac Series of control devices designed with unified communications specifications and user interface specifications. The NJ/NX-series Machine Automation Controllers are part of the Sysmac Series. You can use them together with EtherCAT slaves, other Sysmac products, and the Sysmac Studio Automation Software to achieve optimum functionality and ease of operation. With a system that is created fro m Sysmac produ cts, you can connect components and operate the system throu gh unified concepts and usability.
The DB Connection Service is a function to insert, update, retrieve, and delete records to/from a relational database (hereinafter called “DB”) on a server connected to the built-in EtherNet/IP port of an NJ/NX-series CPU Unit by executing special instructions (called “DB Connection Instruction”) on the NJ/NX-series CPU Unit. The DB Connection Service is available with the NX-series NX701-@@20 CPU Unit and NJ-series NJ501-@@20 and NJ101-@@20 CPU Units.
Structure variables
Server
Relational Database
Sysmac Studio
NJ/NX-series Database Connection CPU Unit
EtherNet/IP port
DB Connection Instruction e.g. DB_Insert instruction
DBConnection
MapVar
abc
TABLE Field1 :10 Field2 :20
Field3 :40
Field4 :100
TABLE
Field1
Field2
Field3
Field4
10
20
40
100
e.g. Insert a record
LAN
Oracle Database of Oracle Corporation, SQL Server of Microsoft Corporation, DB2 for Linux,
UNIX and Windows of IBM Corporation, MySQL of O racle Corporation, Firebird of Firebird Foundation Incorporated, and PostgreSQL of PostgreSQL Global Development Group are supported.
*1
NJ501-@@20 and NX701-@@20 CPU Units can access up to three databases on up to three
servers.
*2
It is possible to access more than one database in one or m ore servers. You can realize flexible operations such as switching the database to access according to the specified data and SQL operations (such as INSERT/SELECT ) and connecting to another database in a different server when a database cannot be conne ct ed, for example, due to a server problem.
*1 The connectable databases a r e di fferent between NJ501-1@20/NJ101-@@20 and
NJ501-4320. Refer to 1-2-1 DB Connection S ervice Specifications for the conn ectable databases.
*2 An NJ101-@@20 can access only one database.
Loading...
+ 276 hidden pages