Documentation

Reset Function

Executes contents on a model reset event

  • Library:
  • User-Defined Functions

Description

The Reset Function block is a preconfigured subsystem block created from an Initialize block that executes on a model reset event.

Note

The Reset Function block is not in the Simulink® Library Browser.

To create a Reset Function block:

  1. Add an Initialize block.

  2. Open the Event Listener block within the Initialize block. From the Event drop-down list, select Reset.

    One parameters appear.

    • By default, the Event name is set to Reset. You can change the name of a reset event by editing this text box.

  3. Rename the block from Initialize Function to Reset Function.

The Reset Function block includes an Event Listener block with Event set to Reset, a Constant block with Constant value set to 0, and a State Writer block.

Replace the Constant block with source blocks that generate the state value for the State Writer block.

For a list of unsupported blocks and features, see Initialize, Reset, and Terminate Function Limitations.

A model can potentially have multiple Reset Function blocks with each block having a different Event name. Each of these reset events appear in the generated code as a different function.

Was this topic helpful?