Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Editors

Most perspectives in the Workbench are comprised of an editor area and one or more views.

  • You can associate different editors with different types of files. For example, when you open a file for editing by double-clicking it in the Project Explorer view, the associated editor opens in the Workbench.
  • If there is no associated editor for a resource, the Workbench attempts to launch an external editor outside the Workbench.
    • On Windows, the Workbench first attempts to launch the editor in place as an OLE document. This type of editor is referred to as an embedded editor.
    • For example, if you have a .doc file in the Workbench and Microsoft Word is registered as the editor for .doc files in your operating system, then opening the file launches Word as an OLE document within the Workbench editor area.
    • The Workbench menu bar and toolbar are updated with options for Microsoft Word.
  • Any number of editors can be open at once, but only one can be active at a time. The main menu bar and toolbar for the Workbench window contain operations that are applicable to the active editor.
  • Tabs in the editor area indicate the names of resources currently open for editing. An asterisk (*) indicates that an editor has unsaved changes.
  • By default, editors are stacked in the editor area, but you can choose to tile them in order to view source files simultaneously.

The gray border at the left margin of the editor area may contain icons that flag errors, warnings, or problems detected by the system. Icons also appear if you have created bookmarks, added breakpoints for debugging, or recorded notes in the Tasks view. You can view details for any icons in the left margin of the editor by moving the mouse cursor over them.

External Editors

Sometimes you may need to use an external program to edit a file in the Workbench. This can occur, for example, when the Workbench has no editor for that file type.

The external program is used as the default editor if that program is registered as the system default editor for that file type and no other editor is registered for that file type in the Workbench. For example, on most systems, the default editor for JPEG files is an application for editing or viewing image files. If there is no other editor associated with .jpg or .jpeg files in the Workbench, then opening a JPEG file from the Workbench would cause the file to be opened externally, in the system default editor.

To open an external program that is not the default editor, you can use Open With > Other... from the context menu of a file. External programs can also be registered in RT-LAB as the associated editor for a given file type. Use the General > Editors > File Associations preference page to register editors.

Model Editor

RT-LAB provides a simple form-based multi-page model editor that manages all model properties. To open a user-friendly model editor with the current perspective, double-click your model in the Project Explorer. Note that all model properties are also available in the Properties View when selecting a model.

  • An RT-LAB model is characterized by a Simulink model and a set of properties.
    • These properties are not necessarily linked to a Simulink model. Sometimes these properties are related to an RT-LAB simulator.
  • These Model Properties are defined for each new RT-LAB model.
  • Each new model inherits its default property values from the RT-LAB preferences.
  • These properties are individually editable for each RT-LAB model through the Model Editor or Model Properties View.
  • You can configure several models at the same time by using the Model Properties View.
  • These properties are organized by categories. Each category is shown on different pages of the model editor.
  • One or more categories can be displayed on the same page when related.
    • Each modification of a model property covers only the edited model and is saved only for the edited model.
  • A modification made in the Preference menu will not change the edited model but will be effective for each new RT-LAB model created after the modification.

Model Overview Page

General Information

NameName of the edited model.
PathPath where the model is located on the file system.
StateCurrent state of your model. (See OP_MODEL_STATE )
DescriptionDescription of the model.



Note: If the model is not loadable, an error is displayed in the State field:


Preparing and Compiling

Edit the diagram modelOpens the model with the current Matlab version.
Set development propertiesOpens the Development Page of this Model Editor.
Build the modelBuilds the model with RT-LAB.
Consult result in the Compilation viewOpens the Compilation View.
Check errors in the Problem ViewOpens the Problems view.
Assign targets to subsystemsOpens the Assignation Page of this Model Editor.

Executing

Set the execution propertiesOpens the Execution Page of this Model Editor.
LoadLoads the executable code onto the target nodes (only available when the model is loadable).
ExecuteStarts the simulator and the execution of the distributed model’s simulation on the network of the target. (Only available when the model is paused.)
PausePuts the system in a waiting state, stopping calculation without resetting the nodes. To continue execution, click on Execute. (Only available when the model is running.)
ResetTerminates the execution of the executable(s) on the target nodes and causes a complete stop of the simulator. (Only available when the model is running or paused.)

Development Page

This page contains two main sections that define development settings for the edited model: target platform and compiler/linker settings.

The default property values for a new model come from the RT-LAB Preference pages. If a property is changed from the RT-LAB preference pages, each new model created inherits from these properties.

After that, if you change a model property, only the edited model is affected.

Target Platform section

Target platform: Chooses the target platform (or the operating system) on which to run the simulation (OPAL-RTLinux (x86-based) or Windows).

Compiler/Linker settings section


SourcesNames of source files to be compiled in addition to the code generated by RTW. Used to incorporate user-written code into the model executable (e.g. file1.c file2.c file3.c).
AddAdds a source file to the list of source files.
EditEdits the path and name of the selected source file.
DeleteRemoves a source file from the list.
Move upChanges the order of the source files; moves selected source file UP in the list.
Move downChanges the order of the source files; moves selected source file DOWN in the list.

Sources

Includes

Includes

Target path(s) where user included files can be found.

Used to search for include files required to compile the user-written code, when the include files do not reside in already-searched paths.

AddAdds an include path to the list.
EditEdits the selected include path.
DeleteRemoves the selected include path from the list.
Move upChanges order of include paths; moves include path UP in the list.
Move downChanges order of include paths; moves include path DOWN in the list.

Libraries

LibrariesNames of user-specified libraries to be used when incorporating user-written code, in addition to the standard system libraries (MATLAB and RT-LAB).
AddAdds the path of a library to the list.
EditEdits the path of the selected library.
DeleteRemoves the selected library from the list.
Move upChanges order of libraries; moves up selected library in list.
Move downChanges order of libraries; moves down selected library in list.

Library Path

Library pathTarget path(s) where user libraries can be found. Used to search for libraries other than the MATLAB and RT-LAB libraries when incorporating user-written code.
AddAdds a library path to the list.
EditEdits the selected library path.
DeleteRemoves the selected library path from the list.
Move upChanges the ordering of the library's path; moves up.
Move downChanges the ordering of the library's path; moves down.

Compiler

Compiler VersionSelection of the compiler to be used when building the model.  AUTOMATIC is recommended for most usages, and defaults to MinGW for Windows targets.  If Microsoft Visual C++ is to be used, it must explicitly be selected.
Compiler CommandUser command called on the target during the compilation process.
Compiler Options

Options used by the target compiler during the compilation process.

Refer to the target compiler documentation for specific information on the possible compiler options (e.g. -xxx).

Add flags for maximum CPU portabilityAdds options to the compiler to enable maximum CPU portability (-mtune=generic). Enables the compiled executable to be run on a machine with different CPU from the one it was compiled on. This feature is only available for windows  machines.
Linker Options

Options used by the target linker during the linkage process.

Refer to the target linker documentation for specific information on the possible linker options (e.g. -xxx).

Execution Page

This page contains two main sections that define execution settings for the model: Real-Time Properties and Performance Properties.

The default property values for a new model come from the RT-LAB Preference pages. If a property is changed from the RT-LAB preference pages, each new model created inherits from these properties.

After that, if you change a model property, only the edited model is affected.

Real-Time Properties

Target platformChooses the target platform on which to run the simulation (OPAL-RTLinux (x86-based) or Windows system).
Real-Time simulation modeEnables the user to define how the model’s simulation can be executed on an OPAL-RTLinux (x86-based) or Windows system.
SimulationIn this mode, the model is not synchronized; the model starts a new Simulation with low priority: this simulation mode can be used to run a simulation in the background while working with other applications on the same computer.



Note: Note that the Simulation with low priority mode is only available when working with a Windows target.



Software Synchronized

In this mode, real-time synchronization of the entire simulation is achieved by the OS, using the CPU clock as a reference.

Depending on the resolution available on the OS, some sampling times may not be obtained using this mode.

Hardware SynchronizedIn this mode, an I/O board clock is used to synchronize the entire simulation.
Real-Time communication link type

Sets the target cluster’s communication medium.

Here are the available choices for each target platform.
• Windows: UDP/IP.
• OPAL-RTLinux (x86-based): UDP/IP or Dolphin

Time Factor

This value, when multiplied by the model’s basic calculation step (or fixed step size), supplies the final calculation step for the system.

The time factor can only be changed when the simulation execution is paused and is only available in Synchronized (hardware/software) mode.


Note: This parameter enables you to change the I/O acquisition speed. Because the model always uses the basic calculation step, changing the time factor for the I/O may give results that differ from the offline simulation.

  • This parameter should be used only to determine the simulation’s minimum calculation step.
  • Once this step is determined, this parameter must be brought back to a value of 1.
  • The model’s basic calculation step must be updated accordingly by setting the correct value in the Simulink model and by recompiling it.


Stop Time [s]This value (in seconds) specifies when the model stops. If the value is Infinity, the model executes forever. You don’t need to recompile the model to apply a new value.
Pause Time [s]This value (in seconds) specifies when the model pauses. If the value is Infinity, the model executes until a reset is done except if a stop time is specified.

Performance Properties

Enable detection of overruns

(Only applies to models run in hardware/software synchronized modes.) When this parameter is unchecked, RT-LAB does not detect overruns.

When this parameter is checked, RT-LAB detects overruns and performs the action specified in the Action to perform on overruns field. This property has no effect in simulation mode.

Action to perform on overruns

Type of action to perform when overruns are detected.

Here are the available types:
ContinueNo action is performed; the Number of overruns is simply displayed during the next pause/reset of the model.
ResetA reset of the model is performed when the number of overruns reaches the value of the Perform action after the N overruns field.
PauseA pause of the model is executed when the number of overruns reaches the value of the Perform action after the N overruns field.
Perform action after N overruns

Performs the action specified in the Action to perform on overruns field when the number of overruns detected by RT-LAB reaches this number.

(Only applies when Action to perform on overruns is set to Reset or Pause.)

Number of steps without overrunsPrevents RT-LAB from detecting overruns during the first steps of simulation.

Environment Variables Page

This page gives a list of environment variables defined for the edited model.

User environment variables enable some settings for the simulation without having to recompile the model. Most of these settings are used to debug models or as workarounds for specific target situations.

The default property values for a new model come from the RT-LAB Preference pages. If a property is changed from the RT-LAB preference pages, each new model created will inherit from these properties.

After that, if you change a model property, only the edited model is affected.

NameName of the user variable.
ValueValue of the user variable.
DescriptionDescription of the user variable.

Adding a New User Variable

To add a new user variable:

  • Click the Add button.
  • Fill the Name field
  • Fill the Value field
    • Type a value
    • Select a path to a file or a folder by clicking the File... or Folder... button
    • Get the value of a host environment variable by clicking the Variable... button
  • Click the OK button.

Selecting an Environment Variable

Sometimes, it can be useful to import an existing variable from the host system to the target nodes.

To select an existing environment variable on your host system:

  • Click on the Select button.
  • Select all the desired environment variables that you want to import. If you want to select/deselect all environment variables, you CAN click on the Select All and the Deselect All buttons respectively.
  • Click the OK button.

Editing a User Variable

To modify a user variable:

  • Select a user variable from the list to modify.
  • Click on the Edit button.
  • Change the desired field: Name, Value or Description field.



For the Value field, choose between these options:

  • Complete a value manually.
  • Select a path to a file or a folder by clicking the File... or Folder... button
  • Get the value of a host environment variable by clicking the Variable... button
  • Click OK


Deleting a User Variable

To remove a user variable:

  • Select the user variable from the list to delete.
  • Click the Delete button.

Set/Unset a User Variable

You can also Set or Unset a user variable to activate/deactivate variables on the target nodes. Unset variables are unavailable on the target.

  • Select the user variable you want to Set or Unset.
  • Click the Set/Unset button.

Files Page

This page shows the file's properties for the edited model.

  • The default property values for a new model come from RT-LAB Preference pages.
  • If a property is changed from the RT-LAB preference pages, each new model created will inherit from these properties.
  • After that, if you change a model property, only the edited model is affected.

Enable automatic file retrievalWhen enabled, RT-LAB retrieves files generated by the model simulation on the target nodes and transfers them to the host computer.
Enable file retrieval during simulation

If enabled, RT-LAB retrieves the files generated by the model simulation as they are created on the target.

If this option is disabled, RT-LAB retrieves those files after the model resets.

Build intermediate tree on file retrievalSpecifies if intermediate folders are generated or not in the retrieved directory.
File retrieval root directoryDirectory where the files retrieved by RT-LAB after model execution are copied.
List of extra files

This list specifies one or more files to be copied and transferred to (or from) the target environment.

Properties for each extra file:

  • Name: Extra file path and name.
  • Mode: File transfer type (ascii or binary).
Category
  • S-Function: Files that should be transferred during the compilation of S-Functions.
  • Asynchronous Process: Files that should be transferred during the compilation of Asynchronous Programs.
  • Other: For all other cases.
Transfer time

When the file is transferred. 

  • Before compilation
  • After compilation
  • Before load
  • After reset
Subsystem

Subsystem directory where files should be transferred. Type All if you want to transfer files for each subsystem.

Note that a unique folder exists for each subsystem on the target nodes and on the host computer.

Add an Extra File to List

To add a new extra file:

  • Click the Add button.
  • Fill the File Name field or select a file from the file system by clicking the ... button. You can select an absolute path by clicking the Abs button.
  • Select the subsystem directory where files should be transferred. If you want to transfer the files on All subsystem directories, type All in the field Subsystems.
    • Select the category 
    • Select the transfer mode
    • Select the transfer time 
  • Click OK to add the file.

To delete an extra file from the list:

  • Select the extra file from the list.
  • Click Delete.

To delete all extra files from the list:

  • Click Delete All.

Edit an Extra File

To edit an extra file in the list:

  • Select an extra file.
  • Modify the field(s) you want to change.
  • Click OK to add the file.

Assignation Page

This page gives the subsystems properties for the edited model.

The subsystems page contains two main sections that define the subsystems properties:

  • Assigns the computation subsystems to the different target nodes
  • Clean a target or to embed a subsystem

Assignations

This section allows the user to set all the properties for subsystems of a real-time model.

The editor directly edits the properties in the table or edits the selected subsystems in the fields below.

The user can set properties for each subsystem directly in the subsystem table: target assignation, XHP mode, debug mode and core assignation.

NameModel’s subsystem names.
Assigned Node

Select the target node where the subsystem is executed from the list of available targets.

By default, the Assigned node is set to the development node. See Preferences->RT-LAB- >Simulation Tools->RT-LAB section.

PlatformType of platform of the selected target. (OPAL-RTLinux (x86-based) or Windows systems).
XHPIf checked, the subsystem is executed in eXtreme High Performance (XHP) mode (available only on Linux targets).
DebugCheck the subsystems you want to debug. 
Cores

(For advanced users only)

CPU cores allocated (and optionally specified) for the subsystem and its worker threads.

The system will allocate cores and will assign subsystems using the following set of rules:

  • Single-core systems do not support XHP mode.
  • Assignation starts at CPU #1 on multiple core systems; CPU #0 is reserved.
  • Specified cores are allocated first.

Unspecified cores of XHP subsystems are allocated before unspecified cores of other subsystems.

  • XHP subsystems cannot share cores with any other subsystem.
  • Unspecified workers' threads are allocated last using a fair distribution until no cores are available.



Note: A system with N CPU has a maximum of N - 1 subsystems in XHP.



When the Advanced section is activated, select ... in the Cores column to display the core selection dialog. Then, select the number of cores and optionally, select specific cores.

Multiple Assignation

When selecting multiple subsystems in the table, the user can set the properties for this group below the table: target assignation, XHP mode and debug mode. This can also be used when only one subsystem is selected in the table.

Select one or N subsystem(s) in the Subsystem table and set the properties:

  • Choose a physical node: Select the target node where the subsystem is executed from the list of available targets.
  • By default, the Assigned node is set to your development node.
  • See Preferences > RT-LAB > Simulation Tools > RT-LAB.
    • Run in XHP mode: If checked, the subsystem is executed in eXtreme High Performance (XHP) mode (available only on Linux targets).
    • Run in Debug mode (For advanced users only): Check the subsystems you want to debug.

Target Utilities

The target utilities section cleans a target or embeds a subsystem.

Clean targetCleans the model directory on the target node. All files are deleted.
Set as embeddedSets the current model’s simulation as an embedded simulation on the target. It allows the target to automatically load and execute a simulation at power-up. 
Clear embeddedClear an embedded simulation from the assigned target. 

Diagnostic Page

The diagnostic page contains two main sections that define the diagnostic properties: Monitoring properties and Debugging properties.

  • The default property values for a new model come from the RT-LAB Preference pages.
  • If a property is changed from the RT-LAB preference pages, each new model created inherits from these properties.
  • After that, if you change a model property, only the edited model is affected.

Monitoring Properties

Enable monitoringEnables or disables the monitoring during execution of the model.
Display MonitoringSpecifies when Monitoring results are to be displayed in the Display View (NEVER, AT_PAUSE, AT_RESET, or BOTH)
Target display information

Represents the amount of information displayed in the display window during load and execution.

Setting the value from MINIMAL to EXHAUSTIVE retrieves more information about communication and I/Os initialization, for example. This can be used to debug unexpected model behaviors.



Note: Note that Exhaustive mode should only be used for debugging as it can affect real-time performance.



Message precision factor [us] (For advanced users only): Defines the precision of the timer reporting the time required to perform one calculation step in microseconds. The default value is 0 (no printout).

  • Value =1 prints the step size of the model every 1,000,000 steps with a precision of 1 μs.
  • Value =100 prints the model’s step size every 10,000 steps with a precision of 100 μs and so on.

Warning: This option may affect real-time performance.

Debugging Properties

Enable extended timeoutAll timeouts are extended when this option is enabled. It is typically used when debugging the model. The default value is 300 seconds.
Enable watchdog

Enables or disables the Watchdog functionality. The Watchdog ensures all nodes are running normally.

  • There are as many watchdogs as there as computation subsystems in the model.
  • At regular user-defined time intervals, the watchdog verifies that the model is still running and that processes are still active.
  • If an error occurs, the watchdog stops the simulation. This option is not available on the Windows targets.
Watchdog timeout [ms]The regular user-defined time interval the watchdog verifies the model is still running. 5000 ms by default.
Compile model in debug

When enabled, the compiler's optimization options are removed and replaced by debug options during model compilation.

Hardware Page

The Hardware page contains two main sections that define the hardware properties: Monitoring properties and Performance properties.

The default property values for a new model come from the RT-LAB Preference pages. If a property is changed from the RT-LAB preference pages, each new model created will inherit from these properties.

After that, if you change a model property, only the edited model will be affected.

Monitoring Properties

Reset model on IO missing

When checked and the model loaded, RT-LAB stops loading and generates an error, if some I/O boards required by the model are not detected on the target(s).

  • RT-LAB generates only a warning if this setting is unchecked.
  • Note that only a few I/O boards (mainly the Opal-RT TestDrive boards) support this option.
  • Most I/O blocks force a reset of the model if the boards are not detected at load time.
Abort compilation on bitstream missingWhen this option is enabled, if some bitstreams required by a model are not present in the model directory, RT-LAB stops the compilation and generates an error. RT-LAB generates only a warning if this setting is disabled.

Simulation Tools Page

The Simulation Tools Properties page contains three main sections defining common properties related to external simulation tools: Matlab and Simulink properties, Simulink Console and Real-Time Workshop properties.

The default property values for a new model come from the RT-LAB Preference pages. If a property is changed from the RT-LAB preference pages, each new model created will inherit from these properties.

After that, if you change a model property, only the edited model will be affected.

Matlab and Simulink Properties

Model fixed step size [s]Displays the basic calculation step of the model as specified in the Simulation > Configuration Parameters > Solver menu of the Simulink model file. This property is read-only.
MATLAB command before opening modelMATLAB command to execute before opening the model. For example. MyInitFile.m, where MyInitFile includes commands that initialize model variables.
MATLAB command after opening modelMATLAB command to execute after opening the model. For example, MyInitFile.m, where MyInitFile includes commands that initialize model variables.

Simulink Console

Handle console automaticallyAutomatically opens and closes console when a model is Loaded or Reset. The console starts automatically at the first model’s execution.

Real-Time Workshop Properties

This option is available for SIMULINK models only.

User TLC file

Specifies which TLC file to use during the compilation.

When Automatic is selected, the TLC file corresponding to the MATLAB version is automatically selected. 

User TMF file

Specifies which template makefile to use during the compilation.

When Automatic is selected, the template makefile corresponding to MATLAB version is automatically selected.




OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323