Latch

This chapter describes the Latch interface. It provides an interface to configure and access a latch in a controller, usually a position latch that is triggered by a configurable input.

Behavior

A latch stores a value from a DataSource when it is triggered. See figure Latch state machine for the functional diagram of a latch.

Latch state machine

Latch state machine

A latch must be configured. The DataSource and TriggerSource inputs must be connected to a signal. TriggerType and TriggerMode options must be specified, for which supported options are listed in tables Latch trigger types and Latch trigger modes.

Latch trigger types

Trigger type

Description

None

Trigger type not configured

RisingEdge

Trigger on rising edges

FallingEdge

Trigger on falling edges

AnyEdge

Trigger on both falling and rising edges

Latch trigger modes

Trigger mode

Description

None

Trigger mode not configured

OneShot

Latch is disabled after first trigger event

Continuous

Latch is re-enabled automatically after a trigger event

See figure Latch state diagram for a state diagram and table Latch states for state descriptions.

Latch state diagram

Latch state diagram

Latch states

State

Description

NotConfigured

Latch is not configured. Required configurations are DataSource input, TriggerSource input, latch trigger type and trigger mode.

Configured

Latch is configured.

Waiting

Latch is waiting for trigger event. Modifying the data or trigger source input is not allowed in this state.

Triggered

Latch is triggered.

A latched value does not change when the value of the DataSource signal changes, e.g. due to sensor scaling. Only after the latch is successfully triggered again, the latched value is updated.

Signals

Signals present for latches are described in table Latch signals.

Latch signals

Signal

Data type

R/W

Description

Value

<latch specific>

R

Latched data source value.

Inputs

A latch has inputs as described in table Latch inputs.

Latch inputs

Name

Data type

Description

DataSource

<latch specific>

Input for signal to be latched.

TriggerSource

Bool

Input for trigger signal.

Events

The latch has the following events:

  • Triggered (Active when the latch state equals “Triggered”.)

See also

Latch

XML configuration example of the latch interface.