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
Name | Name of the edited model. |
---|---|
Path | Path where the model is located on the file system. |
State | Current state of your model. (See OP_MODEL_STATE ) |
Description | Description of the model. |
Note: If the model is not loadable, an error is displayed in the State field:
Preparing and Compiling
Edit the diagram model | Opens the model with the current Matlab version. |
---|---|
Set development properties | Opens the Development Page of this Model Editor. |
Build the model | Builds the model with RT-LAB. |
Consult result in the Compilation view | Opens the Compilation View. |
Check errors in the Problem View | Opens the Problems view. |
Assign targets to subsystems | Opens the Assignation Page of this Model Editor. |
Executing
Set the execution properties | Opens the Execution Page of this Model Editor. |
---|---|
Load | Loads the executable code onto the target nodes (only available when the model is loadable). |
Execute | Starts the simulator and the execution of the distributed model’s simulation on the network of the target. (Only available when the model is paused.) |
Pause | Puts 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.) |
Reset | Terminates 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
Sources | Names 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). |
---|---|
Add | Adds a source file to the list of source files. |
Edit | Edits the path and name of the selected source file. |
Delete | Removes a source file from the list. |
Move up | Changes the order of the source files; moves selected source file UP in the list. |
Move down | Changes 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. |
---|---|
Add | Adds an include path to the list. |
Edit | Edits the selected include path. |
Delete | Removes the selected include path from the list. |
Move up | Changes order of include paths; moves include path UP in the list. |
Move down | Changes order of include paths; moves include path DOWN in the list. |
Libraries
Libraries | Names of user-specified libraries to be used when incorporating user-written code, in addition to the standard system libraries (MATLAB and RT-LAB). |
---|---|
Add | Adds the path of a library to the list. |
Edit | Edits the path of the selected library. |
Delete | Removes the selected library from the list. |
Move up | Changes order of libraries; moves up selected library in list. |
Move down | Changes order of libraries; moves down selected library in list. |
Library Path
Library path | Target 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. |
---|---|
Add | Adds a library path to the list. |
Edit | Edits the selected library path. |
Delete | Removes the selected library path from the list. |
Move up | Changes the ordering of the library's path; moves up. |
Move down | Changes the ordering of the library's path; moves down. |
Compiler
Compiler Version | Selection 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 Command | User 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). |
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 platform | Chooses the target platform on which to run the simulation (OPALRT Linux (x86-based) or Windows system). |
---|---|
Real-Time simulation mode | Enables the user to define how the model’s simulation can be executed on an OPAL-RTLinux (x86-based) or Windows system. |
Simulation | In 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 Synchronized | In 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. |
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.
| |
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: | |
Continue | No action is performed; the Number of overruns is simply displayed during the next pause/reset of the model. |
Reset | A reset of the model is performed when the number of overruns reaches the value of the Perform action after the N overruns field. |
Pause | A 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 overruns | Prevents 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.
Name | Name of the user variable. |
---|---|
Value | Value of the user variable. |
Description | Description 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 retrieval | When 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 retrieval | Specifies if intermediate folders are generated or not in the retrieved directory. |
File retrieval root directory | Directory 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:
|
Category |
|
Transfer time | When the file is transferred.
|
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.
Name | Model’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. |
Platform | Type of platform of the selected target. (OPAL-RTLinux (x86-based) or Windows systems). |
XHP | If checked, the subsystem is executed in eXtreme High Performance (XHP) mode (available only on Linux targets). |
Debug | Check 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:
Unspecified cores of XHP subsystems are allocated before unspecified cores of other subsystems.
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 target | Cleans the model directory on the target node. All files are deleted. |
---|---|
Set as embedded | Sets 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 embedded | Clear 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 monitoring | Enables or disables the monitoring during execution of the model. |
---|---|
Display Monitoring | Specifies 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 timeout | All 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.
|
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).
|
---|---|
Abort compilation on bitstream missing | When 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 model | MATLAB command to execute before opening the model. For example. MyInitFile.m, where MyInitFile includes commands that initialize model variables. |
MATLAB command after opening model | MATLAB command to execute after opening the model. For example, MyInitFile.m, where MyInitFile includes commands that initialize model variables. |
Simulink Console
Handle console automatically | Automatically 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. |