MATLAB dSPACE
MATLAB dSPACE
MATLAB-dSPACE
Interface Libraries
Release 7.1 May 2011
dSPACE GmbH
Rathenaustrae 26
33102 Paderborn
Germany
Tel.:
Fax:
E-mail:
Web:
http://www.dspace.com
Important Notice
This document contains proprietary information that is protected by copyright. All rights
are reserved. Neither the documentation nor software may be copied, photocopied,
reproduced, translated, or reduced to any electronic medium or machine-readable form, in
whole or in part, without the prior written consent of dSPACE GmbH.
Copyright 1998 - 2011 by:
dSPACE GmbH
Rathenaustrae 26
33102 Paderborn
Germany
This publication and the contents hereof are subject to change without notice.
AutomationDesk, CalDesk, ConfigurationDesk, ControlDesk, SystemDesk and TargetLink
are registered trademarks of dSPACE GmbH in the United States or other countries, or
both. Other brand names or product names are trademarks or registered trademarks of
their respective companies or organizations.
Contents
7
Document Symbols and Conventions ....................................... 7
Accessing Online Help and PDF Files......................................... 8
Related Documents .................................................................. 9
Introduction to MLIB/MTRACE
11
Basics of MLIB/MTRACE.......................................................... 11
Installation
13
System Requirements ............................................................. 13
Installation Process ................................................................. 14
Demo Files ............................................................................. 15
Getting Started
17
Preparing Real-Time Applications ........................................... 18
Typical Calling Sequences of MLIB/MTRACE Commands.......... 19
23
Basic Principles of Using Multiprocessor Systems .................... 24
Data Capture With Different Sampling Periods or
Asynchronous ........................................................................ 27
MLIB/MTRACE Functions
31
General Information on the Function Reference............................... 32
Naming Conventions.............................................................. 32
MLIB/MTRACE Function Reference .................................................. 33
CaptureState.......................................................................... 34
FetchData .............................................................................. 36
Get ........................................................................................ 40
GetApplInfo ........................................................................... 42
GetBoardInfo ......................................................................... 44
GetMapVar ............................................................................ 45
GetTrcVar ............................................................................... 47
Intrpt ..................................................................................... 51
May 2011
Contents
IsApplRunning ....................................................................... 52
LoadFile ................................................................................. 53
LoadVarFile ............................................................................ 55
LockProgram.......................................................................... 56
Multiprocessing ..................................................................... 57
Read ...................................................................................... 57
SearchMap ............................................................................ 59
SearchTrc ............................................................................... 60
SelectBoard............................................................................ 61
Set......................................................................................... 62
SetVarProperty ....................................................................... 67
StartCapture .......................................................................... 69
StopCapture .......................................................................... 71
TriggerState ........................................................................... 72
UnlockProgram ...................................................................... 73
Write ..................................................................................... 73
MLIB/MTRACE Programming
75
Programming Instructions ............................................................... 76
Multiple MLIB/MTRACE Data Captures in One Real-Time
Application ............................................................................ 76
Locking the Real-Time Program.............................................. 77
Accessing Matrices with MLIB/MTRACE........................................... 78
Built-in Simulink Blocks .......................................................... 79
2-D Look-Up Tables................................................................ 79
S-Functions ............................................................................ 79
mlib_1dlookup ...................................................................... 80
mlib_2dlookup ...................................................................... 83
mlib_matrix............................................................................ 86
MLIB/MTRACE Programming Examples ........................................... 88
MLIB/MTRACE with Handcoded Applications ......................... 89
MLIB/MTRACE with dSPACE RTI ............................................. 93
Additional MLIB/MTRACE Programming Examples.................. 96
MLIB/MTRACE with dSPACE RTI-MP ....................................... 97
File Reference
101
MAT File Generated by MLIB/MTRACE.................................. 101
Utilities
103
Basics on the TrcView Utility ................................................. 103
How to Use TrcView............................................................. 104
May 2011
Contents
Limitations
107
Accessing Variables with Read/Write Functions..................... 108
Number of Applications Simultaneously Accessing the
Hardware............................................................................. 108
Number of Platforms Simultaneously Accessed by
MLIB/MTRACE...................................................................... 108
Troubleshooting
109
MLIB/MTRACE Error Messages.............................................. 109
Invalid Variable Connections When Migrating to MATLAB R2011a
125
Appendix
127
MLIB/MTRACE Benchmarks .................................................. 127
Impact of MLIB/MTRACE on Execution Time ......................... 130
Index
133
May 2011
Contents
May 2011
Related Documents
May 2011
Naming conventions
After you install your dSPACE software, the documentation for the
installed products is available as online help and Adobe PDF files.
Online help
May 2011
PDF Files
Related Documents
Below is a list of documents that you are recommended to also read
when working with MLIB/MTRACE.
Information in other documents
Interface libraries
MLIB/MTRACE MATLAB-dSPACE Interface Libraries
ControlDesk
ControlDesk Next Generation
AutomationDesk
RTI and RTLib
May 2011
10
May 2011
Introduction to MLIB/MTRACE
Basics of MLIB/MTRACE
The MATLAB-dSPACE Interface Libraries give you access to dSPACE
real-time processor hardware from the MATLAB workspace.
MLIB/MTRACE functions can be called from the MATLAB Command
Window or from MATLAB M files. Thus the powerful numerical tools
running under MATLAB can be used in combination with
MLIB/MTRACE for:
n
Test automation
May 2011
11
Introduction to MLIB/MTRACE
12
May 2011
Installation
For M files information about the copied demo files, refer to Demo
Files on page 15
System Requirements
Host PC and operating system MLIB/MTRACE runs on IBMPC/AT or compatible machines under the following operating systems:
n
Windows XP
Windows Vista
Windows 7
DS1103
DS1104
DS1401
May 2011
13
Installation
DS1005
DS1006
Related topics
Board
RTLIB
DS1103
RTLIB1103
DS1104
RTLIB1104
DS1401
RTLIB1401
DS1005
RTLIB1005
DS1006
RTLIB1006
Basics
Installation on page 13
Installation Process
The installation program performs all necessary steps automatically.
During installation you will only be asked for the MATLAB root folder.
When MLIB/MTRACE is installed, files are copied to
%DSPACE_ROOT%\Matlab\Mlib.
In addition, the file %DSPACE_ROOT%\Matlab\Local\Dspacerc.m is copied
to \Matlab\Toolbox\Local.
14
May 2011
Installation
Basics
Installation on page 13
Demo Files
The files necessary to run the MLIB/MTRACE demos supplied by
dSPACE are installed in the following folders:
n
%DSPACE_ROOT%\demos\dsXXXX\mlib,
%DSPACE_ROOT%\demos\dsXXXXMP\dualXXXX\mlib.
dsXXXX denotes the respective processor board name, for
example, DS1103, DS1104, DS1401, DS1005 or DS1006.
Related topics
Basics
Installation on page 13
May 2011
15
16
Installation
May 2011
Getting Started
%DSPACE_ROOT%\demos\dsXXXXMP\dualXXXX\mlib for
MLIB/MTRACE-MP.
The sample M files can also be used as templates for new applications.
n
Board info
mlibini.m
May 2011
17
Getting Started
master_cmd_server()
18
May 2011
Getting Started
master_cmd_server()
Example
while(1)
{
...
master_cmd_server();
...
}
Related topics
Basics
Getting Started on page 17
May 2011
19
Getting Started
Example
20
May 2011
Related topics
Getting Started
Basics
Getting Started on page 17
May 2011
21
22
Getting Started
May 2011
May 2011
23
24
Information on the time stamp when the data set was collected
must be available.
May 2011
The first condition is fulfilled if the time stamps at which the data has
been collected are also traced. The second condition is met by using a
trigger mechanism: One of the processors is used to synchronize the
start of data acquisition on all the other processors. This processor is
called the synchronizing processor below. If triggered mode has been
selected, the synchronizing processor is the processor on which the
trigger variable resides. For non triggered mode, any processor can be
the synchronizing processor. In this case MLIB/MTRACE chooses the
synchronizing processor according to certain rules, which are not of
importance for an understanding of the distributed tracing method.
The synchronized processors always run in triggered mode.
The trigger signal which starts data acquisition on these processors is a
32-bit word sent by the synchronizing processor.
Assuming triggered mode has been selected, as soon as the trigger
event is recognized by the synchronizing processor, a trigger word is
changed according to predefined rules and sent to the synchronized
processors. The synchronized processors react to the change in the
trigger word and start data acquisition.
Data Capture in
Continuous Mode
Service Group
May 2011
25
The service group is identified by its name. To specify the service group
as above, the following MLIB/MTRACE functions must be called
(assuming Task1 on the master is called with 0.00012 sampling period,
and Task2 on the slave is called with a sample period of 0.00036)
mlib('Set', 'ServiceGroup','Master1_Slave2_Group',....
'CPU','Master',...
'Service', 1,....
'StepSize', 0.00012);
mlib('Set','ServiceGroup','Master1_Slave2_Group',....
'CPU','Slave',....
'Service',2,....
'StepSize', 0.00036);
Each time the StartCapture function is called with this name as an
input parameter: mlib('StartCapture','Master1_Slave2_Group);, the
data capture is carried out by service 1 on the master processor and by
service 2 on the slave processor.
The TRC files generated by RTI-MP contain entries describing the
available host services in the following form:
sampling_period[1]
{
value:
0.0
alias:
"AsynchronousTask"
}
The index of the sampling_period vector denotes the host_service
number, the service name is specified under alias and the step size (0.0
= asynchronous task) under value. If TRC files exist, MLIB/MTRACE
combines services that are on different processors but have the same
name to form one service group. The name of the service group
corresponds to the name of the services. You do not have to specify
the service group as shown above. However, you can use this service
group, for example, with StartCapture function.
Related topics
Basics
Data Capture With Different Sampling Periods or Asynchronous on page 27
26
May 2011
Synchronizing processor: P1
May 2011
27
Only points which lie exactly on or after the lower time limit, and
points which lie before or exactly on the upper time limit, are
collected.
The number of samples collected with processor P1 differs from the
number of samples collected with processor P2.
2. The trace interval is specified by the number of samples to be
collected:
mlib('Set',...
'Delay', -2,....
'NumSamples',5,...
);
28
May 2011
Related topics
Basics
Basic Principles of Using Multiprocessor Systems on page 24
May 2011
29
30
May 2011
MLIB/MTRACE Functions
May 2011
31
MLIB/MTRACE Functions
Description
var.name
var.cpu
var.type
Data type
var.addr
var.offset
var.length
Number of elements
var_vec
ival
uival
32
May 2011
MLIB/MTRACE Functions
Refer to
Administrative Functions
To get information about a real-time application
GetApplInfo on page 42
To get information about boards currently registered in ControlDesk 3.x's Platform Manager or
in ControlDesk Next Generation's Platform/Device Manager.
GetBoardInfo on page 44
SelectBoard on page 61
IsApplRunning on page 52
LockProgram on page 56
Multiprocessing on page 57
UnlockProgram on page 73
LoadVarFile on page 55
GetMapVar on page 45
To obtain the descriptor for a global variable specified within the TRC file
GetTrcVar on page 47
To search the linker map file for variables whose names match the specified regular expression
SearchMap on page 59
To search the TRC file for variables whose names match the specified regular expression
SearchTrc on page 60
SetVarProperty on page 67
Read/Write Functions
To read data from a real-time processor board
Read on page 57
Write on page 73
Interrupt Functions
To generate an interrupt on a real-time processor
Intrpt on page 51
StartCapture on page 69
StopCapture on page 71
TriggerState on page 72
CaptureState on page 34
To transfer data from the processor board memory to the MATLAB workspace
FetchData on page 36
Set on page 62
Get on page 40
Processing mode
LoadFile on page 53
SP = single-processor mode
May 2011
33
MLIB/MTRACE Functions
CaptureState
34
Purpose
Syntax SP
state = mlib('CaptureState')
state = mlib('CaptureState', services)
Syntax MP
state = mlib('CaptureState')
state = mlib('CaptureState', serviceGroups)
May 2011
Description
MLIB/MTRACE Functions
Description
May 2011
35
MLIB/MTRACE Functions
Example
Example 1:
% wait for a data acquisition to finish
while mlib('CaptureState')~=0, end
disp('Capture finished.');
Example 2:
% wait for a data acquisition performed
% by services 1 and 2 to be finished
while any(mlib ('CaptureState', [1 2])) ~= 0, end
disp('Both captures finished.');
Example 3:
% wait for a data acquisition performed
% by the service groups HostService1 and HostService2
while any(mlib ('CaptureState', ...
{HostService1; HostService2})) ~= 0, end
disp('Both captures finished.');
Related topics
References
StartCapture on page 69
TriggerState on page 72
FetchData
36
Purpose
To fetch data from the real-time processor buffer and transfer it to the
MATLAB workspace.
Syntax
traced_data = mlib('FetchData')
traced_data = mlib('FetchData', [count ,], ...
property_name, property_value, ...
Description
Matrix
Structure
May 2011
MLIB/MTRACE Functions
.time
.signals
.values
.label
The .label field specifies the variable name, the .values field contains a
[N x variable length] matrix, with values of the corresponding variable
at time stamps specified in the .time field.
Structure
The format is the same as the structure with time, except
the .time field remains empty.
Structures for
multiprocessor systems
If the structure format has been selected in the Set function, the
FetchData function returns a vector of structures as described above,
each of which corresponds to one processor with traced variables. To
indicate which structure corresponds to which processor, an additional
.name field is added to hold the processor name.
Note that each processor has its own time vector.
May 2011
37
MLIB/MTRACE Functions
The data can be fetched from the processor memory even if the
capturing process is still in progress. If the count parameter is omitted,
all the data already captured and written to the trace buffer is
returned. It is recommended to call the CaptureState function
beforehand to ensure that the data capturing process is finished. The
count parameter can be used to fetch the exact number of samples. In
this case the number of columns in the output matrix and the number
of rows in the .values matrices in the output structure equals the
count. If there is not enough data to complete the output
matrix/structure (for example, the FetchData function was already
called several times and the remaining number of samples to be read
from the trace buffer is smaller than count), zeros are written instead.
By default, MLIB/MTRACE assumes that the data to be fetched was
captured by default capture service (SP) or service group (MP1005 or
MP1006).
If the data capture was started in the continuous mode of
MLIB/MTRACE with the StreamToDisk option set to ON
(see the Set function), each call of the FetchData function
also streams the data into a MAT file on the hard disk.
The data is always stored in the MAT file (matrix/matrix
with time), independently of the output format of the
FetchData function. The structure and structure with time
formats are not supported.
The possible properties and their descriptions are as follows:
SP
Service If a service other than the default is used, you must specify
its number via this property. This property can be used only in singleprocessor mode.
MP
ServiceGroup
38
May 2011
MLIB/MTRACE Functions
Result
The data captured for each variable selected with the Set function is
transferred into the MATLAB workspace.
Example
Example 1:
References
Set on page 62
May 2011
39
MLIB/MTRACE Functions
Get
Purpose
Syntax SP
info = mlib('Get')
info = mlib('Get', property_name)
info = mlib('Get', 'Service', service_number)
info = mlib('Get', 'Service', service_number, ...
property_name)
Syntax MP
info = mlib('Get')
info = mlib('Get', property_name)
info = mlib(Get,ServiceGroup, service_group_name)
info = mlib(Get,ServiceGroup, service_group_name, ...
property_name)
Result
40
MP Mode
.Service
.ServiceGroup
.Trigger
.Trigger
.TriggerVariable
.TriggerVariable
.TriggerLevel
.TriggerLevel
.TriggerEdge
.TriggerEdge
.StepSize
.Downsampling
.Downsampling
.TimeStamping
.TimeStamping
.UseAbsoluteTime
May 2011
SP Mode
MP Mode
.UseAbsoluteTime
.TraceVars
.Start
.AcquisitionMode
.Stop
.StreamToDisk
MLIB/MTRACE Functions
.Delay
.Output format
.NumSamples
.AutoClearBuffer
.TraceVars
.InterpolateBoundaryPoints
.AcquisitionMode
.CPU
.StreamToDisk
.TimeOutValue
.FileName
.OutputFormat
.AutoClearBuffer
.TimeOutValue
.CPU
The .CPU field is a vector of structures, where each structure
contains information about settings specified for one CPU. Each
structure has the following subfields:
n
.start (the start of the trace interval for which the data is to be
collected, stated in the units of the step size)
.stop (the end of the trace interval for which the data is to be
collected, stated in the units of the step size)
For further information on the fields and the returned info structure,
refer to the Set function.
May 2011
41
MLIB/MTRACE Functions
Example
% display the settings of the data capture process
% performed by service 2
mlib('Get', 'Service', 2)
...
% display the value of the NumSamples property of the data
% capture process performed by service 1(default)
mlib('Get', 'NumSamples')
Related topics
References
Set on page 62
GetApplInfo
42
Purpose
Syntax
info = mlib('GetApplInfo')
info = mlib('GetApplInfo', 'property_name', property_value...)
Result
Description
Description
.name
.date
.board
.type
May 2011
MLIB/MTRACE Functions
Description
.master_cpu
.master_board
.reachable
References
IsApplRunning on page 52
May 2011
43
MLIB/MTRACE Functions
GetBoardInfo
Purpose
Syntax
board_info = mlib('GetBoardInfo')
Description
Description
.name
.type
.index
This function can be invoked at any time, which means without calling
the SelectBoard function first.
Example
Related topics
References
SelectBoard on page 61
44
May 2011
MLIB/MTRACE Functions
GetMapVar
Purpose
Syntax
Description
May 2011
45
MLIB/MTRACE Functions
Description
Int8
UInt8
Int16
UInt16
Int32
UInt32
FloatIEEE32
FloatIEEE64
Int8Ptr
UInt8Ptr
Int16Ptr
UInt16Ptr
Int32Ptr
UInt32Ptr
FloatIEEE32Ptr
FloatIEEE64Ptr
Length
value is 1.
46
May 2011
MLIB/MTRACE Functions
The variable addresses are retrieved from the linker map file generated
by the linker. The MAP file must reside in the same folder as the
associated object files (PPC or X86). A variable declared as static, or
local variables within the function body, cannot be accessed.
Example
Example 1:
% obtain the descriptors for variables declared
% in the real-time application running on DS1005 board:
% int simState;
% double * currentTime;
% double finalTime;
var_names = {'simState'; 'currentTime'; 'finalTime'};
var
= mlib('GetMapVar',vars_names);
% set the appropriate data types
var(1)
= mlib('SetVarProperty', var(1), 'type', 'Int32');
var(2)
= mlib('SetVarProperty', var(2), 'type', ...
'FloatIeee64Ptr');
% var(3)
= mlib('SetVarProperty', 'var(3)', 'type, ...
% 'FloatIeee64'); not necessary, FloatIeee64 is default type
% for DS1005 board
Example 2:
% obtain the descriptors for variables declared
% in the real-time application running on DS1005 board:
% float mass, damping, spring_coefficient;
var_names = {'mass'; 'damping'; 'spring_coefficient'};
var
= mlib('GetMapVar', var_names, 'type', ...
'FloatIeee32');
Related topics
References
GetTrcVar on page 47
SetVarProperty on page 67
GetTrcVar
Purpose
To obtain the descriptor for a variable specified within the TRC file.
Syntax SP
var_vec
= mlib('GetTrcVar', variable_names)
[var1, ..., varN] = mlib('GetTrcVar', variable_names)
May 2011
47
MLIB/MTRACE Functions
Syntax MP
var_vec
= mlib('GetTrcVar', variable_names, 'CPU', cpu_name)
[var1, ..., varN] = mlib('GetTrcVar', variable_names, 'CPU', cpu_name)
Description
48
May 2011
MLIB/MTRACE Functions
If the trace variables are identical to the Simulink variables, the syntax
for their names is as follows:
Syntax
Description
Model Root/<subsystem>/<blockName>/<parameterName>
Model Root/<subsystem>/<blockName>/Out<i>
Model Root/<subsystem>/<blockName>/ContState
Model Root/<subsystem>/<blockName>/DiscState
Model Root/<subsystem>/<blockName>/ContStateDeriv
Model Root/<subsystem>/<outportName>
Labels/<label>
For the parameters of the Look-Up tables the following syntax applies:
Syntax
Description
Model Root/<subsystem>/<blockName>/InputValues
Model Root/<subsystem>/<blockName>/OutputValues
Model Root/<subsystem>/<blockName>/Look-Up\nTable (2D)/OutputValues For the table matrix of the 2-D Look-Up table block
May 2011
49
MLIB/MTRACE Functions
Description of vectorized
variables in TRC file
In the second case, the GetTrcVar function returns the descriptor for
the whole vector. Since the vectorized parameters, outputs, states and
state derivatives of the Simulink block are generated in the TRC file in
this manner, the retrieved descriptor always describes all of the vector
elements.
If you create TRC files manually, the following general syntax applies to
variable names:
group/subgroup1/.../subgroupN/name.
50
May 2011
MLIB/MTRACE Functions
Related topics
Basics
Accessing Matrices with MLIB/MTRACE on page 78
References
GetMapVar on page 45
SetVarProperty on page 67
Intrpt
Purpose
Syntax
mlib('Intrpt')
Result
Name
DS1103
DS1104
May 2011
51
MLIB/MTRACE Functions
ST M
Example
IsApplRunning
52
Purpose
Syntax
state = mlib('IsApplRunning')
Result
May 2011
Description
MLIB/MTRACE Functions
Description
.board
Board name
.cpu
CPU name
.appl_state
1 application is running
Example
if mlib('IsApplRunning')
str = 'Currently running real-time application is:';
appl = mlib('GetApplInfo');
disp([str appl.name]);
else
disp('No real-time application running\n');
end
Related topics
References
GetApplInfo on page 42
LoadFile
Purpose
Syntax
Result
May 2011
53
MLIB/MTRACE Functions
Description
54
May 2011
MLIB/MTRACE Functions
Example
Related topics
Basics
LoadVarFile
Purpose
Syntax
mlib('LoadVarFile', var_file_name)
Description
May 2011
55
MLIB/MTRACE Functions
LockProgram
Purpose
Syntax
mlib('LockProgram')
Result
Example
56
May 2011
Related topics
MLIB/MTRACE Functions
References
UnlockProgram on page 73
Multiprocessing
Purpose
Syntax
mlib('Multiprocessing', 'sdf_file_name')
mlib('Multiprocessing', 'off')
Result
Description
Example
% select board
mlib('SelectBoard', 'DS1005');
mlib('Multiprocessing', 'pipt1_dual1005_sl.sdf');
% access variables in the multiprocessor system
...
mlib('Multiprocessing', 'off');
% single-processor on DS1005...
Read
Purpose
Syntax
data
= mlib('Read', var_vec)
[data1, ..., dataN] = mlib('Read', var_vec)
May 2011
57
MLIB/MTRACE Functions
Result
Description
Example
Example 1:
% get the descriptor of the variables simState,
% currentTime and read their values
% obtain the addresses
variables = {'simState'; 'currenTime'}
vars
= mlib('GetTrcVar', variables);
% read the values
data
= mlib('Read', vars);
simState
= data{1};
currentTime = data{2};
The last 3 statements can optionally be replaced by
[simState, currentTime] = mlib('Read', vars);
Example 2:
% read the 3 values of the variable int_vector and 5
% values of the variable dbl_vector
% get the variable descriptors
int_vector_desc = mlib('GetMapVar', 'int_vector', 'type', ...
'Int32', 'length', 3);
dbl_vector_desc = mlib('GetMapVar', 'dbl_vector', 'type', ...
'FloatIeee64', 'length', 5);
[int_vector, dbl_vector] = mlib('Read', ...
[int_vector_desc; dbl_vector_desc]);
58
May 2011
Related topics
MLIB/MTRACE Functions
References
Write on page 73
SearchMap
Purpose
To search the linker map file for variables whose names match the
specified regular expression.
Syntax SP
Syntax MP
Result
May 2011
59
MLIB/MTRACE Functions
Example
Related topics
References
SearchTrc on page 60
SearchTrc
Purpose
To search the TRC file for variables whose names match the specified
regular expression.
Syntax SP
Syntax MP
Result
60
May 2011
MLIB/MTRACE Functions
Example
% Example
% Get the names of all Simulink block outputs
% contained in the subsystem PID-Controller
output_names = mlib(SearchTRC,.*PID-Controller/.*/Out1);
% Obtain the descriptors for found block outputs
output_desc = mlib(GetTrcVar,output_names);
Related topics
References
SearchMap on page 59
SelectBoard
Purpose
Syntax
mlib(SelectBoard)
mlib('SelectBoard', 'board')
Description
May 2011
61
MLIB/MTRACE Functions
Example
Set
Purpose
Syntax
Result
The data acquisition options, such as the time frame, triggering and
variables to be traced, are set by defining the appropriate
property/value pairs.
The permissible property/value pairs for data acquisition are listed
below:
ServiceGroup (MP1005 or MP1006) Name of the service group
used for data acquisition on multiprocessor systems based on DS1005
or DS1006.
Service An integer number (1 31) specifying which data capture
service in the real-time program is to perform data acquisition
(MLIB/MTRACE can distinguish between up to 31 different services).
The default is service number 1.
Trigger
TriggerVariable
TriggerLevel
TriggerEdge
62
May 2011
MLIB/MTRACE Functions
May 2011
63
MLIB/MTRACE Functions
OFF data is not saved in a MAT file (default value) on the hard
disk
64
May 2011
MLIB/MTRACE Functions
OFF the buffer is not cleared and the data can be read multiple
times.
May 2011
65
MLIB/MTRACE Functions
Service
FileName
MaxSamplesPerSecond
StepSize
Example 1:
% obtain the variable address
variables = {'Model Root/Signal Generator/Out1'; ...
'Model Root/Plant/out'};
vars_desc = mlib('GetTrcVar', variables);
% specify the data capture options:
% triggering on the variable Model Root/Signal Generator/out1,
% trigger level 0.0, rising edge;
% 500 samples with 10 samples pre-trigger;
% variables to be traced:
% 'Model Root/Signal Generator/Out1' and,
% 'Model Root/Plant/out';
% single_shot mode, downsampling 1
% service number: 1
mlib('Set', 'Trigger', 'ON', ...
'TriggerVariable', vars_desc(1), ...
'TraceVars', vars_desc, ...
'Delay', -10, ...
'NumSamples', 500);
Example 2:
66
May 2011
MLIB/MTRACE Functions
Related topics
References
Get on page 40
SetVarProperty
Purpose
Syntax
Result
May 2011
67
MLIB/MTRACE Functions
Description
Description
Name
CPU
Type
Addr
Offset
RelativeOffset
Length
68
May 2011
MLIB/MTRACE Functions
Example
Related topics
References
GetMapVar on page 45
GetTrcVar on page 47
StartCapture
Purpose
Syntax SP
mlib('StartCapture')
mlib('StartCapture', services)
Syntax MP
mlib('StartCapture')
mlib(StartCapture,serviceGroups)
Result
May 2011
69
MLIB/MTRACE Functions
Description
Example
Related topics
References
CaptureState on page 34
StopCapture on page 71
70
May 2011
MLIB/MTRACE Functions
StopCapture
Purpose
Syntax SP
mlib('StopCapture')
mlib('StopCapture', services)
Syntax MP
mlib('StopCapture')
mlib('StopCapture', serviceGroups)
Result
Description
May 2011
71
MLIB/MTRACE Functions
Related topics
References
CaptureState on page 34
StartCapture on page 69
TriggerState
Purpose
Syntax SP
status = mlib('TriggerState')
status = mlib('TriggerState', services)
Syntax MP
status = mlib('TriggerState')
status = mlib('TriggerState', serviceGroups)
Result
Description
Description
Trigger is disabled
-1
72
May 2011
MLIB/MTRACE Functions
In this case, state is a vector whose elements indicate the trigger state
of the corresponding capture process.
Example
Related topics
Basics
Additional MLIB/MTRACE Programming Examples on page 96
UnlockProgram
Purpose
Syntax
mlib('UnlockProgram')
mlibn('UnlockProgram')
Result
Example
Related topics
References
LockProgram on page 56
Write
Purpose
Syntax
May 2011
73
MLIB/MTRACE Functions
Result
Description
Example
Related topics
References
Read on page 57
74
May 2011
MLIB/MTRACE Programming
May 2011
75
MLIB/MTRACE Programming
Programming Instructions
For details on how to program multiple MLIB/MTRACE captures in one
real-time application and how to lock the real-time application, refer
to:
n
76
May 2011
Example
mlib('SelectBoard');
mlib('Set', 'Service', 1, ...
'Trigger', 'ON', ...
'TriggerVariable', trg_addr, ...
'NumSamples', 1000, ...
'TraceVars', trc_vars_0);
mlib('Set', 'Service', 2, ...
'Trigger', 'ON', ...
'TriggerVariable', trg_addr, ...
'NumSamples', 1000, ...
'Downsampling', 10, ...
'TraceVars', trc_vars_1);
mlib('StartCapture', [1; 2]);
Related topics
Basics
MLIB/MTRACE Programming
May 2011
77
MLIB/MTRACE Programming
S-Functions on page 79
78
mlib_1dlookup on page 80
mlib_2dlookup on page 83
mlib_matrix on page 86
May 2011
MLIB/MTRACE Programming
S-Functions
Matrices are written out column-wise (MATLAB or Fortran-style). The
index of the (p, q) element of an (m, n) matrix is thus (q-1)m+p.
For more information, refer to the Real-Time Workshops Guide by
Mathworks.
MLIB/MTRACE always writes data vectors to the associated real-time
memory column-wise. For parameter matrices of built-in Simulink
blocks, the MATLAB transpose operator can be used to make sure that
matrices are written in the right order.
The following code shows how the parameters that represent state
space matrices of the Simulink compensator, observer or State Space
block can be modified online by using MLIB/MTRACE.
May 2011
79
MLIB/MTRACE Programming
Example
This example works only if the matrices do not contain zeros or ones,
and if the sizes of the matrices equal the sizes of the matrices in the
Simulink block that the code was generated from.
...
% Design the estimator (as an example for a LTI system).
% a, b, c, d are the resulting state space matrices.
[a,b, c, d] = my_estimator_design_routine;
% Select and lock DSP board
mlib('SelectBoard', 'DS1005');
mlib('LockProgram');
% Obtain addresses
var_names = { ...
['Model Root/compensator/estimator/' ...
'State Space/A']; ...
['Model Root/compensator/estimator/ ...
'State Space/B']; ...
['Model Root/compensator/estimator/ ...
'State Space/C']; ...
['Model Root/compensator/estimator/ ...
'State Space/D']; ...
};
[a_var, b_var, c_var, d_var] = mlib('GetTrcVar', var_names);
% the GetTrcVar function already obtains the number of elements
% in each of specified state space
% Write down the new estimator matrices. Use the transpose
% operator to make sure the matrix elements are stored in the
% right order.
data_to_writing = [a'; b'; c'; d'];
mlib('Write', [a_var; b_var; c_var; d_var], ...
'Data', data_to_writing);
If zeros or ones are involved, omitted elements must also be taken care
of, and the code will not be as simple. An easy way to avoid zeros and
ones is to add eps (machine precision) to the matrices before
generating code with RTI, though this method involves additional
computational loads and may change the system dynamics slightly.
mlib_1dlookup
80
General syntax
Description
May 2011
Init
MLIB/MTRACE Programming
Description
length
inputDesc
outputDesc
name
cpu
The syntax for the lutName parameter is the same as for the Simulink
block parameters, whose addresses are to be obtained with the
GetTrcVar function Model Root/<subsystem>/<blockName>, where
<subsystem> is the path name of the Simulink system containing the
block called <blockName>, but with the model name omitted.
n
ReadOutput
May 2011
81
MLIB/MTRACE Programming
WriteInput
WriteOutput
Example
The 1-D look-up table block named 1DTable resides in the Simulink
subsystem Linearization. The number of elements is 11.
% Init the mlib_1dlookup function
myTable = mlib_1dlookup(Init,...
Model Root/Linearization/1DTable );
% Read all elements of the vector of input values - the
% indices specification is superfluous
inputData = mlib_1dlookup(ReadInput, myTable);
% Read the elements 2, 3 and 4 of the vector of output values
outputData = mlib_1dlookup(ReadOutput, myTable, [2:4])
% Write the new data to the area read before
newOutputData = [1 2 3];
mlib_1dlookup(WriteOutput, myTable, [2:4], newTableData);
82
May 2011
MLIB/MTRACE Programming
mlib_2dlookup
General syntax
Description
Init
Description
rows
cols
rowDesc
colDesc
tableDesc
name
cpu
The syntax for the lutName parameter is the same as for the Simulink
block parameters whose addresses are to be obtained with the
GetTrcVar function Model Root/<subsystem>/<blockName>, where
<subsystem> is the path name of the Simulink system containing the
block named <blockName>, but with the model name omitted.
n
May 2011
83
MLIB/MTRACE Programming
ReadRow
ReadCol
ReadTable
WriteRow
WriteCol
84
May 2011
MLIB/MTRACE Programming
WriteTable
Example
The 2-D look-up table block named 2DTable resides in the Simulink
subsystem Linearization. The number of rows is 3 and the number of
columns is 5.
% Init the mlib_2dlookup function
myTable = mlib_2dlookup(Init,...
Model Root/Linearization/2DTable );
% Read all elements of the row vector - the indices
% specification is superfluous
rowData = mlib_2dlookup(ReadRow, myTable);
% Read the elemnts 2,3 and 4 of the column vector
colData = mlib_2dlookup(ReadCol, myTable, [2:4])
% Read the table values: columns 1-3 from rows 2 and 3.
% The dimension of the output data matrix will be 2 x 3.
tableData = mlib_2dlookup(ReadTable,myTable, [2:3], [1:3]);
% Write the new data to the area read before
newTableData = [1 2 3; 5 6 7];
mlib_2dlookup(WriteTable, myTable, [2:3], [1:3],...
newTableData);
May 2011
85
MLIB/MTRACE Programming
mlib_matrix
General syntax
Description
Init
Description
rows
cols
matDesc
Matrix descriptor
name
alignment
cpu
The name of the first matrix element must be specified as the matName
parameter. Apply the same syntax as for the Simulink block vectorized
parameters, whose addresses are to be obtained with the GetTrcVar
function Model Root/<subsystem>/<blockName>/<matrixParameter>,
where <subsystem> is the path name of the Simulink system
containing the block named <blockName>, but with the model name
omitted.
Use the trcview utility to get the correct syntax of the
matName.
86
May 2011
Read
MLIB/MTRACE Programming
Write
Example
May 2011
87
MLIB/MTRACE Programming
88
May 2011
MLIB/MTRACE Programming
May 2011
89
MLIB/MTRACE Programming
90
May 2011
MLIB/MTRACE Programming
function chmass_1005(mass);
% Syntax: chmass_1005(mass)
% Purpose: Demonstrates MLIB/MTRACE on a DS1005
% This file needs the demo application
%'DSPACE_ROOT\demos\ds1005\GettingStarted\HandCode\smd_1005_hc.obj' running.
% The input signal 'x_disp', and the state 'x' of a second
% order lag system are traced.
% Data is plotted in a figure window.
% The chmass_1005.m demo is augmented by MLIB/MTRACE
% functions, which are used to change the mass 'm'
% of the spring-mass-damper system.
% Copyright (c) 1996-2000 by dSPACE GmbH
if margin ~= 1,
mass=[0.002 0.005 0.01 0.02];
end
if mass<0.001 | mass>0.1,
error('*** mass must be in the range 0.001 < mass < 0.1')
end
% select DS1005 board for use with MLIB/MTRACE
mlib('SelectBoard', 'DS1005');
% select the variable used by MLIB/MTRACE and get their
% descriptors
variables = {'Model/Model Parameters/m';...
'Model/x_disp';...
'Model/x'};
[m_desc, x_disp_desc, x_desc] = mlib('GetTrcVar', ...
variables)
% set the option for data acquisition performed
% by service number 1 (default)
mlib('Set', 'Trigger', 'ON', ...
'TriggerLevel', 0, ...
% default, can be omitted
'TriggerEdge', 'rising', ... % default, can be omitted
'TriggerVariable', x_disp_desc, ...
'TraceVars', [x_disp_desc; x_desc], ...
'NumSamples', 100, ...
'Delay', -10, ...
'DownSampling', 1);
% default, can be omitted
for m = mass,
% lock program during capture
mlib('LockProgram');
% write new mass value to DS1005 via MLIB/MTRACE
mlib('Write',
m_desc, 'Data', m);
% start capture and wait until it is complete
mlib('StartCapture');
while mlib('CaptureState')~=0,end
% transfer data when capture is complete and release lock
out_data = mlib('FetchData');
mlib('UnlockProgram');
% plot results
clf;
plot('out_data');
title(['x_disp, x (mass=' num2str(m) ')']);
set(gcf,'NumberTitle', 'off');
set(gcf,'Name', 'MLIB/MTRACE');
figure(gcf);
if (m ~= mass(end)),
fprintf ('-- press any key --\n');
pause;
end;
end
mclear;
May 2011
91
MLIB/MTRACE Programming
(chmass_XXXX(0.01))
(chmass_XXXX(0.005))
92
May 2011
MLIB/MTRACE Programming
May 2011
93
MLIB/MTRACE Programming
Example
94
%
%
%
%
%
%
%
%
%
%
%
%
-a1
May 2011
MLIB/MTRACE Programming
%
P:Spring-Mass-Damper System.A(2)
-a0
%
P:Spring-Mass-Damper System.C(2)
b0
%
% Before invoking this M file the real-time processor
% application smdtf_1005_sl.ppc must be
% loaded to the DS1005 processor board.
%
% !! To view the results,open the experiment
% file smdtf_1005_sl.cdx
% -----------------------------------------------------------% Initialize dSPACE MLIB
mlib('SelectBoard','DS1005');
% check if the application smdtf_1005_sl.ppc is running
DemoApplName = lower([pwd '\smdtf_1005_sl.ppc']);
if mlib('IsApplRunning'),
ApplInfo = mlib('GetApplInfo');
if strcmp(DemoApplName,lower(ApplInfo.name)) ~= 1,
err_msg = sprintf(['*** This MLIB demo file needs ',...
'the real-time processor application\n***',...
' ''%s'' running!'], DemoApplName);
error(err_msg);
end
else
err_msg = sprintf(['*** This MLIB demo file needs ',...
'the real-time processor application\n***',...
' ''%s'' running!'], DemoApplName);
error(err_msg);
end;
% Get descriptors for the state space matrices
matrices = {'Model Root/Spring-Mass-Damper System/A';...
'Model Root/Spring-Mass-Damper System/C'};
[Amatrix_desc, Cmatrix_desc] = mlib('GetTrcVar',matrices);
% Read current parameter values from real-time processor
Amatrix = mlib('Read',Amatrix_desc);
Cmatrix = mlib('Read',Cmatrix_desc);
a1 = -Amatrix(1);
a0 = -Amatrix(2);
b0 = Cmatrix(2);
OMEGA = sqrt(a0);
% bandwidth
DAMP = a1/(2*OMEGA); % damping factor
fprintf ('\n %8.1e \n',b0);
fprintf (' G(s) = -------------------------\n',b0);
fprintf (' s*s %+8.1e s %+8.1e\n\n',a1,a0);
fprintf (' Bandwidth: %6.0f\n',OMEGA);
fprintf (' Damping factor: %6.2f\n',DAMP);
% Input vector of new damping factors
damp_values = ...
input(' New damping factor(s) [0.5:0.05:1.0] ?');
if isempty(damp_values), damp_values = 0.5:0.05:1; end;
% Input times when parameters are updated
update_time = input(' Update interval 1 sec] ? ');
if isempty(update_time), update_time=1; end;
fprintf (' ---------------------------------------------\n');
% Start MATLAB stopwatch timer (min. timer resolution 54 ms)
TIC; T=0;
for damp=damp_values,
% Compute transfer function parameters
% of spring-mass-damper system
amatrix = [ -2*damp*OMEGA -OMEGA*OMEGA ]; % [ -a1 -a0 ]
% Write new transfer function parameters
% to real-time processor
mlib('Write',Amatrix_desc,'Data', amatrix);
May 2011
95
MLIB/MTRACE Programming
96
May 2011
MLIB/MTRACE Programming
May 2011
97
MLIB/MTRACE Programming
Example
98
May 2011
MLIB/MTRACE Programming
l2 = line(t,out_data(3,:)');
set(l1,'Color','r');
grid;
else
set(l1,'YData',out_data(2,:),'EraseMode','Xor');
set(l2,'YData',out_data(3,:),'EraseMode','Xor');
end
figure(gcf);
drawnow;
pause(1);
end
% reset the amplitude and frequency
mlib('Write',[ampl;freq],'Data',{org_ampl_val;org_freq_val});
% return to single processor mode
mlib('MultiProcessing','OFF');
May 2011
99
100
MLIB/MTRACE Programming
May 2011
File Reference
experiment_info for SP
May 2011
101
File Reference
Information
.date
.step_size
timestamping
102
.downsampling
Downsampling factor
.applications
.variables
May 2011
Utilities
May 2011
103
Utilities
To use TrcView
1 Enter the trcview command in the MATLAB Command Window or
call the program directly from a DOS window. Then open the
desired TRC file. A model browser and a variable list make it easy to
search for a specific variable.
2 Double-click in the list to paste the full variable name, with the
syntax required by GetTrcVar, into an edit field.
3 From the edit field, copy and paste the variable name into any M
file editor or the MATLAB Command Window with the standard
shortcut keys Ctrl-C, Ctrl-V
The illustration below shows the Simulink system SimModel. Suppose
that the Constant Value parameter of the Simulink block Discrete PID
for realization/Anti-Windup/zero is to be changed with MLIB/MTRACE.
The name of the subsystem contains a carriage return.
104
May 2011
Utilities
May 2011
105
Utilities
Method 2
If a TRC file contains syntax errors, you cannot open it with TrcView,
and the trace error file is displayed instead. The error positions are
marked and appropriate messages are also output.
For details on the TRC file syntax, refer to Syntax of the TRC File
(
RTI and RTI-MP Implementation Reference).
ST M
106
May 2011
Limitations
May 2011
107
Limitations
108
May 2011
Troubleshooting
109
125
MLIB 2
May 2011
109
Troubleshooting
MLIB 3
MLIB 4
RESERVED
MLIB 5
MLIB 6
RESERVED
MLIB 7
MLIB 8
MLIB 9
MLIB 10
110
May 2011
MLIB 11
Troubleshooting
The syntax of a
RESERVED
MLIB 13
RESERVED
MLIB 14
MLIB 15
RESERVED
MLIB 16
MLIB 17
MLIB 18
MLIB 19
MLIB 21
RESERVED
May 2011
111
Troubleshooting
MLIB 22
RESERVED
MLIB 23
MLIB 24
RESERVED
MLIB 25
RESERVED
MLIB 26
MLIB 27
MLIB 28
MLIB 29
MLIB 30
112
May 2011
MLIB 31
Troubleshooting
MLIB 32
MLIB 33
MLIB 34
MLIB 35
MLIB 36
MLIB 37
May 2011
113
Troubleshooting
MLIB 38
Set the time frame for capturing real-time data first. Before
the function StartCapture can be called, you must specify the time
frame. See the description of the Set function for information on how
to specify the data capturing time frame.
MLIB 39
RESERVED
MLIB 40
The collected data is stored directly into the MAT file. Please
change the file extension to .mat.
MLIB 41
MLIB 42
MLIB 43
MLIB 44
MLIB 46
114
May 2011
Troubleshooting
MLIB47
MLIB 48
MLIB 49
MLIB 50
MLIB 51
MLIB 52
RESERVED
MLIB 53
RESERVED
MLIB 54
RESERVED
May 2011
115
Troubleshooting
MLIB 55
MLIB 56
116
MLIB 57
MLIB 100
May 2011
MLIB 101
Troubleshooting
MLIB 102
MLIB 103
MLIB 104
MLIB 105
MLIB 106
May 2011
117
Troubleshooting
MLIB 107
RESERVED
MLIB 108
MLIB 109
MLIB 110
118
MLIB 111
RESERVED
MLIB 112
RESERVED
MLIB 113
RESERVED
MLIB 114
RESERVED
MLIB 115
MLIB 116
May 2011
Troubleshooting
MLIB 117
MLIB 118
RESERVED
MLIB 119
RESERVED
MLIB 120
MLIB 121
Probably the data capture service was not correctly initialized. Check if
the function init_trace() is called in your application.
MLIB 122
RESERVED
MLIB 123
MLIB 124
RESERVED
MLIB 125
May 2011
119
Troubleshooting
MLIB 126
MLIB 127
MLIB 129
Processor ID mismatch.
Each member processor of a
multiprocessor system based on DS1005 or DS1006 has its own
unique processor index (ID). this error message occurs if the processor
indices that are read directly from the real-time application do not
match the indices specified in the SDF file (Keyword: ServiceID).
If the real-time application was generated by RTI-MP, these indices will
be written to the SDF file automatically. If the real-time application was
handcoded, you must set the indices, and they must start with 0 in a
real-time application and with 1 in a SDF file.
MLIB 130
120
May 2011
MLIB 131
Troubleshooting
MLIB 132
Call the function Set to add a processor with the desired trigger
variable to your service group.
MLIB133
Call the Set function to add a processor with the desired trace
variable to your service group.
May 2011
121
Troubleshooting
MLIB134
MLIB135
MLIB136
MLIB137
The time stamps have not been traced during the data
acquisition. Due to it is not possible to find a time correlation
between data being collected on different processors. The
reason can be a wrong call to the host_service macro in your
real-time application.
The time stamps can be collected only if
the host_service is called with the pointer to the time stamp structure
as a second parameter:
host_service(service_no, ts)
If your application was generated by RTI/RTI-MP, a call to the macro is
made automatically. If your application is handcoded, make sure that
the macro is called correctly.
MLIB 138
122
May 2011
Troubleshooting
sampling_period[<index>]
{
value:
0.0
alias:
<serviceName>
}
are required. They are generated with RTI/RTI-MP version 3.6 and
higher. Regenerate your application with the newer RTI/RTI-MP version
if you want to use this function.
MLIB 139
Time out after <number> sec while waiting for desired number
of samples to be collected in the trace buffer. If necessary you
can increase the time after which the timeout error is reported
by altering the Set function property TimeOutValue.
Altering this property allows you to increase the time after which this
error message is displayed, for example, if your applications run very
slowly.
If the FetchData function is called with count as an input argument
and data acquisition is still in progress, MLIB/MTRACE waits until the
desired number of samples are collected in the trace buffer.
To avoid MLIB/MTRACE hanging when the data is not collected in the
trace buffer (for example, if the application crashed), the MATLAB
Command Window is automatically reactivated after <number>
second(s). In this case a timeout error message is displayed.
MLIB 140
MLIB 200
May 2011
123
Troubleshooting
MLIB 201
There is
MLIB 202
MLIB 203
Can't open file <file_name>. The most likely reason is that the
file cannot be found or does not exist at all.
1. Check if <file name> is spelled correctly and you are in the
appropriate working folder. All linker map files, associated objects
(PPC, X86) and SDF files (for multiprocessor mode only) must reside
in the same folder.
124
MLIB 204
MLIB 205
MLIB 206
MLIB 207
MLIB 208
RESERVED
MLIB 209
May 2011
Troubleshooting
May 2011
125
126
Troubleshooting
May 2011
Appendix
127
130
MLIB/MTRACE Benchmarks
As described in Multiple MLIB/MTRACE Data Captures in One RealTime Application on page 76, the time needed for processor board
access from host applications mainly depends on the type of
connection; for example, whether a PC/AT bus interface or a TCP/IP
network is used. It is impossible to provide general benchmarks for
network connections. Network performance depends on many factors
such as the type of Ethernet cards and cabling, the implementation of
the TCP/IP software, the TCP/IP packet length, and the actual traffic. In
typical configurations, network access is 3-10 times slower than PC/AT
bus access.
The following two graphs show the performance of MLIB/MTRACE
with a Pentium II 400 MHz host connected to a DS1005/400 MHz
processor board via a bus interface.
May 2011
127
Appendix
The first graph shows the number of 64-bit words transferred per
second (N) with mlib('Read', var) versus the number of words to be
read (n = var.length):
128
May 2011
Appendix
Measurement details
Execution times
Related topics
Basics
Impact of MLIB/MTRACE on Execution Time on page 130
References
MLIB/MTRACE with DS1103 on page 130
May 2011
129
Appendix
MLIB/MTRACE with
DS1401
130
pre-trigger
post-trigger
trigger OFF
pre-trigger
post-trigger
trigger OFF
May 2011
MLIB/MTRACE with
DS1005
Appendix
pre-trigger
post-trigger
trigger off
May 2011
131
132
Appendix
May 2011
Index
Index
A
accessing matrices
MLIB/MTRACE 78
adc_XXXX.m 96
address evaluation functions 33
administrative functions 33
appendix
MLIB/MTRACE 127
B
benchmarks
MLIB/MTRACE 127
built-in Simulink blocks 79
C
CaptureState 34
chkerr_XXXX.m 96
clear command (MLIB) 18
cont_XXXX.m 96
D
data acquisition
real-time 127
data acquisition functions 33
default service
MLIB/TRACE 35
default service group 35
demo files
MLIB 15
descriptor 32
device driver
register 17
E
error messages
MLIB/MTRACE 109
exectime_XXXX.m 96
execution time 130
F
FetchData 36
function reference
MLIB/MTRACE 33
functions supporting MLIB/MTRACEgenerated MAT-files 33
G
Get 40
GetApplInfo 42
GetBoardInfo 44
GetMapVar 45
getting started
MLIB/MTRACE 17
GetTrcVar 47
H
help
MLIB/MTRACE 33
host_service
MLIB 18
I
installation
MLIB 13
process for MLIB 14
interrupt functions 33
introduction 11
Intrpt 51
IsApplRunning 52
L
limitations
accessing variables 108
number of applications 108
simultaneous platform access 108
LoadFile 53
LoadVarFile 55
LockProgram 56
lookup-table 78
M
master_cmd_server 19
MAT file 127
matrices
accessing with MLIB/MTRACE 78
MLIB/MTRACE
appendix 127
benchmarks 127
default service 35
error messages 109
function reference 33
functions 31
getting started 17
help 33
multiple data captures 76
naming conventions 32
programming 75
programming examples 88
troubleshooting 109
with DS1005 131
with DS1103 130
with DS1401 130
mlib_1dlookup 80
Init 80
ReadInput 81
ReadOutput 81
WriteInput 82
WriteOutput 82
mlib_2dlookup 83
Init 83
ReadCol 84
ReadRow 84
ReadTable 84
WriteCol 84
WriteRow 84
WriteTable 85
mlib_matrix 86
Init 86
Read 87
Write 87
mlibini.m 17
multiple data captures
MLIB/MTRACE 76
Multiprocessing 57
multiprocessor systems
MLIB/MTRACE 23
N
network 127
P
programming
MLIB/MTRACE 75
programming examples
MLIB/MTRACE 88
R
Read 57
read functions 33
RTI 93
S
SearchMap 59
SearchTrc 60
SelectBoard 61
service group
default 35
definition 25
Set 62
SetVarProperty 67
S-functions 79
Simulink 93
StartCapture 69
StopCapture 71
May 2011
133
Index
system requirements
MLIB 13
T
table look-up 78
TCP/IP network 127
time stamp 18
trace buffer 18
TraceView utility 127
TRC file 48
generated by RTI 103
trigger_xxxx.m 96
TriggerState 72
troubleshooting
MLIB/MTRACE 109
U
UnlockProgram 73
W
Write 73
write functions 33
134
May 2011