Print Preview C:\TEMP\Apdf_2541_3068\home\AppData\Local\PTC\Arbortext\Editor\.aptcache\ae1qwjtr/tf1qwcnj Simulink Coder User's Guide
User Manual:
Open the PDF directly: View PDF
Page Count: 1365 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- toc
- Check Bug Reports for Issues and Fixes
- Model Architecture and Design
- Modeling
- Configure a Model for Code Generation
- Scheduling
- About Scheduling
- Single-Tasking and Multitasking Execution Modes
- About Tasking Modes
- Execute Multitasking Models
- Multitasking and Pseudomultitasking Modes
- Build a Program for Multitasking Execution
- Single-Tasking Mode
- Build a Program for Single-Tasking Execution
- Model Execution and Rate Transitions
- Simulate Models with the Simulink Product
- Execute Models in Real Time
- Single-Tasking Versus Multitasking Operation
- Handle Rate Transitions
- Single-Tasking and Multitasking Model Execution
- Handle Asynchronous Events
- About Asynchronous Events
- Handling Interrupts
- Connecting the Async Interrupt Block
- Requirements and Restrictions
- Performance Considerations
- Using the Async Interrupt Block in Simulation and Code Generatio
- Dual-Model Approach: Simulation
- Dual-Model Approach: Code Generation
- Initialization Code
- Generated ISR Code
- Model Termination Code
- Initialization Code
- Task and Task Synchronization Code
- Task Termination Code
- Rate Transitions and Asynchronous Blocks
- Use Timers in Asynchronous Tasks
- Create a Customized Asynchronous Library
- C MEX Block Implementation
- ssSetAsyncTimerAttributes
- ssSetAsyncTaskPriorities
- SS_OPTION Settings
- TLC Implementation
- Generate #include Directives
- BlockInstanceSetup Function
- Outputs Function
- Start Function
- Terminate Function
- C MEX Block Implementation
- TLC Implementation
- Generate #include Directives
- BlockInstanceSetup Function
- Start Function
- Outputs Function
- Terminate Function
- Import Asynchronous Event Data for Simulation
- Asynchronous Support Limitations
- Timers
- Configure Scheduling
- Supported Products and Block Usage
- Modeling Semantic Considerations
- Subsystems
- Code Generation of Subsystems
- Generate Code and Executables for Individual Subsystem
- Inline Subsystem Code
- Generate Subsystem Code as Separate Function and Files
- Generate Reusable Function for Identical Subsystems Within a Mod
- Optimize Code for Identical Nested Subsystems
- Generate Reusable Code for Subsystems Containing S-Function Bloc
- Generate Reusable Code from Stateflow Charts
- Code Reuse Limitations for Subsystems
- Code Reuse For Subsystems Shared Across Referenced Models
- Reusable Library Subsystem
- Code Generation of Constant Parameters
- Shared Constant Parameters for Code Reuse
- Generate Reusable Code for Subsystems Shared Across Models
- Create a reusable library subsystem.
- Create the example model.
- Set configuration parameters of the top model.
- Create and propagate a configuration reference.
- Generate and view the code.
- Determine Why Subsystem Code Is Not Reused
- Referenced Models
- Code Generation for Referenced Models
- Generate Code for Referenced Models
- Project Folder Structure for Model Reference Targets
- Configure Referenced Models
- Build Model Reference Targets
- Simulink Coder Model Referencing Requirements
- Storage Classes for Signals Used with Model Blocks
- Inherited Sample Time for Referenced Models
- Customize Library File Suffix and File Type
- Reusable Code and Referenced Models
- Simulink Coder Model Referencing Limitations
- Combined Models
- Configure Model Parameters
- Platform Options for Development and Deployment
- Configure Emulation and Embedded Target Hardware
- Configure Embedded Hardware Characteristics
- Configure Emulation Hardware Characteristics
- Control the Location for Generated Files
- Control Generated Files Location Used for Simulation
- Control the Location for Code Generation Files
- Override Build Folder Settings for Current Session
- Model Protection
- Modeling
- Data, Function, and File Definition
- Data Representation
- Enumerations
- Structure Parameters and Generated Code
- Parameters
- About Parameters
- Nontunable Parameter Storage
- Tunable Parameter Storage
- Tunable Parameter Storage Classes
- Declare Tunable Parameters
- Tunable Expressions
- Linear Block Parameter Tunability
- Configuration Parameter Quick Reference Diagram
- Generated Code for Parameter Data Types
- Tunable Workspace Parameter Data Type Considerations
- Tune Parameters
- Parameter Objects
- About Parameter Objects for Code Generation
- Use Parameter Objects for Code Generation
- Configure Parameter Objects for Code Generation
- Storage Classes and Code Generation for Parameter Objects
- Generate Code for Parameter Objects from Command Line
- Generate Code for Parameter Objects Using Model Explorer
- Parameter Object Configuration Quick Reference Diagram
- Resolve Conflicts in Parameter Object Configurations
- Structure Parameters and Generated Code
- Signals
- About Signals
- Signal Storage Concepts
- Signals with Auto Storage Class
- Signals with Test Points
- Interface Signals to External Code
- Symbolic Naming Conventions for Signals
- Summary of Signal Storage Class Options
- Interfaces for Monitoring Signals
- Signal Objects
- About Signal Objects for Code Generation
- Use Signal Objects for Code Generation
- Configure Signal Objects for Code Generation
- Storage Classes and Code Generation for Signal Objects
- Generate Code for Signal Objects from Command Line
- Generate Code for Signal Objects Using Model Explorer
- Resolve Conflicts in Configuration of Signals Objects
- Initialize Signals and States Using Signal Objects
- States
- Data Stores
- Entry Point Functions and Scheduling
- Entry Point Functions and Scheduling
- About Model Execution
- Non-Real-Time Single-Tasking Systems
- Non-Real-Time Multitasking Systems
- Real-Time Single-Tasking Systems
- Real-Time Multitasking Systems
- Multitasking Systems Using Real-Time Tasking Primitives
- Program Timing
- Program Execution
- External Mode Communication
- Data Logging in Single-Tasking and Multitasking Model Execution
- Rapid Prototyping and Embedded Model Execution Differences
- Rapid Prototyping Model Functions
- Embedded Model Functions
- Data Representation
- Code Generation
- Configuration
- Configuring a Model for Code Generation
- Code Generation Configuration
- Open the Model Configuration for Code Generation
- Configure a Model Programmatically
- Step 1. Open a model.
- Step 2. Get the active configuration set.
- Step 3. Select the Generic Real-Time (GRT) target.
- Step 4. Modify parameters to optimize execution speed.
- Step 5. Save the model configuration to a file.
- Application Objectives
- Target
- Hardware Targets
- Available Targets
- About Targets and Code Formats
- Types of Target Code Formats
- Targets and Code Formats
- Targets and Code Styles
- Backwards Compatibility of Code Formats
- Selecting a Target
- Template Makefiles and Make Options
- Custom Targets
- Describing the Emulation and Embedded Targets
- Describing Embedded Hardware Characteristics
- Describing Emulation Hardware Characteristics
- Specifying Target Interfaces
- Selecting and Viewing Code Replacement Libraries
- Select the Target Language
- Code Appearance
- Debug
- Configuring a Model for Code Generation
- Source Code Generation
- Initiate Code Generation
- Reload Generated Code
- Generated Source Files and File Dependencies
- Files and Folders Created by Build Process
- How Code Is Generated From a Model
- Code Generation of Matrices and Arrays
- Shared Utility Code
- Generating Code Using Simulink Coder™
- Report Generation
- Reports for Code Generation
- HTML Code Generation Report Location
- HTML Code Generation Report for Referenced Models
- Generate a Code Generation Report
- Generate Code Generation Report After Build Process
- Open Code Generation Report
- Generate Code Generation Report Programmatically
- Search in the Code Generation Report
- View Code Generation Report in Model Explorer
- Package and Share the Code Generation Report
- Document Generated Code with Simulink Report Generator
- Configuration
- Deployment
- Desktops
- Rapid Simulations
- About Rapid Simulation
- Rapid Simulation Performance
- General Rapid Simulation Workflow
- Identify Rapid Simulation Requirements
- Configure Inports to Provide Simulation Source Data
- Configure and Build Model for Rapid Simulation
- Set Up Rapid Simulation Input Data
- Scripts for Batch and Monte Carlo Simulations
- Run Rapid Simulations
- Using the RSim target, you can build a model once and run multip
- Requirements for Running Rapid Simulations
- Set a Clock Time Limit for a Rapid Simulation
- Override a Model Simulation Stop Time
- Read the Parameter Vector into a Rapid Simulation
- Specify New Signal Data File for a From File Block
- Specify Signal Data File for an Inport Block
- Change Block Parameters for an RSim Simulation
- Specify a New Output File Name for a Simulation
- Specify New Output File Names for To File Blocks
- Rapid Simulation Target Limitations
- Generated S-Function Block
- About Object Libraries
- Create S-Function Blocks from a Subsystem
- Tunable Parameters in Generated S-Functions
- System Target File and Template Makefiles
- Checksums and the S-Function Target
- S-Function Target Limitations
- Limitations on Using Tunable Variables in Expressions
- Run-Time Parameters and S-Function Compatibility Diagnostics
- Limitations on Using Goto and From Block
- Limitations on Building and Updating S-Functions
- Unsupported Blocks
- SimState Not Supported for Code Generation
- Profiling Code Performance Not Supported
- Limitations on Nesting S-Functions
- Limitations on User-Defined Data Types
- Limitation on Right-Click Generation of an S-Function Target
- Limitation on S-Functions with Bus I/O Signals
- Limitation on Subsystems with Function-Call I/O Signals
- Rapid Simulations
- Real-Time Systems
- External Code Integration
- Integration Options
- Reuse Algorithmic Components in Generated Code
- Deploy Algorithm Code Within a Target Environment
- Export Generated Algorithm Code for Embedded Applications
- Export Algorithm Executables for System Simulation
- Modify External Code for Language Compatibility
- Automate S-Function Generation
- Integrate External Code Using Legacy Code Tool
- Configure Model for External Code Integration
- Insert Custom Code Blocks
- Insert S-Function Code
- About S-Functions and Code Generation
- Write Noninlined S-Functions
- Write Wrapper S-Functions
- Write Fully Inlined S-Functions
- Write Fully Inlined S-Functions with mdlRTW Routine
- Guidelines for Writing Inlined S-Functions
- Write S-Functions That Support Expression Folding
- S-Functions That Specify Port Scope and Reusability
- S-Functions That Specify Sample Time Inheritance Rules
- S-Functions That Support Code Reuse
- S-Functions for Multirate Multitasking Environments
- Build Support for S-Functions
- Program Building, Interaction, and Debugging
- Compiler or IDE Selection and Configuration
- Choose and Configure a Compiler
- Compilers and the Build Process
- Simulink Coder and ANSI C/C++ Compliance
- Support for C and C++ Code Generation
- Support for International (Non-US-ASCII) Characters
- C++ Target Language Considerations
- Choose and Configure Compiler on Microsoft Windows
- Choose and Configure Compiler on UNIX
- Include S-Function Source Code
- Troubleshoot Compiler Configurations
- Choose and Configure a Compiler
- Program Builds
- Build and Run a Program
- Profile Code Performance
- Data Exchange
- Host/Target Communication
- Logging
- Parameter Tuning
- Data Interchange Using the C API
- ASAP2 Data Measurement and Calibration
- Direct Memory Access to Generated Code
- Compiler or IDE Selection and Configuration
- Desktops
- Performance
- Optimizations for Generated Code
- Defensive Programming
- Data Copy Reduction
- Execution Speed
- Memory Usage
- Verification
- Customization
- Build Process Integration
- Control Build Process Compiling and Linking
- Cross-Compile Code Generated on Microsoft Windows
- Control Library Location and Naming During Build
- Recompile Precompiled Libraries
- Customize Post-Code-Generation Build Processing
- Configure Generated Code with TLC
- Customize Build Process with STF_make_rtw_hook File
- Customize Build Process with sl_customization.m
- About sl_customization.m
- Register Build Process Hook Functions Using sl_customization.m
- Variables Available for sl_customization.m Hook Functions
- Example Build Process Customization Using sl_customization.m
- Example 1: sl_customization.m for Simulink Coder Build Process C
- Example 2: CustomRTWEntryHook.m
- Example 3: CustomRTWPostProcessHook.m
- Replace the STF_rtw_info_hook Mechanism
- Customize Build to Use Shared Utility Code
- Run-Time Data Interface Extensions
- Customize an ASAP2 File
- Create a Transport Layer for External Communication
- Custom Target Development
- About Embedded Target Development
- Sample Custom Targets
- Target Development Mechanics
- Folder and File Naming Conventions
- Components of a Custom Target
- Key Folders Under Target Root (mytarget)
- Key Files in Target Folder (mytarget/mytarget)
- Additional Files for Externally Developed Targets
- Target Development and the Build Process
- Customize System Target Files
- Customize Template Makefiles
- Template Makefiles and Tokens
- Invoke the make Utility
- Structure of the Template Makefile
- Customize and Create Template Makefiles
- Support Optional Features
- Interface to Development Tools
- Device Drivers and Target Preferences
- Build Process Integration
- Desktop IDEs and Desktop Targets
- Project and Build Configurations for Desktop Targets
- Model Setup
- Block Selection
- Target Preferences
- Configuration Parameters
- What are Configuration Parameters?
- Setting Model Configuration Parameters
- Build format
- Build action
- Overrun notification
- Function name
- Configuration
- Compiler options string
- Linker options string
- System stack size (MAUs)
- Link Automation
- Maximum time allowed to build project (s)
- Maximum time allowed to complete IDE operation (s)
- Export IDE link handle to base workspace
- IDE link handle name
- Source file replacement
- Model Reference
- IDE Projects
- Makefiles for Software Build Tool Chains
- Model Setup
- Verification Code Generated for Desktop Targets
- Working with Eclipse IDE
- Working with Linux Target
- Working with Microsoft Windows Target
- Project and Build Configurations for Desktop Targets
- Examples
- Index
- tables
- Execution Order and Sample Times (Single-Tasking)
- Task Allocation of Blocks in Multitasking Execution
- Supported Sample Time and Priority for Function Call Subsystem w
- Summary of asynclib.tlc Library Functions
- Additional Math and Discrete: Additional Discrete
- Additional Math and Discrete: Increment/Decrement
- Continuous
- Discontinuities
- Discrete
- Logic and Bit Operations
- Lookup Tables
- Math Operations
- Model Verification
- Model-Wide Utilities
- Ports & Subsystems
- Signal Attributes
- Signal Routing
- Sinks
- Sources
- User-Defined
- Configuration Requirements for Model Referencing with All System
- Configuration Requirements for Model Referencing with ERT System
- Relationships of Signals and Storage Classes Between Parent and
- Targets Available from the System Target File Browser
- Features Supported by Simulink Coder Targets and Code Formats
- Macros for Accessing the Real-Time Model Data Structure
- Code Styles Listed by Target
- Comparison of Features Licensed with the Simulink Coder Product
- System Header Files
- Simulink Coder Header Files
- Types of Output Expressions
- External Mode Command-Line Parameters
- Differences Between ASAP2 and Simulink Parameter and Signal Obje
- Target Language Compiler Optional Variables
- Built-In Transport Layer Implementations
- MATLAB Commands to Rebuild ext_comm and ext_serial_win32 MEX-Fil
- Execution Support Files
- rtwoptions Structure Fields Summary
- Template Makefile Tokens Expanded by make_rtw