Based on the output port number (portIdx
), the user control variable
(ucv
), the loop control variable (lcv
), the signal
index (sigIdx
), and the output signal destination,
LibBlockAssignOutputSignal
assigns a block’s output to a specified
right hand side value, (rhs
).
See LibBlockAssignOutputSignal
in customstoragelib.tlc
.
Returns the number of data output ports of a block (excludes control and state ports).
See LibBlockNumOutputPorts
in blocklib.tlc
.
Determines the index mode of a block's output port.
If a block's output port is set as an index port and its indexing base is marked as
zero-based or one-based, this information is written into the
file.
model
.rtwLibBlockOutputPortIndexMode
queries the indexing base to branch to
different code according to what the output port indexing base is.
%if LibBlockOutputPortIndexMode(block, idx) == "Zero-based" ... %elseif LibBlockOutputPortIndexMode(block, idx) == "One-based" ... %else ... %endif
block
— Block record
pidx
— Port index
""
for a nonindex port, and "Zero-based"
or
"One-based"
otherwise.
See LibBlockOutputPortIndexMode
in blkiolib.tlc
.
Based on the output port number (portIdx
), the user control variable
(ucv
), the loop control variable (lcv
), the signal
index (sigIdx
), and the output signal destination,
LibBlockOutputSignal
returns a reference to a block output
signal.
The returned value is a valid lvalue
(left-side value) for an
expression. The block output destination can be a location in the block I/O vector (another
block's input), the state vector, or an external output.
Do not use LibBlockOutputSignal
to access the address of an output
signal.
The code generator tracks when a variable (e.g., a signal or parameter) is accessed by
its address. To access the address of an output signal, use
LibBlockOutputSignalAddr
as in the following example:
%assign yAddr = LibBlockOutputSignalAddr(0, "", lcv, sigIdx) x = %<yAddr>;
See LibBlockOutputSignal
in blkiolib.tlc
.
Returns a string that provides the memory address of the specified block output port signal.
When an output signal address is required, you must use
LibBlockOutputSignalAddr
instead of taking the address that is returned
by LibBlockOutputSignal
. For example,
LibBlockOutputSignal
can return a literal constant, such as 5 (i.e., an
invariant output signal). When LibBlockOutputSignalAddr
is called on an
invariant signal, the signal is declared as a const
instead of being
placed as a literal constant in the generated code.
Note that unlike LibBlockOutputSignal
, the last argument,
sigIdx
, is not overloaded. Hence, if the output signal is complex, the
address of the complex container is returned.
To get the address of a wide output signal and pass it to a user function for processing, you could use
%assign u = LibBlockOutputSignalAddr(0, "", "", 0) %assign y = LibBlockOutputSignal(0, "", "", 0) %<y> = myfcn (%<u>);
See LibBlockOutputSignalAddr
in blkiolib.tlc
.
Returns the type name string (e.g., int_T, ... creal_T
) of the
aliased data type corresponding to the specified block output port.
Specify the reim
argument as ""
if you want the
complete signal type name. For example, if reim
== ""
and the first output port is real and complex, the data type placed in
dtname
is creal_T
:
%assign dtname = LibBlockOutputSignalAliasedThroughDataTypeName(0x,"")
Specify the reim argument as tRealPart
if you want the raw element
type name. For example, if reim
== tRealPart
and the
first output port is real and complex, the data type name returned is
real_T
.
%assign dtname = LibBlockOutputSignalAliasedThroughDataTypeName(0,tRealPart)
See LibBlockOutputSignalAliasedThruDataTypeName
in
.blkiolib.tlc
Returns whether the specified output port is connected to a Merge block.
See LibBlockOutputSignalBeingMerged
in blkiolib.tlc
.
Returns 1 if the specified output port is connected to a block other than the Ground block and 0 otherwise.
See LibBlockOutputSignalConnected
in blkiolib.tlc
.
Returns the numeric ID corresponding to the data type of the specified block output port.
If the output port signal is complex, LibBlockOutputSignalDataTypeId
returns the data type of the real (or the imaginary) part of the signal.
See LibBlockOutputSignalDataTypeId
in blkiolib.tlc
.
Returns the type name string (e.g., int_T
, ...
creal_T
) of the data type corresponding to the specified block output
port.
Specify the reim
argument as ""
if you want the
complete signal type name. For example, if reim==""
and the first output
port is real and complex, the data type name placed in dtname
is
creal_T
.
%assign dtname = LibBlockOutputSignalDataTypeName(0x,"")
Specify the reim
argument as tRealPart
if you want
the raw element type name. For example, if reim==tRealPart
and the first
output port is real and complex, the data type name returned is
real_T
.
%assign dtname = LibBlockOutputSignalDataTypeName(0,tRealPart)
See LibBlockOutputSignalDataTypeName
in blkiolib.tlc
.
Returns the dimensions of the specified block output port.
See LibBlockOutputSignalDimensions
in blkiolib.tlc
.
Returns 1 if the specified block output port is complex, 0 otherwise.
See LibBlockOutputSignalIsComplex
in blkiolib.tlc
.
Returns 1 (true) if the output signal is an expression, and 0 (false) otherwise.
See LibBlockOutputSignalIsExpr
in blkiolib.tlc
.
Returns 1 if the specified block output port is frame based, 0 otherwise.
See LibBlockOutputSignalIsFrameData
in blkiolib.tlc
.
Returns the local sample time index corresponding to the specified block output port.
See LibBlockOutputSignalLocalSampleTimeIndex
in blkiolib.tlc
.
Returns the number of dimensions of the specified block output port.
See LibBlockOutputSignalNumDimensions
in blkiolib.tlc
.
Returns the offset time corresponding to the specified block output port.
See LibBlockOutputSignalOffsetTime
in blkiolib.tlc
.
Returns the sample time corresponding to the specified block output port.
See LibBlockOutputSignalSampleTime
in blkiolib.tlc
.
Returns the symbolic dimensions of specified block output port.
See LibBlockOutputSignalSymbolicDimensions
in blkiolib.tlc
.
Returns the symbolic width of specified block output port.
See LibBlockOutputSignalSymbolicWidth
in blkiolib.tlc
.
Returns the sample time index corresponding to the specified block output port.
See LibBlockOutputSignalSampleTimeIndex
in blkiolib.tlc
.
Returns the width of the specified block output port.
See LibBlockOutputSignalWidth
in blkiolib.tlc
.