Host Initialize Host Keyboard navigation bar

Table of Contents

Host Heartbeat

Receives a heartbeat message from the host to monitor the host connection.

Library

QUARC Targets/Devices/Peripherals/Host

Description

Host Heartbeat

The Host Heartbeat block receives a heartbeat message from the host periodically, which it uses to monitor the connection to the host. It can use the heartbeat message to detect the loss of the connection. This block is useful in situations where the Host blocks are being used but there is a possibility of losing the connection, such as a WiFi link to an embedded QUARC target.

The Host Heartbeat block has two outputs. The heart output goes high for one sampling instant each time a heartbeat message is received. This output may be used to see when the last heartbeat message arrived from the host. Heartbeat messages are sent at the period specified by the Period parameter.

The loss output goes high when no heartbeat message has been received within the timeframe specified in the Loss detection interval parameter. This output is typically used to enter an emergency recovery state, such as landing a drone or stopping an unmanned vehicle.

Input Ports

This block has no input ports.

Output Ports

heart

This output goes high for one sampling instant each time a heartbeat message is received from the host.

loss

This output goes high when no heartbeat message has been received from the host within the loss detection interval. It will go low again as soon as a heartbeat message is received.

Parameters and Dialog Box

Host Heartbeat

Host name

The identity of the associated Host Initialize block. The Host Heartbeat block must be associated with a Host Initialize block.

Period (tunable offline)

The period in seconds at which heartbeat messages will be sent from the host. It must be a positive scalar.

Loss detection interval (tunable online)

If a heartbeat message is not received within this time interval, in seconds, then the loss output goes high. The loss detection interval must be a positive scalar that is greater than or equal to the Period parameter.

Sample time

The sampling period (in seconds) at which the mouse coordinates and button states are acquired and output from the Host Heartbeat block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered or Enabled Subsystem, or in a referenced model.

The default sample time is set to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model. Hence, the default sample time is a discrete sample time with the same sampling time as the fixed step size of the model.

Enabled (tunable offline)

Check this option to enable the block. If this option is not checked then the outputs will be set to default values. This checkbox is convenient for disabling the block when use of the mouse is not desired.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar