1 confidential © omron nj5 sql connection for sql databases jan 23 rd 2014 johnston hall omron...
TRANSCRIPT
1Confidential © Omron
NJ5 SQLConnection for SQL Databases
Jan 23rd 2014
Johnston Hall
Omron Automation and Safety
2Confidential © Omron
NJ SQL has SQL Client Software
Built-in Database Connectivity allows the NJ SQL to directly read and write data to a SQL database.
Ethernet
NJ5-1320/1420/1520
SQL running on a server
3Confidential © Omron
Eliminates Middleware
No Middleware/PC
◦ No PC Maintenance
◦ Faster – Insert as fast as 20ms
Before
After
4Confidential © Omron
Supports Most Popular SQL Databases
Works with:• Oracle Database from Oracle Corporation• SQL Server from Microsoft Corporation.• MySQL from Oracle (Community Edition)• IBM DB2 for Linux, Unix, and Windows• Firebird 2.1, 2.5
5Confidential © Omron
New Simple SQL Instructions
Easy SQL Language Instructions to append, insert, update, or delete data.
6Confidential © Omron
Advanced Debugging
NJ will log SQL events and errors to it’s SD card for debugging.
7Confidential © Omron
Data Saving Spooling Feature
In the event of communication loss to the SQL server, data will be spooled in battery backed memory.• 1 Mbyte of battery backed spooling memory• Auto or manual resend of data
Ethernet
Internal Spool
8Confidential © Omron
Getting Started in 4 easy steps?
9Confidential © Omron
Configure your Connections
Easy to configure connection screen with test button.
10Confidential © Omron
Use DB_Connect to Connect to Database
The DB_Connect and DB_Close instructions make it easy to log into and out of the database.
The SQL_DBConnection variable is used with all the other instructions to indicate which connection to use.
11Confidential © Omron
DB_CreatMapping to point to table and fields.
• Tablename is used to specify the table• MapVar is the variable you want to send• The Mapvar variable’s structure specifies the fields
The DB_CreateMapping instruction specifies the database “table” to be used, the variable to be mapped to the fields, and if this vaiable is to be an insert (_DBC_SQLTYPE_INSERT), select (_DBC_SQLTYPE_SELECT), update or delete.
Specify the table name
Create a variable for the data. The data “type” is a structure that matches the field names of the table. Up to 1000 fields.
You do not have to specify all the fields in a table – just the ones you want to use. The Select statement uses an array variable for the multiple records in the answer.
12Confidential © Omron
Four new Instructions to move Data
• DB_Insert• DB_Delete• DB_Select• DB_Update (write on top of existing data)
13Confidential © Omron
Notes
• Up to 32 database instructions can be used at one time.
• The “DB_Select” instruction supports wild cards and Correlated Subqueries
14Confidential © Omron
All NJ’s Get FTP Client
NJ Stores data to SD cardNJ Sends file to FTP server
Computer asks for file
Old• NJ has FTP server• Computer has to figure out when to get file.
New• NJ has FTP client also• Sends or gets file using FTP, computer has FTP server