Writing S-Functions | ![]() ![]() |
Introduction |
Describes various approaches to writing S-functions for the Real-Time Workshop. |
Noninlined S-Functions |
Explains the noninlined approach to writing S-functions for the Real-Time Workshop. |
Writing Wrapper S-Functions |
Creating S-functions that serve as wrappers for existing code. |
Fully Inlined S-Functions |
Explains the inlined approach to writing S-functions for the Real-Time Workshop. |
Fully Inlined S-Function with the mdlRTW Routine |
How to use the mdlRTW callback method in an inlined S-function. |
Creating Code-Reuse-Compatible S-Functions |
How to create S-functions that are compatible with the Real-Time Workshop's subsystem code reuse feature. |
Introduction
This chapter describes how to create S-functions that work seamlessly with the Real-Time Workshop. It begins with basic concepts and concludes with an example of how to create a highly optimized direct-index lookup table S-Function block.
This chapter assumes that you understand these concepts:
See the Target Language Compiler Reference Guide and the Real-Time Workshop User's Guide for more information about these subjects.
A note on terminology: when this chapter refers to actions performed by the Target Language Compiler, including parsing, caching, creating buffers, etc., the name Target Language Compiler is spelled out fully. When referring to code written in the Target Language Compiler syntax, this chapter uses the abbreviation TLC.
![]() | Example of a Time-Varying Continuous Transfer Function | Classes of Problems Solved by S-Functions | ![]() |