Console View and Shortcuts

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.

Console View and Shortcuts

 

The MATLAB View provides quick access to the local MATLAB application inside RT-LAB. From here, users can make modifications to the offline model with MATLAB.

Matlab View
Matlab View

 

By default, the MATLAB View is included in the Edition perspective. To add it to the current perspective, click Window > Show view > Other... > RT-LAB > MATLAB View

 

 

Note: Because there is no MATLAB environment on the real-time operating system, any changes to the Simulink model require recompilation to affect the real-time simulator.

 

Console View

The Console View is a generic view that may contain different Console types. A Console basically displays formatted text. Some Consoles enable user input, for example, the Interactive Python Console.

By default, the RT-Lab Workbench includes three different Consoles:

  • An Interactive Python Console for Python development:

Interactive Python Console overview
Interactive Python Console overview
  • A Target Console that displays output from target nodes when executing remote commands:

Target Console overview
Target Console overview
  • A Log Console that provides internal debug information. This Console can only be used if the Advanced User Capabilities preference page is enabled:

Log Console overview
Log Console overview


Several Console Views may be opened at the same time in the workbench, but they all share the same list of Consoles.

To add a Console View to the current perspective, click Window > Show view > Other... > RT-LAB > Console or use the Open Console button of an existing Console View.

This is useful when you want to display several Consoles side-by-side, for example, to compare two command outputs.

Toolbar

Command

Name

Description

Availability

Command

Name

Description

Availability

Clear Console

Clears the current
console.

Toolbar and Context
menu

Scroll Lock

Toggles the Scroll Lock

Toolbar

Pin Console

Pins the current console
to remain on top of all
other consoles in the
current Console View.

Toolbar

Display Selected
Console

Opens a listing of current
consoles and allows you
to select which one you
would like to see.

Toolbar

Open Console

Opens a new console of
the selected type.

Toolbar

Most Console types provide the following additional commands:

Command

Name

Description

Availability

Close Console

Closes the current console

Toolbar

Save Console session

Saves the current content of the Console to a file

Toolbar


The Interactive Python Console is shown in the Console View. This Console is provided by the PyDev plugin, available at http://pydev.org

Interactive Python Console: Overview


To open a new Interactive Python Console, you can use the main application toolbar:

Python menu
Python menu


...or the corresponding menu: Tools > Python > Open Console.

A dialog is displayed to choose among available console types:

Python Console dialog
Python Console dialog


Repeat these operations to open several Consoles in the same View. These Consoles may be of different types. Use the toolbar to switch between opened Consoles.

Once started, the Interactive Python Console is able to launch Python scripts and to execute Python commands. This is particularly useful when working with RT-Lab projects since RT-Lab provides a complete Python module. This module, named RtlabApi, allows you to control any part of a simulator, from configuration to execution. All available functions are described in the Python API Reference Guide.


In order to use this module, users must import it with the following command:

>>> import Rt LabApi

However, by default, when opening an Interactive Python Console, some modules are automatically imported, including the RT-Lab API. The RT-Lab API is also given the alias ‘r’. Use the PyDev preference page to edit these initial commands (see Configuration).

Using the RT-Lab API through the Interactive Python Console is a good way to test some commands that would be later integrated to a Python script and thus create a full automated sequence.

Here is an example of what the Interactive Python Console can do:

Toolbar
Toolbar

Command

Name

Description

Availability

Terminate

Closes the current console

Toolbar

Save

Saves current content to a file

Toolbar

Clear Console

Clears the current console

Toolbar and Context menu

Pin Console

Pins the current console to remain on top of all other consoles in the current Console View

Toolbar

Display Selected Console

Opens a listing of current consoles and allows you to select which one you would like to see

Toolbar

Open Console

Opens a new console of the selected type

Toolbar

 

Shortcuts

SHORTCUT

ACTION

Ctrl + Space

Code completion.

PageUp

Displays history in a dialog.

Up/Down Arrows

Cycles through history.

Esc

Clears current line.

Ctrl + f

Opens the search dialog.

Configuration


Enabling the Advanced User Capabilities preference page allows you to configure the Interactive Python Console.

Go to Window > Preferences > PyDev > Interactive Console:

Python Console settings
Python Console settings


You can also change the current Python version and settings in Window > Preferences > PyDev > Interpreter - Python.

References


PyDev web site: http://pydev.org/

Target Console


The Target Console is shown in the Console View. It is a simple Shell interface that looks similar to a Terminal View:

Target Console: Overview

 

The Target Console automatically opens when you execute a command or launch a Python script on a Target from its context Menu.

If the Advanced Capabilities preference page is enabled, you can open a new Target Console from the Console View Menu. A dialog is displayed to select the Target to connect to this new Console:

Toolbar

Command

Name

Description

Availability

Terminate

Closes the current
console.

Toolbar

Clear Console

Clears the current
console.

Toolbar and Context
menu

Scroll Lock

Toggles the Scroll Lock

Toolbar

Pin Console

Pins the current console
to remain on top of all
other consoles in the
current Console View.

Toolbar

Display Selected
Console

Opens a listing of current
consoles and allows you
to select which one you
would like to see.

Toolbar

Open Console

Opens a new console of
the selected type.

Toolbar

Log Console


The Log Console is shown in the Console View. It displays internal debug messages and needs the Advanced Capabilities preference page to be used.

LogConsole: Overview

 

The Log Console can be opened using the Open Console command of the Console View.

Toolbar

Command

Name

Description

Availability

Command

Name

Description

Availability

Terminate

Closes the current
console.

Toolbar

Save

Saves current content to
a file.

Toolbar

Clear Console

Clears the current
console.

Toolbar and Content menu

Scroll Lock

Toggles the Scroll Lock

Toolbar

Pin Console

Pins the current console
to remain on top of all
other consoles in the
current Console View.

Toolbar

Display Selected
Console

Opens a listing of current
consoles and allows you
to select which one you
would like to see.

Toolbar

Open Console

Opens a new console of
the selected type.

Toolbar


The Variables Table View displays one or more sets of RT-LAB variables, such as Signals and Parameters, in a tabbed notebook:

Variables Table View, Overview
Variables Table View, Overview

 


By default, the Variables Table View is included in the Edition perspective. To add it to the current perspective, click Window > Show view > Other... > RT-LAB > Variables Table.

Working Sets


Variables Working Sets are intended to represent logical groups of RT-LAB variables, for example, the main parameters of a controller. This allows you to focus on a particular set of variables without having to search for them within an entire model.

Several Variables Table Views can be used to display different working sets. The same working set can also be shared between several Variables Tables.

Selecting Working Sets


When a new Variables Table View is created, it opens a default working set. This working set is fully functional but will not be saved when RT-LAB is closed. To have a working set restored the next time RT-LAB is opened, you must create a working set with a unique name.

The easiest way to do so is to click on the New Working Set button. Enter a name and click OK to create a new working set containing all the variables currently displayed in the Variables Table View.

This working set is then automatically opened in the Variables Table and its name appears at the top of the table.

This method can also be used to merge several workings sets into a new one: select the working sets you want to merge (see below) then create a new working set. Duplicates will automatically be removed.


To select which working sets should be shown in a Variable Table, click on the Select Working Sets button to open the following dialog:

Select Working Sets dialog
Select Working Sets dialog


This dialog allows you to create, edit and delete variables working sets.

 

Note: Variables working sets are common to the entire workbench, which allows them to be used in the Project Explorer like other types of Working Sets:

Using variables working sets in the Project Explorer

 

Editing Working Sets


In the Select Working Sets dialog, clicking the Edit... button opens a new dialog that can be used to choose the variables that will be part of the selected working set:

Edit Working Set dialog
Edit Working Set dialog

 

An easier way of adding elements to a working set is to open it in a Variables Table and to drag and drop variables from the Project Explorer, the Search View or another Variables Table View.

You can also drag a block, a subsystem or even a model to add all the contained variables to the working set.

If the Variables Table displays several working sets, the variables will be added to each of them.

It is also possible to right-click on a variable or a block (or a combination of them) in the Project Explorer or the Search View and then click on Add to Working Sets:

Context menu: Add to Working Set

 


This opens the Select Working Set dialog described above.

To remove a variable from a working set, right-click it in the Variables Table and click Remove, or press the Delete key.

Lost Elements


If a variable is not available, it is displayed with a red-cross icon as below:

Unavailable variables
Unavailable variables

 


This happens, for example, when the project is closed, when the model is removed from the project, or when the model has been recompiled and the variable does not exist anymore.

Then you can either remove the variables from the working set or fix the problem. If a variable becomes available again, the Variable Table will automatically be updated.

Editing Values


When a model is running, the values of the variables are automatically updated every few seconds. You can also change the value of editable variables such as parameters.

  • By default, the Variables Table View is in Auto-apply mode. This means that as soon as you change a value and hit Enter, the value is sent to the model.

  • If you want to send several values at the same time (so that all the variables are updated during the same calculation step), toggle the Auto-apply button.

  • Then if you modify a value and hit Enter, the value will be displayed with an asterisk indicating a non-applied change.

  • The new value will not be sent to the model until you press the Apply button or you toggle the Apply button again. If you press the Discard button, all pending changes will be canceled.

Variables Table with pending changes
Variables Table with pending changes

 

Note: Pending changes are shared between views which means that only one pending change is allowed per variable at any time.

 

To edit the value of a vector or a matrix, you have to use the Variable Viewer: double-click on the variable or right-click on it and select Show In > Variable Viewer.

Table Customization


You can sort variables by name, path, type or any property by clicking on the corresponding column header. Columns can be resized and moved by drag and drop.

The Variables Table also provides Filter and Search functionalities at the bottom of the view.

For advanced customization, open the View Menu and select Customize Table to open the following dialog:

Customize Table dialog
Customize Table dialog

Toolbar: View Menu

Command

Name

Description

Discard

Discards current changes.

Apply

Applies current changes.

Auto-apply

Toggles auto-apply mode.

Select Working Sets

Selects the working sets to be displayed in this view.

New Working Set

Saves current variables to a new working set.

New View

Opens a new Variables Table view.

Command

Description

Customize Table

Opens the configuration dialog.

Show In...

Displays the selected variable in another view.

Copy

Copies the selected lines to the clipboard.

Remove

Removes the selected variables from the current Working Sets

Select All

Selects all the variables currently displayed in the view.

Refresh

Updates the table content.

Probe Control Panel


The Probe Control panel enables you to specify the acquisition parameters for each acquisition group. The signals from a given group share the same characteristics, such as: size of the data frames being sent, expressed either as a number of samples per signal, or in units of time

  • decimation factor

  • sampling mode (repetitive or not) and re-arming delay

  • blocking mode in case acquisition or transmission is interrupted

  • a write-to-file option, that enables simulation data to be saved as a .mat file on the target nodes.


The Probe Control Panel can be launch using the Tools > Probe Control menu or using the toolbar button. Note that the panel is only available when a model is selected in the Project Explorer view.

Probe Control
Probe Control

Connect

Connects to a simulation model which acquisition parameters are to be changed. It displays the Active Models panel, if there are simulations running, to enable you to select the model from a list of running models.

Disconnect

Disconnects from the model we are currently connected to.

Group #

These tabs enable you to select which acquisition group parameters are to be changed.

More information

Opens the group info panel on which additional information about the acquisition group is displayed.

Data acquisition triggering

Sets dynamically a trigger on the acquisition group. Data will be acquired only when the specified signal is triggered. The trigger is defined using the fields Trig signal name, Trig by value, Offset, Trig by signal and Condition. If a block OpTrigger is present in the model when activating the dynamic acquisition, the triggering will be set to the value of parameters provided via the Probe Control. When deactivating the dynamic triggering, the block OpTrigger will regain the triggering control once again.

Trig signal name

Sets the name of the signal to be triggered.

Trig by value

Specifies the value that must be reached by the trigger signal to trigger acquisition.

Trig by signal

Specifies a triggering signal instead of a constant value.

Offset

If this parameter is a positive value, it is used to set the number of steps (cycles) to wait before starting the acquisition system, once the trigger condition is met.

The default value is 0, which means start as soon as the trigger condition is met. The trigger offset can also be a negative value n.

In this case, the n samples which correspond to the simulation results of the n steps before the trigger condition happened will be acquired (up to the number of samples per signals). The range value for the offset is [-FrameSize ; +FrameSize].