Reactis User's Guide   Contents  |  Index
 Chapters:  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | A | B | C

Chapter 14  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.

14.1  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.

14.1.1  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 “Pre-Load Function” code prior to loading the model and the “Post-Load Function” code after loading the model. This method allows you to use Reactis in such an environment without having to modify your model.

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 Simulink window, select the File > Model Properties menu item.
  3. In the resulting dialog, select the Callbacks tab.
  4. In the Model pre-load 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.

14.1.2  Unsupported MATLAB Features

While Reactis supports most of MATLAB, the following exceptions may not be used in Simulink / Stateflow models, e.g. in callbacks or mask initializations. Note, that a feature added in V2010.2 adds partial support for these commands. 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.

Expression Evaluation
ASSIGNINAssign variable in workspace.
EVALINEvaluate expression in workspace.
Model Construction/Modification
ADD_BLOCKAdd a block to a Simulink system.
ADD_LINEAdd a line to a Simulink system.
ADD_PARAMAdd a parameter to a Simulink system.
DELETE_BLOCKDelete a block from a Simulink system.
DELETE_LINEDelete a line from a Simulink system.
DELETE_PARAMDeletes a parameter from a Simulink system.
NEW_SYSTEMCreate a new empty Simulink system.
REPLACE_BLOCKReplace blocks in model.
SET_PARAMSet Simulink system and block parameters.

14.2  Simulink

Reactis currently supports Simulink releases R2012b through R2022b. Most features of Simulink are supported; but the following are not supported by Reactis:

  • Continuous-time 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 Section 14.2.3. For blocks that can be either continuous- or discrete-time, only the discrete-time version is supported. For some blocks identified as supported, not all settings are supported.

14.2.1  S-Functions

Reactis supports both C-Coded and M-File S-functions, with some restrictions. For C-Coded S-functions, the following are not supported by Reactis:

  • Port-based sample times.
  • Multiple sample times.
  • Complex number signals.
  • Zero-crossing detection.
  • Output of function-calls.
  • Level 1 S-functions (For a guide on how to convert Level 1 S-functions to Level 2 S-functions — 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 S-Function.

For M-File S-functions, the following are not supported by Reactis:

  • Multiple sample times.
  • Complex number signals.
  • Level 2 S-functions.

In addition to the above restrictions, care must be taken about any internal data that is stored by S-functions. In order to work properly, Reactis must be able to retrieve and reset the values of all internal states of any S-function 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 S-function 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 S-function maintains by other means, such as:

  • global or static variables in C-code;
  • memory allocated by malloc() or mxMalloc() functions in C-code;
  • Use of workspace variables in M-File S-functions.

Reactis will also not save and restore memory requested by ssGetNumPWork(), since otherwise pointers stored in this vector by your S-function might get lost or mangled, resulting in memory leaks or crashes.

If an S-function 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.

In general, Reactis passes S-Function parameters as fixed values at the time the S-Function is first initialized (i.e. when Tester or Simulator is started). Therefore, if a configuration variable is used as a parameter to an S-Function, the S-Function will not see any changes to the configuration variable unless the S-Function is designed to process such updates. To have an S-Function be updated on changes to its parameters, define a mdlProcessParameters function (see Simulink documentation) within the S-Function code. If this function is present, then Reactis will propagate the parameter changes into the S-Function by calling the S-Function’s mdlProcessParameters function at each step with the new parameter values. In the mdlProcessParameters function, the S-Function can then take appropriate actions if any parameters have changed.

14.2.2  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 R2022b terminology here. If you are using an older version of MATLAB your block names and settings may be slightly different.

14.2.2.1  1-D Lookup Table

Note that this block was previously named Lookup Table. All block settings and the data type combinations listed below are supported (note that fixpoint includes all fixed-point data types and integer data types int8, uint8, int16, uint16, int32 and uint32).

Supported Data Type Combinations
Input of LUTOutput of LUT
doubledouble
singledouble
fixpointdouble
singlesingle
fixpointsingle
doublefixpoint
singlefixpoint
fixpointfixpoint
doubleboolean
singleboolean
fixpointboolean

14.2.2.2  2-D Lookup Table

Note that this block was previously named Lookup Table (2-D). All block settings are supported. Supported data type combinations are listed in the table below (note that fixpoint includes all fixed-point data types and integer data types int8, uint8, int16, uint16, int32 and uint32).

Supported Data Type Combinations
1st Input of LUT2nd Input of LUTOutput of LUT
doubledoubledouble
doublefixpointdouble
doublebooldouble
singlesingledouble
fixpointdoubledouble
fixpointfixpointdouble
booldoubledouble
singlesinglesingle
singlefixpointsingle
singleboolsingle
fixpointsinglesingle
fixpointfixpointsingle
boolsinglesingle
doubledoublefixpoint
singlesinglefixpoint
fixpointfixpointfixpoint
fixpointfixpointbool
doubledoublebool
singlesinglebool

14.2.2.3  n-D Lookup Table

Note that this block was previously named Lookup Table (n-D). Reactis supports a wide variety of n-D lookup tables, subject to restrictions which depend on the number of table dimensions. There are two levels of support, native and via S-function.

Native support means Reactis will natively execute the n-D Lookup Table block and track coverage for it. Only n-D lookup tables which satisfy the following requirements are natively supported in Reactis:

  1. The number of table dimensions is at most three, or the number of dimensions is four and all input, output and internal data types are the same floating-point data type.
  2. The interpolation and extrapolation methods are not cubic spline.
  3. The types used in the table are restricted to the following: fixed-point types with a bias of zero and a slope that is a (negative) power of two, integer types, single- or double-precision floating-point types, Boolean.
  4. None of the inputs or outputs have enumerated types.

Support via S-function requires MATLAB R2017b or earlier: it is not available with R2018a and later. Support via S-function means Reactis can execute the n-D lookup block but not track coverage. In order to execute the block, Reactis requires the sfun_lookupnd.mexw32 S-Function that comes with MATLAB R2007a or earlier. Starting with MATLAB R2007b, this S-Function 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 S-Function with MATLAB R2007b to R2017b, but not with R2018a and later.

n-D lookup tables which meet the following six requirements are supported via S-function in Reactis:

  1. The input and output types are the same floating-point 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.

14.2.2.4  Lookup Table Dynamic

All parameters and the data type configurations listed for the 1-D Lookup Table block above are supported.

14.2.2.5  Prelookup

There are two levels of support for the Prelookup block in Reactis, native and via S-function.

Native support means Reactis will natively execute the Prelookup block and track coverage for it. Reactis natively supports Prelookup blocks which use the following types: fixed-point types with a bias of zero and a slope that is a (negative) power of two, integer types, single- or double-precision floating-point types, Boolean.

Support via S-function means Reactis can execute the Prelookup block but not track coverage. In order to execute the block, Reactis requires the sfun_idxsearch.mexw32 S-Function that comes with all versions of MATLAB.

All parameters are supported. The following data type restrictions apply:

  • Only floating-point (double and single) input data types are supported.
  • Only “int32” and “uint32” are supported as the data type of the “index” output.
  • Only “single” and “double” are supported as the data type of the “fraction” output.

14.2.2.6  Interpolation Using Prelookup

There are two levels of support for the Interpolation Using Prelookup block in Reactis, native and via S-function.

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 table dimensions is at most four.
  2. The interpolation and extrapolation methods are not cubic spline.
  3. The types used in the table are restricted to the following: fixed-point types with a bias of zero and a slope that is a (negative) power of two, integer types, single- or double-precision floating-point types, Boolean.

Support via S-function means Reactis can execute the Interpolation block but not track coverage. In order to execute the block, Reactis requires the sfun_kflookupnd.mexw32 S-Function that comes with all versions of MATLAB.

All parameters are supported. The following data type restrictions apply:

  • Only floating-point (double and single) data types are supported for “fraction” inputs.
  • Data types of all “fraction” inputs must be the same as the output data type.
  • Only “int32” and “uint32” are supported as the data type of the “index” input.
  • Table data type must match output data type
  • Intermediate results data type must match output data type.

14.2.3  Table of Supported Blocks

BlockIntroducedReactis
Support
Notes
Commonly Used Blocks
Bus Creatorpre-R14Y 
Bus Selectorpre-R14Y 
Constantpre-R14Y 
Data-Type Conversionpre-R14Y 
DelayR2011bYOnly supported if Input processing is set to Elements as channels (sample based)
Demuxpre-R14Y 
Discrete-Time Integratorpre-R14Y 
Gainpre-R14Y 
Groundpre-R14Y 
Inportpre-R14Y 
Integratorpre-R14N 
Logical Operatorpre-R14Y 
Muxpre-R14Y 
Outportpre-R14Y 
Productpre-R14Y 
Relational Operatorpre-R14Y 
Saturationpre-R14Y 
Scopepre-R14Y 
Subsystempre-R14Y 
Sumpre-R14Y 
Switchpre-R14Y 
Terminatorpre-R14Y 
Vector ConcatenateR14Y 
Continuous
Derivativepre-R14N 
Descriptor State-SpaceR2018bN 
Entity Transport DelayR2019bN 
First Order HoldR2019bN 
Integratorpre-R14N 
Integrator LimitedR2010aN 
Integrator Second-OrderR2010aN 
Integrator Second-Order LimitedR2010aN 
PID ControllerR2009bN 
PID Controller (2DOF)R2009bN 
State-Spacepre-R14N 
Transfer Fcnpre-R14N 
Transport Delaypre-R14N 
Variable Time DelayR2007bN 
Variable Transport Delaypre-R14N 
Zero-Polepre-R14N 
Discontinuities
Backlashpre-R14Y 
Coulomb & Viscous Frictionpre-R14Y 
Dead ZoneR14Y 
Dead Zone DynamicR14Y 
Hit CrossingR14Y 
PWMR2020bN 
Quantizerpre-R14Y 
Rate Limiterpre-R14Y 
Rate Limiter DynamicR14Y 
Relaypre-R14Y 
Saturationpre-R14Y 
Saturation DynamicR14Y 
Wrap To ZeroR14Y 
Discrete
DelayR2011bYOnly supported if Input processing is set to Elements as channels (sample based)
DifferenceR14Y 
Discrete DerivativeR14Y 
Discrete Filterpre-R14Y 
Discrete FIR FilterR2008aY 
Discrete PID ControllerR2009bN 
Discrete PID Controller (2DOF)R2009bN 
Discrete State-Spacepre-R14Y 
Discrete-Time Integratorpre-R14Y 
Discrete Transfer Fcnpre-R14Y 
Discrete Zero-PoleR14Y 
Enabled Delaypre-R2006Y 
Memorypre-R14Y 
Resettable DelayR2012bY 
Tapped DelayR14Y 
Transfer Fcn First OrderR14Y 
Transfer Fcn Lead or LagR14Y 
Transfer Fcn Real ZeroR14Y 
Unit Delaypre-R14Y 
Variable Integer DelayR2012bN 
Zero-Order Holdpre-R14Y 
Logic and Bit Operations
Bit Clearpre-R14Y 
Bit Setpre-R14Y 
Bit To Integer ConverterR2022aY 
Bitwise Operatorpre-R14Y 
Combinatorial Logicpre-R14Y 
Compare To Constantpre-R14Y 
Compare To Zeropre-R14Y 
Detect Changepre-R14Y 
Detect Decreasepre-R14Y 
Detect Fall Negativepre-R14Y 
Detect Fall Nonpositivepre-R14Y 
Detect Increasepre-R14Y 
Detect Rise Nonnegativepre-R14Y 
Detect Rise Positivepre-R14Y 
Extract BitsR14Y 
Integer To Bit ConverterR2022aY 
Interval Testpre-R14Y 
Interval Test Dynamicpre-R14Y 
Logical Operatorpre-R14Y 
Relational Operatorpre-R14Y 
Shift Arithmeticpre-R14Y 
Lookup Tables
1-D Lookup Tablepre-R14YPreviously named Lookup Table. See Section 14.2.2.1
2-D Lookup Tablepre-R14YPreviously named Lookup Table (2-D). See Section 14.2.2.2
Cosinepre-R14YOnly output formula cos
Direct Lookup Table (n-D)pre-R14Y 
Interpolation using Prelookuppre-R14YSee Section 14.2.2.6
Lookup Table DynamicR14YSee Section 14.2.2.4
n-D Lookup Tablepre-R14YPreviously named Lookup Table (n-D). See Section 14.2.2.3
Prelookuppre-R14YSee Section 14.2.2.5
Sinepre-R14YOnly output formula sin
Math Operations
Abspre-R14Y 
Addpre-R14Y 
Algebraic Constraintpre-R14N 
Assignmentpre-R14Y 
BiasR14Y 
Complex to Magnitude-Anglepre-R14N 
Complex to Real-Imagpre-R14N 
Dividepre-R14Y 
Dot Productpre-R14Y 
Find Nonzero ElementsR2010aN 
Gainpre-R14Y 
Magnitude-Angle to Complexpre-R14N 
Math Functionpre-R14YExcept Hermitian
Matrix Concatenatepre-R14Y 
MinMaxpre-R14Y 
MinMax Running Resettablepre-R14Y 
Permute DimensionsR2007aY2 dimensions only
Polynomialpre-R14Y 
Productpre-R14Y 
Product of Elementspre-R14Y 
Real-Imag to Complexpre-R14N 
Reciprocal SqrtR2010aY 
Reshapepre-R14Y 
Rounding Functionpre-R14Y 
Signpre-R14Y 
Signed SqrtR2010aY 
Sine Wave Functionpre-R14YUsing simulation time
Slider Gainpre-R14Y 
SqrtR2010aY 
SqueezeR2007aN 
Subtractpre-R14Y 
Sumpre-R14Y 
Sum of Elementspre-R14Y 
Trigonometric Functionpre-R14YApproximation method must be None
Unary Minuspre-R14Y 
Vector ConcatenateR14Y 
Weighted Sample Time MathR14Y 
Matrix Operations
ConcatenateR2022aY 
Create Diagonal MatrixR2022aY 
Cross ProductR2021bY 
Extract DiagonalR2022aY 
Hermitian TransposeR2021bY 
IdentityMatrixR2021bY 
IsHermitianR2022aN 
IsSymmetricR2021bY 
IsTriangularR2021bY 
MatrixSquareR2021bY 
MultiplyR2022aY 
Permute MatrixR2022aY 
SubmatrixR2022aY 
TransposeR2021bY 
Messages & Events
Hit Crossing ProbeR2006aY 
Message MergeR2021aN 
Message Triggered SubsystemR202aN 
QueueR2016aN 
ReceiveR2016aN 
SendR2016aN 
Sequence ViewerR2015bN 
Model Verification
Assertionpre-R14N 
Check Discrete Gradientpre-R14N 
Check Dynamic Gappre-R14N 
Check Dynamic Lower Boundpre-R14N 
Check Dynamic Rangepre-R14N 
Check Dynamic Upper Boundpre-R14N 
Check Input Resolutionpre-R14N 
Check Static Gappre-R14N 
Check Static Lower Boundpre-R14N 
Check Static Rangepre-R14N 
Check Static Upper Boundpre-R14N 
Model-Wide Utilities
Block Support TableR2007aN 
DocBlockpre-R14Y 
Model Infopre-R14Y 
Time-Based Linearizationpre-R14N 
Trigger-Based Linearizationpre-R14N 
Ports & Subsystems
Atomic Subsystempre-R14Y 
CodeReuse SubsystemR14N 
Configurable Subsystempre-R14Y 
Enablepre-R14Y 
Enabled Subsystempre-R14Y 
Enabled and Triggered Subsystempre-R14Y 
For Each SubsystemR2010aY 
For Iterator Subsystempre-R14Y 
Function-Call Feedback LatchR2011aY 
Function-Call Generatorpre-R14Y 
Function-Call SplitR2010aY 
Function-Call Subsystempre-R14Y 
Ifpre-R14Y 
If Action Subsystempre-R14Y 
In Bus ElementR2017aY 
Inportpre-R14Y 
ModelR14Y 
Out Bus ElementR2017aY 
Outportpre-R14Y 
Resettable SubsystemR2015aY 
Subsystempre-R14Y 
Switch Casepre-R14Y 
Switch Case Action Subsystempre-R14Y 
Triggerpre-R14YExcept trigger type “message”
Triggered Subsystempre-R14YExcept trigger type “message”
Variant ModelR2010bY 
Variant SubsystemR2010bY 
While Iterator Subsystempre-R14Y 
Signal Attributes
Bus to VectorR2007bY 
Data Type Conversionpre-R14Y 
Data Type Conversion Inheritedpre-R14Y 
Data Type Duplicatepre-R14Y 
Data Type Propagationpre-R14Y 
Data Type Scaling Strippre-R14Y 
ICpre-R14Y 
Probepre-R14Y 
Rate Transitionpre-R14Y 
Signal Conversionpre-R14Y 
Signal Specificationpre-R14Y 
Unit ConversionR2016aN 
Weighted Sample TimeR14Y 
Widthpre-R14Y 
Signal Routing
Bus AssignmentR14Y 
Bus Creatorpre-R14Y 
Bus Selectorpre-R14Y 
Connection PortR2007aN 
Data Store Memorypre-R14Y 
Data Store Readpre-R14Y 
Data Store Writepre-R14Y 
Demuxpre-R14Y 
Environment ControllerR14Y 
Frompre-R14Y 
Gotopre-R14Y 
Goto Tag Visibilitypre-R14Y 
Index Vectorpre-R14Y 
Manual Switchpre-R14N 
Manual Variant SinkR2016bY 
Manual Variant SourceR2016bY 
Mergepre-R14Y 
Multiport Switchpre-R14Y’Data port for default case’ must be ’Last data port’ and ’Diagnostic for default case’ must be ’Error’
Muxpre-R14Y 
Parameter WriterR2022aN 
Selectorpre-R14Y 
State Reader Y 
State Writer Y 
Switchpre-R14Y 
Vector ConcatenateR14Y 
Sinks
Displaypre-R14Y 
Floating Scopepre-R14Y 
Out Bus ElementR2017aY 
Outportpre-R14Y 
Record2021aN 
Scopepre-R14Y 
Stop Simulationpre-R14N 
Terminatorpre-R14Y 
To Filepre-R14NYou can configure Reactis to ignore To File blocks from the Settings dialog.
To Workspacepre-R14NYou can configure Reactis to ignore To Workspace blocks from the Settings dialog.
XY Graphpre-R14N 
Sources
Band-Limited White Noisepre-R14N 
Chirp Signalpre-R14N 
Clockpre-R14Y 
Constantpre-R14Y 
Counter Free-Runningpre-R14Y 
Counter Limitedpre-R14Y 
Digital Clockpre-R14Y 
Enumerated ConstantR2009bY 
From Filepre-R14Y.mat file must be in ’Array’ format, not ’MATLAB timeseries object’ format. Linear interpolation and extrapolation must be used.
From Workspacepre-R14Y 
Groundpre-R14Y 
In Bus ElementR2017aY 
Inportpre-R14Y 
Pulse Generatorpre-R14Y’Pulse type’ must be ’sample based’ and ’Time (t)’ must be ’Use simulation time’
Ramppre-R14Y 
Random Numberpre-R14YThis block may only be used in virtual sources.
Repeating Sequencepre-R14Y 
Repeating Sequence InterpolatedR14Y 
Repeating Sequence StairR14Y 
Signal Builderpre-R14Y 
Signal EditorR2017bN 
Signal Generatorpre-R14Y’Wave form’ of ’random’ not supported
Sine Wavepre-R14Y’Time (t)’ must be ’Use simulation time’
Steppre-R14Y 
Uniform Random Numberpre-R14N 
Waveform GeneratorR2015bN 
String
ASCII to StringR2018aN 
Compose StringR2018aN 
Scan StringR2018aN 
String CompareR2018aN 
String ConcatenateR2018aN 
String ConstantR2018aN 
String ContainsR2020aN 
String CountR2020aN 
String Ends WithR2020aN 
String FindR2018aN 
String LengthR2018aN 
String Starts WithR2020aN 
String to ASCIIR2018aN 
String to DoubleR2018aN 
String to EnumR2018aN 
String to SingleR2018aN 
SubstringR2018aN 
To StringR2018aN 
User-Defined Functions
C CallerR2018bYSupported in Reactis if using MATLAB R2019b or later
C FunctionR2020aN 
Function CallerR2015aY 
Initialize FunctionR2016bY 
Interpreted MATLAB Functionpre-R14NPreviously named MATLAB Fcn
Level-2 MATLAB S-Functionpre-R14N 
MATLAB Functionpre-R14YPreviously named Embedded MATLAB Function. Only a subset of the Embedded MATLAB language is supported. See Section 14.4 for details.
MATLAB SystemR2013bN 
Reset FunctionR2018bY 
S-functionpre-R14Y 
S-function Builderpre-R14Y 
Simulink FunctionR2014bY 
Terminate Function N 
Additional Discrete
Fixed-Point State-SpaceR14Y 
Transfer Fcn Direct Form IIR14N 
Transfer Fcn Direct Form II Time VaryingR14N 
Additional Math
Decrement Real Worldpre-R14Y 
Decrement Stored Integerpre-R14Y 
Decrement Time To Zeropre-R14Y 
Decrement To Zeropre-R14Y 
Increment Real Worldpre-R14Y 
Increment Stored Integerpre-R14Y 
Stateflow
Chartpre-R14YSee Section 14.3.
Truth TableR14YSee Section 14.4 for supported subset of the underlying Embedded MATLAB language.

14.2.4  Simulink Extras

The following table lists the supported blocks from the “Simulink extras” library which is available in all MATLAB versions:

Additional Discrete
Supported: Discrete Transfer Fcn (with initial outputs), Discrete Transfer Fcn (with initial states), Discrete Zero-Pole (with initial outputs), Discrete Zero-Pole (with initial states), Idealized ADC Quantizer
Unsupported: 
Additional Linear
Supported: 
Unsupported: State-Space (with initial outputs), Transfer Fcn (with initial outputs), Transfer Fcn (with initial states), Zero-Pole (with initial outputs), Zero-Pole (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 Flip-Flop, D Latch, J-K Flip-Flop, S-R Flip-Flop
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: 

14.2.5  HDL Coder Blockset

The following table lists the supported blocks from the HDL Coder blockset:

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, Discrete-Time 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, Zero-Order 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, Discrete-Time 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, Magnitude-Angle to Complex
HDL Operations
Supported: Multiply-Accumulate, Multiply-Add
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: 1-D Lookup Table, 2-D Lookup Table, Direct Lookup Table (n-D), n-D 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 Real-Imag, HDL Reciprocal, Real-Imag 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
Model-Wide 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 Free-Running, Counter Limited, Enumerated Constant, Ground, HDL Counter, In Bus Element, In
Unsupported: 
User Defined Functions
Supported: MATLAB Function
Unsupported: MATLAB System

14.2.6  TargetLink 2.2.1 Library Blocks

The following table lists the supported blocks from the dSPACE TargetLink library (version 2.2.1), if installed:

Main TargetLink Library
Supported: Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, Look-Up Table, Look-up Table (2-D), Direct Look-up Table (n-D), PreLook-Up Index Search, Interpolation (n-D) using PreLook-Up, Saturation, MinMax, Abs, Sign, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, Discrete-Time Integrator, Discrete State-Space, 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
Non-Linear
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 Flip-Flop, D Latch, J-K Flip-Flop, S-R Flip-Flop, 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: 
TargetLink-Supported Simulink Blocks
Supported: Please see list of Reactis-Supported Simulink Blocks
Unsupported: 

14.2.7  TargetLink 2.3.1 Library Blocks

The following table lists the supported blocks from the dSPACE TargetLink library (version 2.3.1), if installed:

Main TargetLink Library
Supported: Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, Look-Up Table, Look-up Table (2-D), Direct Look-up Table (n-D), PreLook-Up Index Search, Saturation, MinMax, Abs, Sign, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, Discrete-Time Integrator, Discrete State-Space, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled),
Unsupported: Interpolation (n-D) using PreLook-Up, Rate Limiter
Non-Linear
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 Flip-Flop, D Latch, J-K Flip-Flop, S-R Flip-Flop, 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: 
TargetLink-Supported Simulink Blocks
Supported: Please see list of Reactis-Supported Simulink Blocks
Unsupported: 

14.2.8  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:

Main TargetLink Library
Supported: Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, Look-Up Table, Look-up Table (2-D), Direct Look-up Table (n-D), PreLook-Up Index Search, Interpolation (n-D) using PreLook-Up, Saturation, MinMax, Abs, Sign, Rate Limiter, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, FIR Filter, Discrete-Time Integrator, Discrete State-Space, Data Store Write, Data Store Memory, Data Store Read, Merge, Sink, Bus Inport, Bus Outport, Switch, Multiport Switch, Unit Delay (Reset Enabled),
Unsupported: 
Non-Linear
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 Flip-Flop, D Latch, J-K Flip-Flop, S-R Flip-Flop, 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: 
TargetLink-Supported Simulink Blocks
Supported: Please see list of Reactis-Supported Simulink Blocks
Unsupported: 

14.2.9  TargetLink 3.5 to 22.1 Library Blocks

The following table lists the supported blocks from the dSPACE TargetLink library (versions 3.5 to 22.1), if installed:

Main TargetLink Library
Supported: Inport, Outport, Constant, Sum, Gain, Product, Logical Operator, Relational Operator, Fcn, Look-Up Table, Look-up Table (2-D), Direct Look-up Table (n-D), PreLook-Up Index Search, Interpolation (n-D) using PreLook-Up, Saturation, MinMax, Abs, Sign, Rate Limiter, Relay, Trigonometric Function, Math, Unit Delay, Discrete Transfer Fcn, Discrete-Time Integrator, Discrete State-Space, 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
Non-Linear
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 Flip-Flop, D Latch, J-K Flip-Flop, S-R Flip-Flop, 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: 
TargetLink-Supported Simulink Blocks
Supported: Please see list of Reactis-Supported Simulink Blocks
Unsupported: 

14.3  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 Section 14.4. Charts with “C” action language are supported.
  • Implicit “enter”, “exit” and “change” events
  • Range limits for variables.
  • “ml.” name-space operator and “ml()” function call.
  • Embedded MATLAB code. Reactis supports the language subset described in Section 14.4.
  • 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 odd-shaped transitions (for example, single transition segments which leave and reenter a state).
  • The temporalCount operator.
  • Atomic Subcharts (introduced in R2010b).

14.4  Embedded MATLAB

Reactis V2012 introduced black-box 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@reactive-systems.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 white-box testing of the EML portions of a model. See Chapter 17 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 white-box or black-box mode for EML, Reactis supports the same subset of EML. This subset is defined in Section 17.4.