%if EXISTS("_SUTILLIB_") == 0
%assign _SUTILLIB_ = 1
%function SLibSetNeedAbsoluteTime(tid)
%if SLibIsERTCodeFormat()
%assert TYPE(tid) == "Number" && tid >= 0
%assign ::CompiledModel.SampleTime[tid].NeedAbsoluteTime = "yes"
%if ::CompiledModel.SampleTime[tid].TimeSource == "BaseRate"
%<SLibSetNeedAbsoluteTime(0)>
%elseif ::CompiledModel.SampleTime[tid].TimeSource == "Caller"
%<SLibSetNeedAbsoluteTime(FcnGetAsyncPromotedTID(tid))>
%endif
%assign fcnType = ::BlockFcn
%if LibAsynchronousTriggeredTID(tid) && fcnType != "UNKNOWN"
%if fcnType == "Output" || fcnType == "Outputs"
%assign fcnType = "OutputUpdate"
%endif
%assign flagName = "asyncTaskAccessTimeIn%<fcnType>"
%if !ISFIELD(::CompiledModel.SampleTime[tid],flagName)
%addtorecord ::CompiledModel.SampleTime[tid] %<flagName> 1
%endif
%endif
%endif
%return ""
%endfunction
%function LibAsyncTaskAccessTimeInFcn(tid, fcnType)
%if fcnType == "Output" || fcnType == "Outputs"
%assign fcnType = "OutputUpdate"
%endif
%assign flagName = "asyncTaskAccessTimeIn%<fcnType>"
%return ISFIELD(::CompiledModel.SampleTime[tid],flagName) && ...
::CompiledModel.SampleTime[tid].%<flagName>
%endfunction
%function SLibSetNeedFloatAbsoluteTime(tid)
%if SLibIsERTCodeFormat()
%assert TYPE(tid) == "Number" && tid >= 0
%assign ::CompiledModel.SampleTime[tid].NeedAbsoluteTime = "yes"
%assign ::CompiledModel.SampleTime[tid].NeedFloatTime = "yes"
%endif
%return ""
%endfunction
%function SLibNeedAbsoluteTime()
%assign needAbsoluteT = TLC_FALSE
%with ::CompiledModel
%foreach tid = NumSampleTimes
%if SampleTime[tid].NeedAbsoluteTime == "yes"
%assign needAbsoluteT = TLC_TRUE
%break
%endif
%endforeach
%endwith
%return(needAbsoluteT)
%endfunction
%function SLibNeedAbsoluteTimeForTID(tid)
%if TYPE(tid) == "Number" && tid >= 0
%return(::CompiledModel.SampleTime[tid].NeedAbsoluteTime == "yes")
%else
%return(SLibNeedAbsoluteTime())
%endif
%endfunction
%function SLibClockTickIsUnit32Pair(tid)
%assert TYPE(tid) == "Number" && tid >= 0
%return (::CompiledModel.SampleTime[tid].ClockTickDataTypeId == ...
tSS_TIMER_UINT32_PAIR)
%endfunction
%function SLibGetReimAndIdx(sigIdx) void
%assign idxType = TYPE(sigIdx)
%if idxType == "String"
%assign idNum = IDNUM(sigIdx)
%elseif idxType == "Number"
%assign idNum = ["", %<sigIdx>]
%else
%assign errTxt = "The last input argument '%<sigIdx>' is of type " ...
"'%<idxType>', expecting an argument of type /"Number/" or " ...
"/"String/". "
%<LibReportError(errTxt)>
%assign idNum = "error"
%endif
%return idNum
%endfunction
%endif