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.

RTE Latch

Library

RT-EVENTS Discrete

Block

Description

The RTE Latch block stores in memory the value of the input signal each time an event occurs in the trigger signal. The latch block outputs the last value stored in memory. The value is held until the occurrence of the next trigger event. The block compensates the error due to events occurring between two samples.

The RTE Latch block enables you to:

  • Define initial condition of the output signal.
  • Latch on a rising, a falling or either edge.

Defining Initial Conditions

You can define the initial condition as a parameter in the block dialog box or you can input them from an external signal. To define the initial condition as a block parameter, specify the Initial condition source parameter as internal and enter the value in the Initial condition parameter field. To provide the initial condition from an external source, specify the Initial condition source parameter as external. An additional input port appears under the block input.

Trigger Type

The block can store in memory its inputs only when specific events occur in the trigger signal.

The trigger type parameter allows the user to select the type of edge that causes the block to do the storage:

  • Select rising to store the input when rising edges are detected.
  • Select falling to store the input when falling edges are detected.
  • Select either to store the input when rising or falling edges are detected.

Mask

RTE Latch Mask

Parameters

Trigger Type

Determine if the latch occurs on rising, falling or either edge.

Initial condition source

Specify the source of the initial condition as internal or as external.

Initial Condition

Value outputs before the first edge is detected.

Sample Time

The time interval between samples.

Input

Input (Double)

Input signal to be latched.

Trigger (RTE Boolean)

RTE Boolean signal uses to trigger the storage.

Initial Condition (Double)

Value outputs before the first edge is detected.

Output

Output (Double)

Latched signal.

Characteristics

Direct Feedthrough

Yes

Sample time

Fixed discrete

Work offline

Yes

Dimensionalized

Yes

Example

The rte_engine.mdl model demonstrates the precision of the RTE blocks compared to the Simulink discrete blocks in the context of a combustion engine. The firing of the combustion is an events based behaviour and necessitates the use of RT-EVENTS to be simulated correctly in discrete sample time.

In this example the RTE Latch block is used to simulate the compression phase of the combustion cycle of the engine.

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