Stream Listen Stream Print navigation bar

Table of Contents

Stream Poll

Polls for events associated with the stream.

Library

QUARC Targets/Communications/Advanced

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library/Communications/Advanced')

Description

Stream Poll

The Stream Poll block polls for events associated with the stream. For example, it can be used to wait until data is ready to receive or until a client connection is pending. The Stream Poll block waits for one of the selected events or the timeout to occur. If one or more events occur then it returns a non-zero value at the corresponding output ports, and a positive value at the err output. If the timeout occurs then it returns zero at all the event output ports and at the err output. If an error occurs then it returns a negative error code at the err output. The operation of this block is not affected by the blocking mode of the stream connected to its input.

Input Ports

stm

A reference to the stream created by the Stream Connect, Stream Accept or Stream Listen block. If the stream is closed or is otherwise invalid then the negative error code -QERR_INVALID_STREAM is returned by the err output.

Output Ports

stm

A reference to the stream. This output is merely a copy of the stm input. Providing this output makes it much easier to establish the execution order of Stream blocks in the diagram because Simulink generally executes daisy-chained blocks in sequence.

rcv

A boolean value indicating whether data is available to receive. This flag only guarantees that at least one byte is available in the stream buffer to receive. It does not guarantee that the Stream Receive will not block unless it is only receiving a single byte. However, if messages are being sent over the stream it generally means that the entire message can be received almost immediately once the first byte arrives.

snd

A boolean value indicating whether there is space in the stream buffer to store more data for transmission. This flag only guarantees that at least one byte is available in the stream buffer for sending. It does not guarantee that the Stream Send will not block unless it is only sending a single byte. However, if messages are being sent over the stream it generally means that the entire message can be sent almost immediately once space for one byte becomes available.

fls

A boolean value indicating whether the data in the stream buffer can be flushed to the underlying communication channel. This flag only guarantees that at least one byte of the stream buffer can be flushed. It does not guarantee that the Stream Flush will not block unless it is only flushing a single byte.

conn

A boolean value indicating whether a non-blocking Stream Connect has finished making the connection. Note that this condition may not be distinguishable from the snd or fls conditions for some streams. Refer to the help for a particular protocol for details.

acc

A boolean value indicating whether a client connection is pending on a listening stream. This condition is only valid for listening streams. It guarantees that a Stream Accept block will return immediately with a new client connection. Note that this condition may not be distinguishable from the rcv condition for some streams. Refer to the help for a particular protocol for details.

err

An int32 value indicating the results of the operation. If the timeout occurs before any event has occurred then a value of zero is output. If the event occurs within the timeout interval then a positive value is returned. If an error occurs then this value is a negative error code.

Parameters and Dialog Box

Stream Poll

Wait for data available to receive

Enables the rcv output. This flag only guarantees that at least one byte is available in the stream buffer to receive. It does not guarantee that the Stream Receive will not block unless it is only receiving a single byte. However, if messages are being sent over the stream it generally means that the entire message can be received almost immediately once the first byte arrives.

Wait for space available to send

Enables the snd output. This flag only guarantees that at least one byte is available in the stream buffer for sending. It does not guarantee that the Stream Send will not block unless it is only sending a single byte. However, if messages are being sent over the stream it generally means that the entire message can be sent almost immediately once space for one byte becomes available.

Wait for space available to flush

Enables the fls output. This flag only guarantees that at least one byte of the stream buffer can be flushed. It does not guarantee that the Stream Flush will not block unless it is only flushing a single byte.

Wait for connection to complete

Enables the conn output. Note that this condition may not be distinguishable from the snd or fls conditions for some streams. Refer to the help for a particular protocol for details.

Wait for a client connection to be ready to accept

Enables the acc output. This condition is only valid for listening streams. It guarantees that a Stream Accept block will return immediately with a new client connection. Note that this condition may not be distinguishable from the rcv condition for some streams. Refer to the help for a particular protocol for details.

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