# Preparing Models for Use with Reactis
To use Reactis on a Simulink / Stateflow model, you must ensure that the model satisfies certain constraints. This chapter describes what these constraints are. Please note that, while every effort is made to maintain the accuracy of the following list of supported and unsupported features, due to the complexity and continual evolution of the Simulink / Stateflow notation, this description may not be complete. For example, some blocks listed as supported do not support all parameters for the block. A block or feature not listed as either supported or unsupported should be assumed to be unsupported.
We encourage all potential customers to take advantage of a free evaluation license for Reactis to determine if the subset of Simulink / Stateflow supported by Reactis is adequate for your models. If it’s not, please let us know what features or blocks you would like to see Reactis support. Reactive Systems uses such feedback to prioritize enhancements to Reactis.
## MATLAB
Reactis can process Simulink / Stateflow models that contain MATLAB code in callbacks or mask initializations, provided that certain conventions are observed. On the one hand, files that define workspace data items referred to in a model must be “connected” to the model appropriately, and certain MATLAB functions should be avoided. The remainder of this section elaborates on these points.
```{index} single: MATLAB ; workspace
```
(workspacedataitems)=
### Workspace Data Items
Reactis invokes MATLAB to evaluate many MATLAB expressions, but it does not directly interact with an executing MATLAB session in the same way that Simulink does. For this reason, any workspace data items that a model uses must be initialized within one of the following locations:
* Any Simulink model callback or block callback that is executed when loading or running the model (PreLoadFcn, PostLoadFcn, InitFcn, StartFcn).
* A “startup.m” file located in the folder where the model file is located. When using this method, make sure that the “Execute startup.m and pathdef.m scripts in model folder” is checked in the “General” tab of the Reactis Info File Editor.
* The “Callbacks” tab of the Reactis Info File Editor. If in your environment the MATLAB workspace for your model is set up via some external script or graphical user interface prior to loading the model, you can add the initialization code here so Reactis knows how to set up the workspace. Reactis will automatically execute the “PreLoad Function” code prior to loading the model and the “PostLoad Function” code after loading the model. This method allows you to use Reactis in such an environment without having to modify your model.
* The Simulink Data Dictionary.
For the cruise control example, the file `cruise_constants.m` defines two workspace variables that are used in `cruise.mdl.` One attaches `cruise_constants.m` to `cruise.mdl` as follows:
1. Load `cruise.mdl` into Simulink.
2. From the **Modeling** tab toolbar, select the **Model Settings** > **Model Properties** menu item.
3. In the resulting dialog, select the **Callbacks** tab.
4. In the **Model preload function** entry box enter `cruise_constants;`.
5. Save the model.
In general, using the PreLoadFcn callback in this manner is good modeling practice, since once the `.m` files are attached to a model file, loading the model file into Simulink (and not just Reactis) will automatically load the `.m` files as well.
### Unsupported MATLAB Features
If any of the following MATLAB functions are used in the callbacks or mask initializations of a model, then the Reactis “Propagate set_param" setting must be enabled. To enable the feature for a model, load the model, select menu item **Edit** > **General**, and then check the box “Propagate set_param changes by saving the model to a temporary file”. To enable this feature for all models, select **File** > **Model Defaults...** and then check the box “Propagate set_param changes by saving the model to a temporary file” in the **General** tab. If this setting is enabled, Reactis will cause Simulink to apply all the changes to the model, then automatically save them to a temporary file. Reactis then imports the temporary model to see the applied changes.
```{listtable} Expression Evaluation
:headerrows: 0
*  assignin
 Assign variable in workspace.
*  evalin
 Evaluate expression in workspace.
```
```{listtable} Model Construction/Modification
:headerrows: 0
*  add_block
 Add a block to a Simulink system.
*  add_line
 Add a line to a Simulink system.
*  add_param
 Add a parameter to a Simulink system.
*  delete_block
 Delete a block from a Simulink system.
*  delete_line
 Delete a line from a Simulink system.
*  delete_param
 Deletes a parameter from a Simulink system.
*  new_system
 Create a new empty Simulink system.
*  replace_block
 Replace blocks in model.
*  set_param
 Set Simulink system and block parameters.
```
```{index} Simulink
```
## Simulink
Reactis currently supports Simulink releases R2014a through R2024a. Most
features of Simulink are supported; but the following are not supported by
Reactis:
* Continuoustime blocks.
* The use of complex values (i.e. values with real and imaginary parts).
* Models containing corresponding DataStoreWrite/DataStoreRead blocks whose execution order is not explicitly defined by either the model logic or priorities.
For the subset of Simulink blocks supported by Reactis please refer to the [Table of Supported Blocks](tableofsupportedblocks) section. For blocks that can be either continuous or discretetime, only the discretetime version is supported. For some blocks identified as supported, not all settings are supported.
Reactis supports the fixedstep and variablestep discrete solvers for models that do not contain any continuoustime blocks. For variablestep solvers, the “Max step size” setting is supported.
```{index} Sfunctions
```
(secsfunctions)=
### SFunctions
Reactis supports both CCoded and MFile Sfunctions, with some restrictions. For CCoded Sfunctions, the following are not supported by Reactis:
* Portbased sample times.
* Multiple sample times.
* Complex number signals.
* Zerocrossing detection.
* Output of functioncalls.
* Level 1 Sfunctions (For a guide on how to convert Level 1 Sfunctions to Level 2 Sfunctions — which are supported by Reactis  please consult the MathWorks documentation)
* Calling any function from MATLAB’s “mex” library (including mexCallMATLAB, mexEvalString and mexGetVariable) from an SFunction.
For MFile Sfunctions, the following are not supported by Reactis:
* Multiple sample times.
* Complex number signals.
* Level 2 Sfunctions.
In addition to the above restrictions, care must be taken about any internal data that is stored by Sfunctions. In order to work properly, Reactis must be able to retrieve and reset the values of all internal states of any Sfunction occurring within a model. The best way to make internal states visible to Reactis (and Simulink) is to declare the appropriate number of discrete states in the `mdlInitializeSizes()` function and then use the state vector that Reactis and Simulink will provide. Reactis will also save and restore memory that an Sfunction allocates as a result of calling the `ssGetNumRWork()` and `ssGetNumIWork()` during `mdlInitializeSizes`.
Reactis has no way of knowing about any other persistent data that an Sfunction maintains by other means, such as:
* global or static variables in Ccode;
* memory allocated by `malloc()` or `mxMalloc()` functions in Ccode;
* Use of workspace variables in MFile Sfunctions.
Reactis will also not save and restore memory requested by `ssGetNumPWork()`, since otherwise pointers stored in this vector by your Sfunction might get lost or mangled, resulting in memory leaks or crashes.
If an Sfunction stores internal states in any of the unsupported ways described above, Reactis will seem to work properly, but the test suites generated by Tester may include wrong outputs. One sign of this can be if you run a test suite in Simulator and get an error message saying “**Model fails test**”. Another problem of such invalid use of internal states may be invalid outputs after using the “back” buttons in Simulator.
```{index} configuration variables
```
```{index} single: configuration variables ; in SFunctions
```
In general, Reactis passes SFunction parameters as fixed values at the time the SFunction is first initialized (i.e. when Tester or Simulator is started). Therefore, if a configuration variable is used as a parameter to an SFunction, the SFunction will *not* see any changes to the configuration variable unless the SFunction is designed to process such updates. To have an SFunction be updated on changes to its parameters, define a *mdlProcessParameters* function (see Simulink documentation) within the SFunction code. If this function is present, then Reactis will propagate the parameter changes into the SFunction by calling the SFunction’s *mdlProcessParameters* function at each step with the new parameter values. In the *mdlProcessParameters* function, the SFunction can then take appropriate actions if any parameters have changed.
### Lookup Tables
This section describes the settings for each of the standard Simulink lookup table blocks that are supported by Reactis. Note that MathWorks has changed the names of these blocks and their settings over different releases. We use the R2023a terminology here. If you are using an older version of MATLAB, your block names and settings may be slightly different.
(1dlookuptable)=
#### 1D Lookup Table
Note that this block was previously named *Lookup Table*. A 1D lookup table is equivalent to an nD Lookup Table with one dimension. See the [nD Lookup Table](ndlookuptable) section for details on which parameter and type combinations are supported in Reactis.
(2dlookuptable)=
#### 2D Lookup Table
Note that this block was previously named *Lookup Table (2D)*. A 2D lookup table is equivalent to an nD Lookup Table with two dimensions. See the [nD Lookup Table](ndlookuptable) for details on which parameter and type combinations are supported in Reactis.
(ndlookuptable)=
#### nD Lookup Table
Note that this block was previously named *Lookup Table (nD)*. Reactis supports a wide variety of nD lookup tables, subject to restrictions which depend on the number of table dimensions. There are two levels of support, *native* and via *Sfunction*.
*Native support* means Reactis will natively execute the nD Lookup Table block and track coverage for it. An nD Lookup Table is natively supported if it satisfies the following requirements:
1. The number of dimensions is at most four.
2. The interpolation method is linear or flat.
3. The extrapolation method is linear or clip.
4. None of the inputs or outputs have enumerated types.
5. If the intermediate type is set to *Inherit via Internal Rule*, then all input, output, breakpoint, and table data types are either (1) a floatingpoint data type, or (2) a fixedpoint type with a binarypoint scaling and a bias of zero.
6. The *Internal rule priority* is set to *Precision*. It may also be set to *Speed* if Reactis has been configured to allow it. The behavior of Reactis is controlled by the setting *If lookup table uses internal rule priority ’Speed’* in the *General* pane of the Reactis Info File Editor (see the [General Pane](secgeneralpane) section).
#### Lookup table support via Sfunction
*Support via Sfunction* requires MATLAB R2017b or earlier: it is *not* available with R2018a and later. *Support via Sfunction* means Reactis can execute the nD lookup block but not track coverage. In order to execute the block, Reactis requires the `sfun_lookupnd.mexw32` SFunction that comes with MATLAB R2007a or earlier. Starting with MATLAB R2007b, this SFunction is no longer included in the MATLAB distribution. However, if a `sfun_lookupnd.mexw32` from R2007a or earlier is placed in Reactis’ search path, Reactis can use that SFunction with MATLAB R2007b to R2017b, but not with R2018a and later.
nD lookup tables which meet the following requirements are supported via Sfunction in Reactis:
1. The input and output types are the same floatingpoint type.
2. The fraction data type is set to *Inherit via internal rule.*
3. The table data type is set to *Inherit: same as output.*
4. The breakpoint data type is set to *Inherit: same as corresponding input.*
5. All inputs are scalars.
6. If the table has more than one dimension, then the intermediate data type is set to *Inherit: same as output.*
(lookuptabledynamic)=
#### Lookup Table Dynamic
All parameters and data type configurations listed for the 1D Lookup Table in the [1D Lookup Table](1dlookuptable) section are supported.
(prelookup)=
#### Prelookup
There are two levels of support for the Prelookup block in Reactis, *native* and *via Sfunction.*
*Native support* means Reactis will natively execute the Prelookup block and track coverage for it. Reactis natively supports Prelookup blocks which meet the following requirements:
1. The breakpoint data specification is *Explicit Values* or *Breakpoint Object.*
2. The breakpoint data source is *Dialog* or *Input port.*
3. The extrapolation method is linear or clip.
*Support via Sfunction* means Reactis can execute the Prelookup block but not track coverage. In order to execute the block, Reactis requires the `sfun_idxsearch.mexw32` SFunction that comes with all versions of MATLAB.
The following data types are supported:
1. The breakpoint type is *double* or *single.*
2. The index type is *int32* or *uint32.*
3. The fraction type is *double* or *single.*
(interpolationusingprelookup)=
#### Interpolation Using Prelookup
There are two levels of support for the Interpolation Using Prelookup block in Reactis, *native* and *via Sfunction.*
*Native support* means Reactis will natively execute the Interpolation block and track coverage for it. Only Interpolation Using Prelookup blocks which satisfy the following requirements are natively supported in Reactis:
1. The number of dimensions is at most four.
2. The number of subtable selection dimensions is less than or equal to the number of dimensions.
3. The interpolation method is linear or flat.
4. The extrapolation method is linear or clip.
5. None of the inputs or outputs have enumerated types.
6. If the intermediate type is set to *Inherit via Internal Rule,* then all input, output, breakpoint, and table data types are either (1) a floatingpoint data type, or (2) a fixedpoint type with a binarypoint scaling and a bias of zero.
7. The *Internal rule priority* is set to *Precision.* It may also be set to *Speed* if Reactis has been configured to allow it. The behavior of Reactis is controlled by the setting *If lookup table uses internal rule priority ’Speed’* in the *General* pane of the Reactis Info File Editor (see the [General Pane](secgeneralpane) section).
*Support via Sfunction* means Reactis can execute the Interpolation block but not track coverage. In order to execute the block, Reactis requires the `sfun_kflookupnd.mexw32`SFunction that comes with all versions of MATLAB.
All parameters are supported. Blocks which satisfy the following requirements are supported:
1. Only floatingpoint (double and single) data types are supported for “fraction” inputs.
2. All fraction types must be the same as the output data type.
3. All index types must be *int32* or *uint32.*
4. Table data type must match output data type.
5. Intermediate results data type must match output data type.
```{index} single: Simulink ; supported blocks
```
(tableofsupportedblocks)=
### Table of Supported Blocks
```{listtable}
: headerrows: 1
*  Block
 Introduced
 Reactis Support
 Notes
*  **Commonly Used Blocks**



*  Bus Creator
 preR14
 Y

*  Bus Selector
 preR14
 Y

*  Constant
 preR14
 Y

*  DataType Conversion
 preR14
 Y

*  Delay
 R2011b
 Y
 Only supported if Input processing is set to `Elements as channels (sample based)`
*  Demux
 preR14
 Y

*  DiscreteTime Integrator
 preR14
 Y

*  Gain
 preR14
 Y

*  Ground
 preR14
 Y

*  Inport
 preR14
 Y

*  Integrator
 preR14
 N

*  Logical Operator
 preR14
 Y

*  Mux
 preR14
 Y

*  Outport
 preR14
 Y

*  Product
 preR14
 Y

*  Relational Operator
 preR14
 Y

*  Saturation
 preR14
 Y

*  Scope
 preR14
 Y

*  Subsystem
 preR14
 Y

*  Sum
 preR14
 Y

*  Switch
 preR14
 Y

*  Terminator
 preR14
 Y

*  Vector Concatenate
 R14
 Y

*  **Continuous**



*  Derivative
 preR14
 N

*  Descriptor StateSpace
 R2018b
 N

*  Entity Transport Delay
 R2019b
 N

*  First Order Hold
 R2019b
 N

*  Integrator
 preR14
 N

*  Integrator Limited
 R2010a
 N

*  Integrator SecondOrder
 R2010a
 N

*  Integrator SecondOrder Limited
 R2010a
 N

*  PID Controller
 R2009b
 N

*  PID Controller (2DOF)
 R2009b
 N

*  StateSpace
 preR14
 N

*  Transfer Fcn
 preR14
 N

*  Transport Delay
 preR14
 N

*  Variable Time Delay
 R2007b
 N

*  Variable Transport Delay
 preR14
 N

*  ZeroPole
 preR14
 N

*  **Discontinuities**



*  Backlash
 preR14
 Y

*  Coulomb & Viscous Friction
 preR14
 Y

*  Dead Zone
 R14
 Y

*  Dead Zone Dynamic
 R14
 Y

*  Hit Crossing
 R14
 Y

*  PWM
 R2020b
 N

*  Quantizer
 preR14
 Y

*  Rate Limiter
 preR14
 Y

*  Rate Limiter Dynamic
 R14
 Y

*  Relay
 preR14
 Y

*  Saturation
 preR14
 Y

*  Saturation Dynamic
 R14
 Y

*  Wrap To Zero
 R14
 Y

*  **Discrete**



*  Delay
 R2011b
 Y
 Only supported if Input processing is set to `Elements as channels (sample based)`
*  Difference
 R14
 Y

*  Discrete Derivative
 R14
 Y

*  Discrete Filter
 preR14
 Y

*  Discrete FIR Filter
 R2008a
 Y

*  Discrete PID Controller
 R2009b
 N

*  Discrete PID Controller (2DOF)
 R2009b
 N

*  Discrete StateSpace
 preR14
 Y

*  DiscreteTime Integrator
 preR14
 Y

*  Discrete Transfer Fcn
 preR14
 Y

*  Discrete ZeroPole
 R14
 Y

*  Enabled Delay
 preR2006
 Y

*  Memory
 preR14
 Y

*  Propagation Delay
 R2022b
 N

*  Resettable Delay
 R2012b
 Y

*  Tapped Delay
 R14
 Y

*  Transfer Fcn First Order
 R14
 Y

*  Transfer Fcn Lead or Lag
 R14
 Y

*  Transfer Fcn Real Zero
 R14
 Y

*  Unit Delay
 preR14
 Y

*  Variable Integer Delay
 R2012b
 N

*  ZeroOrder Hold
 preR14
 Y

*  **Logic and Bit Operations**



*  Bit Clear
 preR14
 Y

*  Bit Set
 preR14
 Y

*  Bit To Integer Converter
 R2022a
 Y

*  Bitwise Operator
 preR14
 Y

*  Combinatorial Logic
 preR14
 Y

*  Compare To Constant
 preR14
 Y

*  Compare To Zero
 preR14
 Y

*  Detect Change
 preR14
 Y

*  Detect Decrease
 preR14
 Y

*  Detect Fall Negative
 preR14
 Y

*  Detect Fall Nonpositive
 preR14
 Y

*  Detect Increase
 preR14
 Y

*  Detect Rise Nonnegative
 preR14
 Y

*  Detect Rise Positive
 preR14
 Y

*  Extract Bits
 R14
 Y

*  Float Extract Bits
 R2023a
 N

*  Integer To Bit Converter
 R2022a
 Y

*  Interval Test
 preR14
 Y

*  Interval Test Dynamic
 preR14
 Y

*  Logical Operator
 preR14
 Y

*  Relational Operator
 preR14
 Y

*  Shift Arithmetic
 preR14
 Y

*  **Lookup Tables**



*  1D Lookup Table
 preR14
 Y
 Previously named *Lookup Table*. See the [1D Lookup Table](1dlookuptable) section
*  2D Lookup Table
 preR14
 Y
 Previously named *Lookup Table (2D)*. See the [2D Lookup Table](2dlookuptable) section
*  Cosine
 preR14
 Y
 Only output formula cos
*  Direct Lookup Table (nD)
 preR14
 Y

*  Interpolation using Prelookup
 preR14
 Y
 See the [Interpolation Using Prelookup](interpolationusingprelookup) section
*  Lookup Table Dynamic
 R14
 Y
 See the [Lookup Table Dynamic](lookuptabledynamic) section
*  nD Lookup Table
 preR14
 Y
 Previously named *Lookup Table (nD)*. See the [nD Lookup Table](ndlookuptable) section
*  Prelookup
 preR14
 Y
 See the [Prelookup](prelookup) section
*  Sine
 preR14
 Y
 Only output formula sin
*  **Math Operations**



*  Abs
 preR14
 Y

*  Add
 preR14
 Y

*  Algebraic Constraint
 preR14
 N

*  Assignment
 preR14
 Y

*  Bias
 R14
 Y

*  Complex to MagnitudeAngle
 preR14
 N

*  Complex to RealImag
 preR14
 N

*  Divide
 preR14
 Y

*  Dot Product
 preR14
 Y

*  Find Nonzero Elements
 R2010a
 N

*  Gain
 preR14
 Y

*  MagnitudeAngle to Complex
 preR14
 N

*  Math Function
 preR14
 Y
 Except Hermitian
*  Matrix Concatenate
 preR14
 Y

*  MinMax
 preR14
 Y

*  MinMax Running Resettable
 preR14
 Y

*  Permute Dimensions
 R2007a
 Y
 2 dimensions only
*  Polynomial
 preR14
 Y

*  Product
 preR14
 Y

*  Product of Elements
 preR14
 Y

*  RealImag to Complex
 preR14
 N

*  Reciprocal Sqrt
 R2010a
 Y

*  Reshape
 preR14
 Y

*  Rounding Function
 preR14
 Y

*  Sign
 preR14
 Y

*  Signed Sqrt
 R2010a
 Y

*  Sign Wave Function
 preR14
 Y
 Using simulation time
*  Slider Gain
 preR14
 Y

*  Sqrt
 R2010a
 Y

*  Squeeze
 R2007a
 N

*  Subtract
 preR14
 Y

*  Sum
 preR14
 Y

*  Sum of Elements
 preR14
 Y

*  Trigonometric Function
 preR14
 Y
 Approximation method must be `None`
*  Unary Minus
 preR14
 Y

*  Vector Concatenate
 R14
 Y

*  Weighted Sample Time Math
 R14
 Y

*  **Matrix Operations**



*  Concatenate
 R2022a
 Y

*  Create Diagonal Matrix
 R2022a
 Y

*  Cross Product
 R2021b
 Y

*  Extract Diagonal
 R2022a
 Y

*  Hermitian Transpose
 R2021b
 Y

*  IdentityMatrix
 R2021b
 Y

*  IsHermitian
 R2022a
 N

*  IsSymmetric
 R2021b
 Y

*  IsTriangular
 R2021b
 Y

*  MatrixSquare
 R2021b
 Y

*  Multiply
 R2022a
 Y

*  Permute Matrix
 R2022a
 Y

*  Submatrix
 R2022a
 Y

*  Transpose
 R2021b
 Y

*  **Messages & Events**



*  Hit Crossing Probe
 R2006a
 Y

*  Message Merge
 R2021a
 N

*  Message Triggered Subsystem
 R2022a
 N

*  Queue
 R2016a
 N

*  Receive
 R2016a
 N

*  Send
 R2016a
 N

*  Sequence Viewer
 R2015b
 N

*  **Model Verification**



*  Assertion
 preR14
 N

*  Check Discrete Gradient
 preR14
 N

*  Check Dynamic Gap
 preR14
 N

*  Check Dynamic Lower Bound
 preR14
 N

*  Check Dynamic Range
 preR14
 N

*  Check Dynamic Upper Bound
 preR14
 N

*  Check Input Resolution
 preR14
 N

*  Check Static Gap
 preR14
 N

*  Check Static Lower Bound
 preR14
 N

*  Check Static Range
 preR14
 N

*  Check Static Upper Bound
 preR14
 N

*  **ModelWide Utilities**



*  Block Support Table
 R2007a
 N

*  DocBlock
 preR14
 Y

*  Model Info
 preR14
 Y

*  TimeBased Linearization
 preR14
 N

*  TriggerBased Linearization
 preR14
 N

*  **Ports & Subsystems**



*  Atomic Subsystem
 preR14
 Y

*  CodeReuse Subsystem
 R14
 N

*  Configurable Subsystem
 preR14
 Y

*  Enable
 preR14
 Y

*  Enabled and Triggered Subsystem
 preR14
 Y

*  Enabled Subsystem
 preR14
 Y

*  For Each Subsystem
 R2010a
 Y

*  For Iterator Subsystem
 preR14
 Y

*  FunctionCall Feedback Latch
 R2011a
 Y

*  FunctionCall Generator
 preR14
 Y

*  FunctionCall Split
 R2010a
 Y

*  FunctionCall Subsystem
 preR14
 Y

*  If
 preR14
 Y

*  If Action Subsystem
 preR14
 Y

*  In Bus Element
 R2017a
 Y

*  Inport
 preR14
 Y

*  Model
 R14
 Y

*  Out Bus Element
 R2017a
 Y

*  Outport
 preR14
 Y

*  Resettable Subsystem
 R2015a
 Y

*  Subsystem
 preR14
 Y

*  Switch Case
 preR14
 Y

*  Switch Case Action Subsystem
 preR14
 Y

*  Trigger
 preR14
 Y
 Except trigger type "message"
*  Triggered Subsystem
 preR14
 Y
 Except trigger type "message"
*  Variant Model
 R2010b
 Y

*  Variant Subsystem
 R2010b
 Y
 Except Subsystem Reference as the variant
*  While Iterator Subsystem
 preR14
 Y

*  **Signal Attributes**



*  Bus to Vector
 R2007b
 Y

*  Data Type Conversion
 preR14
 Y

*  Data Type Conversion Inherited
 preR14
 Y

*  Data Type Duplicate
 preR14
 Y

*  Data Type Propagation
 preR14
 Y

*  Data Type Scaling Strip
 preR14
 Y

*  IC
 preR14
 Y

*  Probe
 preR14
 Y

*  Rate Transition
 preR14
 Y

*  Signal Conversion
 preR14
 Y

*  Signal Specification
 preR14
 Y

*  Unit Conversion
 R2016a
 N

*  Weighted Sample Time
 R14
 Y

*  Width
 preR14
 Y

*  **Signal Routing**



*  Bus Assignment
 R14
 Y

*  Bus Creator
 preR14
 Y

*  Bus Selector
 preR14
 Y

*  Connection Port
 R2007a
 N

*  Data Store Memory
 preR14
 Y

*  Data Store Read
 preR14
 Y

*  Data Store Write
 preR14
 Y

*  Demux
 preR14
 Y

*  Environment Controller
 R14
 Y

*  From
 preR14
 Y

*  Goto
 preR14
 Y

*  Goto Tag Visibility
 preR14
 Y

*  Index Vector
 preR14
 Y

*  Manual Switch
 preR14
 N

*  Manual Variant Sink
 R2016b
 Y

*  Manual Variant Source
 R2016b
 Y

*  Merge
 preR14
 Y

*  Multiport Switch
 preR14
 Y
 ’Data port for default case’ must be ’Last data port’ and ’Diagnostic for default case’ must be ’Error’
*  Mux
 preR14
 Y

*  Parameter Writer
 R2022a
 N

*  Selector
 preR14
 Y

*  State Reader

 Y

*  State Writer

 Y

*  Switch
 preR14
 Y

*  Vector Concatenate
 R14
 Y

*  **Sinks**



*  Display
 preR14
 Y

*  Floating Scope
 preR14
 Y

*  Out Bus Element
 R2017a
 Y

*  Outport
 preR14
 Y

*  Record
 2021a
 N

*  Scope
 preR14
 Y

*  Stop Simulation
 preR14
 N

*  Terminator
 preR14
 Y

*  To File
 preR14
 N
 You can configure Reactis to ignore To File blocks from the Settings dialog.
*  To Workspace
 preR14
 N
 You can configure Reactis to ignore To Workspace blocks from the Settings dialog.
*  XY Graph
 preR14
 N

*  **Sources**



*  BandLimited White Noise
 preR14
 N

*  Chirp Signal
 preR14
 N

*  Clock
 preR14
 Y

*  Constant
 preR14
 Y

*  Counter FreeRunning
 preR14
 Y

*  Counter Limited
 preR14
 Y

*  Digital Clock
 preR14
 Y

*  Enumerated Constant
 R2009b
 Y

*  From File
 preR14
 Y
 .mat file must be in ’Array’ format, not ’MATLAB timeseries object’ format. Linear interpolation and extrapolation must be used.
*  From Workspace
 preR14
 Y

*  Ground
 preR14
 Y

*  In Bus Element
 R2017a
 Y

*  Inport
 preR14
 Y

*  Pulse Generator
 preR14
 Y
 'Pulse type' must be 'sample based' and 'Time (t)' must be 'Use simulation time'
*  Ramp
 preR14
 Y

*  Random Number
 preR14
 Y
 This block may only be used in virtual sources.
*  Repeating Sequence
 preR14
 Y

*  Repeating Sequence Interpolated
 R14
 Y

*  Repeating Sequence Stair
 R14
 Y

*  Signal Builder
 preR14
 Y

*  Signal Editor
 R2017b
 N

*  Signal Generator
 preR14
 Y
 'Wave form' of 'random' not supported
*  Sine Wave
 preR14
 Y
 'Time (t)' must be 'Use simulation time'
*  Step
 preR14
 Y

*  Uniform Random Number
 preR14
 N

*  Waveform Generator
 R2015b
 N

*  **String**



*  ASCII to String
 R2018a
 N

*  Compose String
 R2018a
 N

*  Scan String
 R2018a
 N

*  String Compare
 R2018a
 N

*  String Concatenate
 R2018a
 N

*  String Constant
 R2018a
 N

*  String Contains
 R2020a
 N

*  String Count
 R2020a
 N

*  String Ends With
 R2020a
 N

*  String Find
 R2018a
 N

*  String Length
 R2018a
 N

*  String Starts With
 R2020a
 N

*  String to ASCII
 R2018a
 N

*  String to Double
 R2018a
 N

*  String to Enum
 R2018a
 N

*  String to Single
 R2018a
 N

*  Substring
 R2018a
 N

*  To String
 R2018a
 N

*  **UserDefined Functions**



*  C Caller
 R2018b
 Y
 Supported in Reactis if using MATLAB R2019b or later
*  C Function
 R2020a
 N

*  Function Caller
 R2015a
 Y

*  Initialize Function
 R2016b
 Y

*  Interpreted MATLAB Function
 preR14
 N
 Previously named *MATLAB Fcn*
*  Level2 MATLAB SFunction
 preR14
 N

*  MATLAB Function
 preR14
 Y
 Previously named *Embedded MATLAB Function.* Only a subset of the Embedded MATLAB language is supported. See the [Embedded MATLAB](embeddedmatlab) section for details.
*  MATLAB System
 R2013b
 N

*  Reset Function
 R2018b
 Y

*  Sfunction
 preR14
 Y

*  Sfunction Builder
 preR14
 Y

*  Simulink Function
 R2014b
 Y

*  Terminate Function

 N

*  **Additional Discrete**



*  FixedPoint StateSpace
 R14
 Y

*  Transfer Fcn Direct Form II
 R14
 N

*  Transfer Fcn Direct Form II Time Varying
 R14
 N

*  **Additional Math**



*  Decrement Real World
 preR14
 Y

*  Decrement Stored Integer
 preR14
 Y

*  Decrement Time To Zero
 preR14
 Y

*  Decrement To Zero
 preR14
 Y

*  Increment Real World
 preR14
 Y

*  Increment Stored Integer
 preR14
 Y

*  **Stateflow**



*  Chart
 preR14
 Y
 See the [Stateflow](stateflow) section
*  Truth Table
 R14
 Y
 See the [Embedded MATLAB](embeddedmatlab) section for supported subset of the underlying Embedded MATLAB language.
```
### Simulink Extras
The following table lists the supported blocks from the “Simulink extras” library which is available in all MATLAB versions:
```{listtable}
: headerrows: 0
*  **Additional Discrete**

*  Supported:
 Discrete Transfer Fcn (with initial outputs), Discrete Transfer Fcn (with initial states), Discrete ZeroPole (with initial outputs), Discrete ZeroPole (with initial states), Idealized ADC Quantizer
*  Unsupported:

*  **Additional Linear**

*  Supported:

*  Unsupported:
 StateSpace (with initial outputs), Transfer Fcn (with initial outputs), Transfer Fcn (with initial states), ZeroPole (with initial outputs), ZeroPole (with initial states)
*  **Additional Sinks**

*  Supported:

*  Unsupported:
 Auto Correlator, Averaging Power Spectral Density, Averaging Spectrum Analyzer, Cross Correlator, Floating Bar Plot, Power Spectral Density, Spectrum Analyzer
*  **Flip Flops**

*  Supported:
 D FlipFlop, D Latch, JK FlipFlop, SR FlipFlop
*  Unsupported:
 Clock
*  **Linearization**

*  Supported:

*  Unsupported:
 Switched derivative for linearization, Switched transport delay for linearization
*  **Transformations**

*  Supported:
 Cartesian to Polar, Cartesian to Spherical, Celsius to Fahrenheit, Degrees to Radians, Fahrenheit to Celsius, Polar to Cartesian, Radians to Degrees, Spherical to Cartesian
*  Unsupported:

```
### HDL Coder Blockset
The following table lists the supported blocks from the HDL Coder blockset:
```{listtable}
*  **Discontinuities**

*  Supported:
 Backlash, Coulomb and Viscous Friction, Dead Zone, Dead Zone Dynamic, Hit Crossing, Relay, Saturation, Saturation Dynamic, Wrap To Zero
*  Unsupported:

*  **Discrete**

*  Supported:
 Delay, Discrete FIR Filter, DiscreteTime Integrator, Discrete Transfer Fcn, Enabled Delay, Enabled Resettable Delay, Memory, Resettable Delay, Unit Delay, Unit Delay Enabled Resettable Synchronous, Unit Delay Enabled Synchronous, Unit Delay Resettable Synchronous, ZeroOrder Hold
*  Unsupported:
 Discrete PID Controller, Tapped Delay
*  **HDL Floating Point Operations**

*  Supported:
 Abs, Acos, Acosh, Add, Asin, Asinh, Atan, Atan2, Atanh, Bias, Ceil, Conjugate, Cos, Cosh, Data Type Conversion, Discrete FIR Filter, DiscreteTime Integrator, Discrete Transfer Fcn, Divide, Exp, Fix, Floor, Gain, Hypot, Log, Log10, Magnitude Square, Math Reciprocal, Max, Min, Mod, Pow, Pow10, Product, Product of Elements, Reciprocal, Reciprocal Sqrt, Relational Operator, Rem, Round, Sign, SignedSqrt, Sin, Sincos, Sinh, Sqrt, Square, Subtract, Sum of Elements, Tan, Tanh, Transpose, Unary Minus
*  Unsupported:
 cos+jsin, Discrete PID Controller, Float Typecast, Hermitian, MagnitudeAngle to Complex
*  **HDL Operations**

*  Supported:
 MultiplyAccumulate, MultiplyAdd
*  Unsupported:
 Deserializer1D, Serializer1D
*  **HDL RAMs**

*  Supported:
 Dual Port RAM, Simple Dual Port RAM Single Port RAM,
*  Unsupported:
 Dual Port RAM System, Dual Rate Dual Port RAM, HDL FIFO Simple Dual Port RAM System, Single Port RAM System
*  **HDL Subsystems**

*  Supported:

*  Unsupported:
 Enabled Synchronous Subsystem, Resettable Synchronous Subsystem, State Control, Synchronous Subsystem
*  **Logic and Bit Operations**

*  Supported
 Bit Clear, Bit Slice (R2020b and later), Bitwise Operator, Compare To Constant, Compare To Zero, Detect Change, Detect Decrease, Detect Increase, Extract Bits, Logical Operator, Relational Operator, Shift Arithmetic
*  Unsupported:
 Bit Concat, Bit Reduce, Bit Rotate, Bit Shift, Bit Slice (before R2020b)
*  **Lookup Tables**

*  Supported:
 1D Lookup Table, 2D Lookup Table, Direct Lookup Table (nD), nD Lookup Table, Prelookup
*  Unsupported:
 Cosine HDL Optimized, Sine HDL Optimized
*  **Math Operations**

*  Supported:
 Abs, Add, Assignment, Bias, Decrement Real World, Decrement Stored Integer, Divide, Dot Product, Gain, Increment Real World, Increment Stored Integer, Math Function, Matrix Concatenate, MatrixMultiply, MinMax, Product, Product of Elements, Reciprocal, Reciprocal Sqrt, Reshape, Sign, Sqrt, Subtract, Sum, Sum of Elements, Trigonometric Function, Unary Minus, Vector Concatenate
*  Unsupported:
 Complex to RealImag, HDL Reciprocal, RealImag to Complex
*  **Model Verification**

*  Supported:

*  Unsupported:
 Assertion, Check Dynamic Gap, Check Dynamic Range, Check Static Gap, Check Static Range, Check Dynamic Lower Bound, Check Input Resolution, Check STatic Lower Bound, Check Static Upper Bound, Check Discrete Gradient
*  **ModelWide Utilities**

*  Supported:
 DocBlock, Model Info
*  Unsupported:

*  **Ports & Subsystems**

*  Supported:
 Atomic Subsystem, Enable, Enabled Subsystem, For Each Subsystem, In Bus Element, In, Model, Out Bus Element, Out, Subsystem, Trigger, Triggered Subsystem, Variant Subsystem
*  Unsupported:

*  **Signal Attributes**

*  Supported:
 Bus to Vector, Data Type Conversion, Data Type Duplicate, Data Type Propagation, Probe, Rate Transition, Signal Specification, Signal Conversion
*  Unsupported:

*  **Signal Routing**

*  Supported:
 Bus Element In, Bus Element Out, Bus Assignment, Bus Creator, Bus Selector, Demux, From, Goto, Index Vector, Multiport Switch, Mux, Selector, Switch, Vector Concatenate
*  Unsupported:

*  **Sinks**

*  Supported:
 Display, Floating Scope, Out Bus Element, Out, Scope, Terminator, To File, To Workspace
*  Unsupported:
 Stop Simulation, XY Graph
*  **Sources**

*  Supported:
 Constant, Counter FreeRunning, Counter Limited, Enumerated Constant, Ground, HDL Counter, In Bus Element, In
*  Unsupported:

*  **User Defined Functions**

*  Supported:
 MATLAB Function
*  Unsupported:
 MATLAB System
```
```{index} single: TargetLink supported blocks ; version 2.2.1
```
### TargetLink 2.2.1 Library Blocks
The following table lists the supported blocks from the dSPACE TargetLink library (version 2.2.1), if installed:
```{listtable}
*  **Main TargetLink Library**

*  Supported:
 Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, LookUp Table, Lookup Table (2D), Direct Lookup Table (nD), PreLookUp Index Search, Interpolation (nD) using PreLookUp, Saturation, MinMax, Abs, Sign, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, DiscreteTime Integrator, Discrete StateSpace, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled),
*  Unsupported:
 Rate Limiter
*  **NonLinear**

*  Supported:
 Dead Zone Positive, Dead Zone Negative, Saturation Dynamic, Backlash
*  Unsupported:
 Dead Zone, Dead Zone Dynamic
*  **Math**

*  Supported:
 Rounding Function, Transport Delay
*  Unsupported:

*  **Extras**

*  Supported:
 D FlipFlop, D Latch, JK FlipFlop, SR FlipFlop, Preprocessor IF
*  Unsupported:

*  **Bit Operations**

*  Supported:
 U8 Bit Set, U16 Bit Set, U32 Bit Set , U8 Bit Clear, U16 Bit Clear, U32 Bit Clear, Split U16, Split U32, Combine U16, Combine U32, 8Bit Decoder, 8Bit Encoder, 16Bit Decoder, 16Bit Encoder, Bitwise Logical Operator
*  Unsupported:

*  **TargetLinkSupported Simulink Blocks**

*  Supported:
 Please see list of ReactisSupported Simulink Blocks
*  Unsupported:

```
```{index} single: TargetLink supported blocks ; version 2.3.1
```
### TargetLink 2.3.1 Library Blocks
The following table lists the supported blocks from the dSPACE TargetLink library (version 2.3.1), if installed:
```{listtable}
*  **Main TargetLink Library**

*  Supported:
 Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, LookUp Table, Lookup Table (2D), Direct Lookup Table (nD), PreLookUp Index Search, Saturation, MinMax, Abs, Sign, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, DiscreteTime Integrator, Discrete StateSpace, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled),
*  Unsupported:
 Interpolation (nD) using PreLookUp, Rate Limiter
*  **NonLinear**

*  Supported:
 Dead Zone Positive, Dead Zone Negative, Saturation Dynamic, Backlash
*  Unsupported:
 Dead Zone, Dead Zone Dynamic
*  **Math**

*  Supported:
 Rounding Function, Transport Delay
*  Unsupported:

*  **Extras**

*  Supported:
 D FlipFlop, D Latch, JK FlipFlop, SR FlipFlop, Preprocessor IF
*  Unsupported:

*  **Bit Operations**

*  Supported:
 U8 Bit Set, U16 Bit Set, U32 Bit Set , U8 Bit Clear, U16 Bit Clear, U32 Bit Clear, Split U16, Split U32, Combine U16, Combine U32, 8Bit Decoder, 8Bit Encoder, 16Bit Decoder, 16Bit Encoder, Bitwise Logical Operator
*  Unsupported:

*  **TargetLinkSupported Simulink Blocks**

*  Supported:
 Please see list of ReactisSupported Simulink Blocks
*  Unsupported:

```
```{index} single: TargetLink supported blocks ; version 3.0 to 3.4
```
### TargetLink 3.0 to 3.4 Library Blocks
The following table lists the supported blocks from the dSPACE TargetLink library (versions 3.0 to 3.4), if installed:
```{listtable}
*  **Main TargetLink Library**

*  Supported:
 Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, LookUp Table, Lookup Table (2D), Direct Lookup Table (nD), PreLookUp Index Search, Interpolation (nD) using PreLookUp, Saturation, MinMax, Abs, Sign, Rate Limiter, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, DiscreteTime Integrator, Discrete StateSpace, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled),
*  Unsupported:

*  **NonLinear**

*  Supported:
 Backlash, Dead Zone Positive, Dead Zone Negative, Saturation Dynamic, Dead Zone, Dead Zone Dynamic
*  Unsupported:

*  **Math**

*  Supported:
 Rounding Function, Transport Delay
*  Unsupported:

*  **Extras**

*  Supported:
 D FlipFlop, D Latch, JK FlipFlop, SR FlipFlop, Preprocessor IF
*  Unsupported:

*  **Bit Operations**

*  Supported:
 U8 Bit Set, U16 Bit Set, U32 Bit Set , U8 Bit Clear, U16 Bit Clear, U32 Bit Clear, Split U16, Split U32, Combine U16, Combine U32, 8Bit Decoder, 8Bit Encoder, 16Bit Decoder, 16Bit Encoder, Bitwise Logical Operator
*  Unsupported:

*  **TargetLinkSupported Simulink Blocks**

*  Supported:
 Please see list of ReactisSupported Simulink Blocks
*  Unsupported:

```
```{index} single: TargetLink supported blocks ; version 3.5 to 22.1
```
### TargetLink 3.5 to 22.1 (2022B) Library Blocks
The table below lists the supported blocks from the dSPACE TargetLink library versions 3.5 to 22.1 (2022B). Note that TargetLink 2022B is not certified to work with MATLAB R2023a.
```{listtable}
*  **Main TargetLink Library**

*  Supported:
 Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, LookUp Table, Lookup Table (2D), Direct Lookup Table (nD), PreLookUp Index Search, Interpolation (nD) using PreLookUp, Saturation, MinMax, Abs, Sign, Rate Limiter, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, DiscreteTime Integrator, Discrete StateSpace, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled)
*  Unsupported:
 FIR Filter
*  **NonLinear**

*  Supported:
 Backlash, Dead Zone Positive, Dead Zone Negative, Saturation Dynamic, Dead Zone, Dead Zone Dynamic
*  Unsupported:

*  **Math**

*  Supported:
 Rounding Function
*  Unsupported:
 Transport Delay
*  **Extras**

*  Supported:
 D FlipFlop, D Latch, JK FlipFlop, SR FlipFlop, Preprocessor IF
*  Unsupported:

*  **Bit Operations**

*  Supported:
 U8 Bit Set, U16 Bit Set, U32 Bit Set , U8 Bit Clear, U16 Bit Clear, U32 Bit Clear, Split U16, Split U32, Combine U16, Combine U32, 8Bit Decoder, 8Bit Encoder, 16Bit Decoder, 16Bit Encoder, Bitwise Logical Operator
*  Unsupported:

*  **TargetLinkSupported Simulink Blocks**

*  Supported:
 Please see list of ReactisSupported Simulink Blocks
*  Unsupported:

```
```{index} Stateflow
```
(stateflow)=
## Stateflow
Reactis supports most of Stateflow. Some exceptions are the following unsupported features:
* Charts with the action language set to MATLAB are currently supported if they use the language subset described in the [Embedded MATLAB](embeddedmatlab). Charts with “C” action language are supported.
* Implicit “enter”, “exit” and “change” events
* Range limits for variables.
* “ml.” namespace operator and “ml()” function call.
* Embedded MATLAB code. Reactis supports the language subset described in the [Embedded MATLAB](embeddedmatlab).
* Using Stateflow keywords as variable names. The Stateflow keywords are: at, after, before, change, du, during, enter, en, entry, every, ex, exit, in, on, ml, send, abs, acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, labs, ldexp, log, log10, min, max, pow, rand, rem, sin, sinh, sqrt, tan, tanh, int8, int16, int32, uint8, uint16, uint32, double, boolean.
* The explicit type cast function (“cast”).
* The address operator (&) is supported only in calls to external C functions.
* The pointer operator (*) is supported only inside a literal C code section.
* Charts without trigger or sample time are supported only if the model has a fixed sample time.
* In some cases, the detection of inner transitions fails for oddshaped transitions (for example, single transition segments which leave and reenter a state).
* The `temporalCount` operator.
* Atomic Subcharts (introduced in R2010b).
```{index} EML
```
```{index} Embedded MATLAB
```
```{index} REML
```
```{index} Reactis Embedded MATLAB
```
(embeddedmatlab)=
## Embedded MATLAB
Reactis V2012 introduced blackbox support for Embedded MATLAB. This includes:
Simulink
: * MATLAB Function block
* Truth Table block
Stateflow
: * MATLAB functions
* Truth Table functions with MATLAB language option
* MATLAB action language in Stateflow
Note that a subset of the full Embedded MATLAB language is supported. To use models containing Embedded MATLAB in Reactis, your model must only use the language subset supported by Reactis. Note that the same language restrictions apply no matter which of the five model constructs listed above are used to incorporate Embedded MATLAB into your model. To avoid confusion, we use the following abbreviations in the following discussion:
Embedded MATLAB (EML)
: the subset of MATLAB supported by MathWorks for code generation.
Reactis Embedded MATLAB (REML)
: the subset of EML supported by Reactis.
REML is under active development towards the ultimate goal of supporting a very large subset of EML. Please send requests to Reactive Systems (help@reactivesystems.com) if there are unsupported EML features you would like to use.
The V2015 release of Reactis included a new product: the Reactis for EML Plugin. It integrates with Reactis to offer whitebox testing of the EML portions of a model. See the [Reactis for EML Plugin](chapreactisforemlplugin) chapter for a description of the Reactis for EML Plugin. If not using the new product, you can still test models containing EML; however, exercising coverage targets within the EML will not be an objective of test generation and tracking this coverage will not be available. Whether in whitebox or blackbox mode for EML, Reactis supports the same subset of EML. This subset is defined in the [Subset of Embedded MATLAB Supported by Reactis](sectionembeddedmatlabsubset) section.