Specify Units for Stateflow Data
Units for Input and Output Data
Stateflow® charts in Simulink® models support physical unit specifications for data inputs and outputs. To specify units, use the Unit (e.g., m, m/s^2, N*m) parameter for input or output data on charts, state transition tables, or truth tables. This parameter provides matching suggestions for supported units as you type.
By default, data inherits units from the connected Simulink signal. However, if you enable the Data must resolve to signal object property for output data, you cannot manually specify units. The output data will automatically inherit the unit type from the connected Simulink signal.
To visualize units directly in your model, go to the Debug tab and select Information Overlays > Port Units. This displays unit information on the Simulink signal lines.
Check Unit Consistency
Stateflow validates unit consistency between Simulink signal lines and the corresponding input or output data settings in Stateflow blocks. When units do not match, the system displays a warning during model update, so that you can identify and resolve unit conflicts.
Units for Stateflow Limitations
Unit property settings in Stateflow do not affect block execution. Simulink only checks consistency between Stateflow data settings and their corresponding connected Simulink signal lines.
Stateflow does not warn about unit mismatches in internal operations. For example,
assigning an input with units set to ft directly to an output with units set
to m does not generate a warning, despite the unit inconsistency.
Stateflow does not perform unit conversions.
See Also
Topics
- Unit Specification in Simulink Models (Simulink)