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.

OpComm



Note please that OpComm blocks should not have their names modified.



Library

rtlab

Block

The OpComm block is used in a Console, Master, or Slave subsystem to simulate the behavior of the real-time communication link.

Figure 1: OpComm block

Mask

Figure 2: OpComm mask when inserting inside a SC_ subsystem

Figure 3: OpComm mask when inserting inside a SM_ or SS_ subsystem

Description

The OpComm block is used in a Console, Master, or Slave subsystem to simulate the behavior of the real-time communication link. Any signal entering a Console, Master, or Slave subsystem has to go through the OpComm first.

Only double signals can pass through the block.

This block serves a number of purposes:

  • Provides RT-LAB with information about the size and type of data coming from other subsystems.
  • Defines acquisition groups along with acquisition parameters (only in the Console subsystem).
  • Emulates the behavior of subsystem communication in RT-LAB with models used offline: The block waits until all of its inputs are updated before updating its outputs. Keep this in mind while designing your model.
  • Specifies the sample time of the subsystem in which the block is placed.
  • Specifies the communication sample time of a calculation subsystem (Master or Slave) with another calculation subsystem.

In the Console, there must be one OpComm for each acquisition group. In Master and Slave subsystems, a maximum of two OpComms is allowed: one for signals coming from the Console (non-real-time communication) and one for signals coming from other Master and Slave subsystems (real-time communication). Note that a single OpComm can not be used to receive from both a Console and a Master or Slave subsystem, since the communication types are not the same.

The following figure illustrates an example where all subsystems are at the same sampling rate:

Figure 4:

Parameters

This block's parameters vary depending on the subsystem type (Console, Master, or Slave) in which the block is placed.

General Parameters

Number of inportsNumber of signals to pass through this block. The block dynamically adjusts the number of its input and output pins according to this parameter.

Parameters Specific to Console Subsystems

Acquisition groupSpecifies the acquisition group for all signals that pass through this block.
Subsystem sample timeSpecifies the sample time in seconds for the acquisition group. If no multirate is used, enter 0 to inherit sample time from the model.
Enable SynchronizationEnables the synchronization algorithm, to prevent signal aliasing and other distortions. The Console will attempt to run at the same rate as the model. In case of data loss between two acquisition frames, the Console will evaluate the length of time over which data is lost, and will either maintain the last value received during this period or perform a linear interpolation. Blocking mode must be selected in the Probe Control panel in order to have this option enabled.
Enable InterpolationEnables linear interpolation between two values during data loss. If this option is not selected, the last value received will be maintained during data loss. Applies only if Enable Synchronization is selected.
Threshold time between Command Station and target (sec.)If the difference between simulation time and Console time exceeds this value, the Console will stop filling in missed data (whether interpolated or last value) and will resynchronize with the new value. This is used to prevent the Console from drifting too much behind model execution. Applies only if Enable Synchronization is selected.
Missed data signalCreates a block outport for the number of calculation steps missed between data packets. Applies only if Enable Synchronization is selected.
Simulation offset signalCreates a block outport for the simulation time at which the Console started the acquisition. Refreshed when the Console is stopped and started again, but not when it comes back from pause.
Simulation time signal Creates a block outport for the simulation time on the target nodes.
Sample/second signalCreates a block outport for the average number of samples per seconds displayed on the Console. Includes points inserted during data loss, whether interpolated or not.
Dynamic signals output Creates a block outport to connect to displays, scopes. It is used to prepare connections for dynamic signals. Enabling / Disabling this option will not enable/disable dynamic acquisition for the model. Refer to Probe Control panel for more information about dynamic acquisition.

Parameters Specific to Master and Slave Subsystems

Subsystem sample timeSpecifies the sample time in seconds for the subsystem in which the block is placed. If no multirate is used, enter 0 to inherit sample time from the model.
Communication sample time

For each inport in a MATLAB array, specifies the sample time in seconds of the incoming signal. If only one value is entered, it will be applied to all inports. This parameter is only useful with OpComm simulating real-time communication (between a Master and a Slave or between two Slaves). It is not taken into account for a OpComm receiving signals from a Console. When used between subsystems running at a different time step, the communication sample time should be at least the slowest time step used by any of the two subsystems linked by the opcomm.

Example [0.001 0.005 0.01] => inport 1 will be at 0.001 seconds, inport 2 at 0.005 seconds and so on

Inputs

An inport is created for each signal that must go through the OpComm, based on the Number of inports parameter. Each of these inports is vectorized.

Outputs

An outport is created for each signal that must go through the OpComm, based on the Number of inports parameter. Additionally, outports are created for the Missed Data, Simulation Offset, Simulation Time, Sample/Seconds and dynamic signals output signals if they are selected in the block's parameters.

Characteristics and Limitations

This block has no special characteristics.

Direct Feedthrough

Yes

Discrete sample time

Yes

XHP support

N/A

Work offline

Yes

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