Sie sind auf Seite 1von 6

Number 104 March 6, 1998

Copyright 1998 Wonderware Corporation. All Rights Reserved.


Creating a History Provider Backup in a NAD
Configuration by Daniela Tulbure
This Tech Note shows two examples of how to create a history provider backup for Wonderware
InTouch in a Networked Application Development (NAD) configuration.

Example One
In this example, assume that we have two computers, called Node1 and Node2. Node1 is the server
node and has historical logging enabled. Node2 is the client node. It is configured using NAD and
points to the InTouch application log files on Node1. In the event that Node1 goes down, we want to
disable NAD on Node2 and have Node2 run the local copy of the InTouch application. We also want
Node2 to become the History provider. Here are the steps to accomplish this:
Configuration on Node1
To configure Node1, follow these steps. The InTouch application is stored in: C:\Mydir\MyApp.
1. Open WindowMaker. On the Special menu, click Configure. Next, click the Historical Logging
button and click OK.
2. In the Historical Logging Configuration dialog box, select Distributed History. For Name of
Logging Node, type Node1. For Store Log Files in Directory (UNC), type \\Node1\C\HistDir,
where C is the share name of the C drive and HistDir is the directory where Node1 will store the log
files ( *.lgh and *.idx). Click the OK button.

Configuration on Node2
Follow these steps to configure Node2:
1. In InTouch, click the Create Directory button and create an application directory (using the universal
naming convention) that will point to the application on Node1, \\Node1\C\MyDir\MyApp, where C
is the share name of drive C on Node1.

Copyright 1998 Wonderware Corporation. All Rights Reserved.


6 March 1998 Technical Support Tech Note, No. 104 Page 3

2. In InTouch, click the icon that says Configure InTouch settings for this computer. In the Node
Configuration dialog box, click the App Development tab and select the box Update local
application when WindowViewer starts. For the Local working directory, enter the path to the
location on Node2 where you want the application to be copied.

3. Assume that a heartbeat tag was configured to notify the Client (Node2) that the Server (Node1)
went down (see Setting Up a Heartbeat Between Two InTouch Nodes on the Knowledge Base
CD). Use the following condition script based on the heartbeat tag to configure Node2 as a History
Provider (to start logging) and disable NAD so that Node2 will run from its own NAD directory and
will no longer look at Node1 for changes.

Copyright 1998 Wonderware Corporation. All Rights Reserved.


6 March 1998 Technical Support Tech Note, No. 104 Page 4
INIWriteString( "C:\winnt\win.ini", "Intouch",
"ApplicationDirectory", "c:\MyDir\NAD\ " ); { this line will
change the ApplicationDirectory key in the InTouch section of
the Win.ini file to the local NAD directory: C:\MyDir\NAD}
INIWriteString( "C:\winnt\win.ini", "Intouch",
"ViewNadCopyApplicationOnStartup", "0" ); { this line will
disable NAD }
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szLoggingParams", "\\Node2\C\MyHist" ); { this line will
change the logging parameters so the history files will be
logged to the MyHist directory on Node 2 MyHist directory
must exist on Node2}
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szRetrievalParams", "\\Node2\C\MyHist" ); { this line will
change the retrieval parameters so the History information
will be retrieved from the MyHist Directory on Node2}
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szLoggingNode", "Node2" ); { this line will tell the
application that Node2 is now the Logging node}
RestartWindowViewer(); { this line will restart Window Viewer
so that the above changes will take effect}

The INIWriteString() function is available on the KBCD in the FactorySuite Script Function Library.

Example Two
In this example, assume that Node1 is the server node and Node2, Node3,.NodeX are client nodes
using NAD to point to Node1. When Node1 goes down, we want Node 2 to become the server and the
history provider. In the meantime, all the other nodes (Node3, Node4,NodeX) will continue to use
NAD, but will point to Node2 as the server node.
Configuration
Based on a heartbeat tag that will advise the Client nodes that the server node (Node1) went down, the
following script should run:
If Nodename== Node2
Then
INIWriteString( "C:\winnt\win.ini", "Intouch",
"ApplicationDirectory", "c:\MyDir\NAD ");
INIWriteString( "C:\winnt\win.ini", "Intouch",
"ViewNadCopyApplicationOnStartup", "0" );
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szLoggingParams", "\\Node2\C\MyHist" );
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szRetrievalParams", "\\Node2\C\MyHist" );
INIWriteString( "c:\MyDir\NAD\dhistcfg.ini", "History",
"szLoggingNode", "Node2");

Copyright 1998 Wonderware Corporation. All Rights Reserved.


6 March 1998 Technical Support Tech Note, No. 104 Page 5
RestartWindowViewer();
Else
INIWriteString( "C:\winnt\win.ini", "Intouch",
"ApplicationDirectory", "\\Node2\c\MyDir\NAD ");
RestartWindowViewer();
Endif;

NodeName is a memory message tag that will hold the nodename returned by the function
GetNodeName() that can be used in the application On Startup script.
The above script will disable NAD on Node2, configure Node2 as the history provider, and modify the
NAD settings on Node3NodeX to point to Node2 as the server .

Copyright 1998 Wonderware Corporation. All Rights Reserved.


6 March 1998 Technical Support Tech Note, No. 104 Page 6

The Tech Note publication is published periodically by the Wonderware Technical Support group. Editors: Mari Fujii and
Sabrina Haag; Director of Technical Support: Sheila Kester; Publisher, Wonderware Corporation, 100 Technology Drive,
Irvine CA 92618. E-mail your publication questions or topic requests to techpubs@wonderware.com.
There is also technical information on the Wonderware software products on the Technical Services web page at
http://www.wonderware.com/support/, the Wonderware Bulletin Board Service at (714) 727-0726, the Comprehensive
Support Knowledge Base CD, and the WonderFax FaxBack service at (714) 450-5050. Call Wonderware Technical
Support at (714) 727-3299 for more information on the Technical Services web page, the BBS, the Comprehensive Support
Knowledge Base CD or the WonderFax system.
Copyright 1998 Wonderware Corporation. All Rights Reserved. Wonderware is a registered trademark of the Wonderware
Corporation in the United States of America and/or other countries. March 6, 1998 Number
104

Copyright 1998 Wonderware Corporation. All Rights Reserved.

Das könnte Ihnen auch gefallen