Rules for Naming Stateflow Objects

Characters You Can Use

You can name Stateflow® objects with any combination of alphanumeric and underscore characters. Names cannot begin with a numeric character or contain embedded spaces.

Restriction on Name Length

Name length should comply with the maximum identifier length enforced by Simulink® Coder™ software. You can set the Maximum identifier length parameter. The default is 31 characters and the maximum length you can specify is 256 characters.

Keywords to Avoid When Naming Chart Objects

You cannot use reserved keywords to name chart objects. These keywords are part of the action language syntax.

Usage in Action Language SyntaxKeywordsSyntax References
Boolean symbols
  • true

  • false

Boolean Symbols, true and false
Change detection
  • hasChanged

  • hasChangedFrom

  • hasChangedTo

Detect Changes in Data Values
Complex data
  • complex

  • imag

  • real

Define Complex Data Using Operators
Data types
  • boolean

  • double

  • int8

  • int16

  • int32

  • single

  • uint8

  • uint16

  • uint32

Set Data Properties
Data type operations
  • cast

  • fixdt

  • type

Type Cast Operations
Explicit events
  • send

Broadcast Events to Synchronize States
Implicit events
  • change

  • chg

  • tick

  • wakeup

Control Chart Execution Using Implicit Events
  • send

  • forward

  • discard

  • isvalid

  • length

  • receive

Stateflow Message Syntax in Charts
Literal symbols
  • inf

  • t (C charts only)

Supported Symbols in Actions
MATLAB® functions and data
  • matlab

  • ml

ml Namespace Operator
State actions
  • bind

  • du

  • during

  • en

  • entry

  • ex

  • exit

  • on

State Action Types
State activity
  • in

Check State Activity
Temporal logic
  • after

  • at

  • before

  • every

  • sec

  • msec

  • usec

  • temporalCount

  • elapsed

  • t

  • duration

Control Chart Execution Using Temporal Logic
Was this topic helpful?