The increasing complexity of control systems in automation and the verification of compliance with safety standards, require system wide, device spanning modeling of functions. Such models can be expressed with the help of UML in the form of component and class diagrams as well as state charts. In this book an UML Profile is defined, which both restricts and extends UML to model function in the rolling stock domain appropriately. In addition, concepts to describe the quality of service aspects like time constraints and fault tolerance are added to the Profile (based on the UML Profile for Modeling Quality of Service and Fault Tolerance Characteristics and Mechanisms, defined by the OMG). A generator is realized for the defined language, which is able to check UML models for conformance to the Profile and to map conforming models to the target language 'Structured Text'. Mechanisms which allow traceability of single code fragments into the model are used during the generation.