software redundancy

Upload: khaled-averos

Post on 04-Apr-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Software Redundancy

    1/13

    03.98 Software Redundancy

    1-1

    1 Software Redundancy

    Within WinCC, the software redundancy feature makes it possible to monitor

    critical sections of a plant by using a redundant connection to several PLCs.

    PLC 1 PLC 2

    WinCC (Tag Management)

    Tag 1

    Tag 2

    Tag n

    .

    .

    T 1 T 2 T 3

    RedundantPLC Section

    RedundantConnection

    RedundantTags

    LogicalConnections

    Non-redundantConnection to PLC 1

    Non-redundantConnection to PLC 2

    Software redundancy considerably improves reliability when critical plant

    sections are to be monitored. For example, a redundant connection to two

    PLCs means that one PLC takes over if the other PLC fails. Using software

    redundancy does not mean that you can only establish redundant connections

    to the PLCs configured. It is still possible to connect any PLC in a non-

    redundant layout. The switchover between redundant PLCs is performed

    automatically in the event of a malfunction. However, a manual switchover is

    also possible by specifying a tag (@ForceConnectionState).

    Note

    Establishing a redundant connection requires two PLCs.

  • 7/29/2019 Software Redundancy

    2/13

    Software Redundancy 03.98

    1-2

    Setting up software redundancy:

    In order to use software redundancy under WinCC, the following settings are

    required in the Control Center:

    Step 1The computer properties must be set to the following values:

    Step 2

    Within the Alarm Logging system, the "short-term archive" must be

    activated:

    If the "short-term archive" has not yet been activated, proceed as follows:

    In the navigation window, open the pop-up menu of the "Archives" object

    and select the "Add/Remove" menu item. Within the "Assign Storage

    Parameters" dialog box, activate the "Short-Term Archive Active" check

    box.

  • 7/29/2019 Software Redundancy

    3/13

  • 7/29/2019 Software Redundancy

    4/13

    Software Redundancy 03.98

    1-4

    Step 4

    By means of the "DynWizEdit.exe" program, integrate the Dynamic

    Wizard for software redundancy into the WinCC system (Graphics

    Designer). This integration procedure requires the following steps: In the

    Windows Explorer, start the "C:\Siemens\WinCC\bin\DynWizEdit.exe"program. Select the "German" language in the toolbar. Retrieve the

    "C:\Siemens\WinCC\wscripts\wscripts.deu\SW_Redundanz.wnf" script by

    selecting the "Dynamic Wizard" and "Retrieve Wizard Script" menu

    items. The compilation progress is shown in the output window. After the

    compilation has been completed successfully, the new entry "Establish

    Redundant Connection" appears in the "Dynamic Wizard" window.

    Step 5

    Integrate the "SIMATIC S7 PROTOCOL SUITE" communications driver

    within the tag management.

    Step 6

    Within the required bus type (e.g. MPI), create a logical connection in the

    "SIMATIC S7 PROTOCOL SUITE" communications driver. Give an

    expressive name to this connection.

    Step 7

    Open an existing picture in the Graphics Designer. Within the Dynamic-

    Wizard (in the "System Functions" tab), start the "Establish Redundant

    Connection" program by double-clicking.

  • 7/29/2019 Software Redundancy

    5/13

    03.98 Software Redundancy

    1-5

    Step 8

    Press the "More" button in the welcome screen.

    Step 9

    Select the main connection in the "Set Options" dialog box. Then press the

    "More" button.

  • 7/29/2019 Software Redundancy

    6/13

    Software Redundancy 03.98

    1-6

    Step 10

    Edit the settings for the back-up connection in the "Set Options" dialog

    box. Then press the "More" button. The "Automatic Switchover" check

    box must be active (default setting).

    The settings for the back-up connection (S7 network address) can be found

    in the "Connection" tab. Access this tab via the connection properties

    dialog box for the connection.

  • 7/29/2019 Software Redundancy

    7/13

    03.98 Software Redundancy

    1-7

    Step 11

    The settings you specified are displayed in the final "Finished" dialog box.

    By pressing the "Finish" button, connection-specific internal tags are

    created in a tag group. This tag group is stored within the tag management

    under "SIMATIC S7 PROTOCOL SUITE" and the associated channelunit.

    Note

    By pressing the "Back"u button, you can go back one step and make any

    necessary changes.

  • 7/29/2019 Software Redundancy

    8/13

    Software Redundancy 03.98

    1-8

    1.1 Connection-specific Internal Tags

    Connection control is accomplished by means of connection-specific internal

    tags. The connection-specific internal tags are created by a wizard. The name

    of a connection-specific internal tag is composed of the name of the associatedconnection and an identifier. The connection name is provided with a '@'

    prefix to identify it as a system tag. Example: "@connection

    name@identifier". All connection-specific internal tags are assembled to form

    a "@connection name" tag group.

    Note

    Only if the associated connection is ready for operation does the WinCC data

    manager permit access to connection-specific tags. However, it is possible to

    have read and write access to connection-specific internal tags independently

    of the connection status.

    The following system tags are available for SIMATIC S7PROTOCOL SUITE

    software redundancy:

    @ConnectionState

    Meaning: connection status

    Type: DWORD

    Access: read

    Default: 0 = "faulty"

    The current connection status can be determined by means of the

    'ConnectionState' tag.

    0 = connection faulty

    1 = connection ready for operation

    @ConnectionError

    Meaning: error cause

    Type: DWORD

    Access: read

    Default: 0 = "no error"

    The tag contains an error cause describing the reason why the

    connection was interrupted. Default = 0, i.e. connection not yetestablished or without error. When establishing a connection, the tag is

    loaded with 0 (no error) again. The error code is interpreted in a

    channel-specific manner. The S7 channel stores the S7 DOS error code

    here.

    0 = no error

    0 = S7 DOS error code

  • 7/29/2019 Software Redundancy

    9/13

    03.98 Software Redundancy

    1-9

    @ConnectionErrorString

    Meaning: error cause as string

    Type: TEXT8 [128]

    Access: read

    Default: "" = "no error"

    The tag contains the error cause in the format of a string describing the

    reason why the connection was interrupted. The string is put out in the

    language currently selected. Default = "", i.e. connection not yet

    established or without error. The following texts are entered in the S7

    channel in English, without regard to the selected language.

    "No Error" = No error

    "Error hhhh" = hhhh error occurred

    (hhhh = S7 DOS hexadecimal error code)

    @ConnectionErrorCount

    Meaning: communication error counter

    Type: DWORD

    Access: read

    Default: 0 = "no error"

    The value of this tag is incremented by 1 each time a connection is

    interrupted.

    In the event of an overflow the count starts again with 0.

    @ConnectionEstablishMode

    Meaning: connect mode

    Type: DWORDAccess: write

    Default: 1 = "automatic"

    This tag enables you to specify a connection to be established

    automatically. The S7 channel then attempts to reestablish a failed

    connection at intervals of approx. 4 seconds. If a value = 0 is entered

    in this tag, the connection will not be reestablished automatically at

    intervals of 4 seconds, but remains interrupted.

    Writing the @ConnectionEstablishMode tag takes the following effect:

    0 = manual connecting mode-> deactivate automatic connecting

    0 = automatic connect mode

    -> activate automatic connecting

  • 7/29/2019 Software Redundancy

    10/13

    Software Redundancy 03.98

    1-10

    @ForceConnectionState

    Meaning: preferred connection status

    Type: DOWRD

    Access: write

    Default: 1 = "established"

    This tag can be used to notify the channel of the preferred connection

    status. Usually this tag has the value 1, i.e. the channel attempts to

    establish the connection (at regular intervals of approx. 4 seconds, if

    applicable). If the value 0 is written to this tag, the channel interrupts

    the connection.

    Writing to this tag takes the following effect:

    0 = preferred connection status: connection interrupted

    -> if connection established

    -> cause connection to be interrupted

    1 = preferred connection status: connection established

    -> if connection interrupted

    -> cause connection to be established

    @ForceConnectionAdress

    Meaning: selecting the connection address

    Type: DWORD

    Access: write

    Default: 0 = "configured"

    This tag specifies which of the connection addresses is to be used for

    establishing the connection.

    Writing to this tag takes the following effect:

    0 = connection via configured connection parameters

    -> if @ForceConnectionAddress previously 1

    -> cause connection to be interrupted

    1 = connection via alternative connection parameters

    -> if @ForceConnectionAddress previously 0

    -> cause connection to be interrupted

    -> If connect mode is set to "automatic", the connection is

    automatically established with the corresponding address.

  • 7/29/2019 Software Redundancy

    11/13

    03.98 Software Redundancy

    1-11

    @AlternateConnectionAdress

    Meaning: Alternative connection address

    Type: TEXT8 [255]

    Access: write

    Default: "..." = "configured"

    The alternative connection address string can be entered in this tag.

    This is the same string as the one which is displayed as connection

    parameter in the WinCC Control Center. The string is channel-

    specific. On system start-up (runtime), the configured address is

    entered here as default for the S7 channel. If an address has not been

    configured yet, the text "Illegal Address" is entered for the S7 channel.

    Example of an address specified for an S7 PLC with station address 3

    via MPI: MPI,3 0,,0,0,02

    Writing to this tag takes the following effect:

    -> If the address is changed by the write process, the "Connection via

    alternative connection parameters" setting causes the connection to be

    interrupted.

    -> If the "automatic" connect mode has been set, the connection is

    established automatically, using the address just previously written.

  • 7/29/2019 Software Redundancy

    12/13

    Software Redundancy 03.98

    2-12

    2 Master-Reserve Change-over on the S7When the Dynamics Wizard has finished setting up the redundant-backup link, you can

    extend the script by adding the Master-Reserve Change-over option.

    To do so, you open the script under Global Script -> Actions -> Global Actions. If your

    selected connection is called CPU_3 as in the illustrations above, open @CPU_3.pas.

    Control Center- (Projekt.MCP)

    Projekt

    Variablenhaushalt

    Editoren

    Global Script

    Aktionen

    Globale Aktionen

    CPU_3.pas

    CPU_4.pas

    CPU_5.pas

    Having opened it, you then insert the sequence printed in bold type and highlighted ingray. Here too it is assumed that your connection is called CPU_3. If you have used a

    different name, replace each occurrence of CPU_3 with the name you have used. The bit

    variable SWR.Standby is the bit Reserve from the status word (DW 9.1) from the

    instance DB of the call for FB101 SWR_ZYK. If you have used a different name for

    this, replace the name accordingly.

    ...........

    {

    MSRTStopMsgService ( ServiceID, &Error );

    }

    If ( GetTagDWordWait( "@CPU_3@ConnectionState" ) == 0 ){

    SetTagDWord( "@CPU_3@ForceConnectionState", 1 );

    }

    else

    {

    if ( GetTagBitWait( "SWR.Standby" ) == TRUE )

    {

    SetTagDWord( "@CPU_3@ForceConnectionState", 0 );

    }

    }

    return 1;

    }}

  • 7/29/2019 Software Redundancy

    13/13

    03.98 Software Redundancy

    2-13

    Note: you can add the Standby bit to the structure for the redundant software backup

    screen block (see section 7.2.2 in the user documentation for the redundant-backup

    software blocks) as follows:

    Name Data type Offset Bit

    WORD Status WORD 0 0

    BIT MasterSwitch BIT 2 0

    BIT RedTurnOn BIT 2 9

    BIT RedTurnOff BIT 2 8

    BIT Standby BIT 0 9