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

Supported Operations for Complex Data
Data types
  • boolean

  • double

  • int32

  • int16

  • int8

  • single

  • uint32

  • uint16

  • uint8

Specify Type of Stateflow Data
Data type operations
  • cast

  • fixdt

  • type

Type Cast Operations
Explicit events
  • send

Broadcast Local Events to Synchronize Parallel States
Implicit events
  • change

  • chg

  • tick

  • wakeup

Define Chart Behavior by Using Implicit Events
Messages
  • send

  • forward

  • discard

  • isvalid

  • length

  • receive

Communicate with Stateflow Charts by Sending Messages
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 by Using the in Operator
Temporal logic
  • after

  • at

  • before

  • every

  • sec

  • msec

  • usec

  • temporalCount

  • elapsed

  • t

  • duration

  • count

Control Chart Execution by Using Temporal Logic