LINK DATABASE TO SQL WONDERWARE INTOUCH
While tag values are often logged for reporting and historical purposes by using Wonderware Historian, the same results can be achieved through using InTouch functionality. Historian provides a simple thanks to import InTouch tags for recording historical data to an SQL Server database, but this simple use comes at a price through licensing. With slight scripting InTouch can provide the same historical logging results without the need for Historian, plus the pliability of using different data sources through ODBC.
- NB Designer OMRON HMI Youtube Tutorial Videos
- DOPSOFT DELTA HMI Youtube Tutorial Videos
- Wonderware Intouch Youtube Tutorial Videos
- GT Designer MITSUBISHI HMI Youtube Tutorial Videos
- WinCC Siemens HMI Youtube Tutorial Videos
- FACTORY TALK VIEW Youtube Tutorial Videos
Prerequisites:
1.InTouch version 7.1 or higher. For this instance version 10.0 are going to be used.
2. An ODBC data source. SQL Server 2005 is going to be used for this instance.
3. Create an ODBC Data source
In order for InTouch to record tag information, a knowledge source must be created to store the info. This is done through the utilization of an ODBC connection, which is set up through the Windows ODBC data source administrator tool. See the article Creating an ODBC data source for information on creating an ODBC data connection. For this instance set the info source name (DSN) to “InTouchDB”.
Add a New Database Table to SQL server
To store the InTouch Tag data, a database table will need to be created with the SQL Server Management Studio Tool. For this example, I will be using a database called “InTouch” and a table called “tblTagValues”.
The tag values table will have the following columns:
Column Name Data Type
Tag1 varchar(50)
Tag2 real
Tag3 real
Tag4 real
Tag5 int
For further information on creating a database table within SQL server, see the article Using SQL to create a Database Table.
Create a Bind List within InTouch
For further information on creating a database table within SQL server, see the article Using SQL to create a Database Table.
Create a Bind List within InTouch
Open InTouch Window Maker for the InTouch application you would like to log tag data for, and find the Tools view which is found towards rock bottom left side. Within Tools find the “SQL Access Manager” node and expand it to display the “Bind List” and “Table Template” child nodes.
3.1. Double click on the “Bind List” node to make a replacement bind list. If this is often the primary time you’ve got created a replacement bind list you’ll be asked to make a replacement SQL Access Manager definition (.DEF) file . Click Yes on this to make the definition file.
3.2. you’ll now be ready to create a replacement Bind List, click the “New” button on the “Select a Bind List” Window. The Bind List Configuration window will open.
3.3. Within the Bind List Configuration window enter a Bind List Name. Here the bind list name has been called “blTagValues”.
3.4. Specify a Tag name to use because the source of tag data.
3.5. Specify a database table column name that to record tag data. These column names relate to the database table created in section 2.
3.6. Once the tag name and column name are specified, add this item to the bind list by clicking on the “Add Item” button.
3.7. Add bind list items for every of the table columns laid out in section 2 then click on the “OK” to save lots of the bind list.
Logging tag values with a knowledge Change event.
For the aim of this instance, tag value data are going to be logged every minute using some InTouch scripting and a knowledge Change event.
4.1. Within InTouch Window Maker, find the scripts view. Within the scripts view find the “Data Change” tree node then right click thereon to open the choices popup menu. From this popup menu left click on the “New” choice to create a replacement data change event. the info change scripts window will open.
4.2. Within the info change scripts window, enter a tag name into the “Tag Name” field. For this instance, the tag name “$Minute” are going to be used, which can trigger the info change script every minute.
4.3. Add the subsequent InTouch Script:
{Connect to SQL server}
{Parameters: ConnetionID; DSN Name}
SQLConnect( ConnectionID, “DSN=InTouchDB”);
{Record the tag data to the Tag Values database table}
{Parameters: ConnectionID; TableName; BindListName.}
SQLInsert( ConnectionID, “tblTagValues”, “blTagValues” );
{Disconnect the open SQL Server database connection}
{Parameters: ConnectionID}
SQLDisconnect( ConnectionID );
4.4. Click the “OK” button to save lots of the info change script.
Run the InTouch application. a replacement record should be inserted into the “tblTagValues” table every minute.
Note: If SQL errors occur they’re going to be logged within the System Management Console or the WWLogger application (InTouch 7.1). Use this information to diagnose scripting and configuration issues.
Useful Links:-