Loading Models in Reactis — Reactis FAQ (2024)

What model preparation needs to be done to run Tester?#

In brief, you should:

  • All workspace data items used by a model are automatically loaded whenloading the model in Simulink. There are several ways to automaticallyload the data items:

    • From a callback function of the model that gets automatically executedby Simulink when loading or running the model (for example the model’sPreLoadFcn)

    • From a startup.m script located in the directory in which the modelis located. To make Reactis execute the startup.m script, make sure to checkthe Execute startup.m and pathdef.m scripts in model folder option onthe MATLAB tab in Reactis’ Global Settings dialog.

    • From the “Pre-Load Function” setting in Reactis. Load your model inReactis and then select the Edit > Callbacks… menu. You can enterMATLAB code in either of the text boxes available on that page.

  • Ensure that the model does not use unsupported Simulink blocks or otherMATLAB or Stateflow features currently not supported by Reactis. For alist of features supported by Reactis, see Chapter Preparing Models forUse withReactisof the Reactis User’sGuide. Alternatively,you can just try to run Tester (or start Simulator) at which time anyunsupported blocks in your model will be flagged.

  • Optionally, you may restrict the values that may arrive at top-levelinports of the model during test-generation. For details on how to dothis please see Chapter The Reactis Info FileEditor.In brief, do the following:

    1. Load your model in Reactis.

    2. Select menu item Edit > Inport Types…

    3. In the resulting window, double-click on the row corresponding to theinport you wish to constrain. A dialog will appear for specifying the setof values the inport may assume.

Why do I get Reactis was unable to invoke MATLAB when I try to simulate or generate tests in Reactis?#

When importing models for test generation or simulation, Reactis invokesMATLAB in the background to perform various tasks. When you see the aboveerror, this indicates that Reactis encountered a problem when it attemptedto invoke MATLAB. If this occurs, try the following troubleshooting steps.

  1. What type of MATLAB license do you have?

    • Floating. Is license available?

      • Yes. Goto step 2.

      • No. Wait for MATLAB license to become available.

    • Not floating. Goto step 2.

  2. Try alternate MATLAB invocation method. In Reactis:

    1. Select File > Global Settings…

    2. In MATLAB tab, change the Invoke MATLAB via setting. We currentlyrecommend the Full MATLAB window setting, but if that does not worktry the others.

    3. Try to start Reactis Tester. If unsuccessful, goto step 3.

  3. Unregister the MATLAB engine server.

    1. Open a DOS command window in administrator mode. You can do this byright-clicking on the Command Prompt entry in the Windows Start Menuand selecting Run as Administrator.

    2. In the command window, type: matlab /unregserver

    3. Try to start Reactis Tester. If unsuccessful, goto step 4.

  4. Increase the length of time Reactis will wait for response from MATLABbefore timing out.

    1. In Reactis, select File > Global Settings…, then MATLAB tab

    2. Set Invoke MATLAB via to MATLAB engine interface via C API

    3. Make sure Reuse existing MATLAB command windows is checked.

    4. Increase MATLAB startup timeout (seconds) from its default value of 120.

    5. Try to start Reactis Tester. If unsuccessful, goto step 5.

  5. Toggle setting to reuse MATLAB command windows.

    1. In Reactis, select File > Global Settings…, then MATLAB tab

    2. Toggle the checkbox Reuse existing MATLAB command windows.

    3. Try to start Reactis Tester. If unsuccessful, goto step 6.

  6. Check for faulty MATLAB installation.

    1. Create a text file named MATLAB_automation.vbs and enter thefollowing lines in the file:

     Option Explicit DIM MATLAB_Shell DIM var_version set MATLAB_Shell=CreateObject("Matlab.Application") var_version=MATLAB_Shell.Execute("ver") Wscript.Echo var_version
    1. Start the script by double-clicking on the file’s icon. Does a smalldialog appear listing the MATLAB version and installed toolboxes?

      • Yes. MATLAB installation is not faulty. Please send email tohelp@reactive-systems.com and include the error message you get whenyou try to start Reactis Tester.

      • No. Indicates a faulty MATLAB installation. Please contact MathWorkstechnical support and tell them that the script does not run.

Can Reactis process models containing S-Functions?#

Yes. In the base Reactis product, S-Functions can be executed, but they aretreated as black boxes, and coverage of targets within S-Functions (forexample, branches) is not tracked.

The Reactis for C Plugin integrates seamlessly with Reactis to offerwhite-box testing and validation of the C-code portions of models(S-Functions, C Caller blocks, and C code called from Stateflow). Together,Reactis for Simulink and Reactis for C Plugin automate the generation oftest data from, and validation of models constructed with Simulink,Stateflow, and C code.

A separate license is required to use the Reactis for C Plugin. If yourorganization does not yet own such a license please contactsales@reactive-systems.com to inquire about purchase options or to obtain ademo license for the product. Reactis for C Plugin requires base Reactisfor Simulink to run.

Can Reactis process models containing embedded MATLAB?#

Yes. Reactis V2012 added support for Embedded MATLAB (EML) code. Note,currently a subset of the full language is supported, i.e. not allfunctions, data types and features of the EML language aresupported. Support for additional features of the language are graduallybeing added. Please see Section15.4of the Reactis User’sGuide for a listof currently supported features.

Embedded MATLAB support in the base Reactis for Simulink product isblack-box only, meaning Reactis can execute the code but it is not possibleto track coverage or to single-step through the code within Reactis. If youpurchase the Reactis for EML Plugin, you obtain white-box support includingcoverage tracking and stepping through EML code.

Does Reactis support Simulink block “X”?#

Chapter Preparing Models for Use withReactisof the Reactis User’sGuide contains adescription of which MATLAB/Simulink/Stateflow features are supported byReactis. Please see Section15.2.3of the Reactis User’sGuide for a tabledetailing which blocks are supported specifically.

Can Reactis process models containing TargetLink blocks?#

Yes. TargetLink is an automatic code generator produced by dSPACEGmbH. Reactis for Simulink cangenerate tests for models constructed with the TargetLink blockset andthese tests can be run on TargetLink-generated code in Reactis for C.Reactis currenlty supports TargetLink versions 3.0 through 2023-B.

Can Reactis process multi-rate models?#

Yes. Reactis interprets sample times defined in your model exactly as Simulink does.

When I try to load my model file I get an error message like Couldn’t find library file simulink.mdl. Why?#

In order to process Simulink models, Reactis needs access to the blocklibraries included in the Simulink distribution. These libraries are notlibraries in the traditional, systems-programming sense of the word(i.e. they are not .dll files); rather, they are plain-text files thatSimulink treats as libraries. For this reason, the MATLAB installer doesnot add the folders containing these files to the Windows searchpath. Reactis therefore must maintain its own search path for thesefolders. The likely source of the error is that your Reactis search pathdoes not contain the relevant entry. To check whether or not this is thecase, select the File > Settings… menu from the top-level Reactiswindow. The Path tab of the resulting dialog includes a list offolders. One of the entries should have the form

MATLABHOME\toolbox\simulink\blocks

(for MATLAB R2010b or earlier), or

MATLABHOME\toolbox\simulink\blocks\library

(for MATLAB R2011a or later) where MATLABHOME is the name of the mainMATLAB installation folder. The default name for the installation folderis:

c:\Program Files\MATLAB\R2017b

For 32-bit installations the location is:

c:\Program Files (x86)\MATLAB\R2015b

If the relevant entry is missing from your Reactis library path, then clickthe Add button and add the missing folder.

Note that the Reactis installer automatically adds the necessarydirectories to the search path, so re-installing Reactis should resolve theproblem.

I get errors loading my model into Reactis, even though the model loads without problem into Simulink. Why?#

There are two possible causes of this problem.

  • Some required folders are missing from your Reactis path. To resolvethe problem, add the missing folders to the Reactis path. Note that theReactis path consists of two parts:

    1. A global path set from the Reactis Settings dialog, and

    2. A model-specific path set from the Reactis Info File Editor.

Note that the dialogs for setting both the global and model-specific pathsinclude an Import button that allows the MATLAB path to be imported intoReactis. This can be useful in the case where the model already loadsproperly in MATLAB.

  • You have multiple versions of MATLAB installed and the version ofMATLAB that Reactis is invoking is different from the version of MATLABin which the model is working. To resolve the problem, consult theMATLAB tab of the Reactis Settings dialog to check that the UseMATLAB version pulldown specifies the version of MATLAB that youintend for Reactis to invoke.

Why doesn’t Reactis recognize a workspace variable in my model?#

Although Reactis may invoke MATLAB to perform some tasks, Reactis does notdirectly interact with an executing MATLAB session in the same way thatSimulink does. Consequently, any workspace data items that a model usesmust be attached to a model in a way such that they are automaticallyinitialized when the model is loaded. There are several ways toautomatically load the data items:

  • From a callback function of the model that gets automatically executed bySimulink when loading or running the model (for example the model’sPreLoadFcn)

  • From a startup.m script located in the directory in which the model islocated. To make sure Reactis executes the startup.m script, make sure to checkthe Execute startup.m and pathdef.m scripts in model folder option onthe MATLAB page in Reactis’ settings dialog.

  • From the Pre-Load Function setting in Reactis. Load your model inReactis and then select the Edit > Callbacks… menu. You can enterMATLAB code in either of the text boxes available on that page.

For example: for the cruise-control model included in the Reactis release, thefile cruise_constants.m defines two workspace variables that are used incruise.slx. One attaches cruise_constants.m to cruise.slx as follows:

  1. Load cruise.slx in 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. (note the .m suffix is omitted)

  5. Save the model.

Why do I get a Mismatched Simulink version warning?#

This warning is issued when you load a model that was created with aversion of Simulink that differs from the version that Reactis isconfigured to use. There are a couple of ways to eliminate the warning.

  1. Configure Reactis to use the version of Simulink with which the modelwas created. Note, however that this solution changes the Simulink versionused by Reactis for all models. Change the Simulink version used by Reactisas follows.

    1. Start Reactis.

    2. Select menu item File > Settings…

    3. Select the MATLAB tab of the Settings dialog.

    4. In the Use MATLAB version menu, select the version ofMATLAB/Simulink used by the model. The versions of Simulink installed onyour machine are listed in the menu.

    5. Click Ok to save the change.

  2. If the Simulink version used to create the model is older than theversion used by Reactis, then you can convert the model to the versionof Simulink that Reactis is configured to use. Do this as follows.

    1. Start the version of MATLAB used by Reactis.

    2. Load the model.

    3. Save the model.

Loading Models in Reactis — Reactis FAQ (2024)

References

Top Articles
Latest Posts
Article information

Author: Golda Nolan II

Last Updated:

Views: 5923

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Golda Nolan II

Birthday: 1998-05-14

Address: Suite 369 9754 Roberts Pines, West Benitaburgh, NM 69180-7958

Phone: +522993866487

Job: Sales Executive

Hobby: Worldbuilding, Shopping, Quilting, Cooking, Homebrewing, Leather crafting, Pet

Introduction: My name is Golda Nolan II, I am a thoughtful, clever, cute, jolly, brave, powerful, splendid person who loves writing and wants to share my knowledge and understanding with you.