MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER manuali

Manuali dei proprietari e guide per l'utente per Software MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER.
We fornisce 4 manuali pdf MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER per scaricare gratuitamente in base al tipo di documento: Manuale Utente, Guida Utente, Manuale di Servizio


Indice

External Interfaces

1

How to Contact The MathWorks:

2

Creating Fortran MEX-Files

5

Calling Java from MATLAB

6

Serial Port I/O

10

Contents

12

Calling C and Fortran

13

Programs from MATLAB

13

Introducing MEX-Files

15

MATLAB Data

18

Numeric Matrices

19

MATLAB Strings

19

Sparse Matrices

19

Cell Arrays

20

Structures

20

Multidimensional Arrays

20

Logical Arrays

21

Empty Arrays

21

The explore Example

21

Building MEX-Files

23

Selecting a Compiler

24

Preconfigured Options Files

29

Custom Building MEX-Files

32

Default Options File on UNIX

34

The User Profile Directory

35

Compile Stage

36

Link Stage

36

Build Options

37

Prelink Stage

39

Linking DLLs to MEX-Files

40

Versioning MEX-Files

40

•See the

43

Troubleshooting

44

DLLs Not on Path on Windows

44

General Configuration Problem

45

UNIX only

46

MEX-files only

46

Potential Memory Leaks

52

Additional Information

54

<matlab>/bin

55

<matlab>/extern/include

56

<matlab>/extern/src

56

<matlab>\bin\win32

57

<matlab>\extern\include

58

<matlab>\extern\src

58

Examples From the Text

58

MEX Reference Examples

59

MX Examples

59

Engine and MAT Examples

59

Technical Support

60

Creating C Language

61

C MEX-Files

63

Examples of C MEX-Files

67

that returns the values of

70

Passing Strings

71

The results of this input are

80

Handling Complex Data

81

Handling Sparse Arrays

89

Persistent Arrays

98

Hybrid Arrays

100

Specifying the Function Name

101

Handling Complex Numbers

102

Advanced Topics

103

Building the MEX-File

104

Creating C Language MEX-Files

106

Debugging on UNIX

107

Microsoft Compiler

108

Watcom Compiler

109

Creating Fortran

111

MEX-Files

111

3 Creating Fortran MEX-Files

112

Fortran MEX-Files

113

The Pointer Concept

115

The Gateway Routine

116

Examples of Fortran MEX-Files

119

Passing Matrices

127

Dynamically Allocating Memory

135

Memory Management

147

Compaq Visual Fortran

149

Calling MATLAB from C

151

Using the MATLAB Engine

153

Communicating with MATLAB

154

GUI-Intensive Applications

155

Return continues the program

160

Open field, type

166

OK. This starts MATLAB

166

Setting Runtime Library Path

168

Compiling and Linking

169

Calling Java from

171

5 Calling Java from MATLAB

172

Sources of Java Classes

175

Defining New Java Classes

175

Using the javaObject Function

180

Examples

186

Assigning to a Static Field

187

Working with Java Arrays

199

Array Access from Java

201

Array Access from MATLAB

201

Array One-dimensional Array

201

Array Indexing

202

The Shape of the Java Array

202

Using the javaArray Function

204

Using the Colon Operator

207

Using END in a Subscript

209

Assigning to a Linear Array

211

Assigning the Empty Matrix

211

Subscripted Deletion

212

Concatenating Java Arrays

213

Passing Data to a Java Method

216

Passing String Arguments

219

Passing Strings in an Array

220

Passing Objects in an Array

222

Other Data Conversion Topics

223

Empty Matrices and Nulls

224

Built-In Data Types

227

Java Objects

227

Example – Reading a URL

233

1. Construct a URL Object

233

Running the Example

237

3. Open the Serial Port

239

4. Configure the Serial Port

240

10. Close the Serial Port

241

3. Create a Hash Table

245

4. Create a File Input Stream

245

1. Input the Entry to Add

249

Running the phonebook Program

253

Importing and Exporting

257

Importing and Exporting Data

258

Using MAT-Files

259

Exporting Data from MATLAB

260

Use the Save command

261

Use MATLAB I/O functions

261

MAT-File Interface Library

262

Finding Associated Files

264

Include Files

265

Libraries

265

Example Files

265

Examples of MAT-Files

267

Reading a MAT-File in C

272

Reading a MAT-File in Fortran

280

Using the Options File

286

ActiveX and DDE Support

287

7 ActiveX and DDE Support

288

ActiveX Interfaces

289

MATLAB ActiveX Client Support

292

Creating ActiveX Objects

292

Manipulating the Interface

292

Writing Event Handlers

294

Converting Data

297

MATLAB Sample Control

299

% Workbook.Saved = 1;

301

% Quit Excel

301

Dynamic Data Exchange (DDE)

309

The Service Name

310

The Topic

310

The Item

310

Clipboard Formats

310

Accessing MATLAB As a Server

311

MATLAB System Topic

312

MATLAB Engine Topic

313

Requesting Data from MATLAB

314

Sending Data to MATLAB

315

Using MATLAB As a Client

317

Introduction

322

Overview of the Serial Port

324

8 Serial Port I/O

326

Signal States

328

The Data Pins

329

The Control Pins

329

Bytes Versus Values

331

How Are the Bits Transmitted?

332

Start and Stop Bits

333

Data Bits

333

The Parity Bit

334

Windows Platform

335

UNIX Platform

336

Selected Bibliography

337

, or readasync function

339

Configuring Property Values

342

Specifying Property Names

343

Default Property Values

343

Creating a Serial Port Object

344

Connecting to the Device

347

function

349

Writing Data

351

Writing and Reading Data

353

Writing Text Data

354

Writing Binary Data

356

Reading Text Data

359

A read operation with fscanf

361

, then you must issue the

362

. RS232?

364

Example: Reading Binary Data

365

Viewing the Bitmap Data

366

Events and Callbacks

368

MATLAB workspace

375

Using Control Pins

376

Hardware Handshaking

379

Software Handshaking

380

End the serial port session

383

The Record File Contents

386

Saving and Loading

388

Disconnecting and Cleaning Up

389

Property Reference

390

Serial Port Object Properties

391

Index

395

Indice

Real-Time Workshop

1

How to Contact The MathWorks:

2

Targeting Custom Hardware

12

Real-Time Workshop Libraries

13

Contents

14

Real-Time Workshop Ada Coder

15

Glossary

16

Foreword

17

Foreword

18

What Is MATLAB?

19

What Is Simulink?

20

What Is Stateflow?

21

How to Use This Guide

23

Boldface with an

23

File menu

23

Installation

24

System,gototheEnvironment

25

Where to Go from Here

27

Introduction to the

29

The Real-Time Workshop

31

Types of Output

32

The Rapid Prototyping Process

34

Using External Mode

37

Modeling Systems in Simulink

38

Algorithm Design and Analysis

39

Target Language Compiler

42

Make Utility

42

S-Functions

43

The Build Procedure

43

Basic Features of example.rtw

45

Basic Features of example.c

47

Bundled Target Systems

48

Getting Started with the

51

2. Customizing Generated Code

54

3. Optimizing Generated Code

55

4. Validating Generated Code

55

8. Code Tracing

56

9. Automatic Build Procedure

56

10. Parameter Tuning

56

Simulation Parameters dialog

58

The Build Process

59

Specifying Model Parameters

60

The Simulink Model

62

Setting Program Parameters

64

Customizing the Build Process

66

Inline parameters check

66

Data Logging

67

The UNIX Template Makefile

68

PC Template Makefiles

69

Generic Real-Time Modules

70

Continuous Blocks

71

Discrete Blocks

71

Nonlinear Blocks

71

Analyzing Data with MATLAB

76

Tracing Generated Code Back

76

Targeting dSPACE

78

Motherboard “host”

79

Embedded cards

79

(target system)

79

PC chassisMonitor/keyboard

79

Real-Time Interface (RTI)

80

Code Generation and the

83

Build Process

83

Automatic Program Building

85

Build button on the

85

Inline Parameters

92

Retaining the model.rtw File

93

Template Makefile

93

Make Command

93

Options Button

97

System Target File Browser

98

S3 in this block

99

S3 in the generated

99

Tunable Parameters

100

Signal Properties

101

.tlc) files. These files are

104

Template Makefiles

105

Make Utilities

108

Simulation

109

Parameters

109

Generic Real-Time Templates

114

File and Function Splitting

120

Code Generation Options

122

Function Management pull-down

122

Function Split Threshold

122

External Mode

125

Introduction

126

4 External Mode

130

Signals & Triggering

131

-tf switch overrides the

133

A and B.WithA=2 and B=3,the

133

External Mode GUI

134

External Mode Control Panel

134

Target Interface

135

Data Archiving

139

Update Diagram

142

Using the TCP Implementation

146

External Target

146

Interface

146

External

148

MEX-File Optional Arguments

148

Options on the Real-Time

149

Possible Error Conditions

150

Data Logging and Signal

153

Monitoring

153

MAT-File Data Logging

154

Make command

154

To File Block MAT-Files

154

C API for Signal Monitoring

156

Program Architecture

163

Model Execution

166

SimStruct,but

187

The main Function

189

Initialization

189

Program Termination

190

Components

190

The SimStruct Data Structure

194

— MdlInitializeSampleTimes

195

Inlining S-Functions

196

Embedded Program Framework

198

Models with Multiple

201

Sample Rates

201

Solver options pull-down

203

Executing Multitasking Models

205

Lowest Priority

206

Highest Priority

206

Singletasking

208

Executing Models in Real-Time

209

Multitasking Operation

210

Singletasking Operation

210

Sample Rate Transitions

211

T=1sec T=2sec

212

T=2s T=1s

212

T=1sT=1s T=1s

212

T=2sT=1s

212

Unit Delay

218

Targeting Tornado for

219

Real-Time Applications

219

VxWorks Support library

221

Help button on the

222

WindSh (the

223

StethoScope

226

Host Processes

227

VxWorks Tasks

227

Implementation Overview

229

VxWorks Configuration

231

Downloading Configuration

232

Simulation menu:

233

Step Size

233

Initiating the Build

236

Running the Program

237

Targeting DOS for

241

Hardware Requirements

246

Software Requirements

246

Device Drivers

246

Simulink Host

247

Modifying Program Timing

248

Device Driver Blocks

249

'0x300')

252

[-10 10] volts. Refer

252

[lo hi],for

254

Including Device Driver Code

255

Building the Program

256

Targeting Custom

259

Hardware

259

Run-Time Interface

262

Implementing Device Drivers

265

Required Functions

267

S_FUNCTION_NAME Definition

269

Level 2 S-Function Definition

269

Defining the SimStruct

269

Initializing Sample Times

273

Initializing the I/O Device

274

Accessing the Hardware

275

ADC Outputs

275

DAC Outputs

275

The Termination Function

276

Libraries

279

Custom Code Library

282

MdlStart

284

Function Custom Code

284

Interrupt Handling

287

Rate Transition Block Example

302

Library for Your System

303

Configuring Real-Time

305

Workshop for Your

305

Application

305

Real-Time Code Format

314

Real-Time malloc Code Format

316

Embedded-C Code Format

318

Local block outputs

319

Unsupported Blocks

320

System Target File

320

S-Function Code Format

322

Restrictions

324

General Modeling Techniques

325

Stateflow Optimizations

326

Simulation Parameters

326

Diagnostic Page

327

Real-Time Workshop Page

327

Compiler Options

329

Rapid Simulation Target

331

Browse button and

334

System Target

334

File Browser

334

Build buttonontheReal-Time

336

Simulation Performance

343

Carlo simulations

344

Ada Coder

345

Getting Started

350

Generating Ada Code

352

Generated Files

353

Parameters field blank)

354

Generating the Ada Code

355

Signal_Name is declared in

360

Code Validation

362

Supported Blocks

365

Directory Tree

369

Directory Purpose

374

B Glossary

378

See Rsim 13-2

384

SimStruct data structure

385

Indice

SIMULINK

1

How to Contact The MathWorks:

2

Contents

3

Introduction

10

Real-Time Workshop

12

Target Language Compiler

12

A Basic Example

13

System Target Files

18

Block Target Files

19

Where to Go from Here

20

Working with the

21

Target Language

21

The model.rtw File

23

Compiler Directives

26

Conditional inclusion

27

Multiple inclusion

27

Object-oriented

27

Comments

28

Line Continuation

29

Target Language Values

30

Target Language Expressions

33

Formatting

37

Conditional Inclusion

38

%foreach

39

Output File Control

47

Input File Control

48

Built-In Functions and Values

49

FEVAL Function

55

Macro Definition

57

Identifier Definition

57

Creating Records

59

Variable Scoping

62

Target Language Functions

64

Filenames and Search Paths

71

Target Language Debug Mode

71

Writing Target

75

Language Files

75

Block Functions

81

Coding Conventions

82

Writing a Block Target File

89

BlockTypeSetup(block, system)

90

Enable(block, system)

91

Disable(block, system)

91

Start(block, system)

92

Outputs(block, system)

92

Update(block, system)

93

Derivatives(block, system)

93

Terminate(block, system)

93

LibCacheDefine(buffer)

96

LibIsDiscrete(tid)

96

Writing Target Language Files

100

The RTW TLC Function Library

101

STRINGOF(value)

104

EXISTS("name")

104

SIZE(value, n)

104

Inlining an S-Function

105

An Example

106

Unnecessary call to

108

in foogain.c

108

Configurable RTW Variables

114

Matrix Parameters in RTW

115

Loop Rolling

118

Function Library Reference

123

LibBlockFunctionExists

124

LibBlockInputSignal

125

LibBlockIWork

126

LibBlockMatrixParameterAddr

127

LibBlockMatrixParameter

128

LibBlockMode

129

LibBlockOutportLocation

130

LibBlockOutputSignal

132

LibBlockParameter

133

LibBlockParameterAddr

135

LibBlockPWork

136

LibBlockRWork

137

LibBlockSrcSignalIsDiscrete

138

LibCacheDefine

139

LibCacheFunctionPrototype

140

LibCacheGlobalPrmData

141

LibCacheInclude

142

LibCacheNonFiniteAssignment

143

LibContinuousState

144

LibControlPortInputSignal

145

LibConvertZCDirection

146

Arguments

146

Description

146

LibDataInputPortWidth

147

LibDataOutputPortWidth

148

LibDataStoreMemory

149

LibDeclareRollVariables

150

See Also

151

LibDefineIWork

152

LibDefinePWork

153

LibDefineRWork

154

into block states

155

LibExternalResetSignal

156

LibHeaderFileCustomCode

157

LibIndexStruct

158

LibIsDiscrete

159

LibIsEmpty

160

LibIsEqual

161

LibIsFinite

162

LibMapSignalSource

163

LibMaxBlockIOWidth

164

LibMaxDataInputPortWidth

165

LibMaxDataOutputPortWidth

166

LibMdlRegCustomCode

167

LibMdlStartCustomCode

168

LibMdlTerminateCustomCode

169

LibOptionalMatrixWidth

170

LibOptionalVectorWidth

171

LibPathName

172

LibPrevZCState

173

LibPrmFileCustomCode

174

LibRegFileCustomCode

175

LibRenameParameter

176

LibSourceFileCustomCode

177

LibSystemDerivativeCustomCode

178

LibSystemDisableCustomCode

179

LibSystemEnableCustomCode

180

LibSystemInitializeCustomCode

181

LibSystemOutputCustomCode

182

LibSystemUpdateCustomCode

183

Model.rtw File Contents

186

SampleTime {

189

]. Only written if

193

Parameter {

211

ColIdxOfNonZeroD

237

D matrix

237

Error Messages

239

Ambiguous reference to

242

Unrecognized type "

259

" for function

259

Unterminated string

259

option if the variable does

261

Library Error Messages

263

Invalid location:

267

See model.rtw

276





Più prodotti e manuali per Software MATLAB

Modelli Tipo di Documento
XPC TARGET RELEASE NOTES Guida Utente   MATLAB XPC TARGET RELEASE NOTES User`s guide, 531 pagine
CURVE FITTING TOOLBOX - RELEASE NOTES Guida Utente   MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES User`s guide, 216 pagine
SIMULINK 7 - GRAPHICAL USER INTERFACE Specifiche   MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Specifications, 180 pagine
POLYSPACE RELEASE NOTES Manuale Utente   Getting Started with MATLAB 7 [en] , 240 pagine
SIGNAL PROCESSING BLOCKSET 7 Guida Utente   MATLAB SIGNAL PROCESSING BLOCKSET 7 User`s guide [en] , 738 pagine
BUILDER EX 1 Guida Utente   MATLAB BUILDER EX 1 User`s guide, 182 pagine
APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guida Utente   MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE User`s guide [en] , 354 pagine
EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Guida Utente   MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO User`s guide, 575 pagine
APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guida Utente   MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE User`s guide, 274 pagine
SIMULINK 7 - GRAPHICAL USER INTERFACE Manuale Utente   MATLAB Creating Graphical User Interfaces, 500 pagine
MAPPING TOOLBOX RELEASE NOTES Guida Utente   MATLAB MAPPING TOOLBOX RELEASE NOTES User`s guide, 160 pagine
IMAGE ACQUISITION TOOLBOX - RELEASE NOTES Guida Utente   MATLAB IMAGE ACQUISITION TOOLBOX - RELEASE NOTES User`s guide, 172 pagine
SIMULINK 3D ANIMATION - S Guida Utente   MATLAB SIMULINK 3D ANIMATION - S User`s guide, 490 pagine
MATLAB REPORT GENERATOR - RELEASE NOTES Guida Utente   MATLAB MATLAB REPORT GENERATOR - RELEASE NOTES User`s guide, 986 pagine
PARALLEL COMPUTING TOOLBOX - S Guida Utente   MATLAB PARALLEL COMPUTING TOOLBOX - S User`s guide, 656 pagine
EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Guida Utente   MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO User`s guide, 112 pagine
DO QUALIFICATION RELEASE NOTES Manuale Utente   FS-K96 Release Notes V3.5, 15 pagine
FINANCIAL DERIVATIVES TOOLBOX Manuale Utente   Introductory Course to Matlab with Financial Case Studies, 119 pagine
SIMEVENTS RELEASE NOTES Guida Utente   MATLAB SIMEVENTS RELEASE NOTES User guide, 114 pagine
SIGNAL PROCESSING TOOLBOX 6 Manuale Utente   Signal Processing Toolbox Getting Started Guide, 60 pagine