Stateflow User's Guide Previous page   Next Page

Target Properties

Stateflow API objects of type Target have the properties listed in the table below. See also Target Methods.

Property
Type
Access
Description
ApplyToAllLibs
Boolean
RW
If set to true (default), use settings in this target for all libraries. Equivalent to selecting the Use settings for all libraries check box in this target's Target Builder dialog.
CodeFlagsInfo
Array
RO
A MATLAB vector of structures containing information on the code flag settings for this target. See special topic CodeFlagsInfo Property of Targets for more information.
CodegenDirectory
String
RW
Directory to receive generated code (default = ''). Equivalent to the entry in the Generated Code Directory panel of the Target Options dialog for this target. Applies only to targets other than sfun and rtw targets.
CustomCode
String
RW
Custom code included at the top of the generated code (default = ''). Equivalent to the entry in the Include Code panel of the Target Options dialog for this target.
CustomInitializer
String
RW
Custom initialization code (default = ''). Equivalent to the entry in the Initialization Code panel of the Target Options dialog for this target. Applies only to sfun and rtw targets.
CustomTerminator
String
RW
Custom termination code (default = ''). Equivalent to the entry in the Termination Code panel of the Target Options dialog for this target. Applies only to sfun and rtw targets.
Description
String
RW
Description of this target (default = ''). Equivalent to entering a description in the Description field of the properties dialog for this target.
Document
String
RW
Document link to this target (default = ''). Equivalent to entering the Document Link field of the properties dialog for this target.
Id
Integer
RO
Unique identifier assigned to this Target object to distinguish it from other objects loaded in memory.
Machine
Machine
RO
Stateflow machine containing this target.
Name
String
RW
Name of this target (default = 'untitled'). Equivalent to naming or renaming this target in the Explorer.
ReservedNames
String
RW
Comma- or space-separated list of names to not use in Stateflow generated code. Equivalent to the entry in the Reserved Names panel of the Target Options dialog.
Tag
Any Type
RW
Holds data of any type (default = []) for this target.
UserIncludeDirs
String
RW
Custom include directory paths (default = ''). Equivalent to the entry in the Include Paths panel of the Target Options dialog for this target.
UserLibraries
String
RW
Custom libraries (default = ''). Equivalent to the entry in the Libraries panel of the Target Options dialog for this target.
UserSources
String
RW
Custom source files (default = ''). Equivalent to the entry in the Source Files panel of the Target Options dialog for this target.

CodeFlagsInfo Property of Targets

The CodeFlagsInfo property of a Target object is a read-only MATLAB vector of structures containing information on the code flag settings for its target. Each element in the vector has the following MATLAB structure of information about a particular code flag:

Element
Type
Description
name
String
Short name for this flag
type
String
The type of the code flag
description
String
A description of this code flag
defaultValue
Boolean
The default value of this code flag upon creation of its target
visible
Boolean
Whether or not this flag is visible
enable
Boolean
Whether or not to enable this flag
value
Boolean
The value of the flag

The first element of each structure is a shorthand name for the individual flag that you set in the Coder Options dialog. For example, the name 'comments' actually refers to the dialog setting Comments in generated code. While the CodeFlagsInfo property is informational only, you can use these shorthand flag names in the methods getCodeFlag and setCodeFlag to access and change the values of a flag.

The names of each of the possible code flags in the CodeFlagsInfo property along with the name of the flag as it appears in the Coder Options dialog for the target are as follows:

Name in CodeFlagsInfo
Name in Properties Dialog
Target
Default Value
debug
Enable debugging/animation
sfun
Enabled
overflow
Enable overflow detection (with debugging)
sfun
Enabled
echo
Echo expressions without semicolons
sfun
Enabled
comments
Comments in generated code
rtw, custom
Disabled Enabled
preservenames
Preserve symbol names
rtw, custom
Disabled
preservenameswithparent
Append symbol names with no mangling
rtw, custom
Disabled
exportcharts
Use chart names with no mangling
rtw, custom
Disabled
statebitsets
Use bitsets for storing state configuration
rtw, custom
Disabled
databitsets
Use bitsets for storing boolean data
rtw, custom
Disabled
ioformat
Enumerated value can be one of the following:
  • 0 = Use global input/output data
  • 1 = Pack input/output data into structures
  • 2 = Separate argument for input/output data
custom
0
initializer
Generate chart initializer function
custom
Disabled
multi
instanced

Multi-instance capable code
custom
Disabled
ppcomments
Comments for Post-processing
custom
Disabled

For detailed descriptions of each of the preceding code flags, see Configuring a Custom Target in Stateflow in the Stateflow and Stateflow Coder User's Guide documentation.


Previous page  Event Methods Target Methods Next page

© 1994-2005 The MathWorks, Inc.