Main Content

NNG Receive

Receive data through nanomsg next gen (NNG) using publish/subscribe protocol

Since R2023a

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • Raspberry Pi NNG Receive

Libraries:
Simulink Support Package for Raspberry Pi Hardware / Communication

Description

Use the NNG Receive block to receive data from the publisher for the specified uniform resource locator (URL). The block uses a publish/subscribe protocol for all inter process communications. In the publish/subscribe protocol, each publisher that wants to send data publishes them on a certain URL while, each subscriber that wants to receive data subscribes to the same URL.

Ports

Output

expand all

The data received from the publisher, specified as a N-by-1 vector. N is the length of the message specified by the Data length (N) parameter.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean

If the subscriber receives a new message since the last sample time, the Status port outputs 1. Otherwise, the port outputs 0.

Data Types: Boolean

Parameters

expand all

Enter the name of the inter process communication (IPC). This IPC name reflects in the URL.

A URL is a service address used by the publisher to identify rightful subscribers for delivering data. This URL is used by the publisher to receive data sent on the same URL. The IPC name reflects in the URL.

Note

You cannot edit this parameter.

Select the type of input data that the subscriber receives at each sample time.

Enter the maximum length of data that the subscriber receives at each sample time.

Select this option to save the response from the subscriber to a log file each time the data is received by the subscribers. The name of the log file is the Simulink® model name followed by .log.

Enter how often the subscriber checks for new data from the publisher. When you specify the sample time as -1, the block inherits its sample time based on the context of the block within the Simulink model.

Version History

Introduced in R2023a