Function Description

This function block is used to restart all SFC charts of an application with a given set of active steps at a state, saved before a CPU failure.

In a recovery situation it is possible to set a group of steps that represent a given state in the process and to continue at that point.

The behavior of the charts will be like using INITCHART and SETSTEP, i.e. the step time is reset to 0 and P/P1 actions are executed.

For more information please refer to Save and Restore Strategy.

EN and ENO can be configured as additional parameters.

Representation in FBD

Representation

Representation in LD

Representation

Representation in IL

Representation:

CAL SFC_RESTORE_Instance (SLOT:=Slot_Number,
    ADR_W:=Dest_Address, SPACE_KW:=Words_Number,
    SAVE:=Save_In, RESTORE:=Restore_In, RESUME:=Resume_In,
    STATUS=>Save_Restore_State, NUMSAVED=>saved_charts,
    NUMFAILED=>failed_charts, NUMPOSBL=>possible_charts)

Representation in ST

Representation:

SFC_RESTORE_Instance (SLOT:=Slot_Number,
    ADR_W:=Dest_Address, SPACE_KW:=Words_Number,
    SAVE:=Save_In, RESTORE:=Restore_In,
    RESUME:=Resume_In,
    STATUS=>Save_Restore_State, NUMSAVED=>saved_charts,
    NUMFAILED=>failed_charts, NUMPOSBL=>possible_charts);

Parameter Description

The SFC_RESTORE function block is used to access memory (SLOT, ADR_W, SPACE_KW) and to select the possible modes (SAVE, RESTORE, RESUME).

It also gives the status of operation (STATUS).

The amount of memory as an input parameter (SPACE_KW) determines the space that can be used by SFC Interpreter.

This memory area starts at the given address (ADR_W) and exclusive use by SFC system is supposed.

Description of input parameters

Parameter

Data Type

Description

SLOT

INT

PCMCIA card slot

  • 0: upper slot (default)

  • 1: lower slot

ADR_W

DINT

address of the archiving zone where SFC data is stored in memory card (word offset)

SPACE_KW

INT

This number determines the size of the memory in kilo words that the SFC interpreter is allowed to use.

The SFC-Interpreter calculates the number of SFC-sections that can be saved in this space. The result is visualized at the NUMPOSBL output.

NOTE: There is a system limitation for the number of SFC sections being saved. Any space reserved beyond this system limitation won't be used.

SAVE

BOOL

  • 0: save mode not selected

  • 1: save mode selected

    active only if

    • RESTORE = 0 and

    • RESUME = 0

  • 1->0

    falling edge = saving is stopped

    This event is reported to diagnostic buffer.

RESTORE

BOOL

  • 0: restore mode not selected

  • 0->1

    rising edge = saved steps from storage area are restored in each SFC section

    This event is reported to diagnostic buffer. All SFC sections enter mode disable transitions and disable actions.

  • 1: no SAVE / no RESTORE / no RESUME

  • 1->0

    falling edge = no activity

RESUME

BOOL

  • 0: resume mode not selected

  • 0->1

    rising edge = resume all SFC charts to normal mode if RESTORE = 0

    This event is reported to diagnostic buffer.

  • 1: no activity, but prevents SAVE

  • 1->0

    falling edge = no activity

Description of output parameters

Parameter

Data type

Description

STATUS

INT

0 = OK

STATUS error message (see STATUS Error Messages)

NUMSAVED

INT

number of SFC sections on which the save was performed during the last scan

NUMFAILED

INT

number of SFC sections that could not be saved during the last scan

NUMPOSBL

INT

number of SFC sections that fits into the given memory space