Table of Contents
Parent Polymorphic VI: | Stream Read |
Requirements: | Quanser Rapid Control Prototyping Toolkit, LabVIEW 2020 or newer |
The Stream Read VI receives data over a stream. The operation of this VI is affected by the blocking mode of the stream connected to its input. Streams have two modes: blocking (the default) and non-blocking. If a Stream Call or Stream Answer VI is used to create the stream, then the stream will be non-blocking. If a Stream Connect or Stream Accept VI is used to create the stream then the blocking mode of the stream is determined by the Stream Connect or Stream Listen VI.
stream in is a reference to the stream. This output is merely a copy of the stream in input. |
default is the value of the default output. |
stream out is a reference to the stream. This output is merely a copy of the steam in input. |
|
data read from the stream buffer. The output signal is treated as an atomic
unit. It will never read part of the data from the stream buffer. Note that the buffer size for the stream must be at least
as large as the output data or |
|
new indicates whether the value(s) presented at the data port represent newly received data from the peer. If this output is zero (false) then no data has been received from the peer in this sampling instant. |
|
closed indicates whether the connection has been closed by the peer. This output is non-zero (true) when the remote host gracefully closes the connection. Otherwise it is zero (false). |
The Stream Read VI receives data over a stream. The operation of this VI is affected by the blocking mode of the stream connected to its input. Streams have two modes: blocking (the default) and non-blocking. If a Stream Call or Stream Answer VI is used to create the stream, then the stream will be non-blocking. If a Stream Connect or Stream Accept VI is used to create the stream then the blocking mode of the stream is determined by the Stream Connect or Stream Listen VI.
This VI receives values over a client stream, where the size and data type of the signal is determined by the default. If the stream has been configured to swap bytes then this VI will swap the order of the bytes within each element that it reads before writing them to its data output. Multi-dimensional and bus signals are supported.
Since the Intermediate Stream VIs are non-blocking, this VI does not wait. If fewer bytes are available than the size of the output signal then the new output will be zero (false). If all the data requested is available then the new output will be non-zero (true).
If the connection has been closed gracefully by the peer then it sets closed to a non-zero (true) value and returns zero (false) at its new output once there are fewer bytes left to read than the size of the output signal. Otherwise the closed output is zero and the new output returns true (non-zero). Once there are fewer bytes left in the stream buffer than the size of the output data vector then it sets closed to true to indicate the connection has been closed. A graceful closure of the connection by the peer is not considered an error.
If an error occurs, it will be reported to Control and Simulation Loop. If the stream is not valid because it is not yet connected, it will not be considered an err since this condition is expected and the validity of the stream may be checked using the state output of the Stream Call or Stream Answer VIs.
This VI does not support two threads calling Stream Read at the same time. However, Stream Read may be called by another thread at the same time as Stream Write.
All input/output pairs of this function have direct feedthrough behaviour.
RCP CL Comm Advanced Stream Example | ||
RCP CL Comm Intermediate Stream Example | ||
RCP CL Comm Intermediate Stream Mixed Type Example |
Stream Write | ||
Stream Answer | ||
Stream Call |
Target |
Supported |
Comments |
---|---|---|
Yes |
Fully supported. |
Copyright © Quanser Inc. This page was generated 2021-09-24. Submit feedback to Quanser about this page.
Link to this page.