Start of trail End of trail navigation bar

Table of Contents > QUARC > User's Guide > Communications

Variable-Size Signals

Most Simulink users are accustomed to Simulink signals being scalars and vectors or even N-dimensional matrices. The number of dimensions is always fixed and, usually, the size of these signals is also fixed. However, Simulink also supports signals whose size is not fixed but can actually dynamically vary in size as the model is running. These signals are called variable-size signals.

Variable-size signals are useful when the data being processed is dynamic in size. Strings, for example, are prime candidates for variable-size signals. Communications, databases and compression algorithms are other instances where variable-size signals can be valuable.

For a full discussion of variable-size signals in Simulink, refer to

Variable-Size Signal Basics

MATLAB Command Line

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

qc_open_matlab_help('variable_size_signals');
.

QUARC supports variable-size signals with a number of its blocks. For example, the commmunications blocks, string handling blocks and asynchronous FIFO blocks all support variable-size signals. QUARC blocks whose inputs are defined by a format string also tend to support variable-size signals for string inputs. Hence, it is possible to send and receive variable-size data and to manipulate that data in Simulink.

It is important to note that variable-size signals in Simulink are propagated by passing the signal data as well as the signal dimensions between blocks. Variable-size signals cannot grow indefinitely. Their maximum size is actually computed when the Simulink diagram is processed and enough memory is allocated to handle this maximum signal size. Hence, variable-size signals do not save memory - but they can improve performance because only the data included by the current dimensions is processed in any given timestep.

When dealing with multidimensional signals of two or more dimensions, each signal dimension can vary in size. However, the data is always stored consecutively in memory. This detail does not affect the use of variable-size signals when standard Simulink or QUARC blocks are used. However, it does become important when implementing custom S-functions that support variable-size signals.

For examples of using variable-size signals with QUARC's communications facilities, refer to the following demonstrations:

Blocks Supporting Variable-Size Signals

Below is a list of many of the QUARC blocks which support variable-size signals:

Asynchronous Blocks

Communications Blocks

Discrete Blocks

Sink Blocks

String Blocks

User Interface Blocks

 

navigation bar