FB_EnableExecuteQuit

Overview

Type:

Function block

Available as of:

V1.0.4.0

Functional Description

The function block FB_EnableExecuteQuit is based on the function block FB_EnableExecute extended by an additional input i_xErrorQuit used to acknowledge errors that have been detected during the execution.

By setting the input i_xEnable to TRUE, the function block starts the enabling process. The function block continues initialization and the output q_xActive is set to TRUE. Once the initialization is finished and the function block is ready, the output q_xReady is set to TRUE.

A rising edge of the input i_xExecute starts the execution of the function block. The function block continues execution and the output q_xBusy is set to TRUE. A rising edge at the input i_xExecute is ignored while the output q_xReady is FALSE or the function block is being executed.

Once the execution is finished, the output q_xBusy is set to FALSE and the output q_xDone or q_xError is set to TRUE according to the result.

The output q_xDone indicates a successful execution and remains TRUE until the next rising edge of the input i_xExecute.

In case an error is detected, the output q_xReady is set to FALSE and a renewed execution of the function block is not possible as long as the error state is present. A rising edge of the input i_xErrorQuit acknowledges the error.

If the error state persists upon a rising edge of i_xErrorQuit, the function block must be disabled in order to acknowledge the error state.

By setting the input i_xEnable to FALSE, the function block starts the disabling process. The function block must be called as long as the output q_xActive is TRUE.

Interface

Input

Data type

Description

i_xEnable

BOOL

Activation and initialization of the function block.

i_xExecute

BOOL

A rising edge of this input starts the execution of the function block.

i_xErrorQuit

BOOL

A rising edge of this input acknowledges the detected error.

Output

Data type

Description

q_xActive

BOOL

If the function block is active, this output is set to TRUE.

q_xReady

BOOL

If the initialization is successful, the output is set to TRUE.

q_xBusy

BOOL

If this output is set to TRUE, the function block execution is in progress.

q_xDone

BOOL

If this output is set to TRUE, the execution has been completed successfully.

q_xError

BOOL

If this output is set to TRUE, an error has been detected.

Signal Diagrams

The signal diagram for successful execution is identical with the signal diagram during successful execution of the function block FB_EnableExecute.

Signal diagram for successful reset of a detected error:

Signal diagram for unsuccessful reset of a detected error:

State Machine Diagram

The state machine diagram illustrates the procedures, methods, states and state transitions that are defined for this function block.