P-CIM Redundancy Setup: User Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Afcon Software and Electronics Ltd

P-CIM Redundancy Setup


User Guide

Afcon Software and Electronics Ltd

Contents

Overview........................................................................................................................ 1 Requirements ............................................................................................................... 3 Associating Alarm and History File Directories ...........................................................3 Defining Redundancy Parameters .............................................................................. 4 Defining Primary/Secondary Server Settings ........................................................6 Defining Secondary server settings............................................................................. 8 Replication tab......................................................................................................... 9 Redundancy Agent Icons ............................................................................................11 Redundancy Taskbar Options.................................................................................... 12 Client Services in a Redundant System ....................................................................14 Client Setup............................................................................................................ 14 Sending Messages ............................................................................................... 14 Updating Global Messages ................................................................................... 15 History Trends ............................................................................................................. 16 PingRetry ................................................................................................................ 16 Debugging, Resolving Conflicting IP Addresses ................................................. 16 Appendix 1 Removing Auto Logon Settings........................................................... 18 Appendix 2 - Troubleshooting and Maintenance...................................................... 19 Global Messages ...................................................................................................21 PingRetry ................................................................................................................21

Using P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Overview
The P-CIM Redundancy module is used in a P-CIM network to define a backup (secondary) server that automatically runs when the P-CIM (primary) server fails. In a standard P-CIM client/server network, the P-CIM server is designated as the master node. Its purpose is to: Store the alarm and historical data generated by the PLCs connected to it, and to then distribute this information to clients on the network Collect and store data generated by the PLCs connected to the clients

Primary server Primary IP P-CIM

Replication line Virtual IP

Secondary server

P-CIM Secondary IP

P-CIM

P-CIM

P-CIM client

P-CIM client

Clients on the P-CIM network recognize the server by its node number that has a virtual IP address configured. In a redundant network, both the primary and secondary servers must have a unique IP address. When the primary server fails, the secondary server does the following: Takes control of the virtual IP Acts as if it were the primary server, that is, performs all the primary servers functions

Since clients on the redundant network must believe that there is only one server in use, P-CIM Redundancy faces two main problems: Each computer is a separate node with a unique IP address Clients can be configured to send data to one address only

The solution is to create a third (assumable) virtual IP address shared by both servers. When the primary server is operational, it assumes this virtual IP address. During failure, the primary server releases the virtual IP address, whereby the secondary server immediately assumes it. Since only one station is functional at a given time, both stations can now be designated with an identical node number. Clients are all configured to only send data to this virtual IP address by referencing the shared node number.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd New data is always sent to the active server regardless of which computer is currently active. Immediately after the primary server becomes operational, it first replicates the data from the secondary server. It then assumes the virtual IP address and reclaims its status as the active server. In a redundant network, only one instance of a P-CIM project can run at the same time. Therefore, when the primary server is active, P-CIM is inactive on the secondary server. When the primary server fails, the Redundancy module automatically starts up P-CIM on the redundant (secondary) server. After the primary server is restored, and reassumes the virtual IP address, the secondary server automatically shuts down P-CIM.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Requirements
Operating systems: Windows 2000,Windows XP Profesional or Windows 2003 Server. For both the Primary and Secondary server stations: P-CIM SEK version 7.50 and up. Security Enabled Key (SEK) version 7.50 When using Progate an Unlimited I/O Prograte SEK is required for both the Primary and Secondary server stations.

Associating Alarm and History File Directories


In a redundant system, the shared directory of the saved alarm and history data files must be associated with the virtual IP address of all client stations and servers. This enables the clients to read/write data from/to the correct location. Associating the directory for alarm data files differs from associating the directory for historical data files. In each case, the syntax for the relative path is: \\Virtual IP\folder name for Alarm or Hist files\ Generally, by default alarms are saved in the project's Alarms folder and historical data files are saved in the project's History folder. In the following example, a dummy IP address 190.190.190.7 and a dummy project folder projectX are used. The pathname for the shared directory is: \\190.190.190.7\projectX\

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Defining Redundancy Parameters


Accessing the Redundancy Editor In the P-CIM Development Group double click the Editor. Redundancy Editor icon to open the Redundancy

The Redundancy Editor opens displaying the General tab. This dialog box has the following fields:

Table 1: Redundancy Editor Properties


Field P-CIM Master (virtual address) Retry finding local IP every Auto start when Windows starts Description IP address, displaying the virtual IP address attached to the active server. Subnet mask, defining the size of the computer network of which redundancy is part of.

This field defines the number of minutes that connection is retried after Windows starts and communication fails. Connection will be attempted every xxx minutes until it is eventually made. This field defines whether the Redundancy module (PFWREDUN.exe) automatically runs when Windows is restarted.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Table 1: Redundancy Editor Properties (Continued)


Release control only after P-CIM is closed Log enabled When checked P-CIM first releases control and then shutsdown. When unchecked P-CIM shuts down after the current server releases the virtual IP.

When checked defines that redundancy activity is recorded in the Redundancy Log. There are two redundancy logs, one for the primary server, and another for the secondary server. A new log file is created daily. Both logs are saved in the P-CIM project Alarms folder as: YYMMDD_Redun.Log. For example: the log file of 1th June 2005 will be 050601_Redun.Log

Delay on startup

Check to enable. Type in the time period for delaying the redundancy runtime module during Windows startup. A new file was added to the P-CIM program folder, named PfwDelay.exe that delays the redundancy module. Copy the file to the Windows Startup folder. This section defines the criteria to be met for the Primary server to release control. Release control when one of the selected P-CIM servers is closed List of P-CIM servers Wait for response until timeout Number of wait attempts Release control when physical memory is below limit Disable P-CIM when the disk space is below limit Disk space limit When checked the redundancy agent scans all the selected servers in the servers list to check which servers are alive. If a server does not answer, the virtual IP is released. This section holds a list of all available servers in the P-CIM project. Indicating the number of seconds waited for the server to return an answer before timeout is declared. Indicating the number of communication attempts to the server before timeout is declared. Indicating the minimal physical RAM memory level required before releasing control of the server. Indicating the minimal physical memory of the hard disk before P-CIM is shutdown. Indicating the minimal physical memory of the hard disk before P-CIM is shutdown.

Handle critical situations

Defining the General tab 1. In the IP Address field enter the virtual IP. 2. Optional: check the following fields: Auto start when Windows starts Log enabled

3. Relevant server from the List of P-CIM servers 4. We suggest leaving the remaining fields in the default settings.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Defining Primary/Secondary Server Settings


In the Redundancy Editor click the Primary/Secondary Server tabs.

The Primary Server tab has the following fields:

Table 2: Primary Server Properties


Field Primary server IP address Description This field displays the IP address of the primary network. When the Browse button is clicked a list of all the networking cards and their IP addresses in the PC is displayed. Select/enter the IP address that will be used as the primary IP address for the network. Indicating the time waited between when the PFWREDUN.EXE starts before the agent runs. Note: The number of seconds defined in this field must be identical in both tabs. When one server has a longer wait time, the other server will always take control.

Before starting agent process wait (0-99)

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Table 2: Primary Server Properties (Continued)


Before starting P-CIM wait Indicating the number of seconds waited between the time that the redundancy agent starts running and that P-CIM runs in the primary server. Indicating the interval at which the primary server scans the secondary server. Indicating the number of seconds that the Redundancy module (PFWREDUN.exe) waits before regaining control as the active server. Indicating the number of scans the Primary server will wait for the Secondary to successfully load. Should the Secondary fail to attach the virtual IP address in this defined interval, the Primary server will attempt to attach the virtual IP address. Indicating the number of intervals at which updated data is copied by the primary server to the secondary server. When checked, the fields defining automatic log when the computer starts up become active. This field displays the updated actions of the Redundancy save action.

Primary scan time Before primary resumes control wait Wait for Secondary to complete loading __ Scans Replicate data every Auto windows logon Work area

Defining Primary server settings When defining Primary server settings the following can be configured: 1. In the Primary Server IP Address field, either type in the relevant IP number or click the Browse button and search for it. 2. Check the Auto Windows Logon checkbox to enable the Logon fields and then define the Login Username and Password. 3. In the P-CIM (virtual address) fields, define the IP address and subnet mask. We recommend leaving the other settings as default.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Defining Secondary server settings


1. In the Redundancy Editor, click the Secondary Server tab.

The fields in this tab are described in the Primary tab on page 6. 2. In the Server IP Address field either type in the relevant number or click the Browse button and search for it. 3. Check the Auto Windows Logon checkbox to enable the Logon fields and then define the Login Username and Password. 4. In the P-CIM (virtual address) fields, define the IP address and subnet mask. We recommend leaving the other settings as default.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Replication tab
In the Redundancy Editor click the Replication tab to define which information is backed up to the primary server and to the secondary server if it is active.

This dialog box has the following fields:

Table 3: Replication Server Properties


Field Secondary IP address for replication P-CIM project share name on Secondary Description Indicating the IP address of the secondary server to be replicated. Indicating the P-CIM project shared name on the P-CIM network. To locate this click the Browse button to display the Explorer tree and select the relevant folder.

P-CIM Redundancy User Guide

Afcon Software and Electronics Ltd

Table 3: Replication Server Properties (Continued)


Replicate P-CIM project paths and subdirectories Default = checked. This checkbox indicates that all the updated folders of the defined files are copied by the primary server. Data is replicated in the following circumstances: Polling intervals, whereby data saved in the primary server is copied into the secondary server. When the primary server starts up and regains control over the redundant network. In which case data is replicated from the secondary server into the primary server.

When defining the Replicate Project option, if you have files that are not saved in the P-CIM project folder, select the file name and then its path. For example, for history files select *.HIS and then click the Browse button to locate the relevant path. P-CIM path to replicate Replicate files of type Secondary path Add/update path Indicating the folder from which data is replicated into/from. To replicate files that are out of the P-CIM folder, scroll the list and select Other Folder. Indicating the types of files that are replicated. Indicating the folder from which data is replicated into/from. This field has a Browse button which can be used to locate the relevant folder. This button when clicked enters the replication parameters into the work area. Note: Parameters that are not displayed in the work area will not be replicated. Remove path List Enable HST Transactions Replication To Work area This button when clicked removes the replication parameters from the work area. This section holds a list of all available servers in the P-CIM project. This option enables HST files replication. Select the location to copy the replicated files to. This field displays the updated actions of the Redundancy save action.

Defining the Replication tab 1. In the Project Share Name field scroll or type in the name of the relevant folder. 2. Optional: check the Replicate Complete Project checkbox and then define the individual files to backup. 3. Click the Save button and then click the Exit button.

P-CIM Redundancy User Guide

10

Afcon Software and Electronics Ltd

Redundancy Agent Icons


When the Redundancy module is active, the P-CIM Redundancy icon is displayed in the Windows taskbar of both servers: green indicates ACTIVE blue indicates INACTIVE

Positioning the mouse over the Redundancy icon in the taskbar displays a tool tip indicating that the server that is currently running.

P-CIM Redundancy User Guide

11

Afcon Software and Electronics Ltd

Redundancy Taskbar Options


The following commands can be accessed by right clicking the Redundancy icon in the taskbar while the Redundancy module is running.

Field Close

Description Closes the redundancy line on this computer (see page 13). Note: The redundancy line can only be closed when the virtual IP address is detached.

Show Status Help Enable auto start when Windows opens P-CIM Enable Edit Configurations Release Control

When selected displays the present status of the redundancy server. When selected displays P-CIM Help. When checked automatically runs the Redundancy module when Windows starts. When checked this computer (the current computer) can take control. When selected jumps to the Redundancy Editor. When selected releases this servers virtual IP address and shuts down P-CIM. This option is only displayed on the currently active server.

Manually shutting down the active server The active server can be shutdown manually by either Right clicking the Redundancy icon in the taskbar and selecting Detach Virtual IP. Right clicking the Redundancy icon in the taskbar and checking P-CIM enable.

After the server releases the Virtual IP address, P-CIM automatically shuts down. However, if the Enabled P-CIM field is not checked the server cannot take control.

P-CIM Redundancy User Guide

12

Afcon Software and Electronics Ltd Viewing server status The Status window displays the current status of the redundancy servers. To view this dialog box, right click on the Redundancy icon in the taskbar and select Show Status.

Current status can be either: Active server Passive server, in which case P-CIM enabled or P-CIM displayed is also displayed

Checking IP settings The Settings window displays the identity of the server that is currently active. Right click on the Redundancy icon in the taskbar and select Settings.

If this is the primary server, the name of the local network card and IP address followed by the virtual IP address are displayed. An asterisk before the IP address indicates that this server is active and is using the virtual IP address When this computer is the secondary server, the virtual IP address is followed by the fixed IP address of the primary server

Closing redundancy on a server 1. Check that this server is not currently active. If it is, manually shut it down. 2. Right click on the Redundancy icon 3. Select the Close option. in the taskbar.

P-CIM Redundancy User Guide

13

Afcon Software and Electronics Ltd

Client Services in a Redundant System


Client Setup
Client setup for a redundant system is basically the same as client configuration in any P-CIM networked system with the following variations and/or additions: Network Setup, configure the shared node number of the two servers as the NWMaster Node Associate the alarm and history file directories (page 3) Sending messages (Optional)

Sending Messages
Redundancy can be configured to send messages to clients relating to the status of the servers and the replication line. To do so, four $GlobalMessage variables must be reserved in the redundant system for specific messages. By default, the PFWREDUN.INI is set for the last four $GlobalMessage variables in the default range: $GlobalMessage29, indicates whether the primary server is active or not $GlobalMessage30, indicates whether the secondary server is active or not $GlobalMessage31, indicates whether replication communication is connected or not $GlobalMessage32, indicating if the secondary servers is available or not

Designating $GlobalMessage variables Any four $GlobalMessage variables can be designated. To do this, on each server: 1. In the INI File Editor navigate to: File: PfwRedun.INI Section: [StatusNotification]. The token values for primary, secondary, and replicator represent the $GlobalMessage variables that report their respective status. 2. Change the value to the required $GlobalMessage number in the range configured in: File: Pcim.IN Section: [PcimDbsr] Token: MaxGlobalMessage: Maximum 99 The instructions in this section are based on the default configuration. $GlobalMessage29: 0 = Not active; 1=Active $GlobalMessage30: 0 = Not active; 1=Active $GlobalMessage31: 0 = Connected; 1= Not connected $GlobalMessage32: 1 = Available; 0= Unavailable

Sending messages to a client station 1. Create digital value blocks that target the specific $GlobalMessage variables. 2. Configure the required Text = 0 and Text = 1 properties. 1. Create a display on the client station with output text fields. 2. Update the output text fields to reference the relevant $GlobalMessage variable. You can use these variables to send status messages to any other media, such as email.

P-CIM Redundancy User Guide

14

Afcon Software and Electronics Ltd

Updating Global Messages


Global messages are sent throughout the network when a value changes. The last value received is saved in each client station in a holding variable named $GMSGn $GMSG29 contains the latest value of $GlobalMessage29 $GMSG30 contains the latest value of $GlobalMessage30 $GMSG31 contains the latest value of $GlobalMessage31 $GMSG32 contains the latest value of $GlobalMessage32 $GMSG32 = 1, the Secondary server is available $GMSG32 = 0, the Secondary server is unavailable

If a client station is not online when a message is sent, it is not updated. When the station goes online, the holding variables may have incorrect values. Therefore, the values for the $GMSG variables must be set to the current $GlobalMessage values at startup. Updating global messages Configure a startup action on each client station using the following command in the action line: Set |!$GMSG29 7:1:|!$GlobalMessage29; Set |!$GMSG30 7:1:|!$GlobalMessage30; Set |!$GMSG31 7:1:|!$GlobalMessage31 In the above example, the Network port is 7,the shared node number is 1 and the $GlobalMessage variables are set to 29, 30, and 31. Only use the values that apply to your project in an actual application.

P-CIM Redundancy User Guide

15

Afcon Software and Electronics Ltd

History Trends
P-CIM Redundancy continuously acquires data at minimal data loss. During failure and recovery between the servers, if a client station is currently running a historical trend, the down time of data flow can cause the trend to stop. When the Operator Workstation display has input/output text fields, their values are not automatically refreshed which can prevent the trend from restarting. Either: Open the File menu (Alt+F) and select Revert to Saved Do not use output text fields in the Trend display. Create a separate display with the required output text fields

PingRetry
The secondary server continuously polls (pings) the primary server to check that it is active. By default, it does not assume the virtual IP address after one failed ping only. It repeats the ping for a set number of retries. If the full number of retries fails, it then assumes the virtual IP address and becomes the active server. The value of the ping retry count is saved in: File: PFWREDUN.INI Token: PingRetry Default: PingRetry= 4 To modify this setting access the PFWREDUN.INI file and change its value. It is strongly recommended to maintain a value of >1 for PingRetry.

Debugging, Resolving Conflicting IP Addresses


Sometimes both servers indicate active status, that is, the icons in both taskbars are green. In which case, the servers are conflicting, and a message appears on both servers to inform that there are conflicting IP addresses. This occurs when the secondary server pings the primary server to check that it is active and receives a false negative. That is, although the primary server is functioning correctly, the ping failed. The secondary server then attempts to assume the virtual IP address, creating the conflict. Solving conflicting IP addresses 1. Reboot both computers. 2. On the secondary server open the INI File Editor and access the PFWREDUN.INI file. If you have solved conflicting IP addresses previously, select the Debug = 0 token. If the token does not yet exist, create it by typing Debug into the Token field and then selecting Add.

3. Set the value to 2. 4. Select Save and then Close. If the Redundancy system functions normally, you can assume that the conflict was spontaneous. Proceed to step Access the PFWREDUN.INI file.7. When the conflict recurs, the following message indicating the time and date of the subsequent failed ping opens:

P-CIM Redundancy User Guide

16

Afcon Software and Electronics Ltd

5. Open an MSDos window and retry the ping manually. If the ping succeeds, it could be the software configuration in the secondary server. When the ping fails, there may be hardware or software problems in either server.

6. Try to solve the problem using the information in the Troubleshooting section or contact Technical Support at: support@afcon-inc.com 7. Access the PFWREDUN.INI file. 8. Reset the value of Debug to 0 (or entirely delete the token Debug=2).

Even under normal conditions, the secondary server does not respond to one failed ping. Therefore, retry the ping for the full count (default: 4) to verify that the secondary server receives an accurate failure report.

P-CIM Redundancy User Guide

17

Afcon Software and Electronics Ltd

Appendix 1 Removing Auto Logon Settings


During project development the Windows Auto Login option can be either checked or unchecked. When checked this defines that the Redundancy window will always be loaded and displayed when logging in to P-CIM. Auto Logon settings can be changed in the computers Registry Editor. Removing the auto logon option 1. Select the following: Start/Run/Regedit to open the Registry Editor. 2. Select the following: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION\WINLOGON\AUTOADMINLOGON. The Edit String dialog box opens.

3. Change the Value Data to 0. 4. Click OK to save the new settings and to exit this dialog box. Removing the auto start PFWredun.exe 1. Select the following: Start/Run/Regedit to open the Registry Editor. 2. Select the following: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENT VERSION\RUN. 3. Delete the following: prwredun.exe. 4. Delete the following: red_rest.exe.

P-CIM Redundancy User Guide

18

Afcon Software and Electronics Ltd

Appendix 2 - Troubleshooting and Maintenance


Redundancy parameters are mainly governed by the settings in the PFWREDUN.INI file. It is not recommended to change or add parameters unless advised by Afcon Technical Support.

Table 4: Error Messages


Message PFWREDUN.INI does not exist No entry in [Adapters] section of PFWREDUN.INI Meaning The PFWREDUN.INI file was not successfully created. It could be deleted. The relevant computer has not been configured for Windows networking. (My Network Places/Properties). Actions Reinstall the P-CIM Redundancy Option Pack. Configure Windows networking correctly and then reinstall the P-CIM Redundancy Option Pack. Reinstall P-CIM Redundancy Option Pack and configure settings correctly. Close unnecessary applications and restart. If the problem persists, contact Afcon technical support. Verify that the adapter card exists and reinstall the P-CIM Redundancy Option Pack. Reinstall P-CIM Redundancy Option Pack and configure settings correctly. Contact Afcon technical support.

No IP addresses in PFWREDUN.INI. Enter the IP addresses and restart the program Not enough memory available Cannot create timer for polling

The fixed IP address for this computer is absent in the PFWREDUN.INI file.

Insufficient system resources. Internal system failure.

Cannot find Adapter Card *****

Adapter card listed in PFWREDUN.INI file does not match the one in the computer. This usually indicates that an adapter card was replaced. Miscellaneous crucial settings are absent in the PFWREDUN.INI file.

PFWREDUN.INI file is corrupt

Error in AddIPAddress function Or, Error in DeleteIPAddress function

Internal system failure.

P-CIM Redundancy User Guide

19

Afcon Software and Electronics Ltd

Table 4: Error Messages (Continued)


Server is currently active. Cannot close before Detach You attempted to close the active server. The server cannot be closed while it is active. Perform a Manual Shutdown to deactivate the server, and execute the Close command. Check the network cards are installed and configured correctly, and that the cable is securely attached. No action necessary. Reinstall P-CIM Redundancy Option Pack and configure settings correctly. Contact your P-CIM vendor.

Connection failure on replication line

There is no communication between the servers on the replication line. Replication cannot proceed.

Connection on replication line reset Type of computer (Primary or Secondary) has not been assigned

Communication between the servers is restored. Replication proceeds normally. The designation for this computer is absent in the PFWREDUN.INI file.

This computer is not equipped with the proper SEK or Registration key. Contact your P-CIM vendor This computer is running a P-CIM version older than 6.60.

P-CIM Redundancy can run only on computers equipped with the correct SEK (Software Enable Key). P-CIM Redundancy requires P-CIM revision 6.60 or higher.

Verify that you have the correct P-CIM version running on all computers.

P-CIM Redundancy User Guide

20

Afcon Software and Electronics Ltd

Global Messages

Message $GlobalMessage29

Indicating 1 primary active 0 primary inactive

$GlobalMessage30

1 secondary active 0 secondary inactive

$GlobalMessage31

0 replication line OK 1 replication line not OK Replication is through the primary server only.

$GlobalMessage32

1 the Secondary server is available 2 the Secondary server is unavailable

PingRetry
The secondary server continuously polls (pings) the primary checking that it is active. By default, the secondary server does not assume the virtual IP after failed pings. It repeats the ping for a set count of retries. If the full count of retries fails, it then assumes the virtual IP address and becomes the active server. The ping retry count value is saved in the PFWREDUN.INI file under the token PingRetry. Default: PingRetry= 4. To change this setting, access the PFWREDUN.INI file and update the value. We strongly recommend that PingRetry value = >1.

P-CIM Redundancy User Guide

21

You might also like