4. View the InSQL data during runtime in the InTouch Historical Trend object. InTouch will
automatically connect to the InSQL database when the object's window is opened. InSQL tags
may be assigned to pens in the Historical Trend object by preceding the tagname with the
History Provider name and a dot (.) (example, "InSQLData.tagname"). Pen assignments may
also be made using function calls in an InTouch script.
The InTouch demonstration application accompanying this Tech Note (available on the
Wonderware Knowledge Base at www.wonderware.com/support) uses the following Button
script to assign an InSQL tagname to a pen in the Historical Trend object:
IF InSQLTagName == "_None" THEN
HTSetPenName( "HistTrend1", 5, "ReactLevel" );
HistTrend1.Pen5 = None;
ELSE
HTSetPenName( "HistTrend1", 5, "InSQLData." + InSQLTagName );
ENDIF;
This script will also unassign a tagname from the pen if "_None" has been selected for the
tagname from the Listbox.
Note To unassign the pen after a distributed tagname has been assigned to it, you must first
assign the pen to a local InTouch tagname, then reassign it to the tagname None. This tag must
be defined in the InTouch application as tag type TagID.
Method 3: Using the InTouch SQLAccess Manager Option
SQLAccess Manager script function queries provide the most flexible means of retrieving data from
the InSQL database. This method also requires the most effort as InTouch scripts must be written to
retrieve the data and window objects must be created to display the query results. There are 4 basic
steps:
1. Create a BindList to associate the InSQL Runtime database table columns to InTouch tags.
2. Connect to the InSQL database via and ODBC DataSourceName.
3. Execute the desired query using SELECT statements.
4. Display the query results in a window using InTouch tags.
Note A sample InTouch application shown in figure 10 is used to illustrate how a typical window
would be configured to use the SQLAccess Manager option. Though you can still follow this method
without needing the application, the application is available on the Wonderware Knowledge
Base. The Knowledge Base is available exclusively to Comprehensive Support subscribers. Contact
your local Wonderware distributor to learn more about our Comprehensive Support program.
Establishing the ODBC Connection to the InSQL Database
1. Log onto the client computer with Administrator privileges and bring up the Control Panel by
selecting Settings/Control Panel from the Start menu. Double-click on the ODBC Admin
program icon. The ODBC Data Source Administrator dialog box will appear as shown in figure
7.
Configuring InTouch To Query Data From IndustrialSQL Server
http://fa.sammicomputer.co.kr/TECH/html/T000816.htm