SQL Synchronization and SQL Query to MS SQL Database. SQL Synchronization and SQL Query to MS SQL Database

Similar documents
cmt-g01 with OPC UA Server and Modbus Gateway

Weintek HMI to Control Techniques M400 AC Drive via Modbus TCP/IP Ethernet Module

cmt-g04 with OPC UA Server and MQTT Sparkplug B cmt-g04 with OPC UA Server and MQTT Sparkplug B

User. Manual. cmt-3103 Wireless Network Settings Guide. Weintek USA, Inc. (425)

Configuration of Microsoft SQL Server Express

Immotec Systems, Inc. SQL Server 2008 Installation Document

User. Manual. cmt-hdm Startup Guide. Weintek USA, Inc. (425)

User. Manual. cmt-fhd Startup Guide. Weintek USA, Inc. (425)

Immotec Systems, Inc. SQL Server 2008 Installation Document

The EDGE Estimator v12 Network Database Install

2. Setup. Introduction. 2.1 How Do I Get a Copy of QC-CA.C. 2.2 SQ. Server. Enterprise Data Loader Page 2

Working with SQL SERVER EXPRESS

8-1. This chapter explains how to set and use Data Sampling.

LiNC-NXG for Windows 8 Professional, Windows 7 Professional, Vista Business Edition and XP Professional

19.Configure HMI as a MODBUS Server

Passwordstate. Installation Instructions for. SQL Server 2016 Express

Microsoft SQL Installation and Setup

AD Sync Client Install Guide. Contents

DOCUMENT REVISION HISTORY

Database Creation & Setup for SQL Server

Reliable High-Speed Connection to Publication Database for Synchronization

Step-by-Step Guide to Ansur Executive 3.0 With or without Electronic Signatures

SQL Server Deployment Installation Manual. Call a Hygiena representative for more information or support

SQL Server Express: Setting up for UniStream

cmt Quick Start Guide

SQL 2012 Installation

Table of Contents. Knowledge Center -

DOCUMENT REVISION HISTORY

256 MB RAM. 256 MB 32 bits RISC Cortex-A8 600MHz SD Card Slot. N/A USB Host. N/A USB Client

Millennium Expert/Enterprise Installation Guide Version Table of Contents

T-SQL Training: T-SQL for SQL Server for Developers

Sage SQL Gateway Installation and Reference Guide

Introduction. Retrieve company data without slowing down your operational system. Integrate data from multiple sources and across Jonas modules

DeliverNow. Installation Guide RJS Software Systems Document Version

Install and Configure SQL 2012 Express

TGWeb. Step 1: Installer Files Step 2: Installing JAVA Runtime Step 3: Installing Apache/Tomcat Step 4: MSSQL Setup Step 5: DBSelect Utility

Using SQL-server as database engine

Universal Archiving Module. Installation Guide

cmt3090 and Remote I/O Quick Start Guide

Installation and Configuration Guide

1. Installation and Configuration of Database Server

Summary of Server Installation

Software Installation

Schneider Electric Software Knowledge & Support Center

10.User Password and Object Security

EasyLobby Database Setup EasyLobby Family of Products Version 10.0

DOCUMENT TRACKING INSTALLATION GUIDE

When the file has completed downloading you will receive the message below, Select Run

DOCUMENT TRACKING INSTALLATION GUIDE

Setting up EntraPass Card Gateway with SQL Server 2008

Installing SQL 2005 Express Edition

and Installation Guide for the application on the server March 2014 (GUIDE 2) LASS 8-11 and versions 6.05-N and later

How to Install Microsoft SQL Express 2016 ANSWER:

ODBC Client Driver PTC Inc. All Rights Reserved.

MassTransit Server Installation Guide for Windows

Installation User Guide SMART ACCESS 2.0

Installation and Configuration Guide

Guide to Installing DYNAMICS Security Pack

Secure Access Authentication / Restriction of workflows based on User

Installation Instruction

Installation Guide for the Lucid CoPS application on the server. Installation Guide for the application on the server. December 2015 (GUIDE 2)

docalpha Monitoring Station

Aretics T7 Installation Manual

SQL Server Analysis Services

Tech Notes. Before embarking on this process, please make sure that your computer meets the Microsoft SQL Server system minimum requirements.

Installing SQL Server Developer Last updated 8/28/2010

IQSweb Migration Steps

Configuring Dynamics GP econnect with Nexonia... 1

Installation Guide of SQL Server Express

Re-installing SQL Server 2012 Express

EasyBuilder Pro V This model is a gateway device; therefore, it is not possible to generate a

Summary of Server Installation

(B) Execute SMS TCP MODBUS Interface Application

IQSweb Installation Instructions Version 5.0

User Manual. cmt-svr Startup Guide

MX-Contact Instruction Sheet Setting up SQL Replication SQL 2005

Creating the Data Layer

HOW TO GUIDE. Pcounter for Windows Upgrade to version 3.02 with SQL Express. For Support Click here

Configuration Guide. Requires Vorex version 3.9 or later and VSA version or later. English

emerchant API guide MSSQL quick start guide

SQL Data Export for PS/PSS

Step-by-Step Guide to Ansur Executive 3.0 Installation With or without Electronic Signatures

M i c r o s o f t S Q L S e r v e r I n s t a l l a t i o n G u i d e for A D S S S e r v e r

Server Manager User and Permissions Setup

EventMaster PLUS! Version 4 Installation and Upgrade Guide. Enterprise Deployment Microsoft SQL Server

Installation manual SQL Server

MS SQL Server 2016 Installation rev1704

Print Audit 6. Database Documentation Dec :21. Version: Date:

How to resolve connection problems between server and workstation

User s Guide. For Windows, Mac, Palm OS, and Pocket PC. Companion for Palm OS and Pocket PC

ASSET TRACKING SYSTEM INSTALLATION GUIDE

SQL-Server. Insert query in SQL Server. In SQL Server (Transact-SQL), the INSERT statement is used to

RedBeam Inventory Tracking User Manual

Adding your IMAP Mail Account in Outlook 2013 on Windows

Scan to Quick Setup Guide

Exchange. Live Link QuickStart Guide

Installation Manual. Fleet Maintenance Software. Version 6.4

Migrating to MIL-Comply SQL Server Edition

One Schema In Sql Server 2005 Management >>>CLICK HERE<<<

3.1 Updating Web Package Updating OS... 16

Transcription:

Weintek USA, Inc. Rev. Oct 12 2018 www.weintekusa.com (425) 488-1100 SQL Synchronization and SQL Query to MS SQL Database Introduction: This document discusses how to configure SQL Sync and SQL Query feature in Easybuilder Pro, to assist users to successfully connect to Microsoft SQL server. This document also describes the steps to install and configure Microsoft SQL Express. Equipment & Software: A) cmt3090 (cmt Series HMI) B) Microsoft SQL Express 2017, which includes SQL Server and SQL Server Management Studio(SSMS). Note: Easybuilder pro version 6.01.01 and greater supports MS SQL functionalities. In this document, Easybuilder pro V6.01.01.292 is used. MS SQL Express Installation: In this demonstration, MS SQL Express 2017, which is a free and limited version of SQL software, is installed. The user can purchase other versions based on specific needs. During the installation, most of the steps can be kept on Default however, the authentication mode must be set to Mix Mode, to allow Weintek HMI to access the SQL server. Page 1 of 29

In [Database Engine Configuration]» [Authentication Mode], choose Mix Mode. Specify a password for the SQL Server system administrator (sa) account. MS SQL Configuration: After finishing installation, the software will be displayed as shown. I will show you how to configure SQL Server Configuration Manager and SQL Server Management Studio. Page 2 of 29

SQL Server Configuration- 1. Launch SQL Server Configuration Manager. 2. Enable TCP/IP protocol in [TCP/IP Properties] because Weintek HMI connects MS SQL server via TCP/IP protocol. 3. To do that, Expand [SQL Server Network Configuration]. 4. Click on [Protocols for SQLEXPRESS]. 5. Click on [TCP/IP]. 6. Select [Yes]. 7. Under [IP Addresses] tab, the default port of MS SQL server is 1433. Changing the port number is allowed. Page 3 of 29

8. The changes will take effect after restarting the service, so you need to restart the SQL server by the following steps. (1) Click on [SQL Server Services]. (2) Right click on [SQL Server (MSS..]. (3) Select [Restart]. Page 4 of 29

SSMS (SQL Server Management Studio) Configuration- 1. Launch SQL Server Management Studio. 2. To log in the SQL server via SSMS, you can use Windows Authentication or SQL Server Authentication. Page 5 of 29

3. The user interface of SSMS will be displayed as shown. Note: If you didn t choose Mix mode during installation, right click on server and select [Properties]. Page 6 of 29

In [Security] tab, select SQL server and Windows Authentication mode for server authentication. Creating Databases 4. Right click on [Databases] and select [New Database]. Page 7 of 29

5. In [General] tab, enter a desired name to this database. Click on [OK]. 6. The new database will be listed under Databases. Page 8 of 29

Adding accounts 7. Go to [Security]» [Logins]. Right click [Logins] and select [New Login]. 8. In [General] tab, create a new user. Specify a desired name and a password. Page 9 of 29

9. In [User Mapping] tab, select database roles to allow this user can access. Check the following Database roles checkbox, db_datareader, db_datawritter, and db_owner. SQL Sync. (Details of the SQL Sync. Programming in Easybuilder Pro): Workflow - You can synchronize data log and event log to SQL servers. Data Log Sync. Step 1. 1) Launch Easybuilder pro. Go to [Data/History] tab» [Database Server]. Click on [New] to add a database server. Page 10 of 29

2) Choose [MS SQL server] for server system. Enter the IP address, port number, and an authentication account of the SQL server. Database name depends on what database you want to be used for data synchronization. Note: Weintek HMI cannot use Windows Authentication. 3) Define the Status address and the Control address if the Control address is enabled. Page 11 of 29

4) Create the following objects on the editing area. These objects are used to monitor and control the SQL server connection. Step 2. Go to [Data/History] tab» [Data sampling]. Enable and define the Control address, History file, select a database server for Sync.to database. Note: SQL sync. doesn t support Customized file handling. Page 12 of 29

Step 3. Create three Set Word objects on the editing area for the control address of data sampling. Write constant value 1 to clear data. Write constant value 2 to sync data. Write constant value 3 to sync data and then remove duplicate data on HMI, like below setting. Step 4. Go to [Data/History] tab» [History Data Display]. Create this object on the editing area. Screen Shot of the Final Project Page 13 of 29

Testing - When writing constant value 2 via Set Word object to the control address of the data sampling. The data log stored in the HMI memory will be synchronized to the SQL server. Note: HMI synchronizes original data log to a database server. Revamp this table by MS SQL Query syntax. Table naming of data log in SSMS- Tables are automatically created by HMI. For example, Page 14 of 29

Event log Sync. The configuration is similar to data log sync. The differences are Step.2 and 4. Step 2. Go to [Data/History] tab» [Event Log]. Enable and define the Control address and select a database server for Sync. to database. This configuration is set up for all of the events. Step 4. Go to [Data/History] tab» [Event Display]. Create this object on the editing area. Testing - When writing constant value 2 via Set Word object to the control address of the event log. The even log stored in the HMI memory will be synchronized to the SQL server. Note: The HMI synchronizes the original event log to a database server. Revamp this table by SQL Query syntax. Page 15 of 29

Table naming of event log in SSMS - Tables are automatically created by HMI. For example, Page 16 of 29

SQL Query: Workflow- You can use main operations CRUD (Create, Read, Update, Delete) to query the SQL server. Step 1. 1) Launch SSMS. Create a table in SSMS because HMI doesn t create a table in database server. Right click on [Tables] and select [Table]. 2) Fill out the column names and select data type for each column. Specify one column as Primary Key. A Primary Key is placed in the first column, and cannot be set to Null. In this case, id will be the Primary Key. Page 17 of 29

To set Primary Key, right click on [id] and select [Set Primary Key]. To enable AI (Auto Increment), click on [id]. Under [Column Properties] tab, expand [Identity Specification] and change No to Yes for [Is Identity]. Page 18 of 29

To save this table, Right click this tab and select [Save Table_1]. Page 19 of 29

Enter a desired name for the table. Right click on [Tables] and select [Refresh] to finish the procedure of adding the table. Note: If data type conversion cannot run properly, error code 5 will show in the specified error register. For example, when converting MS SQL s INT into EB Pro s 16-bit unsigned, error code 5 will show if the value exceeds the limit of 16-bit Unsigned. Page 20 of 29

Supported data type To insert data to the table, right click the table created earlier, and select [Edit Top 200 Rows]. Page 21 of 29

Enter data you want to insert. SQL Query. (Details of the SQL Query. Programming in Easybuilder Pro): Step 2. Launch Easybuilder pro. Go to [Data/History] tab» [Database Server]. Click on [New] to add a database server. It s the same way as SQL Sync. Page 22 of 29

Simple mode - Step 3. Go to [Data/History] tab» [SQL Query]. Create a [SQL Query] object. There are two options in this object, Simple mode and Advanced mode. [General] tab: Select a database server for querying. Enter a table name and define a register for Schema. Click on [New] to add the columns of the table. Another way is to click on [Import from server] to import columns. You should select correct data type for each columns under [Address format] based on its MS SQL data format. [Command] tab: Define a register for Control address. Create the following objects related to the Control address on the editing area. Each SQL command is given an unique ID number. Page 23 of 29

Step 4. Create four Set Word objects on the editing area for the four commands, Create (Command no.1), Read (Command no.2), Update (Command no.3), and Delete (Command no.4), like below setting. Step 5. Go to [Data/History] tab» [SQL Query]. Create a [SQL Query Result Viewer] object on the editing area to show the result obtained from SQL server. Page 24 of 29

Testing: When writing constant value 2 (Command no.2: Select all) via Set Word object to the control address of the SQL query. The data will be retrieved from the SQL server and be displayed on SQL Query Result Viewer (Table) and Schema registers (Blue boxes). Note: When you write the command ID to LW-200 (Command ID register) via Set Word object to send a SQL command, you must wait for the value returning to 0 and then send the next command to the SQL server. Page 25 of 29

Advanced mode In this mode of [SQL Query] object, you can write your own SQL statements. For example, SELECT [default_name_1], [default_name_2], [default_name_3] FROM [table_name] where [default_name_2] =20; PK : default_name_1 Go to [Data/History] tab» [SQL Query]. Create a [SQL Query] object. To freewrite SQL Query commands, check the [Advanced mode] checkbox. Once you switch to advanced mode, you cannot undo. [General] tab: After advanced mode is enabled, the user interface will be displayed as shown. Select a database server for querying. Page 26 of 29

[Command] tab: Click [New] to create a command or click [Settings] to modify a command. The command window comes up as shown. There are three tabs to set up for a SQL command. [Query] tab: Specify a unique command ID and write SQL command with MS SQL syntax. Page 27 of 29

[Argument] tab: If argument is used in the syntax of a command in [Query] tab, Weintek HMI will refer to the addresses specified in this tab corresponding to the argument number enclosed in ${argument no.} SELECT [id], [item] FROM [weintek_usa] where [count] ='${1}'; [Output] tab: When HMI successfully reads data from the SQL server, the result will be transferred to the addresses specified in this tab. This tab will be hidden if Discard result option in [Query] tab is enabled. Testing: Enter a value to the box below the [Read] button and click on [Read]. [Read] means running the command ID no.2 (Select command) via Set Word object to the control address of the SQL query. If the value exists in the SQL database, data will be displayed on the table and the specified Output registers. Page 28 of 29

Troubleshooting: To make sure the Weintek HMI is able to establish the connection to the MS SQL server, the PC which runs the SQL server needs to allow traffic going to the defined TCP port to pass through. Anti-virus software might block traffic so that the Weintek HMI cannot connect to the MS SQL server. Founded in 1996, WEINTEK LABS is a global-leading HMI manufacturer and is dedicated to the development, design, and manufacturing of practical HMI solutions. WEINTEK LAB s mission is to provide quality, customizable HMI-solutions that meet the needs of all industrial automation requirements while maintaining customer satisfaction by providing on-demand customer service. WEINTEK LABS brought their innovative technology to the United States in 2016, WEINTEK USA, INC., to provide quality and expedient solutions to the North American industrial market. 6219 NE 181s Street STE 120 Kenmore, WA 98028 425-488-1100 Page 29 of 29