Table of Contents
Stream Get Property
Gets the values of stream properties.
Library
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
The Stream Get Property block gets properties of the stream after the stream is created. The operation of this block is not affected by the blocking mode of the stream connected to its input. Changes to stream properties are reflected immediately.
Limitations
Protocols
Communications protocols generally support only a few, if any, stream properties. Properties are provided to retrieve characteristics of the stream after the stream is created.
Helpful Hints
Other uses of this block
Although it is intended for use with the other Advanced stream blocks, the Stream Get Property block may also be used with the Intermediate stream blocks.
UDP Protocol - Peer Address
The string STREAM_PROPERTY_PEER_ADDRESS property may be used with the UDP protocol to get the IP address and port of the socket's peer.
Input Ports
stm
A reference to the stream created by the Stream Connect
or Stream Accept 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.
value
This output contains the value(s) of the selected properties. It will be a vector of the same length as the Property code(s) parameter for boolean, integer and double properties. For string properties, it will have a maximum length equal to the Maximum length parameter. If the Use variable-size output option is checked then it will be variable-sized.
err
An int32 value indicating whether the properties were retrieved successfully. It will be zero on success and a negative error code otherwise. See Error Codes for the different error codes and their values. Use the Compare to Error block rather than the error code itself to check for specific error codes. To check for errors in general use the Compare to Zero block to check whether the err output is less than zero.
Data Type Support
The Stream Get Property block only supports signals consistent with the selected property type.
Parameters and Dialog Box
Type of property
The type of property to retrieve. Each property type has its own set of property codes so boolean property "0" is not the same as integer property "0". This parameter should be set first as it affects the property codes that may be selected.
Property code(s) (tunable offline)
A vector of integers specifying the properties to set. Each property of a stream has an associated integer code to identify that property. To select properties based on their name, use the browse button (labelled "...") beside the Property code(s) edit field.
Maximum length
This parameter is only visible when the Type of property is set to . It specifies the length of the output string. If the Use variable-size output option is checked then it is the maximum length of the output string.
Use variable-size output
This parameter is only visible when the Type of property is set to . If it is checked then the value output will be a variable-size signal. Otherwise it will be a fixed dimension. The string output may be displayed using the String Display block.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
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 |
If the block which created the stream is not active during normal simulation, then the Stream Get Property block does nothing. Otherwise it gets the properties of the stream. |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.