function

Menu: State Charts

The function block lets you define one or more C functions that are called from any state or transition within the state chart. If you are unfamiliar C, refer to C: A Software Engineering Approach.

You use the function block inside a state chart block.

Color

Background: Reserved.

Foreground: Specifies the color of the function window.

Name: Specifies a name for the function. Function names must be unique within the state chart.

Example

This state chart cycles through three states. Function1 increments an integer counter. When the counter reaches 11, control is transitioned to the next state. The output variable for the exiting state is plotted.

function block ex 3