MATLAB XPC TARGET RELEASE NOTES Uživatelská příručka

Procházejte online nebo si stáhněte Uživatelská příručka pro Software MATLAB XPC TARGET RELEASE NOTES. MATLAB XPC TARGET RELEASE NOTES User`s guide Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 531
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 0
xPC Target™ 4
User’s Guide
Zobrazit stránku 0
1 2 3 4 5 6 ... 530 531

Shrnutí obsahu

Strany 1 - User’s Guide

xPC Target™ 4User’s Guide

Strany 2 - Natick, MA 01760-2098

Graphical User Interfaces10xPC Target Interface Blocks to Simulink Mo dels ... 10-2Introduction... 10-2Simulink U

Strany 3 - Revision History

3 Signals and ParametersLimitationsThe f ol lowing ar e limitat ions of uploading xPC Target signals to Sim u li n kexternal mode:• When setting up si

Strany 4

Signal Tracing4 Ensure that the Source parameter is set to manual.5 Set the Mode parameter to normal. T his ensures that the scope acquiresdata contin

Strany 5

3 Signals and Parameters10 From the File menu, select Save As and enter a filename. For example,entermy_xpc_osc6.mdl and then click OK.11 Build and do

Strany 6

Signal TracingSignal Tracing with a Web BrowserThe Web brow ser interface allows you to visualize data using a graphicaluser interface.After you conne

Strany 7

3 Signals and Parametersscope, remove existing scopes, and control all aspects of a scope from thispage.Tocreateascopeoftypehost, use the drop-dow n l

Strany 8 - Working wi

Signal LoggingSignal LoggingIn this section...“Introduction” on page 3-57“Signal Logging with xPC Target Explorer” on page 3- 57“Signal Log ging in th

Strany 9

3 Signals and ParametersTo create xpc_os c4:1 In the MATLAB window, typexpc_osc3The xpc_osc3 model opens.2 In the Simu link wi n dow, select and delet

Strany 10 - Execution Modes

Signal Logging3 Start thetarget application. For example, in the xPC Target Hierarchypane, right-click thexpc_osc4 target application, then select Sta

Strany 11 - Vector CANape Support

3 Signals and ParametersYou can examine and otherwise manipulate the data.Signal Logging in the MATLAB InterfaceYou plot the outputs and states of you

Strany 12 - Frequently Asked Questions

Signal Loggingassumes you have created and downloaded the target application for thatmodel. It also assumes that you have assignedtg to the appropriat

Strany 13

Polling Mode ... 12-5Introducing Polling Mode... 12-5Setting the Polling Mode...

Strany 14 - Function Reference

3 Signals and ParametersThe plot shown below is the result of a real-time execution. To compare thisplot with a plot f or a non-real-time simulation,

Strany 15 - Configuration Parameters

Signal LoggingThe plot shown below is the result of a real-time run.TheTETisthetimetocalculatethesignalvaluesforthemodelduringeach sample interval. If

Strany 16 - Contents

3 Signals and ParametersThe MATLAB interface displays the following information about theaverage task execution time.ans =5.7528e-006ThepercentageofCP

Strany 17 - Target and Scope O bjects

Signal LoggingTask execution time — Logging the task execution time is possible only ifyou select the Log Task Execution Time check box in the Configu

Strany 18 - Target Objects

3 Signals and ParametersParameter Tuning and Inlining ParametersIn this section...“Introduction” on page 3-66“Parameter Tuning with xPC Target Explore

Strany 19 - Scope Objects

Parameter Tuning and Inlining Pa rametersNote Opening a dialog box for a source block causes Simulink to pause. WhileSimulink is paused, you can edit

Strany 20 - 1 Target and Scop e Objects

3 Signals and ParametersThe Model Hierarchy expands to show the elements in the Simulinkmodel.The model hierarchy shows only those blocks that have tu

Strany 21

Parameter Tuning and Inlining Pa rameters7 Press the Enter key.The box is updated and the Update Param eter button becomes active.If there is a scope,

Strany 22

3 Signals and ParametersParameter Tuning with the MATLAB InterfaceYou use the MATLAB functions to change block parameters. W ith thesefunctions, y ou

Strany 23 - See the scope object function

Parameter Tuning and Inlining Pa rametersParameters =INDEX VALUE TYPE SIZEPARAMETERNAMEBLOCKNAME0 1000000 D OUBLE Scalar Gain Gain1 400 DOUBLE Scalar

Strany 24

Configuring the xPC Target and Vector CANapeSoftware... 14-4Setting Up and Building the Model...

Strany 25 - MATLAB Interface

3 Signals and Parameters-tgortg.stoporstop(tg)The target application on the target PC stops running, and the target PCdisplays mes sag es like the fol

Strany 26 - Working with Tar get Objects

Parameter Tuning and Inlining Pa rameters2 To reset to the previous v alues, typesetparam(tg,pt.parIndexVec,pt.OldValues)ans =parIndexVec: 5OldValues:

Strany 27 - Deleting Target Objects

3 Signals and ParametersAll of the current Simulink model parameters are downloaded to yourtarget application. This downloading g uarantees the consis

Strany 28 - Displaying Tar g

Parameter Tuning and Inlining Pa rameters5 In the Gain text box, ente r 800 and click OK.As soon as you change a model parameter and click OK,oryoucli

Strany 29 - Working with Target Ob jects

3 Signals and ParametersThe target application on the target PC stops running, and the target PCdisplays the following messages:minimal TET: 0.000023

Strany 30

Parameter Tuning and Inlining Pa rametersThe procedures assume that• You have a target application object namedtg.• You have assignedtg to the appropr

Strany 31 - Working with Scope Objects

3 Signals and ParametersLoading Saved Parameters to a Target Ap plicationTo load a set of saved parameters to a target application, use theloadparamse

Strany 32

Parameter Tuning and Inlining Pa rameters2 Load the parameter file. For example, typetg.loadparamset('xpc_osc4_param1');3 Display a list o f

Strany 33

3 Signals and Parameters3 Double -click the Signal G ene rator block and enter A for the Ampli tudeparameter. Click OK.4 In the MATLAB Command Window,

Strany 34

Parameter Tuning and Inlining Pa rametersThe Model Parameter Configuration dialog box appears as follows.If you have more global parameters you want t

Strany 35

General I/O Troubleshooting Guidelines ... 15-21Can I View the Contents of the Target PC Display on theHost PC?...

Strany 36

3 Signals and ParametersYou next can use xPC Target Explorer or the MATLAB interface to workwith the tunable parameters.Tuning Inlined Parameters with

Strany 37

Parameter Tuning and Inlining Pa rameters5 Enter a new value for the parameter and press Enter.The box is updated and the Update Param eter button bec

Strany 38

3 Signals and ParametersThe value of Signal Generator is show n in t he right pane.8 Stop the target application.Tuning Inlined Parameters with the MA

Strany 39

Parameter Tuning and Inlining Pa rameters1 Sa ve th e following code in a MA T L A B file. For example, change_inlineA.tg=xpc; %Create xPC Target obje

Strany 40

3 Signals and ParametersNonobser vable Signals and ParametersObservable signals are those that you can monitor, trace, and log.Nonobservable signals a

Strany 41 - Pretriggering (P<0)

4Booting from a DOS Device• “DOSLoader Mode” on page 4-2• “Creating a DOS System Disk” on page 4-6

Strany 42 - Posttriggering (P>0)

4 Bo oting from a DOS DeviceDOSLoader ModeIn this section...“Introduction” on page 4-2“DOSLoader Mode Setup” on page 4-2“Restrictions” on page 4-3“Cre

Strany 43

DOSLoader Mode4 In the Configuration pane, select the DOSLoader tab.5 In the Location field, enter or browse to the directory where you wantto create

Strany 44 - Acquisition of Gap-Free Data

4 Bo oting from a DOS Device• While loaded in memo ry, the D OS partition must not overlap the addressrange o f a target application.To satisfy these

Strany 45

DOSLoader Modegetxpcenv2 Ensure that the following xPC Target properties are set as indicated:•TargetBoot — DOSLoader• DOSLoade rLocation — Your host

Strany 46

Scope Object Methods ... 16-4Scope Object Property Commands... 16-6Aliasing with Variable Commands...

Strany 47

4 Bo oting from a DOS DeviceCreating a DOS System DiskTo use the DOSLoader mode, you need a minimal DOS system on the targetPC boot device. MathWorks

Strany 48

5Embedded OptionThe xPC Target Embedded Option™ productallowsyoutobootthetargetPC from a d ev ice other than a 3.5-inch disk or CD drive or network bo

Strany 49 - Signals and Parameters

5 Embedded OptionIntroductionThe xPC Target Embedded Option software allows you to boot the xPC Targetkernel from a 3.5-inch disk drive a n d other de

Strany 50 - Monitoring Signals

xPC Target Embedded Option™ ModesxPC Target Embedded Option ModesIn this section...“Introduction” on page 5-3“Standalone Mode Overview” on page 5-4“Re

Strany 51

5 Embedded OptionThefollowingaresomeinstanceswhereyoumightwanttousethexPCTarget Embedded Option product. You might have one of these situations ifyou

Strany 52

xPC Target Embedded Option™ Modes8 Copy the contents o f model_name_emb to the target PC hard drive. Thetarget PC hard drive should now contain the fo

Strany 53

5 Embedded Option• While loaded in memo ry, the D OS partition must not overlap the addressrange o f a target application.To satisfy these restriction

Strany 54

Embedded Option SetupEmbedded Option SetupCreating a DOS System DiskWhen using Standalone mode, you must first boot your target PC with DOS.YoucanuseS

Strany 55 - Mo del Hierarchy node

5 Embedded OptionStand-Alone Target SetupIn this section...“Before Yo u Start” on page 5-8“Updating Environment Properties” on page 5-9“Creating a Ker

Strany 56

Stand-Alone Target SetupUpdating Environment PropertiesThe xPC Target software uses the environment properties to determine whatfiles to create for th

Strany 57

Functions18Configuration Parameters19xPC Target options Pane ... 19-2xPC Target options Overview... 19-4A

Strany 58

5 Embedded OptionA S imulink window opens with the model.2 From the Tools menu, point to Real-Time Workshop,andthenclickBuild Model.Real-Time Workshop

Strany 59

Stand-Alone Target Setup2 In the MATLAB Command Window, change folder on the host computer tothe folder that contains the kernel/target application fi

Strany 60

5 Embedded OptionNote Do not confuse C:\xpcfiles\autoex ec.bat with C:\autoexec.bat.The fileC:\xpcfiles\autoexec.bat includes the command xpcboot.comt

Strany 61

6Software Environment andDemos• “Using Environment Properties and Functions” on page 6-2• “xPC Target Demos” on page 6-9

Strany 62

6 Software Environment and DemosUsing Environment Properties and FunctionsIn this section...“Introduction” on page 6-2“Getting a List of Environment P

Strany 63

Using Environment Properties and FunctionssetxpcenvThe M ATLA B interface displays a list of xPC Target environmentproperties and the allowed values.

Strany 64

6 Software Environment and DemosThe MATLAB interface opens the xPC Target Explorer window.Note the contents of the left pane. This is the xPC Target H

Strany 65 - Creating Scopes

Using Environment Properties and FunctionsThe Configuration node under the Target PC node has the targetPC-spe cific configuration pane. If your licen

Strany 66

6 Software Environment and Demos• Auto — The target kernel automatica lly attempts to determine theamount of memory.•Manual — The amount of RAM, in MB

Strany 67 - Scope 1

Using Environment Properties and Functions9 From the Target scope list, select either Enabled or Disabled.Theproperty Target scope is set by default t

Strany 68

xvi Contents

Strany 69 - Scope 2. (Note that

6 Software Environment and DemosThe environment properties you changed with the function setx pcenvbecome the current values.HostTargetCommRS232HostPo

Strany 70

xPC Target™ DemosxPC Target DemosIn this section...“Introduction” on page 6-9“ToLocateorEditaDemoScript”onpage6-11IntroductionThe xPC Target demos are

Strany 71

6 Software Environment and DemosDescription FilenameLogging signal data to a file on the target PCData Logging W ith a Fi leScopeFrame signal processi

Strany 72

xPC Target™ DemosYou can access xPC Target general application and driver demos throughthe MAT LAB Online H elp. In this window, xPC Target > Demos

Strany 73 - Start the scop

6 Software Environment and Demos6-12

Strany 74

7Working with Target PCEnvironments

Strany 75 - Scope 2, right-click Scope

7 Working with Target PC E nvironmentsTarget Environment Command-Line InterfaceIn this section...“Creating Target PC Environment Object Containers” on

Strany 76

Target Environment Command-Line InterfaceIn the MATLAB window, typetgs.getCCompiler: 'VisualC'CompilerPath: 'c:\Microsoft Visual Studio

Strany 77 - Software Triggering Scopes

7 Working with Target PC E nvironmentsAdding Tar get PCEnvironment Collection ObjectsTo add a target PCenvironment collection o bject, use the target

Strany 78

Target Environment Command-Line InterfaceChanging Target PC Environment Object DefaultsBy default, the first target PC environment object is the defau

Strany 79

1Target and Scope O bjectsBefore you can work with xPC Target™ target and scope objects, you shouldunderstand the concept of target and scope objects.

Strany 80

7 Working with Target PC E nvironmentsTcpIpTargetAddress: '222.222.222.222'TcpIpTargetPort: '22222'TcpIpSubNetMask: '255.255.

Strany 81

Target Environment Command-Line InterfaceAlternatively, you can typeenv.TcpIpTargetPortans =22222env2.TcpIpTargetAddressans =192.168.0.107-7

Strany 82

7 Working with Target PC E nvironments7-8

Strany 83 - Copying Files to the Host PC

8Using the Target PCCommand-Line InterfaceYou can interact with the xPC Target environment through the targetPC command window. The xPC Target softwar

Strany 84

8 Us ing the Target PC Command-Line InterfaceTarget PC Command-Line InterfaceIn this section...“Introduction” on page 8-2“Using Target Application Met

Strany 85 - TargetPC1

Target PC C ommand-Line Inter face2 In the Cmd box, ty pe a target PC com mand. For e xample, to start yo u rtarget application, typestart3 To stop th

Strany 86

8 Us ing the Target PC Command-Line InterfaceThe command window displays a message to indicate that the newparameter has registered.System: p[1] is se

Strany 87

Target PC C ommand-Line Inter faceThe target PC activates the command window.2 Type a scope command. For example, to add a target scope (scope 2) in t

Strany 88

8 Us ing the Target PC Command-Line InterfaceThesecommandscreateatemporarydifferencebetweenthebehaviorofthetarget application and the properties of th

Strany 89

Target PC C ommand-Line Inter face2 Typethevariablenametorunthatcommandsequence. Forexample,toturn the motor on, ty peonThe parameter P7 is changed to

Strany 90

1 Target and Scop e ObjectsTarget ObjectsWhat Is a Target Object?The x PC Target software uses a targ et object (of class xpctarget.xpc)torepresent th

Strany 91

8 Us ing the Target PC Command-Line Interface8-8

Strany 92

9Working with Target PCFiles and File Systems• “Introduction” on page 9-2• “FTP and File System Objects” on page 9-4• “Using xpctarget.ftp Objects” on

Strany 93

9 Working with Target PC Files and File SystemsIntroductionxPC Target file scopes create files on the target PC. To work with thesefiles from the host

Strany 94

IntroductionYou can access signal data files, or any target PC system file, in one of thefollowing ways:• If you are running the target PC as a stand-

Strany 95

9 Working with Target PC Files and File SystemsFTP and File System ObjectsThe xPC Target software uses two objects, xpctarget.ftp and xpctarget. fs(fi

Strany 96

Using xpctarget.ftp ObjectsUsing xpctar get.ftp ObjectsIn this section...“Overview” on page 9-5“Accessing Files on a Specific Target PC ” on page 9-6“

Strany 97

9 Working with Target PC Files and File SystemsAccessing Files o n a Specific Target PCYou can access specific target PC files from the host PC for th

Strany 98

Using xpctarget.ftp ObjectsListing the Contents of the Target PC FolderYou can list the contents of the target PC folder by using xPC Target methodson

Strany 99 - Scope of Type File

9 Working with Target PC Files and File SystemsForexample,toretrieveafilenameddata.dat from the target PC C:\ drive(default),1 Ifyouhavenotalreadydone

Strany 100 - 3 Signals and Parameters

Using xpctarget.fs ObjectsUsing xpctar get.fs ObjectsIn this section...“Overview” on page 9-9“Accessing File Systems from a Specific Target PC” on pag

Strany 101 - Signal Tracing

Scope ObjectsScope ObjectsIn this section...“What Is a Scope Object?” o n page 1 -3“Scope Object Types” on page 1-4What Is a Scope Object?The xPC Targ

Strany 102

9 Working with Target PC Files and File Systems• removefi le to remove a file from the target PC•rmdir to remove a folderUseful global utility:•readxp

Strany 103

Using xpctarget.fs Objects1 In the MATLAB window, type a command like the following to assign thexpctarget.xpc object to a v ariable.tg1=xpctarget.xpc

Strany 104

9 Working with Target PC Files and File Systems1 Ifyouhavenotalreadydoneso,intheMATLABwindow,typethefollowingto assign thexpctarget.fs object to a var

Strany 105 - Signal Logging

Using xpctarget.fs Objectsin xPC Target format. The data must be a vecto r of bytes (uint8). To convertthe data touint8, use a command like the follow

Strany 106

9 Working with Target PC Files and File Systemsx[0] y[0] z[0] t[0] x[1] y[1] z[1] t[1] x[2] y[2] z [2] t[2]...x[N] y[N] z[N] t[N]Nis the number of sam

Strany 107

Using xpctarget.fs Objectsfs_object.method_name(argument_list)For example, to get a list of open files for the file system object fsys,1 Ifyouhavenota

Strany 108

9 Working with Target PC Files and File SystemsUse the method syntax to run an xpctarget.fs object method. The sy ntaxmethod_name(fs_object, argument_

Strany 109

Using xpctarget.fs ObjectsFor examp le, to display the disk i n formation for the C:\ drive,1 Ifyouhavenotalreadydoneso,intheMATLABwindow,typethefollo

Strany 110

9 Working with Target PC Files and File Systems9-18

Strany 111

10Graphical User Interfaces

Strany 112

How to Contact MathWorkswww.mathworks.comWebcomp.soft-sys.matlab Newsgroupwww.mathworks.com/contact_TS.html Technical [email protected] Pro

Strany 113

1 Target and Scop e Objectssample time is 0.005, the scope will acquire five identical samples for thissignal,andthenthenextfiveidenticalsamples,andso

Strany 114

10 Graphical User InterfacesxPC Tar get Interface Blocks to Simulink ModelsIn this section...“Introduction” on page 10-2“Simulink User Interface Model

Strany 115 - Hierarchy

xPC Target™ Interfac e Bloc ks to Simulink®ModelsSimulink 3D Animation — The Simulink 3D Animation product enablesyou to d isplay a Simulink u ser int

Strany 116

10 Graphical User Interfaces4 In the MATLAB interface, run the function xpcsliface('model _name') tocreatetheuserinterfacetemplatemodel. Thi

Strany 117 - 7 Press the Enter key

xPC Target™ Interfac e Bloc ks to Simulink®ModelsNote The use of To xP C Target blocks requires a connection between the hostand target PC. If there i

Strany 118

10 Graphical User InterfacesBecause only one num erical value per signal is uploaded during a timestep, the number of samples of a scope object is set

Strany 119

xPC Target™ Interfac e Bloc ks to Simulink®Modelstarget application, and you use this model to select the parameters andsignals you want to connect to

Strany 120

10 Graphical User Interfaces4 In the Description box, delete the existing tag and enter a tag to theparameters for this block.For example, the SetPoin

Strany 121

xPC Target™ Interfac e Bloc ks to Simulink®Models5 Repeat steps 1 through 3 for the remaining parameters y ou want to tag.For example, for the Control

Strany 122

10 Graphical User InterfacesAfter you create a Simulink model, you can mark the block signals. Thisprocedure uses the modelxpctank1.mdl (or xpc tank .

Strany 123 - 800 and click OK

xPC Target™ Interfac e Bloc ks to Simulink®ModelsFor example, the block labeled TankLevel is an integrator with a singlesignal that indicates the leve

Strany 124

Scope ObjectsEach scope object type has a group of object properties particular to thatobject type.1-5

Strany 125

10 Graphical User InterfacesTo create the From xPC blocks in an user interface model for a signal linewith four signals (port dimension of 4), use the

Strany 126

11xPC Target Web BrowserInterface

Strany 127 - Inlined Parameters

11 xPC Target™ Web Browser InterfaceWeb Browser InterfaceIn this section...“Introduction” on page 11-2“Connecting the Web Interface Through TCP/IP” on

Strany 128

Web Browser InterfaceBefore you connect your Web browser on the h os t PC, you must load a targetapplication onto the target PC. The target applicatio

Strany 129 - 11 In th

11 xPC Target™ Web Browser Interface1 In the MATLAB window, typexpcwwwenable or close(xpc)The MATLAB interface is disconnected from the target PC, lea

Strany 130

Web Browser Interface5 In the DOS command window, press Ctrl+C.The TCP/IP to RS-232 Gateway stops running, and the DOS commandwindow displays the mess

Strany 131 - Signal Generator

11 xPC Target™ Web Browser InterfaceCommand-Line Option Description-vVerbose mode. Pro duces a line of output every time aclient connects or disconnec

Strany 132

Web Browser InterfaceUsing the Main PaneThe Main pane is divided into four parts, one below the other. The four partsare System Status, xPC Target Pro

Strany 133

11 xPC Target™ Web Browser InterfaceAfter you connect a Web browser to the target PC, you can use the Mainpane to control the target application:1 In

Strany 134

Web Browser Interface4 Enter new values in the StopTime and SampleTime boxes, then clickthe Apply button. You can enter-1 or Inf in the StopTime box f

Strany 135 - Booting from a DOS Device

1 Target and Scop e ObjectsThe xpcsctg scope object of type target has the follo w in g object properties:•Grid• Mode• YLimitThe xpcschost scope objec

Strany 136 - DOSLoader Mode

11 xPC Target™ Web Browser InterfaceSignals with a width greater than the value you enter are not displayedon the Signals pane.2 In the Refresh Interv

Strany 137 - Restrictions

Web Browser InterfaceThe Screen Shot pane is loaded a n d a copy of the current target PC screenis displayed. T he screen shot uses the portable netwo

Strany 138 - 4 Bo oting from a DOS Device

11 xPC Target™ Web Browser Interface3 In the Target selection section, access levels are set in the Systemtarget file box. For example, to set the acc

Strany 139

12Execution Modes• “Introducing Execution Modes” o n page 12-2• “Interrupt Mode” on page 12-3• “Polling Mode” on page 12-5

Strany 140 - Creating a DOS System Disk

12 Execution ModesIntroducing Execution ModesIntroductionInterrupt mode is the default real-time execution mode for the xPC Targetkernel. In certain c

Strany 141 - Embedded Option

Interrupt ModeInterrupt M odeInterrupt mode is the default real-timeexecutionmodefor the kernel. Thismode provides the greatest flexibility and is the

Strany 142 - Introduction

12 Execution Modes• CPU h ardw are latency — Modern CPU s try to predict the next couple ofinstructions, including branches, by the use of instruction

Strany 143

Polling M o dePolling ModePolling m od e fo r the k ern el is de signed to execute target app lic a tion s a tsample times close to the limit of the h

Strany 144 - 5 Embedded Option

12 Execution ModesEven a h ighly clocke d CPU is not likely to lead to an ov erflow of a 64 bitcounter (2^64 * 1e-9 (1 GHz CPU) = 584 years). The Pent

Strany 145

Polling M o de• Use the fastest available computer hardware — Ensure that the CPU withthehighestclockrateavailableisusedforagivenPCformfactor.Forthede

Strany 146

Scope Objects• TriggerS lope• TypeSee the scope object functionget (scope object) for a description of theseobject properties.1-7

Strany 147 - Embedded Option Setup

12 Execution Modes3 In the TLC options edit field, specify the o ption-axpcCPUClockPoll=CPUClockRateMHzTheassignmentoftheclockrateofthetargetPC’sCPUis

Strany 148 - Stand-Alone Target Setup

Polling M o de-axpcCPUClockPoll=1200If you want to execute the target application in interrupt mode again,either remove the option or assign a CPU clo

Strany 149 - Updating Enviro

12 Execution ModesRestrictions Introduced by Polling ModeAs explained above, polling mode ex ecutes the Simulink-based targetapplication in real time

Strany 150

Polling M o deNevertheless, there is a way to stop the execution interactively beforereaching the target application stop time. See “Controlling the T

Strany 151

12 Execution ModesThe Only Rapid-Prototyping Feature Available Is Data LoggingBecause host-target communication and target screen updating are disable

Strany 152

Polling M o derates, the CPU will most likel y overload for the given base sample time. As animportant consequence, polling mode is only a feasible al

Strany 153 - Software Environment and

12 Execution Modesexecution of the target application, depending on the state of the digital inputsignal. You can either use a hardware switch connect

Strany 154 - Target PCs

Polling M o deThe minimu m achievable base sample time for th i s model using an ode4fixed-step integration algorithm is 11 µs with signal logging dis

Strany 155 - Explorer

12 Execution Modes12-16

Strany 156

13Incorporating FortranCode into the xPC TargetEnvironment• “Before You Start” on page 13-2• “Step-by-Step Example of Fortran and xPC Target” on page

Strany 157 - Settings

1 Target and Scop e Objects1-8

Strany 158 - Appearance

13 Incorporating Fortran Code into the xPC Ta rget™ EnvironmentBefore You StartIn this section...“Introduction” on page 13-2“Simulink D emos Folder” o

Strany 159 - 2 In the MATLAB window, type

Before You StartA list of Simulink examples appears.3 Click Custom Code and H and Coded Blocks using the S-functionAPI.The associated Simulink demos p

Strany 160

13 Incorporating Fortran Code into the xPC Ta rget™ Environment4 Run a simu lation C-MEX file w ith the S imulink sof tw are to va li date thecompiled

Strany 161

Step-by-Step Example of Fortran and xPC Target™Step-by-Step Exam ple of Fortran and xPC TargetIn this section...“In This Example” on page 13-5“Creatin

Strany 162

13 Incorporating Fortran Code into the xPC Ta rget™ Environment2 Typesfcndemo_atmosThe sfcndemo_atmos model is displayed.3 Add an xPC Target Scope blo

Strany 163

Step-by-Step Example of Fortran and xPC Target™8 Click Apply,thenOK.9 Double-click the Sine Wave block.10 For the Sample time parameter, enter 0.05.11

Strany 164

13 Incorporating Fortran Code into the xPC Ta rget™ Environment• svml_dis p.lib3 From a DOS prompt, change folder to the working folder and create the

Strany 165 - Environments

Step-by-Step Example of Fortran and xPC Target™Note This topic describes how to create a level 2 Fortran S-function for thefortran_atmos_xpc model. Th

Strany 166

13 Incorporating Fortran Code into the xPC Ta rget™ Environment#endif8 Add a typedef to specify the parameters for the block. For example,typedef enum

Strany 167 - Properties

Step-by-Step Example of Fortran and xPC Target™ssSetOutputPortWidth(S, 1, 3); /* pressure */ssSetOutputPortWidth(S, 2, 3); /* density */#if de fined(M

Strany 168

2Targets and Scopes in theMATLAB InterfaceYou can work with xPC Target target and scope objects through the MATLABinterface (MATLAB Command Window), t

Strany 169

13 Incorporating Fortran Code into the xPC Ta rget™ EnvironmentP[k] = mxGetScalar(P0(S)) * (double) fdelta;rho[k] = mxGetScalar(R0(S)) * (double) fsig

Strany 170 - To check your changes, type

Step-by-Step Example of Fortran and xPC Target™• libifcor e.lib• libifcor emd.lib• ifconsol .lib• libifpor tmd.lib• libifpor t.lib• libmmd.l ib• libm.

Strany 171 - Alternatively, you can type

13 Incorporating Fortran Code into the xPC Ta rget™ EnvironmentYour next task is to validate the Fortran code and wrapper S-function. See“Validating t

Strany 172

Step-by-Step Example of Fortran and xPC Target™• The build procedure has access to the Fortran run-time libraries (see“Compiling and Linking the Wrapp

Strany 173 - Command-Line Interface

13 Incorporating Fortran Code into the xPC Ta rget™ EnvironmentThis command requires that the application build folder be the current folder(one level

Strany 174

14Vector CANape S upportThis topic describes how to use xPC Target to interface thetarget PC to the Vector CAN Application Environment (CANape)(http:/

Strany 175 - Target PC

14 Vector CANape®SupportVector CANapeIn this section...“Introduction” on page 14-2“xPC Target and Vector CANape Limitations” on page 14-3IntroductionY

Strany 176

Vector CANape• An X CP server process in the target a pplication that runs on-demand inthe background.• A generator that produces A2L (ASAP2) files th

Strany 177

14 Vector CANape®SupportConfiguring the xPC Target and Vector CANape SoftwareIn this section...“Setting Up and Building the Model” on page 14-4“Creati

Strany 178

Configuring the xPC Target™ and Vector CANape®Software• Target Address —TargetIPaddressfortargetPC.Thedefaultvalueisgetxpcenv(`TcpIpTargetAddress&apos

Strany 179

2 Targets and Scopes in the MATLAB®InterfaceWorking with Tar get ObjectsIn this section...“Accessing Help f or Target Objects” on page 2-2“Creating Ta

Strany 180

14 Vector CANape®SupportThe xPC Target software builds the target application, including an A2L(ASAP2) data file for the target application.11 On the

Strany 181 - Files and File Systems

Configuring the xPC Target™ and Vector CANape®SoftwareConfiguring the Vector CANape DeviceThis procedure describes how to configure the Vector CANape

Strany 182

14 Vector CANape®SupportThisisthetargetPCtowhichyouhavedownloadedthetargetapplication.11 Ensure that the port number is 5555.12 Click OK.13 If you hav

Strany 183

Configuring the xPC Target™ and Vector CANape®SoftwareConfiguring the Location of the A2L (ASAP2) FileUse this procedure to configure the location of

Strany 184 - methods for both

14 Vector CANape®SupportDuring target application change s, you might need to manually reload theA2L (ASAP2) that is generated by the xPC Target build

Strany 185 - Using xpctar get.ftp Objects

Event Mode Da ta AcquisitionEvent Mode Data AcquisitionIn this section...“Guidelines” on page 14-11“Limitations” on page 14-11GuidelinesTo acquire eve

Strany 186

14 Vector CANape®Support14-12

Strany 187 - Using xpctarget.ftp Objects

15Frequently Asked Questions• “Overview ” on page 15-2• “BIOS Settings” on page 15-3• “Booting Issues” on page 15-4• “Communications” on page 15-6• “I

Strany 188

15 Frequently Asked QuestionsOver viewThis chapter describes guidelines, hints, and tips for questionsor issues y ou might have while using the xPC Ta

Strany 189 - Using xpctar get.fs Objects

BIOS SettingsBIOS SettingsThe BIOS settings of a PC system can affect how the PC works. If youexperience problems using the xPC Target s oftw are, you

Strany 190

Working with Target Ob jectsto the host through an RS-232 connection. In the MATLAB CommandWindow, typetg = xpctarget.xpc('rs232', 'COM

Strany 191 - Using xpctarget.fs Objects

15 Frequently Asked QuestionsBooting IssuesIn this section...“Is Your Host PC MATLAB Interface H alted?” on page 15-4“Is Your Target PC Unable to Boot

Strany 192

Booting Issues• If you still cannot boot the target PC from a boot disk, you might need toreplace the target PC 3.5-inch or CD disk drive.Is the Targe

Strany 193

15 Frequently Asked QuestionsCommunicationsIn this section...“Is There Communication Between Your PCs ?” on page 15-6“Why Does the xPC Target System L

Strany 194

Communications• If the communication between the host PC and target PC is TCP/IP, set thehost PC network interface card (NIC) card and hub to half-dup

Strany 195

15 Frequently Asked QuestionsBy default, if the host PC does not get a response from the target PC afterdownloading a target application and waiting 5

Strany 196

Communications5 Rebuild the model.In this case, the host PC waits for abo ut 20 seconds before declaring thata time-out has occurred. Note that it doe

Strany 197

15 Frequently Asked QuestionsIf you experience this issue, perform the following to try to connect to thetarget PC:1 Connect the network cable to Ethe

Strany 198

Communicationssuch an event, you need to reboot the target and reestablish communicationbetween the host PC and target PC.To get yourself back up and

Strany 199

15 Frequently Asked QuestionsInstallation, Configuration, a nd Build TroubleshootingIn this section...“Troubleshooting xpctest Results” on page 15-12“

Strany 200 - 10 Graphical User Interfaces

Installation, Configuration, and Build TroubleshootingIf you are using a TCP/IP connection and need more help with Test 1, checkthe following:• Be sur

Strany 201

2 Targets and Scopes in the MATLAB®InterfaceDisplaying Tar get Object PropertiesYou might want tolist the target object properties to monitor a target

Strany 202

15 Frequently Asked Questionsxpctest: Test 3 FailsFirst, follow the procedure in “Test 3, Reboot Target Using Direct Call” in thexPC Target Getting St

Strany 203 - From xPC Target Block

Installation, Configuration, and Build Troubleshootingxpctest: Test 4 FailsFirst, follow the procedure in th e “Test 4, Build and Download Application

Strany 204

15 Frequently Asked Questions3 In the Select C compiler field, select the appropriate compiler type(VisualC or Watcom).4 In the Compiler Path field, e

Strany 205 - Marking Block Parameters

Installation, Configuration, and Build Troubleshooting6 Create the boot disk or boot image.7 Reboot the target PC.8 Rerun xpctest.If this procedure do

Strany 206

15 Frequently Asked Questionssuch as 0.001. This change causes the test, and the MATLAB interface itself,to halt. To correct this, set thexpcosc model

Strany 207 - Marking Block Signals

Installation, Configuration, and Build Troubleshootingbottom of the xPC Target block library pop-up window. If the version numberis not the one to whi

Strany 208

15 Frequently Asked QuestionsHow Can I Build a Model That Contains a CAN Board?The procedure to build a model wit hCANblocksdiffersasfollows:• In rele

Strany 209

General xPC Target™ TroubleshootingGeneral xPC Target TroubleshootingIn this section...“General I/O Troubleshooting Guidelines” on page 15-21“Can I Vi

Strany 210

15 Frequently Asked Questions• Ensure that you have properly configured the driver.• Ensure that you are using the latest version of the software .• T

Strany 211 - Interface

General xPC Target™ Troubleshooting• Spurious CPU overloads — Commonly caused by factors outside of themodel desig n. These overloads are most likely

Strany 212 - Web Browser Interface

Working with Target Ob jectstarget_object.property_name = new_property_valueFor example, to change the stop time mode for the target object tg,• In th

Strany 213 - Disconnect

15 Frequently Asked QuestionsTarget PC BIOSUndesirable behavior can occur if any of the following BIOS settings areenabled:• Advanced Po we r Managem

Strany 214

General xPC Target™ TroubleshootingOption DescriptionDefaultxPCMaxOverloadsNumber of acceptable overloads.0xPCMaxOverloadLenNumber of contig uo usacce

Strany 215

15 Frequently Asked QuestionsWith the TLC options, you can use the following blocks in your model to helpkeep track of the number of CPU overloads.• U

Strany 216

General xPC Target™ TroubleshootingHow Can I Reduce the TET in My Application?To reduce the Task Execution Time (TET) in your application:• Use fewer

Strany 217 - Using the Main Pa

15 Frequently Asked QuestionsIf you have or want to us e multiple board s of a particular type in yoursystem, ensure that the I/O drive supports multi

Strany 218

General xPC Target™ Troubleshooting• Number of I/O channelsWhy Is My Requested xPC Target Sample TimeDifferent from the Measured Sample Time?You might

Strany 219 - Changing WWW Properties

15 Frequently Asked Questionsprevious ly calculated v alue of 0.25% , there is a di fference of 0.04% from theexpected value.If you want to further re

Strany 220

General xPC Target™ Troubleshootingavailablespaceonthedisk.Thesignaldata will m ost likely be corrupted andirretrievable. You should delete the signal

Strany 221

15 Frequently Asked QuestionsCan I Create a Stand-Alone xPC Target Application toInteract with a Target Application?Yes. You can use either the xPC Ta

Strany 222 - 4 Click OK

General xPC Target™ TroubleshootingFor example, if a model has a stop time of 2.4 and a step size of 1, theReal-TimeWorkshopsoftwareadjuststhestoptime

Strany 223

Revision HistorySeptember 1999 First printing New for Version 1 (Release 11.1)November 2000 Online only Revised for Version 1.1 (Release 12)June 2001

Strany 224 - Introducing Execution Modes

2 Targets and Scopes in the MATLAB®InterfaceSignals are not target object properties. To get the value of the Integ rator1signal from the model xp cos

Strany 225 - Interrupt M ode

15 Frequently Asked Questions• If the blocks of interest have special ch aracters, retrieve the mangled namewithtg.showsignals='on' or tg.sh

Strany 226 - 12 Execution Modes

General xPC Target™ Troubleshooting• An extended counter takes the output of an encoder block and provides acount that is not limited by register size

Strany 227 - Polling Mode

15 Frequently Asked QuestionsGetting Updated xPC Tar get Releases and HelpIn this section...“How to Get Updated xPC Target Releases” on page 15-36“Are

Strany 228

Getting Updated xPC Target™ Releases and HelpRefer to the MathWorks Support Web SiteThis chapter contains general xPC Target troubleshooting tips. For

Strany 229 - Setting the Polling Mode

15 Frequently Asked Questions15-38

Strany 230

16Target PC Command-LineInterface Reference

Strany 231 - -axpcCPUClockPoll=0

16 Target PC Command-Line Inter face ReferenceTarget PC CommandsIn this section...“Introduction” on page 16-2“Target Object Methods” on page 16-2“Targ

Strany 232

Target PC CommandsTarget PCCommand Description and Syntax MATLAB EquivalentstartStart the target applicationcurrently loaded on the targetPC.Syntax:st

Strany 233 - Target Application

16 Target PC Command-Line Inter face ReferenceTarget PCCommand Description and Syntax MATLAB EquivalentSyntax: setparparameter_index =floating_point_n

Strany 234

Target PC Commandsthe difference between a signal index (0, 1,...)andasignalname(S0, S1,...).The following table lists the syntax forthetargetcommands

Strany 235 - Within a Model

Working with Scope ObjectsWorking with Scope ObjectsIn this section...“Accessing Help for Sco pe Objects” on page 2 -7“Displaying Scope O b ject Prope

Strany 236

16 Target PC Command-Line Inter face ReferenceTarget PCCommand Description and Syntax MATLAB Equivalentylimit ylimit scope_indexylimit scope_index =au

Strany 237 - Polling M o de

Target PC CommandsTarget PC MATLAB Equivalenttriggermode scope_index =0, freerun, 1, softwar e, 2,signal, 3, scopesc.TriggerMode = 'freerun'

Strany 238

16 Target PC Command-Line Inter face ReferenceTarget PCCommand Description and SyntaxMATLABEquivale ntsetvarSet a variable to a value. L ater you can

Strany 239 - Code into the xPC Target

17Function ReferenceSoftware Environment (p. 17-2) Define software and hardwareenvironment of host and target PCsGUI (p. 17-3) Open xPC Target ancilla

Strany 240 - Before You Start

17 Function ReferenceSoftware EnvironmentgetxpcenvList environment propertiesassigned to MATLAB variablesetxpcenvChange xPC Target environmentproperti

Strany 241 - Prerequisites

GUIGUIxpcexplrOpen xPC Target ExplorerxpctargetspyOpen Real-Time x PC Target Spywindow on host PC17-3

Strany 242

17 Function ReferenceTestgetxpcinfoRetrieve diagnostic inf ormationto help troubleshoot configurationissuesgetxpcpciDetermine which PCI boards areinst

Strany 243 - In This Example

Target Application ObjectsTarget Application ObjectsaddscopeCreate scopescloseClose serial port connecting ho st PCwith target PCdeleteRemove target o

Strany 244

17 Function Referenceset (target applicationobject)Change target application objectproperty valuessetparamChange writable target objectparametersstart

Strany 245 - Compiling Fortran Files

Scope ObjectsScope ObjectsaddsignalAdd signals to scope represented byscope objectget (scope object)Return property values for scopeobjectsremsignalRe

Strany 246 - SimStruct)

2 Targets and Scopes in the MATLAB®Interfacesc1The current s cope properties are uploaded to the host PC, and thenMATLAB displays a lis t of the scope

Strany 247

17 Function ReferenceFile and File System ObjectsDirectories (p. 17-8) Manage file system and F TP objectsFTP (p. 17-8)Manage FTP objectsFile System (

Strany 248

File and File System ObjectsfopenOpen target PC file for readingfreadRead open target PC filefwriteWrite binary data to open target PCfilegetfilesizeS

Strany 249

17 Function ReferencexPC Target Environment Collection ObjectAdd (env collection object)Add new xPC Target environmentcollection o bjectget (env colle

Strany 250

xPC Target™ Utiliti esxPC Tar get UtilitiesmacaddrConvert string-based MAC addressto vector-based onereadxpcfileInterpret raw data from xPC Targetfile

Strany 251

17 Function Reference17-12

Strany 252

18Functions

Strany 253

Add (env c olle ction object)Purpose Add new xPC Target environment collection objectSyntax MATLAB command lineenv_collection_object.AddDescription Me

Strany 254

addscopePurpose Create scopesSyntax MATLAB command lineCreate a scope and scope object w ithout assigning to a M ATLABvariable.addscope(target_object,

Strany 255 - Vector CANape S upport

addscope10 scopes of type target and h o st, and eight scopes of type file, for amaximum of 28 scopes. If you try to add a scope with the same index a

Strany 256 - Vector CANape

addscopeorsc1 = tg.addscope('target',1)Create a scope with the method addscope and then create a scopeobject, corresponding to this scope, u

Strany 257 - - tg.stop

Working with Scope ObjectsSetting the Value of a Scope PropertyWith the xPC Target software you can use either a function syntax or anobject property

Strany 258 - 14 Vector CANape

addsignalPurpose Add signals to scope represented by scope o bjectSyntax MATLAB command lineaddsignal(scope_object_vector, signal_index_vector)scope_o

Strany 259 - Software

addsignalDisplay a list of properties and values for the scope object sc1 with thepropertySignals, as shown below.sc1.SignalsSignals = 1 : Signal Gene

Strany 260

cdPurpose Change folder on target PCSyntax MATLAB command linecd(file_obj,targ et_PC_dir)file_obj.cd(target_PC_dir)Argumentsfile_objName of the xpctar

Strany 261

closePurpose Close seria l port conn ectin g host PC with target PCSyntax MATLAB command lineclose(target_object)target_object.closeArgumentstarget_ob

Strany 262

deletePurpose Remove target obje ctSyntax MATLAB command linedelete(target_object)target_object.deleteArgumentstarget_objectName of a target object.De

Strany 263

dirPurpose List contents of current folder on target P CSyntax MATLAB command linedir(file_obj)Argumentsfile_objName of the xpctarget.ftp or xpctarget

Strany 264

dir• isdir — Logical value indicating that the object is (1)orisnot(0)afolderExamples List the contents of the current folder for the file system obje

Strany 265 - Event Mode Data Acquisition

diskinfoPurpose Information a bout target PC driveSyntax MATLAB command linediskinfo(filesys_obj,target_PC_drive)filesys_obj.diskinfo(target_PC_drive)

Strany 266

diskinfoExamples Return disk information for the targetPCC:\driveforthefilesystemobjectfsys.diskinfo(fsys,'C:\') or fsys.diskinfo('C:\&

Strany 267

fclosePurpose Close open target PC file(s)Syntax MATLAB command linefclose(filesys_obj,file_ID)filesys_obj.fclose(file_ID)Argumentsfilesys_objName of

Strany 268 - Over view

2 Targets and Scopes in the MATLAB®InterfaceGetting the Value of a Scope PropertyYou can list a property value in the MATLAB window or assign that val

Strany 269 - BIOS Settings

fc422mexcalcbitsPurpose Calculate parameter values for Fastcom 422/2-PCI boardSyntax MATLAB command line[a b ] = fc422mexcalcbits(frequency)[a b df] =

Strany 270 - - XPCTGB1.RTA

fileinfoPurpose Target PC file informationSyntax MATLAB command linefileinfo(filesys_obj,file_ID)filesys_obj.fileinfo(file_ID)Argumentsfilesys_objName

Strany 271 - Is the Target PC Halted?

filetablePurpose Information about open files in target PC file systemSyntax MATLAB command linefiletable(filesys_obj)filesys_obj.filetableArgumentsfi

Strany 272 - Communications

filetablefsys.fclose(h1);See Also xPC Target file object methods fopen and fclose.18-19

Strany 273

fopenPurpose Open target PC file fo r readingSyntax MATLAB command linefile_ID = fopen(file_obj,'f ile_name')file_ID= file_obj.fop en('

Strany 274 - 15 Frequently Asked Questions

fopenOpen the file for reading and writing. Initially, the file pointer is atthebeginningofthefile. Themethoddoesnothingifthefiledoesnot already exist

Strany 275 - Communication Issues?

freadPurpose Read open target PC fileSyntax MATLAB command lineA = fread(file_obj,file_ID)A = file_obj.fread(file_ID)A = fread(file_obj, file_ID, offs

Strany 276

freadlength(A) might be less than the number of bytes requested if thatnumber of bytes are not currently available. It is zero if the operationreaches

Strany 277

fwritePurpose Write binary data to open target PC fileSyntax MATLAB command linefwrite(file_obj,file_ID,A)file_obj.fwrite(file_ID,A)Argumentsfile_objN

Strany 278

fwriteSee Also xPC Target file object methods fclose, fop en,andfrea d.MATLABfwrite function.18-25

Strany 279

Working with Scope ObjectsNote Method names a re case sensitive. You must type the entire name.Property names are not case sensitive. You do not need

Strany 280 - - Reinstall the software

get (env c olle ction object)Purpose Return target object collection environment property valuesSyntax MATLAB command lineget(env_collection_object, &

Strany 281 - 2 At the MATLAB prompt, type

get (env collection object)Property Description WritableDefaultTargetContains an instance of thedefaulttargetenvironmentobject(xpctarget.env).NoFloppy

Strany 282

get (env c olle ction object)See Also xPC Target target object e nvironment method set (env collectionobject)Built-in MATLAB functions get and set18-2

Strany 283

get (env object)Purpose Return target environment property v aluesSyntax MATLAB command lineget(env_object)get(env_object, 'property_name1',

Strany 284

get (env object)Environment Property Description WritableNameTarget PC name.YesHostTargetCommValues are 'RS232' and 'TcpIp'.From t

Strany 285 - Troubleshooting Build Issues

get (env object)Environment Property Description WritableMaxModelSizeBootFloppy and DOSLoader modes ignorethis value.Values are'1MB', '

Strany 286

get (env object)Environment Property Description WritableTargetScopeValues are ' Disabled' and 'Enabled'.From the xPC Target Explo

Strany 287

get (env object)Environment Property Description WritableCDBootImageLocationLocation of cdboot.iso file f o r creation ofCD target boot disk.YesEmbedd

Strany 288

get (env object)Environment Property Description WritableTcpIpTargetAddressValue is 'xxx.xxx.xxx.xxx'.In the xPC Target Explorer window Targ

Strany 289

get (env object)Environment Property Description WritableTcpIpGatewayValue is 'xxx.xxx.xxx.xxx'.In the xPC Target Explorer window TcpIpgatew

Strany 290

2 Targets and Scopes in the MATLAB®Interface1 In the MATLAB window, typesc=tg.addscope('file')The xPC Target software creates a scope of typ

Strany 291

get (env object)Environment Property Description WritableTcpIpTargetBusTypeValues are ' PCI' and 'ISA'.From the xPC Target Explore

Strany 292

get (env object)Environment Property Description Writableanother IRQ and make the correspondingchangestoyourjumpersettings.TcpIpTargetISAMem PortValue

Strany 293 - - Signal lo

get (env object)See Also set (env object)18-38

Strany 294

get (ftp)Purpose Retrieve copy of requested file from target P CSyntax MATLAB command lineget(file_obj,file_name)file_obj.get(file_name)Argumentsfile_

Strany 295

get (scope object)Purpose Return property values for scope objectsSyntax MATLAB command lineget(scope_object_vector)get(scope_object_vector, 'sco

Strany 296

get (scope object)Property Description Writableboxtohavethescopeoftype'File' collectdata up to Number of samples,thenstop.If the named signa

Strany 297

get (scope object)Property Description Writablename, including the specifie r, cannot exceedeight characters.For scopes of type'Host' or &ap

Strany 298

get (scope object)Property Description Writablebeginning and overwrites the first file namein the series . If you do not retrieve the datafrom ex isti

Strany 299 - Partitions?

get (scope object)Property Description Writablewhen the fil e is closed and not du r ing each f ilewrite ope ration. This mode is faster, but if thesy

Strany 300

get (scope object)Property Description WritableScopeIdA numeric index, unique for each scope.NoSignalsList of signal indice s from the target object t

Strany 301 - 2^(n-1)

Working with Scope ObjectsNote Remember to start your scope to acquire signal data.For example, configure a scope of type file named sc to the applica

Strany 302

get (scope object)Property Description WritableAs a special case, setting TriggerSample to-1 means that the current scope is triggeredat the end of th

Strany 303 - Refer to the Documentation

get (scope object)Property Description WritableWriteSizeEnter the block size, in bytes, of the d atachunks. This parameter specifies that amemory buff

Strany 304

get (scope object)See Also The xPC Target scope object method set (scop e object).The target object methodsset (target application object).The built-i

Strany 305 - Interface Reference

get (target application object)Purpose Return target application object property valuesSyntax MATLAB command lineget(target_object, 'target_objec

Strany 306 - Target PC Commands

get (target application object)Property Description Writable• Asynchronous interruptions.• Parameter updating latency (if theDouble buffer parame t er

Strany 307

get (target application object)Property Description WritableLogModeControls which data points are logged:• Time-equidistant logging. Logs a datapointa

Strany 308 - Scope Object Methods

get (target application object)Property Description WritableModeType of Real-Time Workshop codegeneration. Val ue s are'Real-TimeSingletasking&ap

Strany 309

get (target application object)Property Description WritableParametersList of tunable parameter s. This li st isvisible only whenShowParameters is set

Strany 310

get (target application object)Property Description WritableShowSignalsFlag set to view or hide the list of signalsfrom your Simulink blocks. This lis

Strany 311

get (target application object)Property Description WritableTETLogStorage in the MATLAB workspace fora vector containing task execution timesduring ex

Strany 312

2 Targets and Scopes in the MATLAB®Interface6 Toenablethefilescopetocreatemultiplelogfileswiththesamenamepattern, typesc.Filename='file_<%>

Strany 313

getfilesizePurpose Size of file on target P CSyntax MATLAB command linegetfilesize(file_obj,file_ID)file_obj.getfilesize(file_ID)Argumentsfile_objName

Strany 314 - Software Environment

getlogPurpose All or part of output logs f rom target objectSyntax MATLAB command linelog = getlog(target_object, 'log_name', first_point,nu

Strany 315 - Open xPC Target Explorer

getparamPurpose ValueoftargetobjectparameterindexSyntax MATLAB command linegetparam(target_object, parameter_index)Argumentstarget_objectName of a tar

Strany 316 - 17 Function Reference

getparamidPurpose Parameter index from parameter listSyntax MATLAB command linegetparamid(target_object, 'block_name', 'parameter_name&

Strany 317 - Target Application Objects

getparamidTroubleshooting chapter question “Why Does the getparamid FunctionReturn Nothing?” on page 15-33.18-60

Strany 318

getparamnamePurpose Block path and parameter name from index listSyntax MATLAB command linegetparamname(target_object, parameter_index)Argumentstarget

Strany 319

getscopePurpose Scope object pointing to scope defined in kernelSyntax MATLAB command linescope_object_vector = getscope(target_object, scope_number)s

Strany 320 - File and File System Objects

getscopethe target PC. To change the number of samples, you need to create ascope object and then change the scope object propertyNumSamples.sc1 = get

Strany 321

getsignalPurpose ValueoftargetobjectsignalindexSyntax MATLAB command linegetsignal(target_object, signal index)Argumentstarget_objectName of a target

Strany 322

getsignalidPurpose Signal index or signal property from signal listSyntax MATLAB command linegetsignalid(target_object, 'signal_name')tg.get

Strany 323

Working with Scope Objects• Freerun — Starts to acquire data as soon as the scope is started (default)•Software — Starts to acquire data in response t

Strany 324

getsignalidsfromlabelPurpose Return vector of signal indicesSyntax MATLAB command linegetsignalidsfromlabel(target_object, signal_label)target_object.

Strany 325

getsignallabelPurpose Return signal labe lSyntax MATLAB command linegetsignallabel(target_object, signal_index)target_object.getsignallabel(signal_ind

Strany 326 - Add (env c olle ction object)

getsignalnamePurpose Signal name from index listSyntax MATLAB command linegetsignalname(target_object, signal_index)target_object.getsignalname(signal

Strany 327 - Arguments

getTargetNames (env collection object)Purpose Retrieve xPC Target environment object namesSyntax MATLAB command lineenv_collection_object.getTargetNam

Strany 328

getxpcenvPurpose List environment properties assigned to MATLAB variableSyntax MATLAB command linegetxpcenvDescription Function to list environment pr

Strany 329

getxpcenvEnvironment P rope rty DescriptionEmbeddedOptionValues are 'Disabled' and 'Enabl ed'. This propertyis read only.Note that

Strany 330

getxpcenvEnvironment P rope rty Descriptionenough memory for the target application and createsan error.Note, you cannot build a 16 MB target applicat

Strany 331

getxpcenvEnvironment P rope rty DescriptionSecondaryIDEValues are 'off' and 'on'.Setthisvalueto'on' onlyif you want to u

Strany 332 - ,targ et_PC_dir)

getxpcenvEnvironment P rope rty Descriptionmemory up to 64 MB. If the target PC does not containmore than 64 MB of R AM, or yo u do not want to usemor

Strany 333

getxpcenvEnvironment P rope rty DescriptionTcpIpSubNetMaskValue is 'xxx.xxx.xxx.xxx' .In the xPC Target Explorer window LAN subnetmask addre

Strany 335

2 Targets and Scopes in the MATLAB®Interface• If NumPrePostSamples is a positive number, the scope is in a posttriggeringmode, where it starts collect

Strany 336

getxpcenvEnvironment P rope rty DescriptionTcpIpTargetDriverValues are 'NE2000', 'SMC 91C9 X', 'I82559','RTLANCE&ap

Strany 337

getxpcenvEnvironment P rope rty DescriptionTcpIpTargetISAMemPortValue is '0xnnnn'.IfyouareusinganISAbusEthernetcard,youmustenter values for

Strany 338

getxpcinfoPurpose Retrieve di agnostic information to help troubleshoo t configurationissuesSyntax MATLAB command linegetxpcinfogetxpcinfo('-a&ap

Strany 339 - ,file_ID)

getxpcpciPurpose Determine which PCI boards are installed in target PCSyntax MATLAB command linegetxpcpci(target_object, 'type_of_boards')ge

Strany 340

getxpcpciwhichhavetobeprovidedtoadriverblockdialogboxbeforethemodel build process.Examples The following example displays the installed PCI devices, n

Strany 341

getxpcpcipcidevs = getxpcpci18-81

Strany 342

Item (env collection object)Purpose Retrieve specific x P C Target environment (env) o bj ectSyntax MATLAB command lineenv_collection_object.Item(&apo

Strany 343

loadPurpose Download target application to ta rge t PCSyntax MATLAB command lineload(target_object,'target_application')target_object.load(&

Strany 344

loadparamsetPurpose Restore parameter value s saved in specified fileSyntax MATLAB command lineloadparamset(target_object,'filename')target_

Strany 345

macaddrPurpose Convert string-based MAC address to vector-based oneSyntax MATLAB command linemacaddr('MAC address')Argument'MAC address

Strany 346

Working with Scope Objects- sc(2).TriggerSam ple = range 0 to (N + P - 1)In the figures below, TP is the trigger point or sample where a trigger event

Strany 347

makeDefault (env collection o bjec t)Purpose SetspecifictargetPCenvironment object as defaultSyntax MATLAB command lineenv_collection_object.makeDefau

Strany 348

mkdirPurpose Make folder on target PCSyntax MATLAB command linemkdir(file_obj,dir_name)file_obj.mkdir(dir_name)Argumentsfile_objName of the xpctarget.

Strany 349

putPurpose Copy file from host PC to target PCSyntax MATLAB command lineput(file_obj,file_name)file_obj.put(file_name)Argumentsfile_objName of the xpc

Strany 350

pwdPurpose Current folder path of target PCSyntax MATLAB command linepwd(file_obj)file_obj.pwdArgumentsfile_objName of the xpctarget.ftp or xpctarget.

Strany 351

readxpcfilePurpose Interpret raw data from xPC Target file formatSyntax file=readxpcfile(data)readxpcfile('filename')ArgumentsdataVector of

Strany 352

readxpcfilexpcftp=xpctarget.ftpxpcftp.get('filename')datafile = readxpcfile('filename') % Convert the dataUse the xpctarget.ftp ob

Strany 353

rebootPurpose Reboot target PCSyntax MATLAB command linereboot(target_object)Target PC command linerebootArgumentstarget_objectName of an existing tar

Strany 354

Remove (env collection object)Purpose Remove specific xPC Target environment objectSyntax MATLAB command lineenv_collection_object.Remove('env_co

Strany 355

removefilePurpose Remove file from target PCSyntax MATLAB command lineremovefile(file_obj,file_name)file_obj.removefile(file_name)Argumentsfile_nameNa

Strany 356

remscopePurpose Remove scope from ta rget P CSyntax MATLAB command lineremscope(target_object, scope_number_vector)target_object.remscope(scope_number

Strany 357

2 Targets and Scopes in the MATLAB®InterfacePosttriggering (P>0)Scope 1 triggers Scope 2 after the trigger event occurs. The following describessom

Strany 358

remscopeNote that you c an only permanently remove scopes that a re added withthe methodaddscope. This is a scope that is outside a model. If youremov

Strany 359

remsig nalPurpose Remove signals from scope repre sented by scope objectSyntax MATLAB command lineremsignal(scope_object)remsignal(scope_object, signa

Strany 360

remsignalRemove signals from the scope on the target PC w ith the scope objectpropertySignals updated.remsignal(sc1,[0,1])orsc1.remsignal([0,1])See Al

Strany 361

rmdirPurpose Remove folder from target PCSyntax MATLAB command linermdir(file_obj,dir_name)file_obj.rmdir(dir_name)Argumentsdir_nameName of the folder

Strany 362 - See Also set (env object)

saveparamsetPurpose Save current target application parameter valuesSyntax MATLAB command linesaveparamset(target_object,'filename')target_o

Strany 363

selectdrivePurpose Select target PC driveSyntax MATLAB command lineselectdrive(file_obj,'drive')file_obj.selectdrive('drive')Argum

Strany 364

set (env collection object)Purpose Change target object environment collection object property valuesSyntax MATLAB command lineset(env_collection_obje

Strany 365

set (env collection object)Property Description WritableCCompilerValues are 'Watcom' and 'VisualC'.From the xPC Target Explorerwin

Strany 366

set (env collection object)set(tgs)ans =CCompiler: {2x1 cell}CompilerPath: {}DefaultTarget: {}NumTargets: {}Change the p roperty CCompiler to Watcom.t

Strany 367

set (env object)Purpose Change target environment object property valuesSyntax MATLAB command lineset(env_object)set(env_object, 'property_name1&

Strany 368

Working with Scope ObjectsNote The difference b etwe en setting TriggerSample = (N + P - 1),whereN and P are the parameters of the triggering scope (S

Strany 369

set (env object)Environment Property Descrip tion WritableNameTarget PC name.YesHostTargetCommValues are 'RS232' and 'TcpIp'.From

Strany 370

set (env object)Environment Property Descrip tion WritableManual, and enter the amount of RAMinstalled in the target PC.MaxModelSizeBootFloppy and DOS

Strany 371

set (env object)Environment Property Descrip tion WritableTargetScopeValues are 'Disable d' and'Enabled'.From the x PC Target Expl

Strany 372 - The built-in MATLAB functions

set (env object)Environment Property Descrip tion WritableNetworkBoot.WiththexPCTargetEmbedded Option product licensedand installed, you have the addi

Strany 373

set (env object)Environment Property Descrip tion WritableRS232BaudrateValues are '115200', ' 57600','38400', '1920

Strany 374

set (env object)Environment Property Descrip tion WritableTcpIpGatewayValue is 'xxx.xxx.xxx.xxx'.In the xPC Target Explorer w indowTcpIp gat

Strany 375

set (env object)Environment Property Descrip tion WritableTcpIpTargetBusTypeValues are 'PCI' and 'ISA'.From the x PC Target Explor

Strany 376

set (env object)Environment Property Descrip tion Writablein your target PC, choose anotherI/O po r t base address and mak e thecorresponding changes

Strany 377

set (env object)Environment Property Descrip tion WritableMathWorksrecommendssettingtheIRQ to 5, 10, or11.Ifoneofthesehardware settings leads to a con

Strany 378

set (scope object)Purpose Change property values for scope objectsSyntax MATLAB command lineset(scope_object_vector)set(scope_object_vector, property_

Strany 379

2 Targets and Scopes in the MATLAB®InterfaceAcquisition of Gap-Free DataThe following procedure describes how you can programmatically acquiregap-free

Strany 380

set (scope object)The properties for a scope object are listed in the following table. Thistable includes descriptions of the properties and the prope

Strany 381

set (scope object)Property Description WritableDynamicFileNameValues are 'on' and 'off'.Bydefault,thevalue is'off'.Enabl

Strany 382

set (scope object)Property Description Writablefile nam e, an underscore (_), and a <>specifier. Within the specifier, enter one toeight% symbol

Strany 383

set (scope object)Property Description WritableMaxWriteFileSizeProvide the maximum size of Filename,in bytes. This value must be a multiple ofWriteSiz

Strany 384

set (scope object)Property Description WritableFor scopes of type Host, this parameterhas no effect.NumPrePostSamplesFor scopes of type 'Host&apo

Strany 385

set (scope object)Property Description WritableSignalsList of signal indices from the target objectto display on the scope.YesStatusIndicate whether d

Strany 386

set (scope object)Property Description WritableAs a special case, setting TriggerSam pleto -1 means that the current scope istriggered at the end of t

Strany 387 - NumSamples

set (scope object)Property Description WritableWriteSizeEnter the block size, in bytes, of the datachunks. This parameter s pecifies thata m emory buf

Strany 388

set (scope object)NumPrePostSamples: {}Mode: {5x1 cell}YLimit: {}Grid: {}The property value for the scope object sc1 is changed to on:sc1.set('gr

Strany 389

set (target application object)Purpose Change target application object property valuesSyntax MATLAB command lineset(target_object)set(target_object,

Strany 390

Working with Scope Objects5 Set the NumSamples property for both scopes to 500 and the TriggerSamp leproperty for both scopes to -1. With this propert

Strany 391

set (target application object)are listed in the following table. This table includes a description ofthe properties:Property Description WritableComm

Strany 392

set (target application object)Property Description WritableShowParametersFlag set to view or hidethe list of parameters fromyour Simulink blocks. Thi

Strany 393

set (target application object)The function set typically does not return a value. How eve r , if calledwith an explicit return arg u ment, for exampl

Strany 394

setparamPurpose Change writable target object parametersSyntax MATLAB command linesetparam(target_object, parameter_index, parameter_value)Argumentsta

Strany 395

setparamNewValues: {[10] [100]}18-130

Strany 396

setxpcenvPurpose Change xPC Target environment propertiesSyntax MATLAB command linesetxpcenv('property_name', 'property_value')set

Strany 397

setxpcenvEnvironment Property DescriptionCDBootImageLocationLocation of cdboot.i so file for creation of CD target bootdisk.CompilerPathValue is a val

Strany 398

setxpcenvEnvironment Property DescriptionMaxModelSizeBootFloppy and DOSLoader modes ignore this value.Values are'1MB', '4 MB',and&

Strany 399

setxpcenvEnvironment Property DescriptionRS232HostPortValues are 'COM1' and 'COM2'.From the xPC Target Explorer window Host port l

Strany 400

setxpcenvEnvironment Property DescriptionTargetRAMSizeMBValues are 'Auto' and 'Manual'.From the xPC Target Explorer window Target

Strany 401

2 Targets and Scopes in the MATLAB®Interface% Save the data.t( end + 1 : end + 500) = sc(scNum).Time;data(end + 1 : end + 500, :) = sc( scNu m).Data;%

Strany 402

setxpcenvEnvironment Property DescriptionTcpIpGatewayValue is 'xxx.xxx.xxx.xxx'.In the xPC Target E xplo rer window TcpIp gatewayaddress box

Strany 403

setxpcenvEnvironment Property DescriptionTcpIpTargetBusTypeValues are 'PCI' and 'ISA'.From the xPC Target Explorer window TcpIp ta

Strany 404

setxpcenvEnvironment Property DescriptionTcpIpTargetISAIRQValue is 'n',wheren is between 4 and 15.If you are using an ISA bus Ethernet card,

Strany 405

setxpcenvUsing the function set xpce nv w ithout arguments returns a list ofallowed property values in the MATLAB window.Examples List the current env

Strany 406 - Item (env collection object)

star t (scope object)Purpose Start execution of scope on target PCSyntax MATLAB command linestart(scope_object_vector)scope_object_vector.start+scope_

Strany 407

start (scope object)Examples Start one scope with the scope object sc1.sc1 = getscope(tg,1) or sc1 = tg.getscope(1)start(sc1) or sc1.start or +sc1or t

Strany 408

star t (target application object)Purpose Start execution of target application on target PCSyntax MATLAB command linestart(target_object)target_objec

Strany 409

stop (scope object)Purpose Stop ex ecution of scope on target PCSyntax MATLAB command linestop(scope_object_vector)scope_object.stop-scope_objectstop(

Strany 410

stop (scope object)allscopes = getscope(tg) or allscopes = tg.getscope.stop(allscopes) or allscopes.stop or -allscopesor typestop(getscope(tg)) or sto

Strany 411

stop (target application object)Purpose Stop execution of target application on target P CSyntax MATLAB command linestop(target_object)target_object.s

Strany 412

Working with Scope Objectsstart(tg);% Star t things off by triggering scope 1.scNum = 1;sc(scNum).trigger;% Use the two scopes as a double buffer to l

Strany 413

tar getpingPurpose Test communication between host and target computersSyntax MATLAB command linetargetping(target_object)target_object.targetpingArgu

Strany 414 - Syntax file=readxpcfile(data)

triggerPurpose Software-trigger start of data acquisition for scope(s)Syntax MATLAB command linetrigger(scope_object_vector) or scope_object_vector.tr

Strany 415

triggerallscopes.triggermode = 'software'allscopes.start or start(allscopes) or +allscopesallscopes.trigger or trigger(allscopes)18-148

Strany 416 - Purpose Reboot target PC

unloadPurpose Remove current target application from target P CSyntax MATLAB command lineunload(target_object)target_object.unloadArgumentstarget_obje

Strany 417

updatexpcenvPurpose Change current environment properties to n ew propertiesSyntax MATLAB command lineupdatexpcenvDescription Function to update envir

Strany 418

xpcPurpose Call target object cons tructor, xpctarget.xpcSee Also xpctarget.xpc18-151

Strany 419

xpcbootdiskPurpose Create xPC Target boo t disk or DO S Loader files and confirm currentenvironment p ropertiesSyntax MATLAB command linexpcbootdiskDe

Strany 420

xpcbootdiskExamples To create a boot floppy disk, in the MATLAB window, type:xpcbootdiskSee Also The xPC Target functions setxpcenv, getxpcenv,andupda

Strany 421

xpcbytes2filePurpose Generate file suitable for use by From File blockSyntax xpcbytes2file(filename, var1, ...,varn)ArgumentsfilenameNameofthedatafile

Strany 422 - Signals updated

xpcexplrPurpose Open xPC Target ExplorerSyntax MATLAB command linexpcexplrDescription This graphical user interface (GU I) allows you to• Manage an xP

Strany 423

2 Targets and Scopes in the MATLAB®Interface2-24

Strany 424

xpcnetbootPurpose Create kernel to boot target PC ov er dedicated networkSyntax MATLAB command linexpcnetbootxpcnetboot targetPCnameArgumentstargetPCN

Strany 425

xpctarget.fsPurpose Create xPC Target file system objectSyntax MATLAB command linefilesys_object = xpctarget.fs('mode', 'arg1', &a

Strany 426

xpctarget.fsfilesys_object=xpctarget.fsIf you have multiple target PCs in your system, or if you want toidentify a target PC with the file system obje

Strany 427

xpctarget.ftpPurpose Create xPC Target FTP objectSyntax MATLAB command linefile_object = xpctarget.ftp('mode', 'arg1', 'arg2&

Strany 428

xpctarget.ftpIf you have multiple target PCs in your system, or if you want toidentify a target PC with the file object, use the following syntax tocr

Strany 429

xpctarget.targetsPurpose Create container object to manage target PC environment collectionobjectsSyntax MATLAB command lineenv_collection_object = xp

Strany 430

xpctarget.targetsMethodDescriptionmakeDefault (envcollection object)Set target PC environment collectionobject as default.Remove (env collectionobject

Strany 431 - MaxModelSize

xpctarget.targetstgs =xpctarget.targetst = xpctarget.xpcSee Also xPC Target methods get (env collectio n object) and set (envcollection object)18-163

Strany 432

xpctarget.xpcPurpose Create target object representing target applicationSyntax MATLAB command linetarget_object = xpctarget.xpc('mode', &ap

Strany 433

xpctarget.xpcDescription Constructor of a target object. The target object represents the targetapplication and target PC. You make changes to the tar

Strany 434

3Signals and ParametersChanging parameters in your target application while it is running in realtime, and checking the results by viewing signal d at

Strany 435

xpctarget.xpctg1=xpctarget.xpc('RS232','COM1','115200')xPC ObjectConnected = YesApplication = loaderIf y ou have an xPC

Strany 436

xpctargetpingPurpose Test communication between host and target PCsSyntax MATLAB command linexpctargetpingxpctargetping('mode', 'arg1&a

Strany 437

xpctargetpingIf you have multiple target PCs in your system, use the following syntaxto identify the target PC to ping.xpctargetping('mode',

Strany 438 - See Also get (env object)

xpctar getspyPurpose Open Real-Time xPC Target Spy window o n host PCSyntax MATLAB command linexpctargetspyxpctargetspy(target_object)xpctargetspy(&ap

Strany 439

xpctargetspyThe behavio r of this function depends on the value for the environmentpropertyTargetScope:• IfTargetScope is enabled, a single graphics s

Strany 440

xpctestPurpose Test xPC Target installationSyntax MATLAB command linexpctestxpctest('target_name')xpctest('-noreboot')xpctest(&apo

Strany 441

xpctestxpctest('target_name') runs the tests on the target PC identifiedby'target_name'.xpctest('target_name', 'reb

Strany 442

xpcwwwenablePurpose Disconnect target PC from current client applicationSyntax MATLAB command linexpcwwwenablexpcwwwenable('target_obj_name'

Strany 443

xpcwwwenable18-174

Strany 444

19Configuration Parameters

Strany 445

ContentsTarget and Scope Objects1Target Objects ... 1-2What Is a Target Object?... 1-2Scope

Strany 446

3 Signals and ParametersMonitoring SignalsIn this section...“Introduction” on page 3-2“Signal Monitoring with xPC Target Exp lorer” on page 3-2“Signal

Strany 447

19 Configuration ParametersxPC Target options Pane19-2

Strany 448

xPC Target o ptio ns PaneIn this section...“xPC Target options Overview” on page 19-4“Include model hierarchy on the target application” on page 19-27

Strany 449

19 Configuration ParametersxPC Target options OverviewSet up general information about building target applications, includingtarget, execution, data

Strany 450 - SampleTime

xPC Target o ptio ns PaneAutomatically download application after buildingEnable Real-Time Workshop t o build and download the target applicationto th

Strany 451

19 Configuration ParametersDownload to default target PCDirect Real-Time Workshop to download the target application to the defaulttarget PC.SettingsD

Strany 452

xPC Target o ptio ns PaneSpecify target PC nameSpecify a target PC name for your target application.Settings''TipThe target PC name appears

Strany 453

19 Configuration ParametersName of xPC Target object created by build processEnter the name of the target object created by the build process.Settings

Strany 454 - NewValues: {[10] [100]}

xPC Target o ptio ns PaneUse default commun ication t imeoutDirect xPC Target software to wait 5 (default) seconds for the targetapplicationtobedownlo

Strany 455

19 Configuration ParametersSpecify the communication timeout in secondsSpecify a timeout, in seconds, to wait for the target application to downloadto

Strany 456

xPC Target o ptio ns PaneExecution modeSpecify target application execution mode.SettingsDefault: Real-TimeReal-TimeExecutes target application in rea

Strany 457

Monitoring Signals1 If xPC Target Explorer is not started, start it now. In xPC TargetExplorer, select the no de of the running target application in

Strany 458

19 Configuration ParametersReal-time interrupt sourceSelect a real-time interrupt source from the I/O board.SettingsDefault: TimerTimerSpecifies that

Strany 459

xPC Target o ptio ns PaneI/O board generating the interruptSpecify the board interrupt source.SettingsDefault: None/OtherNone/OtherSpecifies that the

Strany 460

19 Configuration ParametersSBS_25x0_ID_0x101Specifies that the interrupt source is an SBS Technologies sharedmemory board associated with ID 0x 1 01 .

Strany 461

xPC Target o ptio ns Pane'SBS_25x0_ID_0x100' |'SBS_25x0_ID_0x101' |'SBS_25x0_ID_0x102' |'SBS_25x0_ID_0x103' |&

Strany 462

19 Configuration ParametersPCI slot (-1: autosearch) or ISA base addressEnter the slot number or base address for the I/O board generating theinterrup

Strany 463

xPC Target o ptio ns PaneAllow tasks to execute concurrentlyEnables multirate models to take advantage of t arget PCs that have multicoreprocessors.Se

Strany 464

19 Configuration ParametersValue: 'on' | 'off'Default: 'off'See AlsoxPC Target O ptions“Automatically handle rate transi

Strany 465

xPC Target o ptio ns PaneLog Task Execution TimeLog task execution times to the target object propertytg.TETlog.SettingsDefault: onOnLogs task executi

Strany 466

19 Configuration ParametersDouble buffer parameter changesUse a double buffer for parameter tuning. This enables parameter tuningso that the process o

Strany 467

xPC Target o ptio ns PaneLoad a parameter set from a file on the designatedtarg et file systemLoad a parameter set from a file on the designated targe

Strany 468 - The scope object method

3 Signals and ParametersThe model hierarchy expands to show the Simulink objects (signals andparameters) in the Simulink model.3-4

Strany 469

19 Configuration ParametersFile nameSpecify the target PC file name from which to load the parameter set.Settings''TipIf the named file does

Strany 470

xPC Target o ptio ns PaneSignal logging data buffer size in doublesEnterthemaximumnumberofsamplepointstosavebeforewrapping.SettingsDefault: 100000Them

Strany 471

19 Configuration ParametersDefault: '100000'See AlsoxPC Target O ptions19-24

Strany 472

xPC Target o ptio ns PaneBuild COM objects from tagged signals/parametersEnable build process to create a model-specific COM library file.SettingsDefa

Strany 473

19 Configuration ParametersGenerate CANape extensionsEnable targ et a pplications to generate data, such as that for A2L, for VectorCANape.SettingsDef

Strany 474

xPC Target o ptio ns PaneInclude model hierarchy on the target applicationIncludes the Simulink model hierarchy as part of the target application .Set

Strany 475 - See Also xpctarget.xpc

19 Configuration ParametersEnable Stateflow AnimationEnables visualization of Stateflow chart animation.SettingsDefault: offOnEnables visualization of

Strany 476

IndexIndexAapplication parameterssaving and reloading 3-76applicationswith DOSLoader mode 4-4with Standalone mode 5-9Bblock paramete rsparameter tunin

Strany 477

IndexxPC Target Explorer 6-3environment collection objectstarget PC 7-2environment propertiesand Standalone mode 5-9changing through CLI 6-7changing t

Strany 478

Indexwith MATLAB 3-70with Simulink e xternal mode 3-73parameterschanging with commands 3-70inlining 3-79tuning with external mode 3-73tuning with MATL

Strany 479

Monitoring SignalsThe Model Hierarchy node can have the following types of nodes:IconsNodesSubsystems , includ i ng th eir sign a ls and paramete rRef

Strany 480

Indexsignal properties 3-9target PCcommand-line interface 8-1copying files withxpctarget.ftp 9-8disk information retrieval withxpctarget.fs 9-16enviro

Strany 481

Indexusing xPC Target setup window 6-2WWeb browser 3-55connecting 11-2parameter tuning 3-76signal logging 3-64XxPC Targetfrequently asked questions 15

Strany 482

3 Signals and Parameterse Re-expand the Model Hierarchy node to see the labeled signals.To view the block path for a la beled signal, hover over the l

Strany 483

Monitoring SignalsNote When work in g with signal labels:• Signal labels must be unique.• xPC Target software ignores signal labels in referenced mode

Strany 484

3 Signals and ParametersThe value of the signal is shown in the right pane.7 Right-click the target application and select Start.The application start

Strany 485

Monitoring Signals9 Enter the signal format. Use one of the following. By default, the format is%0.25g.Type Description%e or %EExponential format usin

Strany 486 - Property

3 Signals and ParametersThelattercommandcausestheMATLABwindowtodisplayalistofthetarget object properties for the available signals. For example, the s

Strany 487

Monitoring SignalsThe Configuration P arameters dialog box is displayed for the model.3 Click the Real-Time Workshop node.The Real-Time Workshop pane

Strany 488

Signals and Parameters3Monitoring Signals ... 3-2Introduction... 3-2Signal Monitoring

Strany 489

3 Signals and Parameters7 In the old_sf_car model, double-click the shift_logic chart.Theshift_logic chart is displayed .8 In the chart, click Tools &

Strany 490 - , delete,andtarge tping

Monitoring Signals13 Click Apply.14 Bu ild and download the old_sf_car target application to the target PC.You can now view t h e states w i th xPC T

Strany 491

3 Signals and ParametersMonitoring Stateflow States with the MATLAB InterfaceThis topic assumes that you have already set Stateflow states as test po

Strany 492

Monitoring Signals1 En sure that the model is in S i mulink extern al mode.2 In the Simulink window, from the Simulation m enu, click ConfigurationPar

Strany 493 - Argument

3 Signals and ParametersSignal TracingIn this section...“Introduction” on page 3-16“Signal Tracing with xPC Target Explorer” on page 3-16“Signal Traci

Strany 494

Signal Tracing• “Software Triggering Scopes” on page 3-29• “Configuring the Host Scope Viewer” on page 3-31• “Acquiring Signal Data into Multiple, Dyn

Strany 495

3 Signals and ParametersThe model hierarchy expands to show the elements in the Simulink model.3 To get the list of scope types you ca n have in the t

Strany 496

Signal Tracing4 TocreateascopetodisplayonthetargetPC,right-clicktheTarget Scopesnode under the xPC Scopes node.A context menu appears. This lists the

Strany 497

3 Signals and ParametersYou can add other scopes, including those of typehost and file.Note,youcan add as manyfile and host scopes as you want. as lon

Strany 498

Signal Tracing9 Select View Scopes.The xPC Target Host Scope Viewer window appears. Note that the signalsyou add to the scope will appear at the top r

Strany 499

Booting from a DOS Device4DOSLoader Mode ... 4-2Introduction... 4-2DOSLoader Mode Se

Strany 500 - 19 Configuration Parameters

3 Signals and Parameters11 To create a scope to acquire signal data into a file o n the target P C filesystem, right-click theFile Scopes node under t

Strany 501

Signal Tracing12 If you want to specify a different folder or filename, select the scope.The scope property pane is displayed. In the File name field,

Strany 502

3 Signals and ParametersYour next task is to add signals to the scopes. The following procedureassumes that you have added scopes to the target PC and

Strany 503 - See Also

Signal Tracing3 Start the scope. For exa mple, to startScope 1, rig ht-click it an d sele c tStart.3-25

Strany 504

3 Signals and ParametersThe target screen plots the signals after collecting each data package.During this time, you can observe the behavior of the s

Strany 505 - Specify target PC name

Signal Tracing6 Start the scope. For example, to start the scope Scope 2, right-click Scope2 in theHost Scopes node of the xPC Target Explorer and se

Strany 506

3 Signals and Parameters7 Add signals to the scope of type fil e. For example, to add signalsIntegrator1 and Signal Generator, right-cli ck each signa

Strany 507 - Dependencies

Signal TracingThe signals shown on the target PC stop updating while the targetapplication continues running, and the target PC displays the following

Strany 508

3 Signals and Parameters2 From the Trigger mode list, select Software.ClickApply.3 Start the scope and target application.4 Observethatthescopehasnopl

Strany 509 - Execution mode

Signal TracingConfiguring the Host Scope ViewerYou can customize your host scope viewer. This section assumes thatyou have added a host scope to your

Strany 510

Software Environment and Demos6Usin g Environment Properties and Functions...6-2Introduction... 6-2Getting a L

Strany 511 - I/O board genera

3 Signals and Parametersof type file to that application. You can then configure that scope to logsignal data to multiple files. This section assumes

Strany 512

Signal Tracing6 To enablethefilescopetocreatemultiplelogfileswiththesamenamepattern, in the File name box, en ter a name likefile_<%>.dat.This s

Strany 513

3 Signals and Parameters7 Select the Enable auto restart check box. The Enable file autoincrement check box is enabled.8 Select the Enable file au to

Strany 514

Signal TracingYou can enable the creation of up to 99999999 files (<%%%%%%%%>.da t). Thelength of a file name, including the specifier, cannot e

Strany 515 - Allow tasks to ex

3 Signals and Parameters6 Select Save to Host PC.A browser dialog box is displayed.7 Ch oose the folder to contain the signal data file. If you want,

Strany 516

Signal Tracingcreated a s cope of type file that contains signal data (see “Adding Signals toScopes” on page 3-24).1 In xPC Ta rge t Explorer, e xpand

Strany 517 - Log Task Executi

3 Signals and ParametersYou can examine and otherwise m anipulate the data. You can also plot thedata withplot(sig_integ.data). This is an alternate m

Strany 518

Signal TracingA Save Target Session as dialog box is displayed.4 As necessary, browse to the desired folderandenterauniquename. Forexample,xpcsession1

Strany 519

3 Signals and ParametersA Load Target Session as dialog box is displayed.4 As necessary, browse to the desired folde r and select the session you arei

Strany 520

Signal Tracingfunctions instead of using the xPC Target graphical user interface. Thisprocedure assumes that you have assignedtg to the appropriate ta

Strany 521

Introduction ... 8-2Using Target Application Methods on the Target PC... 8-2Manipulating Target Object Properties

Strany 522

3 Signals and Parameterstg.ShowSignals='on'The MATLAB window displays a list of the target object properties forthe available signals. For e

Strany 523

Signal TracingNumSamples = 250NumPrePostSamples = 0Decimation = 1TriggerMode = FreeRunTriggerSignal = -1TriggerLevel = 0.0000 00TriggerSlope = EitherT

Strany 524

3 Signals and ParametersThe target screen plots the signals after collecting each data package.During this time, you can observe the behavior of the s

Strany 525 - Include model hi

Signal TracingSignal Tracing with the MATLAB Inter face and File ScopesThis procedure uses the Simulink model xpcosc.mdl as an example, andassumes you

Strany 526

3 Signals and Parameters3 Start running your target application. Type+tgortg.startorstart(tg)The t arget PC displ ays the following message:System: ex

Strany 527

Signal TracingTriggerScope = 2TriggerSample = 0TriggerSignal = -1TriggerLevel = 0.0000 00TriggerSlope = EitherShowSignals = offFileName = unsetMode =

Strany 528

3 Signals and Parametersorstart(sc2)The MATLAB window displays a list of the scope object properties. N oticethatFileName is assigned a defau lt fi le

Strany 529

Signal Tracingstop(sc2)9 Stop the target application. In the MATLAB window, type-tgortg.stoporstop(tg)The target application on the target PC stops ru

Strany 530

3 Signals and ParametersNote If your model has the output of a Mu x block connected to the input ofan xPC Target Scope block, the signal might not b e

Strany 531

Signal TracingIf you want the same data fo r the same signals on the host PC while the datais displayed on the target PC , you need to define a second

Komentáře k této Příručce

Žádné komentáře