Main Content

Block State and Work Vector Functions

R2026b

LibBlockAssignDWork(dwork, ucv, lcv, sigIdx, rhs)

Based on the dwork index of the block or record (dwork), the user control variable (ucv), the loop control variable (lcv), and the signal index (sigIdx), LibBlockAssignDWork assigns a block’s dwork to a specified right hand side value (rhs).

Call LibBlockAssignDWork only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockAssignDWork in customstoragelib.tlc.

LibBlockContinuousState(ucv, lcv, idx)

Returns a string corresponding to the specified block continuous state (CSTATE) element.

Call LibBlockContinuousState only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockContinuousState in blocklib.tlc.

LibBlockContinuousStateDerivative(ucv, lcv, idx)

Returns a string corresponding to the specified block continuous state (CSTATE) element.

Call LibBlockContinuousStateDerivative only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See also LibBlockDiscreteState.

See LibBlockContinuousStateDerivative in blocklib.tlc.

LibBlockContStateDisabled(ucv, lcv, idx)

Returns a string corresponding to the specified block continuous state (CSTATE) element.

Call LibBlockContStateDisabled only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See also LibBlockDiscreteState.

See LibBlockContStateDisabled in blocklib.tlc.

LibBlockDataStore(dsmIdx, ucv, lcv, idx)

Returns a string corresponding to an element of the block data store dsmIdx, where ucv is the user control variable and lcv is the loop control variable. For the argument idx, specify a numeric element index N with an optional prefix re or im :

  • N — Returns the complex container of element N if the data store is complex, and returns element N otherwise.

  • reN — Returns the real part of element N if the data store is complex, and returns element N otherwise.

  • imN — Returns the imaginary part of element N if the data store is complex, and returns "" otherwise.

For example, to return the imaginary part of element 3 of a complex data store, specify idx as im3.

If either ucv or lcv is not equal to "", the function ignores the numeric portion of idx. The function still returns the real or imaginary part of the element based on the prefix re or im.

Call LibBlockDataStore only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockDataStore in blocklib.tlc.

LibBlockDataStoreAddr(dsmIdx, ucv, lcv, idx)

Returns a string corresponding to the address of an element of the block data store dsmIdx, where ucv is the user control variable and lcv is the loop control variable. For the argument idx, specify a numeric element index N with an optional prefix re or im:

  • N — Returns the address of the complex container of element N if the data store is complex, and returns the address of element N otherwise.

  • reN — Returns the address of the real part of element N if the data store is complex, and returns the address of element N otherwise.

  • imN — Returns the address of the imaginary part of element N if the data store is complex, and returns "" otherwise.

If either ucv or lcv is not equal to "", the function ignores the numeric portion of idx. The function still returns the address of the real or imaginary part of the element based on the prefix re or im.

Call LibBlockDataStoreAddr only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockDataStoreAddr in blocklib.tlc.

LibBlockDataStoreCustomStorageClass(dsmIdx)

Returns the storage class of the specified block data store dsmIdx.

See LibBlockDataStoreCustomStorageClass in blkio_api.tlc.

LibBlockDataStoreDataTypeName(dsmIdx, reim)

Returns the data type name of the specified block data store. The input argument reim controls the returned type name:

  • "" — Returns the full data type name of the data store.

  • tRealPart — Returns the data type name of the real part of the data store.

  • tImagPart — Returns the data type name of the imaginary part of the data store.

For example, for a complex data store with base type real_T, specifying reim as "" returns creal_T, and specifying reim as tRealPart or tImagPart returns real_T.

See LibBlockDataStoreDataTypeName in blkio_api.tlc.

LibBlockDataStoreIsComplex(dsmIdx)

Returns 1 if the specified block data store is complex and returns 0 otherwise.

See LibBlockDataStoreIsComplex in blkio_api.tlc.

LibBlockDataStoreWidth(dsmIdx)

Returns the width of the specified block data store.

See LibBlockDataStoreWidth in blkio_api.tlc.

LibBlockDWork(dwork, ucv, lcv, idx)

Returns a string corresponding to the specified block dwork element. For the argument idx, specify a numeric element index N with an optional prefix re or im:

  • N — Returns the complex container of element N if dwork is complex, and returns element N otherwise.

  • reN — Returns the real part of element N if dwork is complex, and returns element N otherwise.

  • imN — Returns the imaginary part of element N if dwork is complex, and returns "" otherwise.

If either ucv or lcv is not equal to "", the function ignores the numeric portion of idx. The function still returns the real or imaginary part of the element based on the prefix re or im.

Call LibBlockDWork only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockDWork in blocklib.tlc.

LibBlockDWorkAddr(dwork, ucv, lcv, idx)

Returns a string corresponding to the address of the specified block dwork element.

Call LibBlockDWorkAddr only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockDWorkAddr in blocklib.tlc.

LibBlockDWorkDataTypeId(dwork)

Returns the data type ID of the specified block dwork.

See LibBlockDWorkDataTypeId in blocklib.tlc.

LibBlockDWorkDataTypeName(dwork, reim)

Returns the data type name of the specified block dwork.

See LibBlockDWorkDataTypeName in blocklib.tlc.

LibBlockDWorkIsComplex(dwork)

Returns 1 if the specified block dworkis complex. Returns 0 otherwise.

See LibBlockDWorkIsComplex in blocklib.tlc.

LibBlockDWorkName(dwork)

Returns the name of the specified block dwork.

See LibBlockDWorkName in blocklib.tlc.

LibBlockDWorkStorageClass(dwork)

Returns the storage class of the specified block dwork.

See LibBlockDWorkStorageClass in blocklib.tlc.

LibBlockDWorkStorageTypeQualifier(dwork)

Returns the storage type qualifier of the specified block dwork.

See LibBlockDWorkStorageTypeQualifier in blocklib.tlc.

LibBlockDWorkUsedAsDiscreteState(dwork)

Returns 1 if the specified block dwork is used as a discrete state, returns 0 otherwise.

See LibBlockDWorkUsedAsDiscreteState in blocklib.tlc.

LibBlockDWorkWidth(dwork)

Returns the width of the specified block dwork.

See LibBlockDWorkWidth in blocklib.tlc.

LibBlockDiscreteState(ucv, lcv, idx)

Returns a string corresponding to the specified block discrete state (DSTATE) element.

Call LibBlockDiscreteState only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockDiscreteState in blocklib.tlc.

LibBlockIWork(definediwork, ucv, lcv, idx)

Returns a string corresponding to the specified block IWORK element.

Call LibBlockIWork only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockRWork.

See LibBlockIWork in blocklib.tlc.

LibBlockMode(ucv, lcv, idx)

Returns a string corresponding to the specified block MODE element.

Call LibBlockMode only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockMode in blocklib.tlc.

LibBlockNonSampledZC(ucv, lcv, NSZCIdx)

Returns a string corresponding to the specified block NSZC.

LibBlockNonSampledZC returns an element for the nonsampled zero-crossing state based on ucv, lcv, and NSZCIdx.

Arguments

ucv — User control variable string

lcv — Loop control variable string

NSZCIdx — Nonsampled zero-crossing index

See LibBlockNonSampledZC in blocklib.tlc.

LibBlockPWork(definedpwork, ucv, lcv, idx)

Returns a string corresponding to the specified block PWORK element.

Call LibBlockPWork only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockRWork.

See LibBlockPWork in blocklib.tlc.

LibBlockRWork(definedrwork, ucv, lcv, idx)

Returns a string corresponding to the specified block RWORK element. The first argument, definedrwork, is a symbol defined in the mdlRTW routine of the C MEX file with code like:

ssWriteRTWWorkVect([...], "RWork", [...], "MyRWorkName", [...])

Alternatively, if RWork defines have not been made, definedrwork is ignored and the raw RWork vector is accessed. In this case, uses in a loop rolling context are disallowed.

Call LibBlockRWork only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockRWork in blocklib.tlc.

LibBlockZCSignalValue(ucv, lcv, zcsIdx, zcElIdx)

Purpose

Returns a string corresponding to the specified block ZCSignalValue

Arguments

ucv

User control variable string.

lcv

Loop control variable string.

zcsIdx

zc signal Idx

zcElIdx

Idx of zc signal element in the zc signal

Description

LibBlockZCSignalValue returns an element for the zero crossing state based on ucv, lcv, and zcsIdx.

Call LibBlockZCSignalValue only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibBlockZCSignalValue in blocklib.tlc.

LibSFcnCopyFromDataStoreToOutput(block, system, dsmIdx, pIdx)

Reads the data store dsmIdx registered by the specified block in the containing system and writes the contents to the output port pIdx.

Call LibSFcnCopyFromDataStoreToOutput only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnCopyFromDataStoreToOutput in utillib.tlc.

LibSFcnCopyToDataStoreFromInput(block, system, dsmIdx, pIdx)

Writes the contents from the input port pIdx to the data store dsmIdx registered by the specified block in the containing system.

Call LibSFcnCopyToDataStoreFromInput only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnCopyToDataStoreFromInput in utillib.tlc.

LibSFcnReadFromDataStore(block, system, dsmIdx, yAddr)

Reads the entire data store dsmIdx registered by the specified block in the containing system and copies the contents to the destination address yAddr. For addressable data stores, the function uses memcpy. For data stores with a nonaddressable custom storage class, the function LibSFcnReadFromDataStore assigns the contents element by element.

Call LibSFcnReadFromDataStore only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnReadFromDataStore in utillib.tlc.

LibSFcnReadFromDataStoreElement(block, system, dsmIdx, yAddr, dsmElem)

Reads the element at index dsmElem from the data store dsmIdx registered by the specified block in the containing system and writes the value to the destination address yAddr.

Call LibSFcnReadFromDataStoreElement only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnReadFromDataStoreElement in utillib.tlc.

LibSFcnWriteToDataStore(block, system, dsmIdx, uAddr)

Writes the contents from the source address uAddr to the entire data store dsmIdx registered by the specified block in the containing system.

For addressable data stores, the function uses memcpy. For data stores with a nonaddressable custom storage class, the function LibSFcnWriteToDataStore assigns the contents element by element.

Call LibSFcnWriteToDataStore only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnWriteToDataStore in utillib.tlc.

LibSFcnWriteToDataStoreElement(block, system, dsmIdx, uAddr, dsmElem)

Writes the value at the source address uAddr to the element at index dsmElem of the data store dsmIdx registered by the specified block in the containing system.

Call LibSFcnWriteToDataStoreElement only within TLC block target file methods that generate executable code (for example, Outputs, Update, and Start).

See LibSFcnWriteToDataStoreElement in utillib.tlc.

See Also

Topics