function

Menu: State Charts

The function 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, we recommend C: A Software Engineering Approach.

You use the function in the levels below the state chart container block. To access the Function Properties dialog box, right-click over it and select Properties.

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