Omron NX701-1620 User Manual

Machine automation controller nj/nx-series database connection cpu units
Hide thumbs Also See for NX701-1620:
Table of Contents

Advertisement

Quick Links

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
CPU Unit
W527-E1-08

Advertisement

Table of Contents

Troubleshooting

loading

Summary of Contents for Omron NX701-1620

  • Page 1 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 CPU Unit W527-E1-08...
  • Page 2: Nx701

    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.
  • Page 3: Introduction

    IEC 61131-3 or Japanese standard 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 •...
  • Page 4: Relevant Manuals

    Relevant Manuals Relevant Manuals The following table provides the relevant manuals 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.
  • Page 5: Manual Structure

    Manual Structure Manual Structure Page Structure The following page structure is used in this manual. Level 1 heading 4 Installation and Wi ring Level 2 heading Mounting Units Level 3 heading Level 2 heading Gives the current Level 3 heading headings.
  • Page 6: Special Information

    Manual Structure Special Information Special information in this manual is classified as follows: Precautions for Safe Use Precautions on what to do and what not to do to ensure safe usage of the product. Precautions for Correct Use Precautions on what to do and what not to do to ensure proper operation and performance. Additional Information Additional information to read as required.
  • Page 7: Sections In This Manual

    Sections in this Manual Sections in this Manual Introduction to the DB Connection Service DB Connection Settings Programming the DB Connection Function Basic Operations and Status Check Other Functions How to Use Operation Logs Troubleshooting Appendix A Appendix B Index NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 8: Table Of Contents

    CONTENTS 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 ........................
  • Page 9: Contents

    CONTENTS 1-2-2 DB Connection System..............1-7 Operation Flow of the DB Connection Service ..........1-9 2 DB Connection Settings .................. 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 ..........
  • Page 10 CONTENTS Establishing/Closing a DB Connection ............4-6 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 ........
  • Page 11 CONTENTS Execution Log File Specifications ............ 6-5 6-2-5 Debug Log ....................6-10 6-3-1 Overview ..................6-10 Application Procedure ..............6-10 6-3-2 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 ...............
  • Page 12 CONTENTS 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) ................
  • Page 13: Terms And Conditions Agreement

    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.
  • Page 14: Application Considerations

    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.
  • Page 15 Terms and Conditions Agreement 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. NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 16: Safety Precautions

    Safety Precautions 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 Manual (Cat. No. W500) For safety precautions on NJ501-4320, please contact our sales representative and check with the product specification document or other documentation.
  • Page 17: Precautions For Safe Use

    Precautions for Safe Use Precautions for Safe Use Refer to the following manuals for precautions for safe use. • NX-series CPU Unit Hardware User’s Manual (Cat. No. W535) • NJ-series CPU Unit Hardware User’s Manual (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 documentation.
  • Page 18: Precautions For Correct Use

    Precautions for Correct Use Precautions for Correct Use This section describes the precautions for correct use in the DB Connection Service. Refer to the following manuals for other precautions for correct use. • NX-series CPU Unit Hardware User’s Manual (Cat. No. W535) •...
  • Page 19: Regulations And Standards

    Concepts  EMC Directive OMRON devices that comply with EU Directives also conform to the related EMC standards so that they can be more easily built into other devices or the overall machine. The actual products have been checked for conformity to EMC standards.* Whether the products conform to the standards in the system used by the customer, however, must be checked by the customer.
  • Page 20: Conformance To Kc Standards

    Connection CPU Unit that complies with shipbuilding 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.
  • Page 21: Versions

    Versions Versions Unit Versions Hardware revisions and unit versions are used to manage the hardware and software in NJ/NX-series Units and EtherCAT slaves. The hardware revision or unit version is updated each time there is a change in hardware or software specifications. Even when two Units or EtherCAT slaves have the same model number, they will have functional or performance differences if they have different hardware revisions or unit versions.
  • Page 22 Versions The ID information on an NJ-series NJ501-1520 CPU Unit is shown below. NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 23 Versions 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.
  • Page 24: Unit Versions Of Cpu Units And Sysmac Studio Versions

    Versions  Changing Information Displayed in Production Information Dialog Box 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.
  • Page 25: Related Manuals

    Related Manuals Related Manuals The following manuals are related to this manual. Use these manuals for reference. Manual name Cat. No. Model numbers Application Description An introduction to the entire NX701 system is NX-series CPU Unit W535 NX701- Learning the basic Hardware User’s Manual provided along with the following information on...
  • Page 26 Related Manuals Manual name Cat. No. Model numbers Application Description NJ/NX-series Database W527 NX701-20 Using the Describes the database connection service. database Connection CPU Units NJ501-20 connection User’s Manual NJ101-20 service with NJ/NX-series Controllers. NJ/NX-series W503 NX701- Learning about Concepts on managing errors that may be Troubleshooting NX1P2-...
  • Page 27: Terminology

    Terminology Terminology Term Description Column One of the information layers of each DB. Refers to the columns of each table. 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.
  • Page 28: Revision History

    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. W527-E1-08 Revision code Revision code Date Revised content April 2013 Original production August 2013 •...
  • Page 29: Introduction To The Db Connection Service

    Introduction to the DB Connection Service This section provides an introduction to the DB Connection Service. Overview and Features ................. 1-2 1-1-1 Overview ...................1-2 1-1-2 Features....................1-3 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 Operation Flow of the DB Connection Service ..........
  • Page 30: Overview And Features

    They provide the safety, reliability, and maintainability that are required of industrial controllers. The NJ/NX-series Controllers provide the functionality of previous OMRON PLCs, and they also 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.
  • Page 31: Features

    1 Introduction to the DB Connection Service 1-1-2 Features No Special Unit, Tool, nor Middleware Required  No special Unit is required for the DB Connection function. You can use the NJ/NX -series CPU Units.  No special tool is required for the DB Connection function. You can use Sysmac Studio. ...
  • Page 32: Db Connection Service Specifications And System

    . The other functions are same as the NX-series NX701-@@20 CPU Unit, NJ-series NJ501-@@00 CPU Unit, or NJ101-@@00 CPU Unit.  NX701-1720: 256-axis type  NX701-1620: 128-axis type  NJ501-1520: 64-axis type  NJ501-1420: 32-axis type  NJ501-1320: 16-axis type ...
  • Page 33 EtherNet/IP tag data link function, please specify the following CPU models on Network Configurator. The following models are also displayed in Sysmac Gateway or CX-Compolet. • NX701-1700 for NX701-1720 • NX701-1600 for NX701-1620 • NJ501-1500 for NJ501-1520 • NJ501-1400 for NJ501-1420...
  • Page 34 1 Introduction to the DB Connection Service • NJ501-1300 for NJ501-1320 • NJ501-4300 for NJ501-4320 • NJ101 for NJ101-@@20 Connections to the DB on the cloud are not supported. When two or more DB Connections are established, the operation cannot be guaranteed if you set different database types for the connections.
  • Page 35: Db Connection System

    1 Introduction to the DB Connection Service 1-2-2 DB Connection System This section describes the basic and other systems of the DB Connection function. Refer to 1-3 Operation Flow of the DB Connection Service for the operation flow. Basic System The following figure shows the basic system of the DB Connection function.
  • Page 36 1 Introduction to the DB Connection Service Other Systems The following figure shows the other systems of the DB Connection function. Sysmac Studio CPU Unit Server User Program DB Connection Service DB Connection Instruction Relational EtherNet/IP database DB_Insert SQL statement DB Mapping DBConnection sent...
  • Page 37: Operation Flow Of The Db Connection Service

    1 Introduction to the DB Connection Service 1-3 Operation Flow of the DB Connection Service This section gives the basic operation flow. The DB Connection Service is basically used according to the following flow. Refer to 2-1 Starting STEP Starting Sysmac Studio Sysmac Studio and Creating a New Project.
  • Page 38 1 Introduction to the DB Connection Service Refer to 3-2 Creating a STEP Creating a Structure for DB Access Structure Data Type. Create a structure data type for DB access. The structure members must satisfy the following conditions.  Member names are the same as corresponding column name of the table to access. ...
  • Page 39 1 Introduction to the DB Connection Service Refer to 3-5 STEP Transferring a Project to the CPU Unit Programming and Transfer. Refer to 4 Basic STEP Starting the DB Connection Service Operations and Status Check. Use any of the following methods to start the DB Connection Service. ...
  • Page 40 1 Introduction to the DB Connection Service Refer to 4 Basic STEP Checking the Status with Sysmac Studio Operations and Status Check. You can check the status of the entire DB Connection Service and the connection status of each DB Connection. ...
  • Page 41 DB Connection Settings This section describes how to make the initial DB Connection settings for using the DB Connection Service. 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...
  • Page 42: Starting Sysmac Studio And Creating A New Project

    2 DB Connection Settings 2-1 Starting Sysmac Studio and Creating a New Project This section describes how to start Sysmac Studio and create a new project when using the DB Connection function. Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504) for detailed operations. Refer to B-4 Version Information for correspondence between CPU Unit and DB Connection Service versions and between CPU Unit and Sysmac Studio versions.
  • Page 43 2 DB Connection Settings . Click the Create Button. DB Connection is displayed under Host Connection Settings in the Multiview Explorer. NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 44: Setting The Built-In Ethernet/Ip Port

    2 DB Connection Settings 2-1-3 Setting the Built-in EtherNet/IP Port . Right-click Built-in EtherNet/IP Port Settings under Configurations and Setup - Controller Setup in the Multiview Explorer and select Edit from the menu. . Make the TCP/IP, LINK, FTP, NTP, SNMP, SNMP Trap, and FINS settings in the Built-in EtherNet/IP Port Settings Tab Page.
  • Page 45: Db Connection Settings

    2 DB Connection Settings 2-2 DB Connection Settings You need to make the initial DB Connection settings before executing the DB Connection Service. Please make the settings of the entire DB Connection Service and each DB Connection. This section describes the DB Connection Service settings and DB Connection settings. 2-2-1 DB Connection Service Settings Right-click DB Connection Service Settings under Configurations and Setup - Host...
  • Page 46 2 DB Connection Settings Service Settings Make a setting for Service Start, Execution Log, Debug Log, and SQL Execution Failure Log in the Service Settings. Refer to 4-1 Run Mode of DB Connection Service and Start/Stop Procedures for details on how to start the DB Connection Service.
  • Page 47 2 DB Connection Settings Category Item Description Value  Continue logging (Delete the oldest When the log is full Set the action to be taken when the log has reached the maximum number of files. file)  Stop logging (Default) ...
  • Page 48: Db Connection Settings

    2 DB Connection Settings 2-2-2 DB Connection Settings This section describes how to add and rename a DB Connection, and also describes the DB Connection setting procedure and items. Adding a DB Connection . Right-click DB Connection Settings under Configurations and Setup - Host Connection Settings - DB Connection in the Multiview Explorer and select Add - DB Connection Settings from the menu.
  • Page 49 2 DB Connection Settings Connection Settings This section describes how to make a setting of each DB Connection and how to perform a communications test.  DB Connection Settings Double-click each DB Connection that you added and make the settings in the Connection Settings.
  • Page 50  DB2: Database name (Cannot be omitted)  MySQL: Database name (Cannot be omitted)  Firebird: Database path (Cannot be omitted) e.g., C:/Firebird/OMRON.FDB  PostgreSQL: Database name (Cannot be omitted) Maximum number of bytes: 127 bytes When omitted,  Oracle: Default service ...
  • Page 51 2 DB Connection Settings Category Item Description Value  DB2: Windows user name of the server User name Set the user name for the server.  Other DBs: DB user name of the server Maximum number of characters: 127 characters Default: Blank ...
  • Page 52 2 DB Connection Settings  Communications Test You can test the connection to the DB according to the settings made in the Connection Settings* of Sysmac Studio. * This is not the DB Connection Settings that have been transferred to the Controller. You can perform the communications test while Sysmac Studio is online with the Controller.
  • Page 53: Programming The Db Connection Function

    Programming the DB Connection Function This section describes programming procedure from variable creation to DB access after making the DB Connection settings. DB Access Procedure ................... 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 ....
  • Page 54: Db Access Procedure

    3 Programming the DB Connection Function 3-1 DB Access Procedure This section describes a specific programming procedure for using the DB Connection Service. Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for the general programming procedure. Use the following procedure to access the DB using DB Connection Instructions after making the DB Connection settings.
  • Page 55: Creating A Structure Data Type

    3 Programming the DB Connection Function 3-2 Creating a Structure Data Type To access a DB, you need to create a user-defined structure data type according to the table definition of the DB. This section describes the specifications and creation procedure of the structure data type. 3-2-1 Overview You create a user-defined structure data type on Sysmac Studio based on the data type of the...
  • Page 56 3 Programming the DB Connection Function Precautions for Correct Use Restrictions on Table’s Column Names: You need to specify the same name for structure members to be used in NJ/NX-series Controllers as the column names of the table to access. There are following restrictions on structure member names in the NJ/NX-series Controllers.
  • Page 57 3 Programming the DB Connection Function Data type category Data type in DB Data type in NJ/NX-series Controllers INTERVAL DAY TO SECOND None Binary None LONG RAW None BLOB None Others BFILE None ROWID None UROWID None XMLTYPE None *1 A NULL character is attached to the end of each text string. Therefore, you need to set the value that is one byte bigger than the number of bytes of the DB’s data type for the number of bytes to be used in STRING data.
  • Page 58 3 Programming the DB Connection Function Data type category Data type in DB Data type in NJ/NX-series Controllers numeric(20) ULINT numeric(3) USINT numeric(5) UINT numeric(10) UDINT numeric(19) TIME smallint USINT smallmoney REAL tinyint USINT float LREAL real REAL Date and time date DATE datetime2...
  • Page 59 3 Programming the DB Connection Function You need to set an appropriate value for the number of bytes used in the STRING data according to the data type and character code in the DB. In NJ/NX Series, text strings are handled as UTF-8. One byte is used for each single-byte alphanumeric character and multiple bytes are used for each multi-byte character.
  • Page 60 3 Programming the DB Connection Function that is one byte bigger than the number of bytes of the DB’s data type for the number of bytes to be used in STRING data. You need to set an appropriate value for the number of bytes used in the STRING data according to the data type and character code in the DB.
  • Page 61 3 Programming the DB Connection Function *1 The DECIMAL(p[ ,s]) is expressed in the short form where the number of digits after the decimal point (s) is omitted. When the short form is used, the number of digits after the decimal point (s) is 0.
  • Page 62 3 Programming the DB Connection Function digits after the decimal point (s) is omitted. When the short form is used, the number of digits after the decimal point (s) is 0. If the number of digits after the decimal point (s) is not omitted and 1 or greater numerical value is set, only the integer portion of the value is applicable.
  • Page 63 3 Programming the DB Connection Function Data type category Data type in DB Data type in NJ/NX-series Controllers character varying(n), varchar(n) STRING Text STRING Others bit [ (n) ] None bit varying [ (n) ] None None Bytea None Cidr None Circle None...
  • Page 64: How To Create A Structure Data Type For Db Access

    3 Programming the DB Connection Function Precautions for Correct Use  When a data type that is not listed in the above tables is used in the NJ/NX-series Controller, the data may not be converted correctly.  When reading a value from a database using a DB Connection Instruction, an instruction error (SQL Execution Error) may occur because the data type cannot be converted due to the following reasons.
  • Page 65 3 Programming the DB Connection Function Pasting the Data from Microsoft Excel onto the Data Type Editor . Use two columns on Microsoft Excel to enter names and data types from the left. . In the 1st column, enter the data type name of the structure on the 1st line and each member name from the 2nd line.
  • Page 66 3 Programming the DB Connection Function Precautions for Correct Use You cannot paste the data type onto the Structure Data Type Editor in the following cases.  When a structure member is selected on the editor  When nothing is selected on the editor When executing the Paste operation on the Structure Data Type Editor, please select a structure data type, not a member.
  • Page 67: Creating A Db Map Variable

    3 Programming the DB Connection Function 3-3 Creating a DB Map Variable After creating a user-defined structure data type for DB access, you create a variable using the data type. The variable is called “DB Map Variable”. This section describes the specifications and creation procedure of DB Map Variables. 3-3-1 DB Map Variables and DB Mapping Each DB Map Variable uses a structure data type for DB access as its data type.
  • Page 68: Registration And Attributes Of Db Map Variables

    3 Programming the DB Connection Function Additional Information When a DB_CreateMapping (Create DB Map) instruction is executed to create a mapping for a DB Map Variable, it is not checked whether the structure members match the table’s columns. In this case, the DB_Insert (Insert DB Record), DB_Update (Update DB Record), or DB_Select (Retrieve DB Record) instruction will result in an error.
  • Page 69: Restrictions On Db Map Variables

    3 Programming the DB Connection Function Precautions for Correct Use When a DB Connection Instruction is used in a function block and an in-out variable of the function block is specified as a DB Map Variable, system-defined initial values for the data types are applied to the members of the DB Map Variable when the DB Connection Instruction is executed.
  • Page 70: Specifying The Table And Applying The Mapping

    3 Programming the DB Connection Function 3-4 Specifying the Table and Applying the Mapping You need to create a mapping from a DB Map Variable to the DB for each SQL type (INSERT, UPDATE, and SELECT) before you can execute a record processing instruction (for inserting, updating, or retrieving records).
  • Page 71: Restrictions On Db Mapping

    3 Programming the DB Connection Function 3-4-3 Restrictions on DB Mapping The DB mapping has the following restrictions.  Restrictions on Table’s Column Names: When a character that cannot be specified for structure member names is used in a column name of the table, you cannot create the mapping.
  • Page 72 3 Programming the DB Connection Function Create2 Trigger DB_CreateMapping Mapping members of MapVar1 Execute Done variable with columns of Table1 DBConnection Connection2 Busy of Connection1 is cleared. TableName ‘Table2’ Error Members of MapVar1 variable MapVar MapVar1 ErrorID are mapped with columns of SQLType _DB_SQLTYPE_INSERT Table2 of Connection2.
  • Page 73 3 Programming the DB Connection Function  Definition of DB Map Variables When a DB_Insert (Insert DB Record), DB_Update (Update DB Record), DB_Select (Retrieve DB Record) instruction is executed in a POU instance that is different from the POU instance where the DB_CreateMapping (Create DB Map) instruction is executed, the DB Map Variable needs to be a global variable.
  • Page 74: Programming And Transfer

    3 Programming the DB Connection Function 3-5 Programming and Transfer This section describes how to program the DB Connection Service, DB Connection Instruction set, and system-defined variables. Refer to Sample Programming of each DB Connection Instruction given in Appendix for programming examples.
  • Page 75: Displaying Db Connection Instructions On Sysmac Studio

    3 Programming the DB Connection Function 3-5-2 Displaying DB Connection Instructions on Sysmac Studio The DB Connection Instructions are displayed in the DB Connect instruction category of Toolbox of Sysmac Studio. 3-23 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 76: Db Connection Instruction Set

    3 Programming the DB Connection Function 3-5-3 DB Connection Instruction Set Instruction Name Function DB_Connect Establish DB Connects to a specified DB. Connection DB_Close Close DB Closes the connection with the DB Connection established by a DB_Connect (Establish DB Connection) instruction.
  • Page 77: System-Defined Variables

    3 Programming the DB Connection Function 3-5-4 System-defined Variables You can use the following system-defined variable in the DB Connection Service. Common Variables of NX701-@@20, NJ501-@@20, and NJ101-@@20 Variable name Initial Data type Meaning Function value Member name _DBC_Status _sDBC_STATUS DB Connection Shows the operation status of the Service Status...
  • Page 78: Simulation Debugging Of Db Connection Instructions

    3 Programming the DB Connection Function 3-5-5 Simulation Debugging of DB Connection Instructions You can perform operation check of the user program using the Simulation function of Sysmac Studio. The DB Connection Instructions perform the following operations during simulation.  The DB_Connect, DB_Close, DB_Insert, and other instructions that do not retrieve data will end normally.
  • Page 79: Debugging In Design, Startup, And Operation Phases

    3 Programming the DB Connection Function 3-6 Debugging in Design, Startup, and Operation Phases You can use the following debugging procedures according to the phase and actual device environment. 3-6-1 Design Phase This section gives the debugging procedure in the design phase. Actual device environment Debugging method CPU Unit...
  • Page 80 3 Programming the DB Connection Function 3-28 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 81: Basic Operations And Status Check

    Basic Operations and Status Check This section describes how to start and stop the DB Connection Service, how to establish and close a DB Connection, and how to check the status of the DB Connection Service and each DB Connection. Run Mode of DB Connection Service and Start/Stop Procedures ....
  • Page 82: Run Mode Of Db Connection Service And Start/Stop Procedures

    4 Basic Operations and Status Check 4-1 Run Mode of DB Connection Service and Start/Stop Procedures This section describes the Run mode of the DB Connection Service and start/stop procedures. 4-1-1 Run Mode of the DB Connection Service The DB Connection Service has two Run modes, Operation Mode and Test Mode. You can change the Run mode according to whether to actually access the DB.
  • Page 83 4 Basic Operations and Status Check Starting the Service Automatically when Operating Mode of the CPU Unit is Changed to RUN Mode Double-click DB Connection Service Settings under Configurations and Setup - Host Connection Settings - DB Connection in the Multiview Explorer. Then, set Service start in Run mode to Auto start (Operation Mode) or Auto start (Test Mode) in the Service Settings.
  • Page 84: Db Connection Service Is Stopped Or Cannot Be Started

    4 Basic Operations and Status Check You can start or stop the DB Connection Service by clicking a button. Category Item Button Operation Service Start/Stop Start (Operation The DB Connection Service is started in Operation Mode) Mode. Start (Test Mode) The DB Connection Service is started in Test Mode.
  • Page 85: Changing The Run Mode Of The Db Connection Service

    4 Basic Operations and Status Check  DB Connection Service is Stopped The DB Connection Service is stopped in the following cases.  When the DB Connection Service is stopped by a DB_ControlService (Control DB Connection Service) instruction or Sysmac Studio. ...
  • Page 86: Establishing/Closing A Db Connection

    4 Basic Operations and Status Check 4-2 Establishing/Closing a DB Connection After starting the DB Connection Service, you establish or close a DB Connection using an instruction as shown below.  Establishing a DB Connection Use a DB_Connect (Establish DB Connection) instruction to establish a DB Connection with a specified name.
  • Page 87: Checking The Status Of Db Connection Service And Each Db Connection

    4 Basic Operations and Status Check 4-3 Checking the Status of DB Connection Service and each DB Connection This section describes how to check the following status.  DB Connection Service  Each DB Connection 4-3-1 Operation Status of the DB Connection Service This section describes the operation status of the DB Connection Service.
  • Page 88: Checking The Status Of The Db Connection Service

    4 Basic Operations and Status Check Status Description Remarks Idle The DB Connection Service is not The DB Connection settings can be changed. running without having any error. The DB Connection Instructions cannot be executed. Running (Operating Mode) The DB Connection Service is The DB Connection settings cannot be running in Operation Mode.
  • Page 89 4 Basic Operations and Status Check You can check the following in the monitor unless the operation status of the DB Connection Service is Initializing or Shutdown. Category Item Description Values Operation Operation status Operation status of the DB Connection Service. - Running (Operation Mode) Information - Running (Test Mode)
  • Page 90 4 Basic Operations and Status Check Checking the Status with a System-defined Variable You can check the operation status of the DB Connection Service with the _DBC_Status system-defined variable. Use this variable when checking the status of the DB Connection Service from the user program or checking the shutdown of the DB Connection Service from an HMI.
  • Page 91: Connection Status Of Each Db Connection

    4 Basic Operations and Status Check 4-3-3 Connection Status of each DB Connection This section describes the connection status of each DB Connection. DB Connection Service Started Cannot be established Closed DB Connection Closed DB Connection Established DB Connection Service Stopped or Shutdown Can be reconnected Connected...
  • Page 92: Checking The Status Of Each Db Connection

    4 Basic Operations and Status Check 4-3-4 Checking the Status of each DB Connection You can use the following methods to check the status of each DB Connection.  Connection Monitor Table of Sysmac Studio  DB_GetConnectionStatus (Get DB Connection Status) instruction Checking the Status with Connection Monitor Table of Sysmac Studio Right-click DB Connection Settings under Configurations and Setup - Host Connection Settings - DB Connection in the Multiview Explorer and select Connection Monitor Table...
  • Page 93 4 Basic Operations and Status Check Category Item Description Values Number of error Number of times when an SQL statement execution Number of error executions failed. executions This is the number of times when an SQL statement is not spooled, but discarded. The number of times when a statement is spooled is not included.
  • Page 94 4 Basic Operations and Status Check Checking the Status using a Get DB Connection Status Instruction You can check the connection status and information of each DB Connection using a DB_GetConnectionStatus (Get DB Connection Status) instruction. Information Description Connection status of the DB Connection status (Closed, Connected, or Disconnected) of the DB Connection Connection.
  • Page 95: Other Functions

    Other Functions This section describes other functions of the DB Connection Service. Examples of Using Functions ............... 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...
  • Page 96: Examples Of Using Functions

    5 Other Functions 5-1 Examples of Using Functions This section explains examples of using functions described in this chapter. DB Connection Service has various functions corresponding to various events that will occur in exchange of data with the relational database in the server. The typical events that can occur, the outline of their countermeasures, and the relationship between the events and DB Connection Service functions are shown below.
  • Page 97 5 Other Functions • Data evacuation to user-defined variables in the user program • Implement the Refer to 5-3 DB When a server failure has Possibility of missing Connection Service occurred for a long time data stored in the countermeasures Connection Shutdown Function relational database...
  • Page 98: Spool Function

    5 Other Functions 5-2 Spool Function This section describes spooling of unsent SQL statements in the DB Connection Service. 5-2-1 Overview When a failure occurred in information exchange between DB Connection Service and DB, the unsent SQL statements are stored in a memory area and resent when the problem is solved. You can set whether to enable or disable the Spool function for each DB Connection.
  • Page 99 5 Other Functions Spooling Execution Conditions SQL statements are spooled in the following cases.  When an applicable instruction is executed, the SQL statement cannot be sent due to a network failure.  When an applicable instruction is executed, the response from the DB cannot be received due to a network failure.
  • Page 100: Memory Area Used By The Spool Function

    5 Other Functions 5-2-4 Memory Area Used by the Spool Function The following provides the memory areas that are used by the Spool function. The memory area differs for the NX-series Controllers and NJ-series Controllers. NX701-@@20 The following memory area is used by the Spool function. Memory area Description ...
  • Page 101 5 Other Functions NJ501-@@20 and NJ101-@@20 The following memory area is used by the Spool function. Memory area Description  The unsent SQL statements are stored  Total capacity of Spool memory: EM Area in the following EM Area. NJ501-@@20: 1 MB max. NJ501-@@20: NJ101-@@20: 192 KB max.
  • Page 102: Spool Function Settings

    5 Other Functions 5-2-5 Spool Function Settings Right-click a DB Connection name under Configurations and Setup - Host Connection Settings - DB Connection - DB Connection Settings in the Multiview Explorer and select Edit from the menu. Set the Spool function in the Spool Settings. Set the following items for the Spool function.
  • Page 103: How To Resend The Sql Statements Stored In The Spool Memory

    5 Other Functions 5-2-6 How to Resend the SQL Statements Stored in the Spool Memory You can resend the SQL statements stored in the Spool memory automatically or manually, which can be selected in the Resend Spool Data of the Spool Settings. Auto Resend The SQL statements stored in the Spool memory are automatically resent when the DB is reconnected.
  • Page 104: Clearing The Sql Statements From The Spool Memory

    5 Other Functions If a Failure Occurred in Information Exchange with the DB when Resending the SQL Statements If a failure occurred again when the SQL statements stored in the Spool memory are resent, the unsent SQL statements are kept in the Spool memory. The SQL statements are resent again by auto resend or manual resend.
  • Page 105 5 Other Functions When the Clear Spool Data operation is executed from Sysmac Studio You can clear the SQL statements from the Spool memory by the following operation from Sysmac Studio. . Right-click a DB Connection in the Multiview Explorer and select Clear Spool Data from the menu while online with an NJ/NX-series CPU Unit.
  • Page 106: Relationship With The Db Connection Instructions

    5 Other Functions 5-2-8 Relationship with the DB Connection Instructions This section describes the operations of DB Connection Instructions to be performed when one or more SQL statements are already stored in the Spool memory and the impacts to the spooling operations to be performed when an Instruction Execution Timeout occurred for a DB Connection Instruction.
  • Page 107 5 Other Functions  DB_Insert (Insert DB Record) or DB_Update (Update DB Record) Instruction If the Spool function is enabled, the SQL statement to send is spooled. Regardless of the Resend spool data setting, the spooled SQL statement is sent after the response to the previous DB Connection Instruction is returned.
  • Page 108: How To Estimate The Number Of Sql Statements That Can Be Spooled

    5 Other Functions 5-2-9 How to Estimate the Number of SQL Statements that Can be Spooled The number of SQL statements that can be spooled depends on the user program. This section describes how to estimate the number of SQL statements that can be spooled. ...
  • Page 109: Db Connection Service Shutdown Function

    5 Other Functions 5-3 DB Connection Service Shutdown Function This section describes the shutdown function of the DB Connection Service to prevent losing the Operation Log data. Refer to 4-3-1 Operation Status of the DB Connection Service for the information on the operation status of the DB Connection Service.
  • Page 110: Shutdown System

    5 Other Functions 5-3-2 Shutdown System The following figure shows the shutdown system. Sysmac Studio a. Shutdown operation from Sysmac Studio CPU Unit Server c. Connections are Program closed Relational Database DB Connection DB Connection Service Instruction DB_Shutdown Shutdown b. DB Connection Service is shut down EtherNet/IP port Operation Log...
  • Page 111: How To Check The Shutdown Of The Db Connection Service

    5 Other Functions Additional Information When you execute the Reset Controller operation on Sysmac Studio, the shutdown function is automatically executed before resetting the Controller. Instruction Execution Execute a DB_Shutdown (Shutdown DB Connection Service) instruction. 5-3-4 How to Check the Shutdown of the DB Connection Service Confirm that the DB Connection Service has been shut down by the following methods before turning OFF the power supply to the CPU Unit.
  • Page 112: How To Prevent Losing Sql Statements At Power Interruption

    5 Other Functions 5-4 How to Prevent Losing SQL Statements at Power Interruption This section describes how to write the user program so as not to lose the SQL statements at power interruption. 5-4-1 Overview You can prevent losing the SQL statements to send and the SQL statements stored in the Spool memory even if a power interruption occurred during execution of a record processing instruction (such as DB_Insert and DB_Update instructions) by using the Spool function in combination with the user program.
  • Page 113 5 Other Functions Necessary Actions against Power Interruption You need to take an action against power interruption according to when power interruption occurs. This section describes the necessary actions using the following figure. CPU Unit Server Program DB Connection Service 3) Sending SQL DB Connection Instruction statement...
  • Page 114 5 Other Functions Resend Flow by User Program Write the user program to re-execute the instruction that is being executed at the time of power interruption. The resend flow differs by whether a DB_Insert or DB_Update instruction is being executed at the time of power interruption. ...
  • Page 115 5 Other Functions  When a DB_Update instruction is being executed START 1st cycle of the operation? Read output parameters of Busy and SendStatus output variables Values of output parameters of Busy and SendStatus output variables Busy = TRUE and SendStatus = _DBC_SEND_SENDING Resend processing required Others...
  • Page 116: Timeout Monitoring Functions

    5 Other Functions 5-5 Timeout Monitoring Functions This section describes timeout monitoring for the DB Connection Service. 5-5-1 Timeout Monitoring Functions The following figure shows the types of timeouts that can be monitored. CPU Unit Server DB Connection Service User program EtherNet/IP DB Connection Instruction...
  • Page 117: Login Timeout

    5 Other Functions 5-5-2 Login Timeout The login timeout is monitored in the following cases.  When connecting to a DB using a DB_Connect (Establish DB Connection) instruction  When reconnecting to a DB while a DB Connection is in the Disconnected status The following table shows the operation to be performed when a login timeout has occurred.
  • Page 118: Communications Timeout

    5 Other Functions 5-5-4 Communications Timeout The communications timeout is monitored in the following cases.  When sending an SQL statement to a DB using a DB_Insert (Insert DB Record), DB_Update (Update DB Record), DB_Select (Retrieve DB Record), or DB_Delete (Delete DB Record) instruction ...
  • Page 119 5 Other Functions Precautions for Correct Use  The Keep Alive monitoring time is a common setting to the built-in EtherNet/IP port. When you set the Keep Alive monitoring time, confirm that the operations of the following functions in the built-in EtherNet/IP port are not affected before changing the value. Socket service, FTP server function, communications with Sysmac Studio, FINS/TCP 5-25 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 120: Other Functions

    5 Other Functions 5-6 Other Functions This section describes the other DB Connection functions related to the backup/restore function of the NJ/NX-series Controllers and verification of operation authority from Sysmac Studio. 5-6-1 Backup/Restore Function in the DB Connection Service The backup function is used to back up the setting data in an NJ/NX-series Controller into an SD Memory Card or a computer.
  • Page 121 5 Other Functions Additional Information The Operation Logs cannot be backed up nor restored by the Backup/Restore operation. If you want to keep the Operation Log data after replacement of the CPU Unit, insert the used SD Memory Card to the restore-destination CPU Unit after completion of the Restore operation.
  • Page 122: Operation Authority Verification In The Db Connection Service

    5 Other Functions 5-6-2 Operation Authority Verification in the DB Connection Service This function is used to restrict the online operations that can be performed on the CPU Unit from Sysmac Studio according to the operation rights. This section describes the operation authority verification function related to the DB Connection Service.
  • Page 123: How To Use Operation Logs

    How to Use Operation Logs This section describes how to use the Operation Logs for tracing the operations of the DB Connection Service. Operation Logs ..................... 6-3 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 6-2-5...
  • Page 124 6 How to Use Operation Logs Checking the Log on the Operation Log Window in Sysmac Studio ....6-25 6-6-2 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 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 125: Operation Logs

    6 How to Use Operation Logs 6-1 Operation Logs Operation Logs are used to trace the operations of the DB Connection Service on the CPU Unit. The logs are saved on the SD Memory Card mounted in the CPU Unit. The following three types of Operation Logs are provided.
  • Page 126: Execution Log

    6 How to Use Operation Logs 6-2 Execution Log This section describes the Execution Log used to trace the executions of the DB Connection Service. 6-2-1 Overview You can check the start/stop of the DB Connection Service, connection/disconnection with the DB, and success/failure of SQL statement executions with the Execution Log.
  • Page 127: Setting The Execution Log

    6 How to Use Operation Logs 6-2-3 Setting the Execution Log Double-click DB Connection Service Settings under Configurations and Setup - Host Connection Settings - DB Connection in the Multiview Explorer. Then, set the following in the Service Setting. Item Description Values Execution log...
  • Page 128 6 How to Use Operation Logs  The following is the format of records. Each record is expressed in one line and composed of multiple parameters. The parameters are separated from each other by a tab. [Serial number]<tab>[Date]<tab>[Time]<tab>[Millisecond]<tab>[Category]<tab>[Log code]<tab>[Log name]<tab>[Result]<tab>[DB Connection name]<tab>[Serial ID]<tab>[Details]<CR><LF> Parameter Size Description...
  • Page 129 6 How to Use Operation Logs Parameter Size Description Details Variable Displays the details of the Execution Log. The contents differ according to the category. In the Details parameter, information items are separated from each other by a tab. Category: DB Connection Service None Category: DB Connection [SQL status]<tab>[DB error code]<tab>[Error message]...
  • Page 130 6 How to Use Operation Logs *3 Code Category Code Operation Log recording timing (decimal) DB Connection 0001 DB Connection When the start processing of the DB Service Service Started Connection Service is completed (succeeded/failed) 0002 DB Connection When the stop processing of the DB Service Stopped Connection Service is completed (succeeded/failed)
  • Page 131 6 How to Use Operation Logs *4 Log Name Category Operation Log name DB Connection DB Connection Service Started Start Service DB Connection Service Stopped Stop DB Connection Service Shutdown Shutdown DB Connection DB Connection Established Connect DB Connection Closed Close DB Connection Disconnected Disconnect...
  • Page 132: Debug Log

    6 How to Use Operation Logs 6-3 Debug Log This section describes the Debug Log used for debugging the DB Connection Service. 6-3-1 Overview You can check which SQL statement is executed, parameters of each SQL statement, and execution results with the Debug Log. You can record this log by clicking the Start Button for Debug Log in the Online Settings Tab Page of Sysmac Studio.
  • Page 133: Setting The Debug Log

    6 How to Use Operation Logs 6-3-3 Setting the Debug Log Double-click DB Connection Service Settings under Configurations and Setup - Host Connection Settings - DB Connection in the Multiview Explorer. Then, set the following in the Service Setting. Item Description Values Number of files...
  • Page 134: Starting Recording To Debug Log

    6 How to Use Operation Logs 6-3-4 Starting Recording to Debug Log You can start recording to the Debug Log by the following methods.  Online operation from Sysmac Studio  Executing a DB_ControlService (Control DB Connection Service) instruction Start by Online Operation from Sysmac Studio .
  • Page 135: Stopping Recording To Debug Log

    6 How to Use Operation Logs 6-3-5 Stopping Recording to Debug Log You can stop recording to the Debug Log by the following methods.  Online operation from Sysmac Studio  Executing a DB_ControlService (Control DB Connection Service) instruction  Automatically stopped when a specified condition is met Stop by Online Operation from Sysmac Studio .
  • Page 136: Checking The Debug Log

    6 How to Use Operation Logs 6-3-6 Checking the Debug Log Refer to 6-6 Checking the Operation Logs for how to check the Debug Log. 6-3-7 Debug Log File Specifications This section describes the specifications of Debug Log files.  Each Debug Log file is composed of multiple records. ...
  • Page 137 6 How to Use Operation Logs Parameter Size Description Result 6 bytes (Fixed) Displays a 4-digit hexadecimal code that shows the execution result. (e.g., 0x1234) 0x0000: Succeeded Other than 0x0000: Failed (Same code as ErrorID of DB Connection Instruction) DB Connection 16 bytes max.
  • Page 138 6 How to Use Operation Logs *2 Category Category Characters displayed in the log DB Connection DB_CONNECTION SQL Execution Result SQL_RESULT User-specified Log USER *3 Code Category Code Operation Log recording timing (decimal) DB Connection 0001 DB Connection When the establishment processing of a DB Established Connection is completed (succeeded/failed) after the establishment is commanded from...
  • Page 139 6 How to Use Operation Logs *4 Log Name Category Operation Log name DB Connection DB Connection Established Connect INSERT INSERT UPDATE UPDATE SELECT SELECT DELETE DELETE SQL Execution INSERT INSERT Result UPDATE UPDATE SELECT SELECT DELETE DELETE Text string specified in the LogName User-specified Log DB_PutLog Instruction Executed input variable of the DB_PutLog...
  • Page 140: Sql Execution Failure Log

    6 How to Use Operation Logs 6-4 SQL Execution Failure Log This section describes the SQL Execution Failure Log used to trace the execution failures of the DB Connection Service due to a DB-caused factor. 6-4-1 Overview You can check the SQL statements and error information when transmission of an SQL statement failed due to a problem* of the DB itself.
  • Page 141: Checking The Sql Execution Failure Log

    6 How to Use Operation Logs 6-4-4 Checking the SQL Execution Failure Log Refer to 6-6 Checking the Operation Logs for how to check the SQL Execution Failure Log. 6-4-5 SQL Execution Failure Log File Specifications This section describes the specifications of SQL Execution Failure Log files. ...
  • Page 142 6 How to Use Operation Logs Parameter Size Description Result 6 bytes (Fixed) Displays a 4-digit hexadecimal code that shows the execution result. (e.g., 0x1234) 0x0000: Succeeded Other than 0x0000: Failed (Same code as ErrorID of DB Connection Instruction) DB Connection 16 bytes max.
  • Page 143 6 How to Use Operation Logs Category Code Operation Log recording timing (decimal)  When the DB Connection Service detected an error and could Status Error 0001 INSERT not send an SQL statement. 0002 UPDATE  When a failure occurred in information exchange between DB Connection Service and DB (when spooling is disabled) ...
  • Page 144: Sd Memory Card Operations

    6 How to Use Operation Logs 6-5 SD Memory Card Operations In the DB Connection Service, the SD Memory Card mounted in the CPU Unit is used for the Operation Log function. The Execution Log files, Debug Log files, and SQL Execution Failure Log files are stored in the SD Memory Card.
  • Page 145: Operation Log Operations In Replacing The Sd Memory Card

    6 How to Use Operation Logs 6-5-3 Operation Log Operations in Replacing the SD Memory Card This section describes operations of each Operation Log when the SD Memory Card is replaced while the DB Connection Service is running. Operation Log SD Memory Card Replacing Status function When the SD Memory Card...
  • Page 146: Replacement Timing Of Sd Memory Card

    6 How to Use Operation Logs 6-5-5 Replacement Timing of SD Memory Card  How to Know the Replacement Timing of the SD Memory Card You can know the replacement timing of the SD Memory Card by the SD Memory Card Life Exceeded Event or the SD Memory Card Life Warning Flag (_Card1Deteriorated system-defined variable).
  • Page 147: Checking The Operation Logs

    6 How to Use Operation Logs 6-6 Checking the Operation Logs This section describes how to check the Operation Logs stored on the SD Memory Card mounted in the CPU Unit. 6-6-1 How to Check the Operation Logs You can use the following methods to check the Operation Logs (i.e., Execution Log, Debug Log, and SQL Execution Failure Log).
  • Page 148 6 How to Use Operation Logs  Detailed information The Details parameter of the log is displayed.  Buttons Upload Button: The log files are uploaded from the Controller. A list of log files is displayed in the following Operation Log Dialog Box. Select a log file to display and click the OK Button.
  • Page 149: Checking The Log With The Sd Memory Card

    6 How to Use Operation Logs When you click the Yes Button, the selected log is cleared.  Execution Log Tab Page: Execution Log is cleared in the Controller.  Debug Log Tab Page: Debug Log is cleared in the Controller. ...
  • Page 150 6 How to Use Operation Logs 6-28 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 151: Troubleshooting

    Troubleshooting This section describes the error confirmation methods and corrections for errors that can occur in the DB Connection Service. 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 Troubleshooting ....................
  • Page 152: Overview Of Errors

    7 Troubleshooting 7-1 Overview of Errors You manage all of the errors that occur on the NJ/NX-series Controller as events. The same methods are used for all events. This allows you to see what errors have occurred and find corrections for them with the same methods for the entire range of errors that is managed (i.e., CPU Unit, EtherCAT slaves,* and CJ-series Units).
  • Page 153: How To Check For Errors

    7 Troubleshooting 7-1-1 How to Check for Errors You can check to see if an error has occurred with the following methods. Checking method What you can check Checking the indicators CPU Unit operating status Checking with the troubleshooting function You can check for current Controller errors, a log of past Controller of Sysmac Studio errors, error sources, error causes, corrections, and error log of...
  • Page 154 7 Troubleshooting Checking with the Troubleshooting Function of Sysmac Studio When an error occurs, you can connect Sysmac Studio online to the Controller to check current Controller errors and the log of past Controller errors. You can also check the cause of the error and corrections.
  • Page 155: Errors Related To The Db Connection Service

    7 Troubleshooting  Status Variables Variable name Data type Meaning Function _DBC_Status _sDBC_STAT DB Connection Service Shows the status of the DB Connection Service. Status BOOL Running Flag TRUE while the DB Connection Service is running. FALSE while the DB Connection Service is not running.
  • Page 156 7 Troubleshooting DB Connection Service Errors by Source The following tables list the errors in each event level that can occur for each source. DB Connection Service Errors Level Error name Major fault None Partial fault None Minor fault - Spool Memory Corrupted - Execution Log Save Failed - SQL Execution Failure Log Save Failed - DB Connection Setting Error...
  • Page 157: Troubleshooting

    7 Troubleshooting 7-2 Troubleshooting This section describes the errors that can occur in the DB Connection Service and the corrections for them. 7-2-1 Error Table The errors (i.e., events) that can occur in the DB Connection Service and DB Connection Instructions are given on the following pages.
  • Page 158 7 Troubleshooting Errors Related to DB Connection Service Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  The user application made an 14D0 0000 hex Spool Memory The Spool 7-16 Corrupted memory is invalid writing to the Spool corrupted.
  • Page 159 7 Troubleshooting Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  The DB Connection Service 95300000hex The DB 7-21 Connection Connection was successfully started. Service Service was Started started.  The DB Connection Service 7-21 95310000hex The DB...
  • Page 160 7 Troubleshooting Errors Related to DB Connection Instructions Errors are given as event codes that use the error code as the lower four digits. For descriptions of an error code, refer to the description of the corresponding event code. For example, if the error code for the instruction is 16#3000, refer to the description for event code 5401 3000 hex.
  • Page 161 7 Troubleshooting Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  A server does not exist for the 54013005hex Failed to 7-26 Connection connect to the specified IP address or the Failed specified host name. ...
  • Page 162 7 Troubleshooting Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  There is no column with the 5401 300B hex The executed 7-31 Execution SQL statement same name as a structure Error resulted in an member of the DB Map error.
  • Page 163 7 Troubleshooting Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  A value outside the valid range 5401 3010 hex Log Code Out The value of the 7-35 of Range entered log code from 0 to 9999 was specified. is outside the valid range.
  • Page 164 7 Troubleshooting Level Event code Event name Meaning Assumed cause Reference Maj Prt Min Obs Info  Though Execution Log was 5401 3017 hex Operation Log The log could 7-38 specified in the LogType input Disabled not be recorded because the variable, the Execution Log is specified disabled.
  • Page 165: Error Descriptions

    7 Troubleshooting 7-2-2 Error Descriptions Controller Error Descriptions The items that are used to describe individual errors (events) are described in the following copy of an error table. Event name Gives the name of the error. Event code Gives the code of the error. Meaning Gives a short description of the error.
  • Page 166 7 Troubleshooting Errors Related to DB Connection Service Event name Spool Memory Corrupted Event code 14D00000hex Meaning The Spool memory is corrupted. Source PLC Function Module Source details DB Connection Detection When the DB Service timing Connection Service is started Error attribute Level Minor fault...
  • Page 167 7 Troubleshooting Event name Execution Log Save Failed Event code 14D20000hex Meaning Failed to save the Execution Log to the SD Memory Card. Source PLC Function Module Source details DB Connection Detection Continuously Service timing Error attributes Level Minor fault Recovery Error reset Log category...
  • Page 168 7 Troubleshooting Event name SQL Execution Failure Log Save Failed Event code 14D30000hex Meaning Failed to save the SQL Execution Failure Log to the SD Memory Card. Source PLC Function Module Source details DB Connection Detection Continuously Service timing Error attributes Level Minor fault Recovery...
  • Page 169 7 Troubleshooting Event name DB Connection Setting Error Event code 35300000hex Meaning The DB Connection settings are not correct. Source PLC Function Module Source details DB Connection Detection At download, Service timing power ON, or Controller reset Error attributes Level Minor fault Recovery Automatic...
  • Page 170 7 Troubleshooting Event name DB Connection Disconnected Error Event code 85100000hex Meaning The DB Connection was disconnected due to an error. Source PLC Function Module Source details DB Connection Detection When a DB Service timing Connection Instruction is executed, or when Spool data is resent Error attributes...
  • Page 171 7 Troubleshooting Event name DB Connection Service Started Event code 9530 0000 hex Meaning The DB Connection Service was started. Source PLC Function Module Source details DB Connection Detection When the DB Service timing Connection Service is started Error attributes Level Information Recovery...
  • Page 172 7 Troubleshooting Event name DB Connection Service Shutdown Event code 9532 0000 hex Meaning The DB Connection Service was shut down. Source PLC Function Module Source details DB Connection Detection When the DB Service timing Connection Service is shut down. Error attributes Level Information...
  • Page 173 7 Troubleshooting Errors Related to DB Connection Instructions Event name DB Connection Service Not Started Event code 5401 3000 hex Meaning The DB Connection Service has not been started. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level...
  • Page 174 7 Troubleshooting Event name DB Connection Service Run Mode Change Failed Event code 5401 3001 hex Meaning Failed to change the Run mode of the DB Connection Service. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation...
  • Page 175 7 Troubleshooting Event name DB Connection Service Shutdown or Shutting Event code 5401 3002 hex Down Meaning The DB Connection Service is already shut down or being shut down. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level...
  • Page 176 7 Troubleshooting Event name DB Connection Rejected Event code 5401 3004 hex Meaning The DB rejected the connection. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects User program Continues.
  • Page 177 7 Troubleshooting Event name DB Connection Already Established Event code 5401 3006 hex Meaning A same-name DB Connection is already established. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects User program...
  • Page 178 7 Troubleshooting Event name Invalid DB Connection Event code 5401 3008 hex Meaning The specified DB Connection is not correct, or the DB Connection is already closed. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery...
  • Page 179 7 Troubleshooting Event name Invalid DB Map Variable Event code 5401 3009 hex Meaning The specified DB Map Variable is not correct. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects User program...
  • Page 180 7 Troubleshooting Event name Unregistered DB Map Variable Event code 5401 300A hex Meaning The specified DB Map Variable has not been registered. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects...
  • Page 181 7 Troubleshooting Event name SQL Execution Error Event code 5401 300B hex Meaning The executed SQL statement resulted in an error. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects User program...
  • Page 182 7 Troubleshooting Attached Attached information 1: Error Location information Attached information 2: Error Location Detail, Rung Number. For a program section, the rung number from the start of the section is given. For ST, the line number is given. Attached information 3: Instruction Name and Instruction Instance Name Where Error Occurred. If there is more than one instruction, all of them are given.
  • Page 183 7 Troubleshooting Event name Spool Capacity Exceeded Event code 5401 300C hex Meaning The SQL statement could not be stored in the Spool memory because its maximum capacity was exceeded. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes...
  • Page 184 7 Troubleshooting Event name Invalid Extraction Condition Event code 5401 300E hex Meaning The entered extraction condition is invalid. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category System Effects User program Continues.
  • Page 185 7 Troubleshooting Event name Log Code Out of Range Event code 5401 3010 hex Meaning The value of the entered log code is outside the valid range. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery...
  • Page 186 7 Troubleshooting Event name DB Connection Instruction Execution Timeout Event code 5401 3012 hex Meaning The instruction was not completed within the time specified for timeout. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery...
  • Page 187 7 Troubleshooting Event name Data Already Spooled Event code 5401 3014 hex Meaning One or more SQL statements are already stored in the Spool memory. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation Recovery Log category...
  • Page 188 7 Troubleshooting Event name DB in Process Event code 5401 3016 hex Meaning The instruction could not be executed because the DB is under processing in the server. Source PLC Function Module Source details Instruction Detection At instruction timing execution Error attributes Level Observation...
  • Page 189 Appendix A DB Connection Instructions 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 Instructions ......A-3 DB_Connect (Establish DB Connection) ..............A-6 DB_Close (Close DB Connection) ................A-9 DB_CreateMapping (Create DB Map) ..............
  • Page 190: Db Connection Instructions And Variables

    Appendix A A-1 DB Connection Instructions and Variables A-1-1 DB Connection Instruction Set This section gives a list of DB Connection Instructions. Instruction Name Page DB_Connect Establish DB Connection DB_Close Close DB Connection DB_CreateMapping Create DB Map A-11 DB_Insert Insert DB Record A-14 DB_Update Update DB Record...
  • Page 191: Variables Used In The Db Connection Instructions

    Appendix A A-1-2 Variables Used in the DB Connection Instructions This section describes the details of the variables used in the DB Connection Instructions. Common Input and Output Variables Used in the DB Connection Instructions  DBConnection Input variable Meaning Data type Description DBConnection...
  • Page 192 Appendix A Output variable Meaning Data type Description Member FailedCnt Number of Error DINT Number of times when an SQL statement Executions execution failed in the DB Connection. DBRespTime DB Response TIME Time since an SQL statement is sent from the Time CPU Unit until the SQL execution result is returned from the CPU Unit when an SQL...
  • Page 193 Appendix A Common Variables Used in NJ/NX-series Instructions Input variable Meaning Data type Description Execute Execute BOOL The instruction is executed when Execute changes to TRUE. Output variable Meaning Data type Description Shows whether the instruction is Done Done BOOL normally completed.
  • Page 194: Db_Connect (Establish Db Connection

    Appendix A DB_Connect (Establish DB Connection) The DB_Connect instruction connects to a specified DB. Instruction Name FB/FUN Graphic expression ST expression DB_Connect Establish DB_Connect_instance(Execute, DB_Connect_instance DBConnectionName, Done, Busy, Connection Error, ErrorID, DBConnection); DB_Connect Execute Done DBConnectionName Busy Error ErrorID DBConnection The DB_Connect_instance is an instance of DB_Connect instruction, which is declared as a variable.
  • Page 195 Appendix A Related Error Codes Error code Meaning Description The DBConnectionName input variable is a text string consisting of 0406 hex Illegal Data Position Specified NULL characters (16#00) only.  A space character is included in the text string specified for the 0410 hex Text String Format Error DBConnectionName input variable.
  • Page 196 Appendix A Precautions for Correct Use  Execution of this instruction is continued until processing is completed 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 completed.
  • Page 197: Db_Close (Close Db Connection

    Appendix A DB_Close (Close DB Connection) The DB_Close instruction closes the connection with the DB established by a DB_Connect (Establish DB Connection) instruction. Instruction Name FB/FUN Graphic expression ST expression DB_Close Close DB DB_Close_instance (Execute, DB_Close_instance Connection DBConnection, Done, Busy, Error, ErrorID);...
  • Page 198 Appendix A Related Error Codes Error code Meaning Description 041D hex Too Many Instructions Executed at the More than 32 DB Connection Instructions were executed at the same Same Time time. 3000 hex DB Connection Service not Started The instruction was executed when the DB Connection Service was not running.
  • Page 199: Db_Createmapping (Create Db Map

    Appendix A DB_CreateMapping (Create DB Map) The DB_CreateMapping instruction creates a mapping from a DB Map Variable to a table of a DB. Instruction Name FB/FUN Graphic expression ST expression DB_CreateMapping Create DB_CreateMapping_instance DB_CreateMapping_instance DB Map (Execute, DBConnection, DB_CreateMapping TableName, MapVar, SQLType, Done, Busy, Error, Done Execute...
  • Page 200 Appendix A Error Error BOOL TRUE or TRUE when the instruction is terminated due to FALSE an error. ErrorID Error Code WORD 16#0000 to Contains the error code when an error occurs. 16#FFFF Related System-defined Variables Name Meaning Data type Description _EIP_EtnOnlineSta Online...
  • Page 201 Appendix A Precautions for Correct Use  Execution of this instruction is continued until processing is completed 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 completed.
  • Page 202: Db_Insert (Insert Db Record

    Appendix A DB_Insert (Insert DB Record) The DB_Insert instruction inserts values of a DB Map Variable to a table of the connected DB as a record. Instruction Name FB/FUN Graphic expression ST expression DB_Insert Insert DB DB_Insert_instance (Execute, DB_Insert_instance Record DBConnection, MapVar, TimeOut, Done, Busy, Error, DB_Insert...
  • Page 203 Appendix A Related System-defined Variables Name Meaning Data type Description _EIP_EtnOnlineSta Online BOOL Status of the communications function of the built-in EtherNet/IP port. TRUE: Can be used. FALSE: Cannot be used. Related Error Codes Error code Meaning Description The value of the TimeOut input variable is outside the valid range. 0400 hex Input Value Out of Range 041D hex...
  • Page 204 Appendix A Function This instruction is used to insert the values of the DB Map Variable specified in the MapVar input variable to the table mapped by a DB_CreateMapping instruction as a record. When the Spool function is enabled, the SQL statement is stored in the Spool memory in the following cases. In these cases, _DBC_SEND_SPOOLED is set in the SendStatus output variable and the instruction is terminated due to an error.
  • Page 205 Appendix A was in progress  When the instruction was executed while the DB Connection Service was stopped due to an error  When the instruction was executed after the DB Connection Service was shut down or while the DB Connection Service was being shut down ...
  • Page 206: Db_Update (Update Db Record

    Appendix A DB_Update (Update DB Record) The DB_Update (Update DB Record) instruction updates the values of a record of a table with the values of a DB Map Variable. Instruction Name FB/FUN Graphic expression ST expression DB_Update Update DB DB_Update_instance (Execute, DB_Update_instance Record DBConnection, MapVar, Where,...
  • Page 207 Appendix A Output Variables Name Meaning Data type Valid range Unit Description Done Done BOOL TRUE or TRUE when the instruction is normally FALSE completed. Busy Executing BOOL TRUE or TRUE when the instruction is being executed. FALSE Error Error BOOL TRUE or TRUE when the instruction is terminated due to...
  • Page 208 Appendix A 3016 hex DB in Process The instruction was executed before completion of the DB’s processing for the DB Connection Instruction Execution Timeout that occurred for the previous DB_Insert, DB_Update, DB_Select, or DB_Delete instruction. Function This instruction is used to update the values of the records retrieved from the table mapped by a DB_CreateMapping instruction according to the retrieval conditions specified in the Where input variable (WHERE clause) with the values of a DB Map Variable specified in the MapVar input variable.
  • Page 209 Appendix A If an instruction error (SQL Execution Error) occurs when the Spool function is enabled, the transmitted SQL statement itself can be the cause of the SQL Execution Error, for example, due to a retrieval condition setting error. Therefore, the SQL statement is not stored in the Spool memory because the SQL Execution Error may occur again when the SQL statement is resent.
  • Page 210 Appendix A  When the value of the Timeout input variable is outside the valid range  When the executed SQL statement resulted in an error in the DB  When the combination of data types is not listed in the table of data type correspondence between NJ/NX-series Controllers and database and the data type cannot be converted ...
  • Page 211 Appendix A Name Data type Initial value Comment RS_Connect_instance Instance of RS instruction Operating_Connect BOOL FALSE The DB_Connect instruction is executed when this variable is TRUE. OperatingEnd_Connect BOOL FALSE This variable changes to TRUE when the DB_Connect instruction is completed. DB_CreateMapping_Insert_instance DB_CreateMapping Instance of DB_CreateMapping...
  • Page 212 Appendix A  Sample Programming - Establish a DB Connection named MyDatabase1 and map a table with a variable. Check the completion of DB_Connect and DB_CreateMapping instructions. DB_CreateMapping_Update_instance.Done OperatingEnd_Connect DB_Connect_instance.Error DB_CreateMapping_Insert_instance.Error DB_CreateMapping_Update_instance.Error Accept the trigger for establishing the DB Connection. RS_Connect_instance Trigger_Connect _DBC_Status.Run...
  • Page 213 Appendix A Map the variable MapVar_Update to the table Production of the DB Connection MyDB1 for the UPDATE operation. DB_CreateMapping_Update_instance DB_CreateMapping_Insert_instance.Done DB_CreateMapping Execute Done MyDB1 DBConnection Busy ‘Production’ TableName Error MapVar_Update MapVar ErrorID _DBC_SQLTYPE_UPDATE SQLType When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_Connect). Program the FaultHandler_Connect according to the device.
  • Page 214 Appendix A Insert production data to the DB Connection MyDB1. Set the timeout for instruction execution to 200 ms. DB_Insert_instance Operating_Insert DB_Insert Execute Done MyDB1 DBConnection Busy MapVar_Insert MapVar Error T#200ms TimeOut ErrorID SendStatus When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_Insert). Program the FaultHandler_Insert according to the device.
  • Page 215 Appendix A Update production data in the DB Connection MyDB1. Set the timeout for instruction execution to 500 ms. DB_Update_instance Operating_Update DB_Update Execute Done MyDB1 DBConnection Busy MapVar_Update MapVar Error WhereCond Where ErrorID T#500ms TimeOut RecCnt SendStatus When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_Update). Program the FaultHandler_Update according to the device.
  • Page 216 Appendix A Structured Text (ST)  Main Variables Name Data type Initial value Comment _DBC_Status _sDBC_STATUS System-defined variable that shows the status of the DB Connection Service DB_Connect_instance DB_Connect Instance of DB_Connect instruction MyDB1 DWORD This variable is assigned to the DBConnection output variable from DB_Connect_instance.
  • Page 217 Appendix A Name Data type Initial value Comment DB_Close_instance DB_Close Instance of DB_Close instruction Trigger_Close BOOL FALSE Variable used as a trigger for closing the DB Connection LastTrigger_Close BOOL FALSE Variable to retain the trigger status of the previous execution Operating_Close BOOL FALSE...
  • Page 218 Appendix A // Map the variable MapVar_Insert to the table Production of the DB Connection MyDB1 for the INSERT operation. // Map the variable MapVar_Update to the table Production of the DB Connection MyDB1 for the UPDATE operation. IF (Operating_Connect=TRUE) THEN CASE Stage OF 1 : // Establish the DB Connection DB_Connect_instance(...
  • Page 219 Appendix A Operating_Connect := FALSE; END_CASE; END_IF; // --------------------------------------------------------------------------------------------------------------------- // - Insert production data to DB Connection MyDB1 when the variable Trigger_Insert changes to TRUE. // Start the sequence when the variable Trigger_Insert changes to TRUE. IF ( (Trigger_Insert=TRUE) AND (LastTrigger_Insert=FALSE) ) THEN OperatingStart_Insert := TRUE;...
  • Page 220 Appendix A // Program the error handler (FaultHandler_Insert) according to the device. FaultHandler_Insert(); Operating_Insert := FALSE; END_IF; END_IF; END_IF; // --------------------------------------------------------------------------------------------------------------------- // - Update the records in the DB Connection MyDB1 when the variable Trigger_Update changes to TRUE. // Start the sequence when the variable Trigger_Update changes to TRUE. IF ( (Trigger_Update=TRUE) AND (LastTrigger_Update=FALSE) ) THEN OperatingStart_Update := TRUE;...
  • Page 221 Appendix A IF (DB_Update_instance.Error=TRUE) THEN // Go to the next step when the instruction is not completed within the specified time. IF (DB_Update_instance.ErrorID = 16#3012) THEN Operating_Update:=FALSE; // Normal end ELSE // Execute the error handler. // Implement the error handler (FaultHandler_Update) according to the device. FaultHandler_Update();...
  • Page 222: Db_Select (Retrieve Db Record

    Appendix A DB_Select (Retrieve DB Record) The DB_Select instruction retrieves records from a table to a DB Map Variable. Instruction Name FB/FUN Graphic expression ST expression DB_Select Retrieve DB DB_Select_instance (Execute, DB_Select_instance Record DBConnection, Where, Sort, TimeOut, MapVar, Done, Busy, DB_Select Error, ErrorID, RecCnt, Done...
  • Page 223 Appendix A In-out Variables Name Meaning Data type Valid range Unit Description MapVar DB Map Structure, Depends on Specify the DB Map Variable mapped by a Variable Structure the data type. DB_CreateMapping instruction. array (entire array) Output Variables Name Meaning Data type Valid range Unit...
  • Page 224 Appendix A 3011 hex DB Connection Disconnected Error Status The DB Connection Service cannot communicate with the DB due to a network failure or other causes. 3012 hex DB Connection Instruction Execution The instruction was not completed within the time specified in the TimeOut input variable.
  • Page 225 Appendix A When using single quotes in the WHERE and SORT clauses, use the escape character ($’). Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for the escape character. Refer to the manual of the database for the format of the WHERE and SORT clauses. Specify the retrieval conditions by the following values in the Where input variable.
  • Page 226 Appendix A the DB Map Variable is STRING[11], this instruction can retrieve only up to 11 characters, but will be normally ended.  When the error code is 300B hex (SQL Execution Error), you can get the detailed information of the SQL Execution Error by executing a DB_GetConnectionStatus instruction.
  • Page 227: Db_Delete (Delete Db Record

    Appendix A DB_Delete (Delete DB Record) The DB_Delete instruction deletes the records that match the conditions from a specified table. Instruction Name FB/FUN Graphic expression ST expression DB_Delete Delete DB DB_Delete_instance (Execute, DB_Delete_instance Record DBConnection, TableName, DB_Delete Where, TimeOut, Done, Busy, Error, ErrorID, RecCnt);...
  • Page 228 Appendix A Output Variables Name Meaning Data type Valid range Unit Description Done Done BOOL TRUE or FALSE TRUE when the instruction is normally completed. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is being executed. Error Error BOOL TRUE or FALSE TRUE when the instruction is terminated due to...
  • Page 229 Appendix A Function This instruction is used to delete the records that match the conditions specified in the Where input variable from the table specified in the TableName input variable. The records to delete are retrieved according to the retrieval conditions specified in the Where input variable (WHERE clause).
  • Page 230 Appendix A  When the instruction was executed after the DB Connection Service was shut down or while the DB Connection Service was being shut down  When the value of the DBConnection input variable is invalid or the specified DB Connection is already closed ...
  • Page 231 Appendix A Name Data type Initial value Comment MyDB1 DWORD This variable is assigned to the DBConnection output variable from DB_Connect_instance. LotNo UINT 1234 Variable to specify the lot number for retrieving/deleting DB records Trigger_Connect BOOL FALSE Variable used as a trigger for establishing a DB Connection RS_Connect_instance Instance of RS instruction...
  • Page 232 Appendix A  Sample Programming - Establish a DB Connection named MyDatabase1 and map a table with a variable. Check the completion of DB_Connect and DB_CreateMapping instructions. DB_CreateMapping_Select_instance.Done OperatingEnd_Connect DB_Connect_instance.Error DB_CreateMapping_Select_instance.Error Accept the trigger for establishing the DB Connection. RS_Connect_instance Trigger_Connect _DBC_Status.Run Operating_Connect...
  • Page 233 Appendix A - Retrieve records for the specified lot number from the DB Connection MyDB1 when the variable Trigger_Select changes to TRUE. Check the completion of the DB_Select instruction. DB_Select_instance.Done OperatingEnd_Select DB_Select_instance.Error Accept the trigger for retrieving DB records. RS_Select_instance Trigger_Select Operating_Select OperatingEnd_Select...
  • Page 234 Appendix A - Delete the records other than the latest one from the DB table Check the completion of the DB_Delete instruction. DB_Delete_instance.Done OperatingEnd_Delete DB_Delete_instance.Error Accept the trigger for deleting DB records. RS_Delete_instance Operating_Delete Request_Delete OperatingEnd_Delete Reset1 Create the conditions for the Where clause. Operating_Delete // Create the conditions for the Where clause (Delete the records other than the latest one) WhereCond_Delete := CONCAT( '"LotNo"...
  • Page 235 Appendix A - Close the DB Connection MyDB1. Check the completion of the DB_Close instruction. DB_Close_instance.Done OperatingEnd_Close DB_Close_instance.Error Accept the trigger for closing the DB Connection. RS_Close_instance Trigger_Close Operating_Close OperatingEnd_Close Reset1 Close the DB Connection MyDB1. DB_Close_instance Operating_Close DB_Close Execute Done MyDB1 DBConnection...
  • Page 236 Appendix A Name Data type Initial value Comment TRUE. DB_CreateMapping_Select_instance DB_CreateMapping Instance of DB_CreateMapping instruction This variable is assigned to the MapVar input MapVar_Select ARRAY[0..99] OF variable to DB_CreateMapping_Select_instance. PRODUCTION_SEL DB_Select_instance DB_Select Instance of DB_Select instruction Trigger_Select BOOL FALSE Variable used as a trigger for retrieving DB records LastTrigger_Select BOOL...
  • Page 237 Appendix A  Sample Programming // --------------------------------------------------------------------------------------------------------------------- // - Establish a DB Connection named MyDatabase1 and map a table with a variable. // Start the sequence when the variable Trigger_Connect changes to TRUE. IF ( (Trigger_Connect=TRUE) AND (LastTrigger_Connect=FALSE) AND (_DBC_Status.Run=TRUE) ) THEN OperatingStart_Connect := TRUE;...
  • Page 238 Appendix A DB_CreateMapping_Select_instance( Execute := TRUE, DBConnection := MyDB1, TableName := 'Production', MapVar := MapVar_Select, SQLType := _DBC_SQLTYPE_SELECT IF (DB_CreateMapping_Select_instance.Done=TRUE) THEN Operating_Connect:=FALSE; // Normal end END_IF; IF (DB_CreateMapping_Select_instance.Error=TRUE) THEN Stage := INT#99; // Error END_IF; 99 : // Execute the error handler. // Program the error handler (FaultHandler_Connect) according to the device.
  • Page 239 Appendix A // Retrieve the records from the DB Connection MyDB1. Timeout is not monitored for the instruction execution. IF (Operating_Select=TRUE) THEN // Retrieve records. DB_Select_instance( Execute := TRUE, DBConnection := MyDB1, Where := WhereCond_Select, Sort := SortCond_Select, MapVar := MapVar_Select IF (DB_Select_instance.Done=TRUE) THEN // If two or more records were retrieved, delete the older records.
  • Page 240 Appendix A OperatingStart_Delete := FALSE; END_IF; // Delete records from the table Production of the DB Connection MyDB1. Timeout is not monitored for the instruction execution. IF (Operating_Delete=TRUE) THEN // Delete the records. DB_Delete_instance( Execute := TRUE, DBConnection := MyDB1, TableName := 'Production', Where...
  • Page 241 Appendix A // Close the DB Connection. DB_Close_instance( Execute:=TRUE, DBConnection:=MyDB1 ); IF (DB_Close_instance.Done=TRUE) THEN Operating_Close := FALSE; // Normal end END_IF; IF (DB_Close_instance.Error=TRUE) THEN // Error handler // Program the error handler (FaultHandler_Close) according to the device. FaultHandler_Close(); Operating_Close := FALSE; END_IF;...
  • Page 242: Db_Controlservice (Control Db Connection Service

    Appendix A DB_ControlService (Control DB Connection Service) The DB_ControlService instruction starts/stops the DB Connection Service or starts/finishes recording to the Debug Log. Instruction Name FB/FUN Graphic expression ST expression DB_ControlService Control DB DB_ControlService_instance DB_ControlService_instance Connection (Execute, Cmd, Done, Busy, Service Error, ErrorID);...
  • Page 243 Appendix A Related System-defined Variables System-defined Name Data Valid range Unit Description variables type _DBC_Status.Idle DB Connection BOOL TRUE or FALSE TRUE when the operation status of the DB Service Idle Status Connection Service Idle. Otherwise, FALSE. _DBC_Status.Run DB Connection BOOL TRUE or FALSE TRUE when the DB Connection Service is...
  • Page 244 Appendix A Function This instruction is used to start and stop the DB Connection Service, and start and finish recording to the Debug Log. When the DB can be connected, start the DB Connection Service in Operation Mode. When there is no DB, for example, in the course of development, start the DB Connection Service in Test Mode. In this case, the following instructions are normally completed without accessing the DB and executing the SQL statement actually.
  • Page 245 Appendix A  When start of the DB Connection Service was commanded while the DB Connection Service was being stopped.  When this instruction was executed with _DBC_CMD_DEBUGLOG_ON selected in the Cmd input variable when the SD Memory Card was not available or write-protected ...
  • Page 246 Appendix A Start recording to the Debug Log. LogOn MOVE _eDBC_CMD#_DBC_CMD_DEBUGLOG_ON MyCmd Finish recording to the Debug Log. LogOn MOVE _eDBC_CMD#_DBC_CMD_DEBUGLOG_OFF MyCmd Command to start/finish recording to the Debug Log. DB_ControlService_instance Operating DB_ControlService Execute Done MyCmd Busy Error ErrorID When the instruction is normally completed, change the variable ControlService_OK to TRUE. Operating DB_ControlService_instance.Done // Normal end processing...
  • Page 247 Appendix A  Sample Programming (* --------------------------------------------------------------------------------------------------------------------- - Start recording to the Debug Log when the variable LogOn changes to TRUE. Finish the recording when the variable LogOn changes to FALSE. --------------------------------------------------------------------------------------------------------------------- *) // Start the sequence when the variable LogOn changes to TRUE. IF ( (LogOn=TRUE) AND (LastTrigger=FALSE) ) THEN OperatingStart := TRUE;...
  • Page 248: Db_Getservicestatus (Get Db Connection Service Status

    Appendix A DB_GetServiceStatus (Get DB Connection Service Status) The DB_GetServiceStatus instruction gets the current status of the DB Connection Service. Instruction Name FB/FUN Graphic expression ST expression DB_GetService Get DB DB_GetServiceStatus_instance DB_GetServiceStatus_instance Status Connection (Execute, Done, Busy, Error, Service Status ErrorID, ServiceStatus);...
  • Page 249 Appendix A Related Error Codes Error code Meaning Description 041D hex Too Many Instructions Executed at the More than 32 DB Connection Instructions were executed at the same Same Time time. 3002 hex DB Connection Service Shutdown or The instruction was executed after the DB Connection Service was Shutting Down shut down or while the DB Connection Service was being shut down.
  • Page 250 Appendix A Name Data type Initial value Comment RS_instance Instance of RS instruction This variable is assigned to the ServiceStatus MyStatus _sDBC_SERVICE_STATUS input variable to DB_GetServiceStatus_instance. Warning BOOL FALSE This variable changes to TRUE when the number of error executions is 100 or greater. GetServiceStatus_OK BOOL FALSE...
  • Page 251 Appendix A Structured Text (ST)  Main Variables Name Data type Initial value Comment DB_GetServiceStatus_instance DB_GetServiceStatus Instance of DB_GetServiceStatus instruction Trigger BOOL FALSE Variable used as a trigger for getting the status of the DB Connection Service LastTrigger BOOL FALSE Variable to retain the trigger status of the previous execution Operating...
  • Page 252 Appendix A  Sample Programming (* --------------------------------------------------------------------------------------------------------------------- - Change the value of the variable Warning to TRUE when the number of SQL execution failures in all connections is 100 or greater. --------------------------------------------------------------------------------------------------------------------- *) // Start the sequence when the variable Trigger changes to TRUE. IF ( (Trigger=TRUE) AND (LastTrigger=FALSE) ) THEN OperatingStart := TRUE;...
  • Page 253: Db_Getconnectionstatus (Get Db Connection Status

    Appendix A DB_GetConnectionStatus (Get DB Connection Status) The DB_GetConnectionStatus instruction gets the status of a DB Connection. Instruction Name FB/FUN Graphic expression ST expression DB_GetConnection Get DB DB_GetConnectionStatus_i DB_GetConnectionStatus_instance Status Connection nstance (Execute, DB_GetConnectionStatus Status DBConnectionName, Done, Busy, Error, ErrorID, Done Execute ConnectionStatus);...
  • Page 254 Appendix A Related System-defined Variables Name Meaning Data type Description _EIP_EtnOnlineSta Online BOOL Status of the communications function of the built-in EtherNet/IP port. TRUE: Can be used. FALSE: Cannot be used. Related Error Codes Error code Meaning Description The DBConnectionName input variable is a text string consisting of NULL 0406 hex Illegal Data Position Specified characters (16#00) only.
  • Page 255 Appendix A  When the instruction was executed while the DB Connection Service was stopped due to an error  When the instruction was executed after the DB Connection Service was shut down or while the DB Connection Service was being shut down ...
  • Page 256 Appendix A  Sample Programming - Change the variable Warning to TRUE when the Spool usage of the DB Connection named MyDatabase1 has exceeded 80%. Check the completion of the DB_GetConnectionStatus instruction. DB_GetConnectionStatus_instance.Done OperatingEnd DB_GetConnectionStatus_instance.Error Accept the trigger. RS_instance Trigger Operating OperatingEnd Reset1...
  • Page 257 Appendix A Structured Text (ST)  Main Variables Name Data type Initial value Comment DB_GetConnectionStatus_instance DB_GetConnectionStatus Instance of DB_GetConnectionStatus instruction Trigger BOOL FALSE Variable used as a trigger for getting the status of the DB Connection LastTrigger BOOL FALSE Variable to retain the trigger status of the previous execution Operating BOOL...
  • Page 258 Appendix A  Sample Programming (* --------------------------------------------------------------------------------------------------------------------- Change the variable Warning to TRUE when the Spool usage of the DB Connection named MyDababase1 has exceeded 80%. --------------------------------------------------------------------------------------------------------------------- *) // Start the sequence when the variable Trigger changes to TRUE. IF ( (Trigger=TRUE) AND (LastTrigger=FALSE) ) THEN OperatingStart := TRUE;...
  • Page 259: Db_Controlspool (Resend/Clear Spool Data

    Appendix A DB_ControlSpool (Resend/Clear Spool Data) The DB_ControlSpool instruction resends or clears the SQL statements spooled by DB_Insert (Insert DB Record) and DB_Update (Update DB Record) instructions. Instruction Name FB/FUN Graphic expression ST expression DB_ControlSpool Resend/Clear DB_ControlSpool_instance DB_ControlSpool_instance Spool Data (Execute, DBConnection, DB_ControlSpool Cmd, Done, Busy, Error,...
  • Page 260 Appendix A Related System-defined Variables Name Meaning Data type Description _EIP_EtnOnlineSta Online BOOL Status of the communications function of the built-in EtherNet/IP port. TRUE: Can be used. FALSE: Cannot be used. Related Error Codes Error code Meaning Description A value that is not defined as an enumerator was specified in the Cmd 0400 hex Input Value Out of Range input variable.
  • Page 261 Appendix A  An error occurs for this instruction in the following cases. Error will be TRUE.  When the Resend Spool Data operation was executed by this instruction when the DB Connection Service was not running  When the instruction was executed while the initialization processing of the DB Connection Service was in progress ...
  • Page 262 Appendix A  Sample Programming - Resend the SQL statements stored in the Spool memory when the status of the DB Connection is Connected. Check the completion of the instruction. Nosent OperatingEnd DB_GetConnectionStatus_instance.Error DB_ControlSpool_instance.Done DB_ControlSpool_instance.Error Accept the trigger. RS_instance Trigger Operating OperatingEnd Reset1...
  • Page 263 Appendix A When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_GetConnectionStatus). Program the FaultHandler_GetConnectionStatus according to the device. Operating DB_GetConnectionStatus_instance.Error // Error handler FaultHandler_GetConnectionStatus(); Resend the Spool data. DB_ControlSpool_instance Operating Resend DB_ControlSpool Execute Done MyDB1...
  • Page 264 Appendix A Structured Text (ST)  Main Variables Name Data type Initial value Comment DB_GetConnectionStatus_instance DB_GetConnectionStatus Instance of DB_GetConnectionStatus instruction DB_ControlSpool_instance DB_ControlSpool Instance of DB_ControlSpool instruction Trigger BOOL FALSE Variable used as a trigger for resending the Spool data LastTrigger BOOL FALSE Variable to retain the trigger status of...
  • Page 265 Appendix A // Get the status of the DB Connection. DB_GetConnectionStatus_instance( Execute := TRUE, DBConnectionName := 'MyDatabase1', ConnectionStatus => MyStatus IF (DB_GetConnectionStatus_instance.Done=TRUE) THEN // Normal end processing // Change the variable Resend to TRUE when the status of the DB Connection is Connected. IF (MyStatus.Status = _DBC_CONNECTION_STATUS_CONNECTED) THEN Resend := TRUE;...
  • Page 266: Db_Putlog (Record Operation Log

    Appendix A DB_PutLog (Record Operation Log) The DB_PutLog instruction puts a user-specified record into the Execution Log or Debug Log. Instruction Name FB/FUN Graphic expression ST expression DB_PutLog Record DB_PutLog_instance (Execute, DB_PutLog_instance Operation Log LogType, LogCode, LogName, DB_PutLog LogMsg, Done, Busy, Error, ErrorID);...
  • Page 267 Appendix A Related Error Codes Error code Meaning Description 0400 hex Input Value Out of Range A value that is not defined as an enumerator was specified in the LogType input variable. 041D hex Too Many Instructions Executed at the More than 32 DB Connection Instructions were executed at the same Same Time time.
  • Page 268 Appendix A When the Execution Log is specified: The log is recorded to the internal buffer of the CPU Unit and the instruction is completed normally. When an SD Memory Card is inserted into the CPU Unit, the log records stored in the internal buffer are saved into the SD Memory Card.
  • Page 269 Appendix A  Sample Programming -Record the log code 100, log name Production Order, and log message Production Start, RecipeCode=12345678 into the Execution Log. Check the completion of the DB_PutLog instruction. DB_PutLog_instance.Done OperatingEnd DB_PutLog_nstance.Error Accept the trigger. RS_instance Trigger Operating OperatingEnd Reset1 Create the log message.
  • Page 270 Appendix A Structured Text (ST)  Main Variables Name Data type Initial value Comment DB_PutLog_instance DB_PutLog Instance of DB_PutLog instruction Trigger BOOL FALSE Variable used as a trigger for recording the user-specified log LastTrigger BOOL FALSE Variable to retain the trigger status of the previous execution Operating BOOL FALSE...
  • Page 271 Appendix A END_IF; IF (DB_PutLog_instance.Error=TRUE) THEN // Error handler Operating := FALSE; END_IF; END_IF; A-83 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 272: Db_Shutdown (Shutdown Db Connection Service

    Appendix A DB_Shutdown (Shutdown DB Connection Service) The DB_Shutdown instruction shuts down the DB Connection Service so as to prevent losing the Operation Log data. Instruction Name FB/FUN Graphic expression ST expression DB_Shutdown Shutdown DB DB_Shutdown_instance (Execute, DB_Shutdown_instance Connection Done, Busy, Error, ErrorID); DB_Shutdown Service Done...
  • Page 273 Appendix A Related Error Codes Error code Meaning Description 041D hex Too Many Instructions Executed at the More than 32 DB Connection Instructions were executed at the same Same Time time. 3001 hex DB Connection Service Run Mode Change The instruction was executed while the stopping processing of the DB Failed Connection Service was in progress.
  • Page 274 Appendix A Sample Programming This section gives sample programming for shutting down the DB Connection Service when the trigger variable changes to TRUE. Ladder Diagram  Main Variables Name Data type Initial value Comment DB_Shutdown_instance DB_Shutdown Instance of DB_Shutdown instruction Trigger BOOL FALSE...
  • Page 275 Appendix A  Sample Programming (* --------------------------------------------------------------------------------------------------------------------- ♦ Shut down the DB Connection Service. --------------------------------------------------------------------------------------------------------------------- *) // Start the sequence when the variable Trigger changes to TRUE. IF ( (Trigger=TRUE) AND (LastTrigger=FALSE) ) THEN OperatingStart := TRUE; Operating := TRUE; END_IF;...
  • Page 276 Appendix A A-88 NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 277: Appendix B

    Appendix B 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 Connection Instructions ..B-7 B-1-4 Guideline for System Service Execution Time Ratio .......
  • Page 278: Task Design Procedure

    Appendix B B-1 Task Design Procedure This section describes the task design procedure for using the DB Connection function. Refer to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for task and system service operation specifications of the NJ/NX-series Controllers. B-1-1 Startup Time of DB Connection Service The time required to get the DB Connection Service ready for operation (i.e.
  • Page 279 Appendix B  NJ101-1020 DB type Percentage of task Reference value for startup time of the DB execution time Connection Service (Average) Oracle 75.59 s 89.31 s 56.36 s SQL Server 67.17 s 61.90 s 73.35 s 54.46 s MySQL 66.83 s 57.61 s Firebird...
  • Page 280: Reference Values For Execution Time Of Db Connection Instructions

    Appendix B Reference Values for Execution Time of DB Connection Instructions B-1-2 The DB Connection Instructions are function block type of instructions that are executed over multiple task periods. The following table gives the reference values for execution time of each DB Connection Instruction. Refer to B-2-1 Restrictions to Execution Time of DB Connection Instructions for the factors that fluctuate execution time of DB Connection Instructions.
  • Page 281 Appendix B  NJ501-1520 Percentage of Reference value task execution for instruction execution time DB type Instruction time Average Maximum Oracle Database 11g DB_Insert 16.2 ms 65 ms DB_Select 37.1 ms 75 ms DB_Insert 49.2 ms 184 ms DB_Select 101.6 ms 272 ms SQL Server 2012 DB_Insert...
  • Page 282 Appendix B Percentage of Reference value task execution for instruction execution time DB type Instruction time Average Maximum DB_Insert 41.3 ms 471 ms DB_Select 66.0 ms 433 ms Measurement Condition 2 The following table shows the measurement conditions and items. Measurement conditions Description Item...
  • Page 283: B-1-3 How To Measure Execution Time Of Db Connection Instructions

    Appendix B B-1-3 How to Measure Execution Time of DB Connection Instructions The execution time of DB Connection Instructions can be measured by a Get1msCnt instruction. The instruction calculates the value of free-running counter of the cycle from when the Busy output variable changes to TRUE to when the variable changes to FALSE.
  • Page 284: Guideline For System Service Execution Time Ratio

    Appendix B B-1-4 Guideline for System Service Execution Time Ratio The DB Connection Service is executed as a system service. When a DB Connection Instruction is executed by a user program, the DB Connection Service executes the processing as a system service. The method of executing the system service depends on the CPU Unit model.
  • Page 285: B-1-5 Checking The System Service Execution Time Ratio

    Appendix B to the NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) for details of task specifications, tag data link service, and system services.  NX701-20 For NX701-20, the system services are executed at any time without being affected by tasks and tag data link services.
  • Page 286 Appendix B  Calculating Times on the Physical Controller When the project consists of one primary periodic task, check the average task execution time using the Task Execution Time Monitor function of Sysmac Studio while online with the physical Controller. Design the task using the following as a guideline: ...
  • Page 287: Execution Time Of Db Connection Instructions

    Appendix B B-2 Execution Time of DB Connection Instructions This section describes execution time of DB Connection Instructions. B-2-1 Restrictions to Execution Time of DB Connection Instructions Execution time of DB Connection Instructions varies according to the following factors.  Status of the NJ/NX-series CPU Unit ...
  • Page 288 Appendix B The following table gives the reference values for execution time of the first DB Connection Instruction after the power supply to the CPU Unit is turned ON.  NX701-1720 Reference value for DB type Instruction Measurement condition instruction execution time Oracle Database 11g DB_Insert 99 ms...
  • Page 289 Appendix B  NJ101-20 Reference value for DB type Instruction Measurement condition instruction execution time Oracle Database 11g DB_Insert 219 ms When executing an INSERT operation for 100-column record DB_Select 406 ms When searching for one record from 100,000 records and retrieving 100-column data* 213 ms SQL Server 2012...
  • Page 290 Appendix B Phenomenon 2: After Execution of a DB_CreateMapping Instruction, Execution Time of the First DB_Insert Instruction Got Longer  Possible causes The following can be the causes: . For the first DB_Insert instruction that is executed after execution of a DB_CreateMapping instruction, the DB may require longer processing time than usual.
  • Page 291 Appendix B  NJ101-20 Reference value for DB type Instruction Measurement condition instruction execution time Oracle Database 11g DB_Insert 28.2 ms When executing an INSERT operation for 100-column record 35.6 ms SQL Server 2012 DB_Insert When executing an INSERT operation for 100-column record 52.7 ms DB2 10.5 DB_Insert...
  • Page 292 Appendix B Phenomenon 5: Depending on the DB’s Status, Execution Time of a DB Connection Instruction (i.e., DB_Insert, DB_Update, DB_Select, or DB_Delete Instruction Got Longer.  Possible causes The following can be the causes: . Load on the server was temporarily increased. .
  • Page 293: Impact Of Operation Log Recording On Execution Time Of Db Connection Instructions

    Appendix B B-2-2 Impact of Operation Log Recording on Execution Time of DB Connection Instructions When the Operation Logs are recorded, execution time of DB Connection Instructions (i.e. DB_Insert, DB_Update, DB_Select, and DB_Delete instructions) gets longer. The following table gives the reference values for increased execution time of DB Connection Instructions while the Operation Logs are recorded.
  • Page 294: How To Measure Db Response Time

    Appendix B B-2-3 How to Measure DB Response Time The DB response time refers to the time since an SQL statement is sent from the CPU Unit until the SQL execution result is returned from the DB. You can find the DB response time by executing a DB_GetConnectionStatus instruction after executing an instruction that sends an SQL statement.
  • Page 295: Instruction Execution Timeout

    Appendix B B-2-4 Ensuring Equipment Performance (Takt Time) by Monitoring Instruction Execution Timeout If you do not want to lower the equipment performance (or extend the takt time) when the execution time of DB Connection Instruction is increased, set a timeout for the instructions. You can specify a timeout in the TimeOut input variable to the DB_Insert, DB_Update, DB_Select, and DB_Delete instructions.
  • Page 296: Specifications

    Appendix B B-3 Specifications This section gives the specifications of the Database Connection CPU Units. B-3-1 General Specifications Refer to the following manual. • NJ/NX-series CPU Unit Software User’s Manual (Cat. No. W501) B-3-2 Performance Specifications Refer to the following manual. •...
  • Page 297: Version Information

    Appendix B B-4 Version Information This section describes the relationship between the unit versions of CPU Units and the Sysmac Studio versions, and the DB Connection functions that were added or changed for each unit version of the CPU Units. B-4-1 Unit Versions and Corresponding DB Connection Service Versions The following table gives the relationship between unit versions of CPU Units and the DB Connection Service versions.
  • Page 298: B-4-3 Actual Unit Version Of Cpu Unit And Unit Version Set In The Sysmac Studio Project

    Appendix B B-4-3 Actual Unit Version of CPU Unit and Unit Version Set in the Sysmac Studio Project The following table gives the relationship between the unit versions of CPU Units and the corresponding Sysmac Studio versions. Unit Versions and Corresponding Sysmac Studio Versions The following table gives the relationship between the unit versions of CPU Units, the DB Connection Service versions, and the Sysmac Studio versions that can set the unit versions.
  • Page 299: Sysmac Studio Project

    Relationship between Actual Unit Version of CPU Unit and Unit Version Set in the Sysmac Studio Project The following table shows the differences in the specifications by the combination of actual DB Connection Service version of CPU Unit and DB Connection Service version set in the Sysmac Studio project when using an NJ501-120 CPU Unit.
  • Page 300 Appendix B  Number of DB Map Variables for which a Mapping can be Created DB Connection DB Connection Service version set in the Sysmac Studio project Service version of 1.00 1.01 1.02 the CPU Unit 1.02 15 variables max. SQL Server: 60 variables max.
  • Page 301 Index...
  • Page 302 Index Index DB mapping ..................25, 3-2 A DB_Close ....................3-24 Adding a DB Connection ..............2-8 DB_Close (Close DB Connection) ............A-9 Assumed cause ................7-8, 7-10 DB_Connect ..................3-24 B DB_Connect (Establish DB Connection) ..........A-6 DB_ControlService ................3-24 Backup/Restore Function in the DB Connection Service .....
  • Page 303 Index Invalid DB Connection ................7-28 Restrictions on Table’s Column Names ..........3-4 Invalid DB Connection Name ..............7-25 Run mode of the DB Connection Service .......... 25, 1-5 Invalid DB Map Variable ................ 7-29 Run Mode of the DB Connection Service ..........4-2 Invalid Extraction Condition ..............
  • Page 304 Index NJ/NX-series Database Connection CPU Units User’s Manual (W527)
  • Page 306 The Netherlands Hoffman Estates, IL 60169 U.S.A Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787 © OMRON Corporation 2013-2018 All Rights Reserved. OMRON (CHINA) CO., LTD. OMRON ASIA PACIFIC PTE. LTD. In the interest of product improvement, Room 2211, Bank of China Tower, No.

Table of Contents