| Real-Time Workshop® | ![]() |
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). Calls LibExecuteFcnCall, but provides a simplified argument list. See LibExecuteFcnCall for more information.
%foreach callIdx = NumSFcnSysOutputCalls
%if LibIsEqual(SFcnSystemOutputCall[callIdx].BlockToCall,...
"unconnected")
%continue
%endif
%% call the downstream system
%<LibBlockExecuteFcnCall(block, callIdx)>\
%endforeachSee LibBlockExecuteFcnCall in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
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 inline.
When used by inlined S-functions to make a function call, LibCallFCSS returns the call to the function-call subsystem with the appropriate number of arguments, or the inlined code.
An S-function can execute a function-call subsystem only via its first output port. The return string is determined by the current code format.
See the SFcnSystemOutputCall record in the model.rtw file.
This example is from matlabroot/toolbox/simulink/blocks/tlc_c/fcncallgen.tlc.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%assign sysToCall = System[ssBlock.ParamSettings.SystemIdx]
%<LibCallFCSS(sysToCall, tSimStruct, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record. System is a record within the global CompiledModel record.
See LibCallFCSS in matlabroot/rtw/c/tlc/lib/syslib.tlc.
For use by inlined S-Functions with function-call outputs. Returns a string to call the disable method for the function-call subsystem, or generates the subsystem's disable code inline.
An S-function can execute a function-call subsystem only via its first output port. The return string is determined by the current code format.
See the SFcnSystemOutputCall record in the model.rtw file.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%assign sysToCall = System[ssBlock.ParamSettings.SystemIdx]
%<LibDisableFCSS(sysToCall, tSimStruct, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record. System is a record within the global CompiledModel record.
See LibDisableFCSS in matlabroot/rtw/c/tlc/lib/syslib.tlc.
For use by inlined S-Functions with function-call outputs. Returns a string to call the enable method for a function-call subsystem, or generates the subsystem's enable code inline (as well as initialize code if the subsystem resets states on reset).
An S-function can execute a function-call subsystem only via its first output port. The return string is determined by the current code format.
See the SFcnSystemOutputCall record in the model.rtw file.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%assign sysToCall = System[ssBlock.ParamSettings.SystemIdx]
%<LibEnableFCSS(sysToCall, tSimStruct, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record. System is a record within the global CompiledModel record.
See LibEnableFCSS in matlabroot/rtw/c/tlc/lib/syslib.tlc.
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).
This example is from matlabroot/toolbox/simulink/blocks/tlc_c/fcncallgen.tlc.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%<LibExecuteFcnCall(ssBlock, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record.
See LibExecuteFcnCall in matlabroot/rtw/c/tlc/lib/syslib.tlc.
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).
This example is from matlabroot/toolbox/simulink/blocks/tlc_c/fcncallgen.tlc.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%<LibExecuteFcnCall(ssBlock, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record.
See LibExecuteFcnDisable in matlabroot/rtw/c/tlc/lib/syslib.tlc.
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).
This example is from matlabroot/toolbox/simulink/blocks/tlc_c/fcncallgen.tlc.
%foreach fcnCallIdx = NumSFcnSysOutputCalls
%% call the downstream system
%with SFcnSystemOutputCall[fcnCallIdx]
%% skip unconnected function call outputs
%if ISEQUAL(BlockToCall, "unconnected")
%continue
%endif
%assign sysIdx = BlockToCall[0]
%assign blkIdx = BlockToCall[1]
%assign ssBlock = System[sysIdx].Block[blkIdx]
%<LibExecuteFcnCall(ssBlock, FcnPortElement, ...
ParamSettings.SampleTimesToSet[0][1])>\
%endwith
%endforeachBlockToCall and FcnPortElement are elements of the SFcnSystemOutputCall record.
See LibExecuteFcnEnable in matlabroot/rtw/c/tlc/lib/syslib.tlc.
Returns an initialized static constant variable string of form:
static const typeName varId[] = { data };The typeName is generated from typeId, which can be one of
tSS_DOUBLE, tSS_SINGLE, tSS_BOOLEAN, tSS_INT8, tSS_UINT8, tSS_INT16, tSS_UINT16, tSS_INT32, tSS_UINT32
The data input argument must be a numeric scalar or vector and must be finite (no Inf, -Inf, or NaN values).
See LibGenConstVectWithInit in matlabroot/rtw/c/tlc/lib/utillib.tlc.
Get a field value inside a block record.
%if LibIsEqual(LibGetBlockAttribute(ssBlock,"MaskType"), ... "Task Block") %assign isTaskBlock = 1 %endif
Returns the value of the attribute (field) or an empty string if it does not exist.
See LibGetBlockAttribute in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For use by asynchronous S-functions with function call outputs. Asynchronous tasks can manage their own time. LibGetCallerClockTickCounter is used to access an upstream asynchronous task's time counter. This is preferred when being driven by another asynchronous rate (e.g., an Interrupt block driving a Task block) because the time the interrupt occurred is used, rather than the time the task is allowed to run.
Returns a string for the counter variable for the upstream asynchronous task.
See LibGetCallerClockTickCounter in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For use by asynchronous S-functions with function-call outputs. Asynchronous tasks can manage their own time. LibGetCallerClockTickCounterHigh is used to access the high word of an upstream asynchronous task's time counter. This is preferred when being driven by another asynchronous rate (for example, an Interrupt block driving a Task block) because the time the interrupt occurred is used rather than the time the Task is allowed to run.
Returns a string for the high word of the counter variable for the upstream asynchronous task.
See LibGetCallerClockTickCounterHigh in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
Returns the name of the complex data type corresponding to a data type ID. For example, if id==tSS_DOUBLE then LibGetDataTypeComplexNameFromId returns "creal_T".
See LibGetDataTypeComplexNameFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type enum corresponding to a data type ID. For example, if id==tSS_DOUBLE, then enum is "SS_DOUBLE". If id does not correspond to a built-in data type, LibGetDataTypeEnumFromId returns "".
See LibGetDataTypeEnumFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type IdAliasedThruTo that corresponds to a data type ID.
See LibGetDataTypeIdAliasedThruToFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type IdAliasedTo that corresponds to a data type ID.
See LibGetDataTypeIdAliasedToFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type IdResolvesTo that corresponds to a data type ID.
See LibGetDataTypeIdResolvesToFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type name that corresponds to a data type ID.
See LibGetDataTypeNameFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Return the size (as Simulink® knows it) corresponding to a data type ID.
See LibGetDataTypeSLSizeFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the data type StorageId corresponding to a data type ID.
See LibGetDataTypeStorageIdFromId in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Given an S-function block and call index, return the block record for the downstream function-call subsystem block.
%assign ssBlock = LibGetFcnCallBlock(block,0)
The block record of the downstream function-call subsystem connected to that element (call index).
See LibGetFcnCallBlock in matlabrootrtw/c/tlc/lib/asynclib.tlc.
Returns the data type identifier of the specified record as a an integer.
See LibGetRecordDataTypeID in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the dimensions of the specified record as a vector of integers.
See LibGetRecordDimensions in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the value 1 if the specified record is complex, and zero otherwise.
See LibGetRecordIsComplex in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns the width of the specified record as an integer.
See LibGetRecordWidth in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
Returns a string to access the absolute time, which is a floating-point number. However, if you have configured the model for integer-only code generation (by deselecting Support floating-point numbers), the string represents an integer equal to the number of base rate ticks (the absolute time divided by the base sample time) rather than the absolute time.
You should use LibGetT to access time only.
LibGetT is the TLC version of the SimStruct macro ssGetT.
See LibGetT in matlabroot/rtw/c/tlc/lib/utillib.tlc.
Returns 1 if the argument passed in is complex, 0 otherwise.
See LibIsComplex in matlabroot/rtw/c/tlc/lib/utillib.tlc.
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.
LibIsFirstInitCond also sets a flag that tells the Real-Time Workshop® code generator if it needs to declare and maintain the first-initialize-condition flag.
LibIsFirstInitCond is the TLC version of the SimStruct macro ssIsFirstInitCond.
See LibIsFirstInitCond in matlabroot/rtw/c/tlc/lib/syslib.tlc.
Returns a string to access whether the current simulation step is a major time step.
LibIsMajorTimeStep is the TLC version of the SimStruct macro ssIsMajorTimeStep.
See LibIsMajorTimeStep in matlabroot/rtw/c/tlc/lib/utillib.tlc.
Returns a string to access whether the current simulation step is a minor time step.
LibIsMinorTimeStep is the TLC version of the SimStruct macro ssIsMinorTimeStep.
See LibIsMinorTimeStep in matlabroot/rtw/c/tlc/lib/utillib.tlc.
For use by asynchronous S-Functions with function-call outputs. Asynchronous tasks can manage their own time, and use LibManageAsyncCounter to determine whether a need exists for an asynchronous counter to manage its own timer.
%if LibManageAsyncCounter(block,callIdx) %% %<LibSetAsyncCounter(block,callIdx), CodeGetCounter)>
where CodeGetCounter is target specific code reading hardware timer.
Returns TLC_TRUE if a asynchronous counter is needed to manage its own counter, otherwise TLC_FALSE.
See LibManageAsyncCounter in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For a built-in integer data type, LibMaxIntValue returns the formatted maximum value of that data type.
See LibMaxIntValue in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
For a built-in integer data type, LibMinIntValue returns the formatted minimum value of that data type.
See LibMinIntValue in matlabroot/rtw/c/tlc/lib/dtypelib.tlc.
For use by asynchronous S-functions with function-call outputs. Asynchronous tasks use LibNeedAsyncCounter to determine whether a need exists for an asynchronous counter.
%if LibNeedAsyncCounter(block,0) %<LibSetAsyncCounter(block,0), "tickGet()")>
Returns TLC_TRUE if an asynchronous counter is needed, otherwise TLC_FALSE.
See LibNeedAsyncCounter in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For use by asynchronous S-functions with function-call outputs. Asynchronous tasks can manage their own time. Use LibSetAsyncClockTicks to return code that sets clockTick counters that are to be maintained by the asynchronous task. If the data type of a clockTick counter maintained by the asynchronous task is tSS_TIMER_UINT32_PAIR, the low and high word of the clockTick counter are set.
buf1 — Code that reads the low word of the hardware counter
buf2 — Code that reads the high word of the hardware counter. Leave buf2 empty if hardware counter length is less than 32 bits.
Returns code that sets clockTick counters that are to be maintained by the asynchronous task.
%if LibNeedAsyncCounter(block, callIdx) %<LibSetAsyncCounter(block, 0, buf1, buf2)> %endif
See LibSetAsyncClockTicks in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For use by asynchronous S-functions with function-call outputs. Asynchronous tasks can manage their own time. Use LibSetAsyncCounter to return code that sets a counter variable that is to be maintained by the asynchronous task.
Returns code that sets the counter variable that is to be maintained by the asynchronous task.
%if LibNeedAsyncCounter(block,0) %<LibSetAsyncCounter(block,0, "tickGet()")> %endif
See LibSetAsyncCounter in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
For use by asynchronous S-functions with function-call outputs. Asynchronous tasks can manage their own time. Use LibSetAsyncCounterHigh to return code that sets the higher word of the counter variable that is to be maintained by the asynchronous task.
Returns code that sets the higher word of the counter variable that is to be maintained by the asynchronous task.
%if LibNeedAsyncCounter(block,0) %<LibSetAsyncCounterHigh(block,0, "hightTickGet()")> %endif
See LibSetAsyncCounterHigh in matlabroot/rtw/c/tlc/lib/asynclib.tlc.
Returns a task identifier (TID) if it is in the scope of a subsystem function and can be called before or during TLC generating code.
LibTIDInSystem(system, fcnType)
A record within the global CompiledModel record.
Any of the following: 'Output', 'Update', 'Outputupdate'
This function returns a TID if it is in the scope of a subsystem function and can be called before or during TLC generating code. It returns the TID argument name, if a TID is passed as argument in the system function scope. If TID is not passed as argument in the scope, this function returns:
'0' if model is single tasking.
The TID value of the subsystem if the subsystem is single rate.
A local TID variable name, if the subsystem is multirate. A local TID variable is added to the subsystem code.
Note This function issue an error message if it is called for a reusable subsystem whose instances run at different rates. |
See LibTIDInSystem in matlabroot/rtw/c/tlc/lib/syslib.tlc.
![]() | Sample Time Functions | Advanced Functions | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |