CONFIDENTIAL NJ 5 1520 DB Connection for SQL
CONFIDENTIAL NJ 5 - 1520 DB Connection for SQL April 2013 Josep Lario Automation Center Europe. © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL NJ Database Connection Function • DB Connection function allows NJ Machine Controller to directly access SQL Database. SQL Ethernet/IP SQL
CONFIDENTIAL Main Features: Easy SQL language • DB Connection services to insert, update, select to/from relational database. SQL
CONFIDENTIAL Main Features: • Oracle Database from Oracle Corp. and SQL Server from Microsoft Corp. re supported. SQL
CONFIDENTIAL Main Features: No additional elements • No additional software, hardware or Server Middleware is required. SQL
CONFIDENTIAL Main Features: Log file • Log File of special instructions and processing into SD Card SQL LOG
CONFIDENTIAL Main Features: Fail-Safe operation • Fail-Safe design against Errors and Power interruption. • If data can not be sent due to an information exchange error with DB or power interruption in the NJ CPU data can be spool into non volatile memory. • Data will be resent after conflict is resolved. SQL Spool
CONFIDENTIAL Main Specifications:
CONFIDENTIAL Connection DB Operation
CONFIDENTIAL DB Connection Operation (1) Configure DB Connection (2) Resister mapping variable (3) DB Connection FB Operation Open Connection SQL FB’s Operation Close Connection © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (1) Configure DB Connection (2) DB Server IP Address (3) DB User (4) DB Password (1) Add new connection (5) Test connection © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (1) Configure DB Connection: TEST © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (2) Register Mapping variable: Structure • NJ Defines same “structure” of the DB SQL TABLE in NJ’s memory, the so called “Map Variable” has to be created according to the “structure”. SQL NJ Structure Datatype* TABLE Definition in SQL Database *Example shows TABLE Structure corresponding to ORACLE Database © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (2) Register Mapping variable: Map Variables • Map Variables of “TABLE_PRODUCT” Datatype are created for different purposes: “INSERT”, “UPDATE”, “SELECT”, … Map Variables SQL TABLE INSERT UPDATE SELECT NJ Structure Datatype © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (3) DB Connection FB Operation DB_Connect and DB_Create. Mapping Connect to SQL Database and Create the Variable and DB TABLE mapping Connect “Insert” Map “Update” Map © OMRON Corporation 2012 All Rights Reserved. “Select” Map Ready to operate with SQL DB !
CONFIDENTIAL (3) DB Connection FB Operation FB: DB_Closes the Database Connection SQL
CONFIDENTIAL (3) DB Connection FB Operation FB: DB_INSERT SQL: INSERT INTO table (column-1, column-2, . . . column-n) VALUES (value-1, value-2, . . . value-n); © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (3) DB Connection FB Operation FB: DB_UPDATE PRODUCT_ID=‘PR 1434’ SQL: Before UPDATE TABLE_PRODUCT SET column 1=value 1, column 2=value 2, … WHERE PRODUCT_ID =‘PR 1434’; After © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (3) DB Connection FB Operation FB: DB_SELECT SQL: SELECT column_list FROM table-name [WHERE Clause] ORDER BY clause]; © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL (3) DB Connection FB Operation FB: DB_SELECT SQL © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL Fail-safe and Maintenance Operation
CONFIDENTIAL Fail-Safe Operation: Spool Settings © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL Maintenance: Log Settings LOG © OMRON Corporation 2012 All Rights Reserved.
CONFIDENTIAL Questions? (Thank you)
- Slides: 24