Editors

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

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

Add flags for maximum CPU portability

Adds 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 platform

Chooses the target platform on which to run the simulation (OPAL-RTLinux (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.
• 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:

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:

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