Target Language Compiler    

Output Signal Functions

LibBlockOutputSignal(portIdx, ucv, lcv, sigIdx)

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 the appropriate 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.

Real-Time Workshop 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.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalAddr(portIdx, ucv, lcv, sigIdx)

Returns the appropriate string that provides the memory address of the specified block output port signal.

When an output signal address is needed, you must use this function 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, unlike LibBlockOutputSignal(), the last argument, sigIdx, is not overloaded. Hence, if the output signal is complex, the address of the complex container is returned.

Example

To get the address of a wide output signal and pass it to a user-function for processing, you could use

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalBeingMerged(portIdx)

Returns whether the specified output port is connected to a merge block.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalConnected(portIdx)

Returns 1 if the specified output port is connected to a block other than the Ground block and 0 otherwise.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalDataTypeId(portIdx)

Returns the numeric ID corresponding to the data type of the specified block output port.

If the output port signal is complex, this function returns the data type of the real (or the imaginary) part of the signal.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalDataTypeName(portIdx, reim)

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 will be creal_T.

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 will be real_T.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalDimensions(portIdx)

Returns the dimensions of specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalIsComplex(portIdx)

Returns 1 if the specified block output port is complex, 0 otherwise.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalIsFrameData(portIdx)

Returns 1 if the specified block output port is frame based, 0 otherwise.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalLocalSampleTimeIndex(portIdx)

Returns the local sample time index corresponding to the specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalNumDimensions(portIdx)

Returns the number of dimensions of the specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalOffsetTime(portIdx)

Returns the offset time corresponding to the specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalSampleTime(portIdx)

Returns the sample time corresponding to the specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalSampleTimeIndex(portIdx)

Returns the sample time index corresponding to the specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.

LibBlockOutputSignalWidth(portIdx)

Returns the width of specified block output port.

See function in matlabroot/rtw/c/tlc/lib/blkiolib.tlc.


  Input Signal Functions Parameter Functions