Using Simulink |
 |
Data Typing Rules
Observing the following rules can help you to create models that are typesafe and therefore execute without error:
- Signal data types generally do not affect parameter data types, and vice versa.
- A significant exception to this rule is the Constant block, whose output data type is determined by the data type of its parameter.
- If the output of a block is a function of an input and a parameter, and the input and parameter differ in type, Simulink converts the parameter to the input type before computing the output.
- In general, a block outputs the data type that appears at its inputs.
- Significant exceptions include Constant blocks and Data Type Conversion blocks, whose output data types are determined by block parameters.
- Virtual blocks accept signals of any type on their inputs.
- Examples of virtual blocks include Mux and Demux blocks and unconditionally executed subsystems.
- The elements of a signal array connected to a port of a nonvirtual block must be of the same data type.
- The signals connected to the input data ports of a nonvirtual block cannot differ in type.
- Control ports (for example, Enable and Trigger ports) accept any data type.
- Solver blocks accept only
double
signals.
- Connecting a non-
double
signal to a block disables zero-crossing detection for that block.
| Data Type Propagation | | Enabling Strict Boolean Type Checking |  |