Target Language Compiler    

Other Useful Functions

LibCallFCSS(system, simObject, portEl, tidVal)

For use by inlined S-functions with function call outputs. Returns a string to call the function-call subsystem with the appropriate number of arguments or generates the subsystem's code in place (inlined).

See the SFcnSystemOutputCall record in the model.rtw file.

The return string is determined by the current code format.

Example

BlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record. System is a record within the global CompiledModel record.

This example is from the file matlabroot/toolbox/simulink/blocks/tlc_c/fcncallgen.tlc.

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

LibGenConstVectWithInit(data, typeId, varId)

Return an initialized static constant variable string of form:

The typeName is generated from typeId which can be one of:

The data input argument must be a numeric scalar or vector and must be finite (no Inf, -Inf, or NaN values).

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

LibGetDataTypeComplexNameFromId(id)

Returns the name of the complex data type corresponding to a data type ID. For example, if id == tSS_DOUBLE then this function returns "creal_T".

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

LibGetDataTypeEnumFromId(id)

Returns the data type enum corresponding to a data type ID. For example id == tSS_DOUBLE => enum = "SS_DOUBLE". If id does not correspond to a built-in data type, this function returns "".

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

LibGetDataTypeIdAliasedToFromId(id)

Return the data type IdAliasedTo corresponding to a data type ID.

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

LibGetDataTypeIdResolvesToFromId(id)

Return the data type IdResolvesTo corresponding to a data type ID.

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

LibGetDataTypeNameFromId(id)

Returns the data type name corresponding to a data type ID.

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

LibGetT()

Returns a string to access the absolute time. You should only use this function to access time.

Calling this function causes the global flag CompiledModel.NeedAbsoluteTime to be set to 1. If this flag isn't set and you manually accessed time, the generated code will not compile.

This function is the TLC version of the SimStruct macro ssGetT.

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

LibIsMajorTimeStep()

Returns a string to access whether the current simulation step is a major time step.

This function is the TLC version of the SimStruct macro: ssIsMajorTimeStep

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

LibIsMinorTimeStep()

Returns a string to access whether the current simulation step is a minor time step.

This function is the TLC version of the SimStruct macro ssIsMinorTimeStep

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

LibIsComplex(arg)

Returns 1 if the argument passed in is complex, 0 otherwise.

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

LibIsFirstInitCond(s)

LibIsFirstInitCond returns generated code intended for placement in the initialization function. This code determines, during run-time, whether the initialization function is being called for the first time.

This function also sets a flag that tells Real-Time Workshop if it needs to declare and maintain the first-initialize-condition flag.

This function is the TLC version of the SimStruct macro, ssIsFirstInitCond.

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

LibMaxIntValue(dtype)

For a built-in integer data type, this function returns the formatted maximum value of that data type.

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

LibMinIntValue(dtype)

For a built-in integer data type, this function returns the formatted minimum value of that data type.

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


  Sample Time Functions Advanced Functions