Vector CANcaseXL Guide de l'utilisateur Page 1

Naviguer en ligne ou télécharger Guide de l'utilisateur pour Tournevis électriques Vector CANcaseXL. Vector CANcaseXL User`s guide Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 370
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - User's Guide

Vehicle Network Toolbox™User's GuideR2015a

Page 2 - How to Contact MathWorks

x ContentsFunctions — Alphabetical List12Properties — Alphabetical List13Block Reference14

Page 3 - Revision History

6 XCP Communication Workflows6-4See AlsoFunctionsconnect | createMeasurementList | disconnect | freeMeasurementLists |getEventInfo | getMeasurementInf

Page 4

7A2L File• “A2L File Support” on page 7-2• “Access an A2L File” on page 7-3• “Access Event Information” on page 7-4• “Inspect the Contents of an A2L F

Page 5 - Contents

7 A2L File7-2A2L File SupportAn A2L file is a special description file that defines the implementation of an ECU thatcan communicate with a slave modu

Page 6 - Using a CAN Database

Access an A2L File7-3Access an A2L FileTo use a A2L file, open the file in your MATLAB session. At the MATLAB commandprompt, type:a2lfile = xcpA2L(&a

Page 7 - XCP Communication Workflows

7 A2L File7-4Access Event InformationThis example shows how to open an A2L file and access event information.Open an A2L file:a2lfile = xcpA2L('X

Page 8

Inspect the Contents of an A2L File7-5Inspect the Contents of an A2L FileAccess Measurement InformationThis example shows how to open an A2L file and

Page 9

7 A2L File7-6Get information about the BitSlice measurement:getMeasurementInfo(a2lfile,'Triangle')ans = Name: 'Trian

Page 10 - Block Reference

8Universal Measurement & CalibrationProtocol (XCP)• “XCP Interface” on page 8-2• “XCP Hardware Connection” on page 8-3• “Read a Single Value” on p

Page 11 - Getting Started

8 Universal Measurement & Calibration Protocol (XCP)8-2XCP InterfaceXCP is a high-level protocol that allows you to acquire, stimulate and calibra

Page 12 - 1 Getting Started

XCP Hardware Connection8-3XCP Hardware ConnectionYou can connect your XCP master to a slave module using the CAN protocol. This allowsyou to use even

Page 13 - Product Capabilities

1Getting Started• “Vehicle Network Toolbox Product Description” on page 1-2• “Product Capabilities” on page 1-3• “Install Required Components” on page

Page 14

8 Universal Measurement & Calibration Protocol (XCP)8-4

Page 15 - Product Capabilities

XCP Hardware Connection8-5In this section...“Create XCP Channel Using CAN Device” on page 8-5“Configure the Channel to Unlock the Slave ” on page 8-6

Page 16

8 Universal Measurement & Calibration Protocol (XCP)8-6 SeedKeyDLL: []Configure the Channel to Unlock the SlaveThis example shows how

Page 17 - Install Required Components

Read a Single Value8-7Read a Single ValueThis example shows how to access a single value by name. The value is read directly frommemory.Create an XCP

Page 18

8 Universal Measurement & Calibration Protocol (XCP)8-8Write a Single ValueThis example shows how to write a single value by name. The value is wr

Page 19 - Driver Library

Acquire Measurement Data via Dynamic DAQ Lists8-9Acquire Measurement Data via Dynamic DAQ ListsThis example shows how to can create a dynamic data ac

Page 20

8 Universal Measurement & Calibration Protocol (XCP)8-10Stimulate Measurement Data via Dynamic STIM ListsThis example shows how to can create a dy

Page 21

9CAN Communications in Simulink• “Vehicle Network Toolbox Simulink Blocks” on page 9-2• “CAN Communication in Simulink” on page 9-3• “Open the Vehicle

Page 22

9 CAN Communications in Simulink9-2Vehicle Network Toolbox Simulink BlocksThis section describes how to use the Vehicle Network Toolbox CAN block libr

Page 23

CAN Communication in Simulink9-3CAN Communication in SimulinkIn this section...“Message Transmission Workflow” on page 9-4“Message Reception Workflow

Page 24

1 Getting Started1-2Vehicle Network Toolbox Product DescriptionCommunicate with in-vehicle networks and access ECUs using CAN and XCP protocolsVehicle

Page 25 - Receive Workflow

9 CAN Communications in Simulink9-4Message Transmission Workflow

Page 26

CAN Communication in Simulink9-5This workflow represents the most common CAN Transmit model. Adjust your model asneeded. For more workflow examples,

Page 27 - Create a CAN Channel

9 CAN Communications in Simulink9-6Message Reception WorkflowFor workflow examples, see “Build CAN Communication Simulink Models” on page9-11 and the

Page 28

CAN Communication in Simulink9-7Do not set up filters if you need to parse all bus communications.Function-Call Triggered Message ProcessingSet up yo

Page 29 - Create a Message

9 CAN Communications in Simulink9-8Open the Vehicle Network Toolbox Block LibraryIn this section...“Using the MATLAB Command Window” on page 9-8“Using

Page 30

Open the Vehicle Network Toolbox Block Library9-9Using the Simulink Library BrowserTo open the Vehicle Network Toolbox block library, start the Simul

Page 31 - Transmit a Message

9 CAN Communications in Simulink9-10The Libraries pane lists all available block libraries, with the basic Simulink librarylisted first, followed by o

Page 32

Build CAN Communication Simulink Models9-11Build CAN Communication Simulink ModelsIn this section...“Build a Message Transmit Model” on page 9-11“Bui

Page 33 - Unpack a Message

9 CAN Communications in Simulink9-12icon. Then click CAN Communication to open the CAN blocks. See Using the SimulinkLibrary Browser for more informat

Page 34

Build CAN Communication Simulink Models9-13Step 3: Drag Vehicle Network Toolbox Blocks into the ModelTo use the blocks in a model, click a block in t

Page 35 - Multiplex Signals

Product Capabilities1-3Product CapabilitiesIn this section...“Vehicle Network Toolbox Characteristics” on page 1-3“Interaction Between the Toolbox an

Page 36

9 CAN Communications in Simulink9-14Step 5: Connect the BlocksMake a connection between the Constant block and the CAN Pack block. When you movethe po

Page 37

Build CAN Communication Simulink Models9-15Configure the Constant BlockDouble-click the Constant block to open its parameters dialog box. On the Main

Page 38

9 CAN Communications in Simulink9-16• Use a virtual CAN channel to receive messages.• Use the CAN Configuration block to configure your virtual CAN ch

Page 39

Build CAN Communication Simulink Models9-17Step 8: Drag Other Blocks to Complete the ModelUse the Function–Call Subsystem block from the Simulink Por

Page 40

9 CAN Communications in Simulink9-183Drop the CAN Unpack block from the Vehicle Network Toolbox block library in thissubsystem.

Page 41 - Access the Toolbox

Build CAN Communication Simulink Models9-19To see the results of the simulation visually, drag the Scope block from the Simulinkblock library into yo

Page 42

9 CAN Communications in Simulink9-202Open the Function–Call Subsystem block and:• Double-click In1 to rename it to CAN Msg.• Double-click Out1 to rena

Page 43 - Installation

Build CAN Communication Simulink Models9-21•The CAN Configuration block does not connect to any other block. This block configuresthe CAN channel use

Page 44 - Vector CAN Device Support

9 CAN Communications in Simulink9-22• Device to Vector Virtual 1 (Channel 2)• Bus speed to 500000• Acknowledge Mode to NormalClick OK.Configure the CA

Page 45 - Vector CAN Device Support

Build CAN Communication Simulink Models9-23Save and Run the ModelThis section shows you how to save the models you built, “Build a Message TransmitMo

Page 46

1 Getting Started1-4See “Supported Hardware” on page 1-10 for more information.Communicate Between MATLAB and CAN BusUsing a set of well-defined funct

Page 47

9 CAN Communications in Simulink9-24Step 11: Save the ModelBefore you run the simulation, save your model by clicking the Save icon or selectingFile &

Page 48 - MathWorks account

Build CAN Communication Simulink Models9-25Step 14: View the ResultsDouble-click the Scope block to view the message transfer on a graph.

Page 49

9 CAN Communications in Simulink9-26If you cannot see all the data on the graph, click the Autoscale toolbar button, whichautomatically scales both ax

Page 50

Create Custom Blocks9-27Create Custom BlocksYou can create custom Receive and Transmit blocks to use with hardware currentlynot supported by the Vehi

Page 51

9 CAN Communications in Simulink9-28• To create a receive block, set output port data type to CAN_MESSAGE:ssSetOutputPortDataType(S, portID, dataTypeI

Page 52

10Hardware LimitationsThis topic describes limitations of using hardware in the Vehicle Network Toolbox basedon limitations placed by the hardware ven

Page 53 - Kvaser CAN Device Support

10 Hardware Limitations10-2Hardware Limitations By VendorVector HardwareYou cannot have more than 64 physical or 32 virtual simultaneous connections u

Page 54

11XCP Communications in Simulink• “Vehicle Network Toolbox XCP Simulink Blocks” on page 11-2• “Open the Vehicle Network Toolbox XCP Block Library” on

Page 55

11 XCP Communications in Simulink11-2Vehicle Network Toolbox XCP Simulink BlocksThis section describes how to use the Vehicle Network Toolbox XCP bloc

Page 56

Open the Vehicle Network Toolbox XCP Block Library11-3Open the Vehicle Network Toolbox XCP Block LibraryIn this section...“Using the MATLAB Command W

Page 57

Product Capabilities1-5In this illustration:• Six CAN modules are attached to a CAN bus.• One module, which is a CAN device, is attached to the Vehic

Page 58

11 XCP Communications in Simulink11-4Using the Simulink Library BrowserTo open the Vehicle Network Toolbox block library, start the Simulink Library B

Page 59 - CAN Communication Workflows

XCP Data Acquisition over CAN11-5XCP Data Acquisition over CANThis example shows you how to use XCP blocks to directly acquire measurement valuesfrom

Page 60 - CAN Transmit Workflow

11 XCP Communications in Simulink11-63Download and install the available version of "XCP Sample Implementation".4In MATLAB, navigate to wher

Page 61 - CAN Transmit Workflow

XCP Data Acquisition over CAN11-7Visualize Measurement Values Received From SlavePlot the results to see the measurement values for Triangle and PWM

Page 63 - CAN Receive Workflow

12Functions — Alphabetical List

Page 64

12 Functions — Alphabetical List12-2attachDatabaseAttach CAN database to messages and remove CAN database from messagesSyntaxattachDatabase (message,

Page 65

attachDatabase12-3 More AboutTipsIf the specified message is an array, then the database attaches itself to each entry in thearray. The database a

Page 66

12 Functions — Alphabetical List12-4canChannelConstruct CAN channel connected to selected deviceSyntaxcanch = canChannel('vendor', 'dev

Page 67

canChannel12-5devicechannelindexAn alpha-numeric channel on the specified device.canchThe CAN channel object the you create.PropertiesCAN Channel Pro

Page 68 - Vector CAN Database Support

1 Getting Started1-6• Attach the database to the configured CAN channel to interpret received CANmessages.• Use the CAN database to construct messages

Page 69 - Create a CAN Message

12 Functions — Alphabetical List12-6• Use canHWInfo to obtain a list of available devices.See AlsocanHWInfo

Page 70 - 4 Using a CAN Database

canDatabase12-7canDatabaseCreate handle to CAN database fileSyntaxcandb = canDatabase('dbfile.dbc')Descriptioncandb = canDatabase('dbf

Page 71 - Update Database Information

12 Functions — Alphabetical List12-8canHWInfoInformation on available CAN devicesSyntaxout = canHWInfo()Descriptionout = canHWInfo() returns informati

Page 72

canHWInfo12-9See AlsocanChannel

Page 73 - Minimum

12 Functions — Alphabetical List12-10canMessageBuild CAN message based on user-specified structureSyntaxmessage = canMessage(id, extended, datalength)

Page 74

canMessage12-11Output ArgumentsmessageThe message object returned from the function.PropertiesExamplesTo construct a CAN message, type: message = can

Page 75 - Change Signal Information

12 Functions — Alphabetical List12-12canMessageImportImport CAN message log file from third-party toolSyntaxmessage = canMessageImport('file&apos

Page 76

canMessageImport12-13Output ArgumentsmessageThe message object returned by the function.ExamplesTo import a log file, type:message = canMessageImport

Page 77

12 Functions — Alphabetical List12-14canSupportGenerate technical support logSyntaxcanSupport()DescriptioncanSupport() returns diagnostic information

Page 78

canTool12-15canToolOpen Vehicle CAN Bus MonitorSyntaxcanToolDescriptioncanTool starts the Vehicle CAN Bus Monitor, which displays live CAN message tr

Page 79

Install Required Components1-7Install Required ComponentsIn this section...“Required Components” on page 1-7“Install Devices and Drivers” on page 1-7

Page 80

12 Functions — Alphabetical List12-16configBusSpeedSet bit timing rate of CAN channelSyntaxconfigBusSpeed(canch, busspeed)configBusSpeed(canch, busspe

Page 81

configBusSpeed12-17tseg2The length of time at the end of the sample point within a bit time.numberofsamplesThe specified count of bit samples used.Ex

Page 82

12 Functions — Alphabetical List12-18discardDiscard all messages from CAN channelSyntaxdiscard(canch)Descriptiondiscard(canch) discards messages that

Page 83

extractAll12-19extractAllSelect all instances of message from message arraySyntax[extracted, remainder] = extractAll(message, messagename)[extracted,

Page 84

12 Functions — Alphabetical List12-20Output ArgumentsextractedAn array of CAN message objects returned with all instances of id found in themessage.re

Page 85

extractRecent12-21extractRecentSelect most recent message from array of messagesSyntaxextracted = extractRecent(message)extracted = extractRecent(mes

Page 86 - Vehicle CAN Bus Monitor

12 Functions — Alphabetical List12-22extendedIndicates whether the message ID is a standard or extended type. The Boolean value istrue if extended and

Page 87 - File Menu

extractTime12-23extractTimeSelect messages occurring within specified time range from array of messagesSyntaxextracted = extractTime(message, startti

Page 88 - 5 Monitoring Vehicle CAN Bus

12 Functions — Alphabetical List12-24ExamplesmsgRange = extractTime(message, 5, 10.5)msgRange = extractTime(message, 0, 60)msgRange = extractTime(mess

Page 89 - Vehicle CAN Bus Monitor

filterAllowAll12-25filterAllowAllAllow all messages of specified identifier typeSyntaxfilterAllowAll(canch, type)DescriptionfilterAllowAll(canch, typ

Page 90

1 Getting Started1-8These drivers are available for download from the Vector Web site at:http://vector.com/vi_downloadcenter_en.htmlDrivers for 32-bit

Page 91

12 Functions — Alphabetical List12-26filterAllowOnlyConfigure message filter to allow only specified messagesSyntaxfilterAllowOnly(canch,name)filterAl

Page 92

filterAllowOnly12-27typeThe identifier type by which to filter messages. CAN messages are 'Standard' and'Extended'.ExamplesTo fil

Page 93 - Attach a Database

12 Functions — Alphabetical List12-28filterBlockAllConfigure filter to block messages with specified identifier typeSyntaxfilterBlockAll(canch,type)De

Page 94

filterAcceptRange 12-29filterAcceptRangeSet range of CAN identifiers to pass acceptance filterNote: filterAcceptRange has been removed. Use filterAll

Page 95 - View Unique Messages

12 Functions — Alphabetical List12-30Input ArgumentscanchThe CAN channel that you want to set the filter for.rangestartThe first identifier of the ran

Page 96

filterBlockRange12-31filterBlockRangeSet range of CAN identifiers to block via acceptance filterNote: filterBlockRange has been removed. Use filterAl

Page 97

12 Functions — Alphabetical List12-32ExamplesYou can set the filter to block or accept messages within a specific range.canch = canChannel('Vecto

Page 98

filterReset12-33filterResetOpen CAN message acceptance filtersNote: filterReset has been removed. Use filterAllowAll, filterAllowOnly, orfilterBlockA

Page 99

12 Functions — Alphabetical List12-34canch = canChannel('Vector','CANCaseXL 1',1)filterBlockRange(canch, 500, 750)filterAcceptRang

Page 100 - 6 XCP Communication Workflows

filterSet12-35filterSetSet specific CAN message acceptance filter configurationNote: filterSet has been removed. Use filterAllowAll, filterAllowOnly,

Page 101 - A2L File

Install Required Components1-9If you are using an NI-CAN device, install the NI-CAN programming library from theNational Instruments Web site. This i

Page 102 - A2L File Support

12 Functions — Alphabetical List12-36maskThe bits in the identifier that are relevant to the filter.idSet a filter on the CAN message with the id, ran

Page 103 - Access an A2L File

messageInfo12-37messageInfoInformation about CAN messagesSyntaxmsgInfo = messageInfo(candb)msgInfo = messageInfo(candb, msgName)msgInfo = messageInfo

Page 104 - Access Event Information

12 Functions — Alphabetical List12-38Output ArgumentsmsgInfoHandle for the returned CAN messages in the specified database.Examplescandb = canDatabase

Page 105 - Open an A2L file:

pack12-39packPack signal data into CAN messageSyntaxpack(message, value, startbit, signalsize, byteorder)Descriptionpack(message, value, startbit, si

Page 106 - 7 A2L File

12 Functions — Alphabetical List12-40Examplespack(message, 25, 0, 16, 'LittleEndian')See AlsocanMessage | extractAll | extractRecent | unpac

Page 107 - Protocol (XCP)

receive12-41receiveReceive messages from CAN busSyntaxmessage = receive(canch, messagesrequested)Descriptionmessage = receive(canch, messagesrequeste

Page 108 - XCP Interface

12 Functions — Alphabetical List12-42PropertiesReceive Message PropertiesError Log PropertiesExamplescanch = canChannel('Vector','CANCa

Page 109 - XCP Hardware Connection

replay12-43replayRetransmit messages from CAN busSyntaxreplay(canch, message)Descriptionreplay(canch, message) retransmits the message or messages me

Page 110

12 Functions — Alphabetical List12-44ch2 = canChannel('Vector', 'CANcaseXL 1', 2)start(ch1)start(ch2)msgTx1 = canMessage(500, fals

Page 111

signalInfo12-45signalInfoInformation about signals in CAN messageSyntaxSigInfo = signalInfo(candb,msgName)SigInfo = signalInfo(candb, id, extended)Si

Page 112

How to Contact MathWorksLatest news:www.mathworks.comSales and services:www.mathworks.com/sales_and_servicesUser community:www.mathworks.com/matlabcen

Page 113 - Read a Single Value

1 Getting Started1-10Install the ToolboxDetermine if Vehicle Network Toolbox software is installed on your system by typing thefollowing in the MATLAB

Page 114 - Write a Single Value

12 Functions — Alphabetical List12-46extendedIndicates whether the message ID is in standard or extended type. The Boolean value istrue if extended an

Page 115

start12-47startSet CAN channel onlineSyntaxstart(canch)Descriptionstart(canch) starts the CAN channel canch on the CAN bus to send and receivemessage

Page 116

12 Functions — Alphabetical List12-48stopSet CAN channel offlineSyntaxstop(canch)Descriptionstop(canch) stops the CAN channel canch on the CAN bus. Th

Page 117

transmit12-49transmitSend CAN messages to CAN busSyntaxtransmit(canch, message)Descriptiontransmit(canch, message) sends the array of messages onto t

Page 118

12 Functions — Alphabetical List12-50To transmit messages on a remote frame, type:message = canMessage(250, false 8, true)message.Data = ([45 213 53 1

Page 119 - CAN Communication in Simulink

transmitConfiguration12-51transmitConfigurationDisplay messages configured for automatic transmissionSyntaxtransmitConfiguration(canch)Descriptiontra

Page 120 - Message Transmission Workflow

12 Functions — Alphabetical List12-52transmitConfiguration(canch)The function returns information about periodic configuration:Periodic MessagesID Ex

Page 121

transmitEvent12-53transmitEventConfigure messages for event-based transmissionSyntaxtransmitEvent(canch, msg, state)DescriptiontransmitEvent(canch, m

Page 122 - Message Reception Workflow

12 Functions — Alphabetical List12-54Enable the message for event-based transmit, start the channel, and change some data totrigger the event-based tr

Page 123

transmitPeriodic12-55transmitPeriodicConfigure messages for periodic transmissionSyntaxtransmitPeriodic(canch, msg, 'On', period)transmitPe

Page 124

Install Required Components1-11• WLAN• PCMCIA• Leaf• Memorator• PCI• USBYou can also use the toolbox with virtual CAN channels available with Kvaser

Page 125

12 Functions — Alphabetical List12-56ExamplesConstruct a CAN channel and configure a message on the channel:canch = canChannel('Vector', &ap

Page 126

unpack12-57unpackUnpack signal data from messageSyntaxvalue = unpack(message, startbit, signalsize, byteorder, datatype)Descriptionvalue = unpack(mes

Page 127

12 Functions — Alphabetical List12-58Output ArgumentsvalueThe value of the message that you specify to be unpacked.Examplesvalue = unpack(message, 0,

Page 128

xcpA2L12-59xcpA2LAccess A2L fileSyntaxa2lfile = xcpA2L(filename)Descriptiona2lfile = xcpA2L(filename) creates an object that accesses an A2L file. Th

Page 129

12 Functions — Alphabetical List12-60See AlsogetEventInfo | getMeasurementInfo

Page 130 - Configure the CAN Pack Block

getEventInfo12-61getEventInfoGet event information about specific event from A2L fileSyntaxinfo = getEventInfo(a2lFile,eventName)Descriptioninfo = ge

Page 131 - Build a Message Receive Model

12 Functions — Alphabetical List12-62Input Argumentsa2lFile — Name of A2L filecharacter stringName of the A2L file object, specified as a string, used

Page 132

getMeasurementInfo12-63getMeasurementInfoGet information about specific measurement from A2L fileSyntaxinfo = getMeasurementInfo(a2lFile,measurementN

Page 133

12 Functions — Alphabetical List12-64 SizeInNibbles: 2 SizeInBits: 8 MATLABType: 'uint8'• “Inspect the Cont

Page 134

xcpChannel12-65xcpChannelCreate XCP channelSyntaxxcpch = xcpChannel(a2lFile,transportLayer,vendor,deviceNumber)xcpch = xcpChannel(a2lFile,transportLa

Page 135

1 Getting Started1-12• PCAN-ExpressCard• PCAN-PCI• PCAN-PCI Express• PCAN-cPCI• PCAN-miniPCI• PCAN-minPCIe

Page 136

12 Functions — Alphabetical List12-66Create an XCP channel.xcpch = xcpChannel(a2l, 'CAN', 'Vector', 'Virtual 1', 1)xcpch

Page 137

xcpChannel12-67Device name and defined interface number for the device, specified as a string. Use thisinput for National Instruments CAN devices, wh

Page 138

12 Functions — Alphabetical List12-68connectConnect XCP channel to slave moduleSyntaxconnect(xcpch)Descriptionconnect(xcpch) creates an active connect

Page 139 - Save and Run the Model

connect12-69XCP channel, specified as an XCP channel object created using xcpChannel. The XCPchannel object can then communicate with the specified s

Page 140

12 Functions — Alphabetical List12-70disconnectDisconnect from slave moduleSyntaxdisconnect(xcpch)Descriptiondisconnect(xcpch) disconnects the specifi

Page 141 - Step 14: View the Results

disconnect12-71Disconnect the channel and check if connection is active.disconnect(xcpch)isConnected(xcpch)ans = 0Input Argumentsxcpch — XCP chan

Page 142

12 Functions — Alphabetical List12-72isConnectedReturn connection statusSyntaxisConnected(xcpch)DescriptionisConnected(xcpch) returns a boolean value

Page 143 - Create Custom Blocks

createMeasurementList12-73createMeasurementListCreate measurement list for XCP channelSyntaxcreateMeasurementList(xcpch,resource,eventName,measuremen

Page 144

12 Functions — Alphabetical List12-74Connect the channel to the slave module.connect(xcpch)Setup a data acquisition measurement list with the ‘10 ms’

Page 145 - Hardware Limitations

createMeasurementList12-75resource — Measurements list type‘DAQ’ | ‘STIM’Measurement list type, specified as a literal string ‘DAQ’ or ‘STIM’.eventNa

Page 146 - 10 Hardware Limitations

Vehicle Network Communication in MATLAB1-13Vehicle Network Communication in MATLABWorkflows in this section are sequential and will help you understa

Page 147

12 Functions — Alphabetical List12-76freeMeasurementListsRemove all measurement lists from XCP channelSyntaxfreeMeasurementLists(xcpch)Descriptionfree

Page 148

freeMeasurementLists12-77viewMeasurementLists(xcpch)DAQ List #1 using the "10 ms" event @ 0.010000 seconds and the following measurements:

Page 149

12 Functions — Alphabetical List12-78viewMeasurementListsView configured measurement lists on XCP channelSyntaxviewMeasurementLists(xcpch)Descriptionv

Page 150

viewMeasurementLists12-79Setup a data acquisition measurement list with the '10 ms' event and 'PMW'measurement.createMeasurementL

Page 151 - XCP Data Acquisition over CAN

12 Functions — Alphabetical List12-80startMeasurementStart configured DAQ and STIM listsSyntaxstartMeasurement(xcpch)DescriptionstartMeasurement(xcpch

Page 152

startMeasurement12-81Setup a data acquisition measurement list with the ‘10 ms’ event and 'Bitslice'measurement.createMeasurementList(xcpch

Page 153

12 Functions — Alphabetical List12-82XCP channel, specified as an XCP channel object created using xcpChannel. The XCPchannel object can then communic

Page 154

stopMeasurement12-83stopMeasurementStop configured DAQ and STIM listsSyntaxstopMeasurement(xcpch)DescriptionstopMeasurement(xcpch) stops all configur

Page 155

12 Functions — Alphabetical List12-84connect(xcpch)Setup a data acquisition measurement list with the ‘10 ms’ event and 'Bitslice'measuremen

Page 156 - Examples

isMeasurementRunning12-85isMeasurementRunningIndicate if measurement is activeSyntaxisMeasurementRunning(xcpch)DescriptionisMeasurementRunning(xcpch)

Page 157 - More About

1 Getting Started1-14Transmit Workflow

Page 158

12 Functions — Alphabetical List12-86ans = 1Input Argumentsxcpch — XCP channelXCP channel objectXCP channel, specified as an XCP channel object cr

Page 159 - Properties

readDAQListData12-87readDAQListDataRead single value of specified measurementSyntaxvalue = readDAQListData(xcpch,measurementName)value = readDAQListD

Page 160 - See Also

12 Functions — Alphabetical List12-88Create a measurement list with the '100ms' event and 'PMW', 'PWMFiltered', and&apos

Page 161

readDAQListData12-89Output Argumentsvalue — Value from specified measurementnumeric arrayValue from the specified measurement, returned as a numeric

Page 162 - Output Arguments

12 Functions — Alphabetical List12-90writeSTIMListDataWrite to specified measurementSyntaxwriteSTIMListData(xcpch,measurementName,value)Descriptionwri

Page 163

writeSTIMListData12-91writeDAQListData(xcpch, 'Triangle' 10)Input Argumentsxcpch — XCP channelXCP channel objectXCP channel, specified as a

Page 164

12 Functions — Alphabetical List12-92readSingleValueRead single sample of specified measurement from memorySyntaxvalue = readSingleValue(xcpch,'m

Page 165

readSingleValue12-93 14Input Argumentsxcpch — XCP channelXCP channel objectXCP channel, specified as an XCP channel object created using xcpChanne

Page 166

12 Functions — Alphabetical List12-94writeSingleValueWrite single sample to specified measurementSyntaxwriteSingleValue(xcpch,measurementName,value)De

Page 167

writeSingleValue12-95XCP channel, specified as an XCP channel object created using xcpChannel. The XCPchannel object can then communicate with the sp

Page 168

Vehicle Network Communication in MATLAB1-15Receive Workflow

Page 169

12 Functions — Alphabetical List12-96CAN.ChannelInfo classPackage: CANDisplay device channel informationDescriptionvendor.ChannelInfo(index) displays

Page 170

CAN.ChannelInfo class12-97ExamplesExamine Kvaser Device Channel InformationGet information on installed CAN devices.info = canHWInfoinfo = CAN Device

Page 171

12 Functions — Alphabetical List12-98CAN.VendorInfo classPackage: CANDisplay available device vendor informationSyntaxinfo = canHWInfoinfo.VendorInfo(

Page 172

CAN.VendorInfo class12-99VendorDriverVersionVersion of the device driver installed for this vendor.ChannelInfoInformation on the device channels avai

Page 173

12 Functions — Alphabetical List12-100 ChannelInfoSee AlsoFunctionsCAN.ChannelInfo | canHWInfo

Page 174

13Properties — Alphabetical List

Page 175

13 Properties — Alphabetical List13-2BusLoadDisplay load on CAN busDescriptionThe BusLoad property displays information about the load on the CAN netw

Page 176

BusSpeed13-3BusSpeedDisplay speed of CAN busDescriptionThe BusSpeed property determines the bit rate at which messages are transmitted. Youcan set Bu

Page 177

13 Properties — Alphabetical List13-4PropertiesNumOfSamples, SJW, TSEG1, TSEG2

Page 178

BusStatus13-5BusStatusDetermine status of CAN busDescriptionThe BusStatus property displays information about the state of the CAN bus.Characteristic

Page 179

1 Getting Started1-16Vehicle Network Communication ExamplesIn this section...“Prerequisites” on page 1-16“Discover Installed Hardware” on page 1-17“Cr

Page 180

13 Properties — Alphabetical List13-6DataSet CAN message dataDescriptionUse the Data property to define your message data in a CAN message.Characteris

Page 181

Database13-7DatabaseStore CAN database informationDescriptionThe Database property stores information about an attached CAN database.CharacteristicsU

Page 182

13 Properties — Alphabetical List13-8can use a period sign in your database name. Rename any CAN database files with non-alphanumeric characters befor

Page 183

Device13-9DeviceDisplay CAN channel device typeDescriptionFor National Instruments devices, the Device property displays the device number onthe hard

Page 184

13 Properties — Alphabetical List13-10Device(NI)Display NI CAN channel device typeDescriptionFor National Instruments devices, the DeviceType property

Page 185

DeviceChannelIndex13-11DeviceChannelIndexDisplay CAN device channel indexDescriptionThe DeviceChannelIndex property displays the channel index on whi

Page 186

13 Properties — Alphabetical List13-12DeviceSerialNumberDisplay CAN device serial numberDescriptionThe DeviceSerialNumber property displays the serial

Page 187

DeviceVendor13-13DeviceVendorDisplay device vendor nameDescriptionThe DeviceVendor property displays the name of the device vendor.CharacteristicsUsa

Page 188

13 Properties — Alphabetical List13-14ErrorCAN message error frameDescriptionThe Error property is a read-only value that identifies the specified CAN

Page 189

Extended13-15ExtendedIdentifier type for CAN messageDescriptionThe Extended property is the identifier type for a CAN message. It can either be astan

Page 190

Vehicle Network Communication Examples1-17The following examples use the Vector CANcaseXL hardware. You can substitute it withany other supported har

Page 191

13 Properties — Alphabetical List13-16PropertiesID

Page 192

ID13-17IDIdentifier for CAN messageDescriptionThe ID property represents a numeric identifier for a CAN message.CharacteristicsUsage CAN messageRead

Page 193

13 Properties — Alphabetical List13-18PropertiesExtended

Page 194

InitializationAccess13-19InitializationAccessDetermine control of device channelDescriptionThe InitializationAccess property determines if the config

Page 195

13 Properties — Alphabetical List13-20MessageReceivedFcnSpecify function to runDescriptionConfigure MessageReceivedFcn as a callback function to run a

Page 196

MessageReceivedFcn13-21PropertiesMessageReceivedFcnCount, MessagesAvailable

Page 197

13 Properties — Alphabetical List13-22MessageReceivedFcnCountSpecify number of messages available before function is triggeredDescriptionConfigure Mes

Page 198

Messages13-23MessagesStore message names from CAN databaseDescriptionThe Messages property stores the names of all messages defined in the selected C

Page 199

13 Properties — Alphabetical List13-24MessagesAvailableDisplay number of messages available to be received by CAN channelDescriptionThe MessagesAvaila

Page 200

MessagesReceived13-25MessagesReceivedDisplay number of messages received by CAN channelDescriptionThe MessagesReceived property displays the total nu

Page 201

1 Getting Started1-181Create the first CAN channel on an installed CAN device:canch1 = canChannel('Vector','CANcaseXL 1',1)Notes Y

Page 202

13 Properties — Alphabetical List13-26MessagesTransmittedDisplay number of messages transmitted by CAN channelDescriptionThe MessagesTransmitted prope

Page 203

Name (Database)13-27Name (Database)CAN database nameDescriptionThe Name (Database) property displays the name of the database.CharacteristicsUsage CA

Page 204

13 Properties — Alphabetical List13-28Name (Message)CAN message nameDescriptionThe Name (Message) property displays the name of the message.Characteri

Page 205

NumOfSamples13-29NumOfSamplesDisplay number of samples available to channelDescriptionThe NumOfSamples property displays the total number of samples

Page 206

13 Properties — Alphabetical List13-30PathDisplay CAN database directory pathDescriptionThe Path property displays the path to the CAN database.Charac

Page 207

ReceiveErrorCount13-31ReceiveErrorCountDisplay number of received errors detected by channelDescriptionThe ReceiveErrorCount property displays the to

Page 208

13 Properties — Alphabetical List13-32RemoteSpecify CAN message remote frameDescriptionUse the Remote property to specify the CAN message as a remote

Page 209

Running13-33RunningDetermine status of CAN channelDescriptionThe Running property displays information about the state of the CAN channel.Characteris

Page 210

13 Properties — Alphabetical List13-34SilentModeSpecify if channel is active or silentDescriptionSpecify whether the channel operates silently. By def

Page 211

SilentMode13-35See AlsoFunctionscanChannel

Page 212

Vehicle Network Communication Examples1-19configBusSpeed(canch1, 250000)2To see the changed property value, type:canch1.BusSpeedMATLAB displays all p

Page 213

13 Properties — Alphabetical List13-36SignalsDisplay physical signals defined in CAN messageDescriptionThe Signals property allows you to view and edi

Page 214

Signals13-37See AlsoFunctionscanMessage, canDatabase

Page 215

13 Properties — Alphabetical List13-38SJWDisplay synchronization jump width (SJW) of bit time segmentDescriptionIn order to adjust the on-chip bus clo

Page 216

Timestamp13-39TimestampDisplay message received timestampDescriptionThe Timestamp property displays the time at which the message was received on a C

Page 217

13 Properties — Alphabetical List13-40TransceiverNameDisplay name of CAN transceiverDescriptionThe CAN transceiver translates the digital bit stream g

Page 218

TransceiverState13-41TransceiverStateDisplay state or mode of CAN transceiverDescriptionIf your CAN transceiver allows you to control its mode, you c

Page 219

13 Properties — Alphabetical List13-42PropertiesTransceiverName

Page 220

TransmitErrorCount13-43TransmitErrorCountDisplay number of transmitted errors by channelDescriptionThe TransmitErrorCount property displays the total

Page 221

13 Properties — Alphabetical List13-44TSEG1Display amount that channel can lengthen sample timeDescriptionThe TSEG1 property displays the amount in bi

Page 222

TSEG213-45TSEG2Display amount that channel can shorten sample timeDescriptionThe TSEG2 property displays the amount of bit time segments the channel

Page 223

Revision HistoryMarch 2009 Online only New for Version 1.0 (Release 2009a)September 2009 Online only Revised for Version 1.1 (Release 2009b)March 2010

Page 224

1 Getting Started1-20a message using canch and receive it using canch1. To transmit a message, create amessage object and pack the message with the re

Page 225

13 Properties — Alphabetical List13-46UserDataEnter custom dataDescriptionUse the UserData property to enter custom data to be stored in your CAN chan

Page 226

Events13-47EventsDisplay A2L events listDescriptionThe Events property displays events available in the selected A2L description file. Thisproperty c

Page 227

13 Properties — Alphabetical List13-48MeasurementsDisplay A2L measurements listDescriptionThe Measurements property displays measurements available in

Page 228

DAQInfo13-49DAQInfoData acquisition information in A2L fileDescriptionThe DAQInfo property displays data acquisition information in the A2L descripti

Page 229

13 Properties — Alphabetical List13-50SlaveNameName of connected slaveDescriptionThe SlaveName property displays the name of the slave node as specifi

Page 230

FileName13-51FileNameName of referenced A2L fileDescriptionThe FileName property displays the name of the referenced A2L file as a string.

Page 231

13 Properties — Alphabetical List13-52FilePathPath of A2L fileDescriptionThe FileName property displays the full file path to the A2L file as a string

Page 232

ProtocolLayerInfo13-53ProtocolLayerInfoProtocol layer informationDescriptionThe ProtocolLayerInfo property displays a structure containing general in

Page 233

13 Properties — Alphabetical List13-54TransportLayerCANInfoCAN transport layer informationDescriptionThe TransportLayerCANInfo property displays a str

Page 234

A2LFileName13-55A2LFileNameName of the A2L fileDescriptionThe A2LFileName property displays the name of the A2L file contains informationabout the s

Page 235

Vehicle Network Communication Examples1-211Use the pack function to pack your message with these input parameters:pack(messageout, 25, 0, 16, 'L

Page 236

13 Properties — Alphabetical List13-56SeedKeyDLLName of seed and key security access dllDescriptionThe SeedKeyDLL property displays the name of the dl

Page 237

TransportLayer13-57TransportLayerTransport layer typeDescriptionThe TransportLayer property displays the type of transport layer used in the XCPconne

Page 238

13 Properties — Alphabetical List13-58TransportLayerDeviceXCP transport layer connectionDescriptionThe TransportLayerDevice property contains a struct

Page 239

14Block ReferenceCAN ConfigurationCAN LogCAN PackCAN ReceiveCAN ReplayCAN TransmitCAN UnpackXCP ConfigurationXCP Data AcquisitionXCP Data StimulationX

Page 240

14 Block Reference14-2CAN ConfigurationConfigure parameters for specified CAN deviceLibraryVehicle Network Toolbox: CAN CommunicationDescriptionThe CA

Page 241

CAN Configuration14-3Dialog BoxUse the Block Parameters dialog box to select your CAN device configuration.DeviceSelect the CAN device and a channel

Page 242

14 Block Reference14-4Synchronization jump width, Time segment 1, Time segment 2, and Numberof samples. If you do not select this option, the device a

Page 243

CAN Configuration14-5the new bit parameter values do not form a valid combination, the verification failsand displays an error message.Acknowledge mo

Page 244

14 Block Reference14-6CAN LogLog received CAN messagesLibraryVehicle Network Toolbox: CAN CommunicationDescriptionThe CAN Log block logs CAN messages

Page 245

CAN Log14-7Other Supported FeaturesThe CAN Log block supports the use of Simulink Accelerator and Rapid Acceleratormode. Using this feature, you can

Page 246

1 Getting Started1-22canch1 MATLAB displays the updated status of the channel:Summary of CAN Channel using 'Vector' 'CANcaseXL 1'

Page 247

14 Block Reference14-8another machine and the source code in the zip file can be built to create an executablewhich can be run independent of MATLAB a

Page 248

CAN Log14-9The model appends the log file name with the current date and time in the YYYY-MMM-DD_hhmmss format. You can also open the block mask and

Page 249

14 Block Reference14-10CAN PackPack individual signals into CAN messageLibraryCAN CommunicationEmbedded Coder/ Embedded Targets/ Host CommunicationDes

Page 250 - CAN.ChannelInfo class

CAN Pack14-11• The use of model referencing. Using this feature, your model can include otherSimulink models as modular components.• Code generation

Page 251

14 Block Reference14-12Select your data signal:• raw data: Input data as a uint8 vector array. If you select this option, you onlyspecify the message

Page 252 - CAN.VendorInfo class

CAN Pack14-13CANdb fileThis option is available if you specify that your data is input via a CANdb file in theData is input as list. Click Browse to

Page 253

14 Block Reference14-14This option is available if you specify that your data is input via a CANdb file in theData is input as field and you select a

Page 254

CAN Pack14-15If you have selected to specify signals manually, create your signals manually in thistable. Each signal you create has the following va

Page 255

14 Block Reference14-16Little-Endian Byte Order Counted from the Least Significant Bit to the Highest Address•BE: Where byte order is in big-endian fo

Page 256 - Characteristics

CAN Pack14-17Big-Endian Byte Order Counted from the Least Significant Bit to the Lowest AddressData typeSpecify how the signal interprets the data in

Page 257 - BusSpeed

Vehicle Network Communication Examples1-23 can.Message handle Package: can Properties: ID: 500 Extended: 0 Name: '&apos

Page 258

14 Block Reference14-18• Standard: The signal is packed at each timestep.• Multiplexor: The Multiplexor signal, or the mode signal is packed. You cans

Page 259 - BusStatus

CAN Pack14-19Specify the Offset value to apply to convert the physical value (signal value) to theraw value packed in the message. See “Conversion Fo

Page 260

14 Block Reference14-20CAN ReceiveReceive CAN messages from specified CAN deviceLibraryVehicle Network Toolbox: CAN CommunicationDescriptionThe CAN Re

Page 261 - Database

CAN Receive14-21Other Supported FeatureThe CAN Receive block supports the use of Simulink Accelerator mode. Using thisfeature, you can speed up the e

Page 262

14 Block Reference14-22which can be run independent of MATLAB and Simulink. The generated code compileswith both C and C++ compilers. For more informa

Page 263

CAN Receive14-23• Allow all: allows all standard IDs to pass the filter. This is the default filterstate of the CAN Receive block• Allow only: Allows

Page 264 - Device(NI)

14 Block Reference14-24for every message delivered to the model for that particular timestep. The outputport always contains one CAN message at a time

Page 265 - DeviceChannelIndex

CAN Replay14-25CAN ReplayReplay logged CAN messagesLibraryVehicle Network Toolbox: CAN CommunicationDescriptionThe CAN Replay block replays logged me

Page 266 - DeviceSerialNumber

14 Block Reference14-26Other Supported FeaturesThe CAN Replay block supports the use of Simulink Accelerator Rapid Accelerator mode.Using this feature

Page 267 - DeviceVendor

CAN Replay14-27another machine and the source code in the zip file can be built to create an executablewhich can be run independent of MATLAB and Sim

Page 268

1 Getting Started1-24 25Refer to the unpack function to understand more about its input arguments.Save a CAN ChannelYou can save a CAN channel obje

Page 269 - Extended

14 Block Reference14-28Variable nameSpecify the variable saved in the MAT-file that holds the CAN message information.Number of times to replay messag

Page 270

CAN Transmit 14-29CAN TransmitTransmit CAN message to selected CAN deviceLibraryVehicle Network Toolbox: CAN CommunicationDescriptionThe CAN Transmit

Page 271

14 Block Reference14-30The CAN Transmit block supports the use of code generation along with the packNGofunction to group required source code and dep

Page 272

CAN Transmit 14-31Dialog BoxUse the Sink Block Parameters dialog box to select your CAN Transmit blockparameters.Tip Configure your CAN Configuration

Page 273 - InitializationAccess

14 Block Reference14-32See AlsoCAN Configuration, CAN Pack

Page 274 - MessageReceivedFcn

CAN Unpack14-33CAN UnpackUnpack individual signals from CAN messagesLibraryCAN CommunicationEmbedded Coder/ Embedded Targets/ Host CommunicationDescr

Page 275

14 Block Reference14-34• The use of model referencing. Using this feature, your model can include otherSimulink models as modular components.• Code ge

Page 276 - MessageReceivedFcnCount

CAN Unpack14-35ParametersData to be output asSelect your data signal:• raw data: Output data as a uint8 vector array. If you select this option, you

Page 277 - Messages

14 Block Reference14-36The number of output ports on your block depends on the number of signals youspecify. For example, if you specify four signals,

Page 278 - MessagesAvailable

CAN Unpack14-37This option is available if you specify that your data is input via a CANdb file in theData to be output as list. Click Browse to find

Page 279 - MessagesReceived

Vehicle Network Communication Examples1-25Set a filter for the message EngineMsg and display the channel:filterAllowOnly(canch1, 'EngineMsg&apos

Page 280 - MessagesTransmitted

14 Block Reference14-38Specify the length of your CAN message from 0 to 8 bytes. If you are using CANdbspecified signals for your output data, the CAN

Page 281 - Name (Database)

CAN Unpack14-39Little-Endian Byte Order Counted from the Least Significant Bit to the Highest Address• BE: Where the byte order is in big-endian form

Page 282 - Name (Message)

14 Block Reference14-40Big-Endian Byte Order Counted from the Least Significant Bit to the Lowest AddressData typeSpecify how the signal interprets th

Page 283 - NumOfSamples

CAN Unpack14-41• Standard: The signal is unpacked at each timestep.• Multiplexor: The Multiplexor signal, or the mode signal is unpacked. You canspec

Page 284

14 Block Reference14-42Specify the Offset value applied to convert the physical value (signal value) to theunpacked raw value. See “Conversion Formula

Page 285 - ReceiveErrorCount

CAN Unpack14-43If you do not select an Output ports option, the number of output ports on your blockdepends on the number of signals you specify.Conv

Page 286

14 Block Reference14-44XCP ConfigurationConfigure XCP slave connectionLibraryXCP CommunicationDescriptionThe XCP Configuration block uses the paramete

Page 287

XCP Configuration14-45Config nameSpecify a unique name for your XCP session.A2L FileClick Browse to select an A2L file for your XCP session.Enable se

Page 288 - SilentMode

14 Block Reference14-46XCP Data AcquisitionAcquire selected measurements from configured slaveLibraryXCP CommunicationDescriptionThe XCP Data Acquisit

Page 289

XCP Data Acquisition14-47

Page 290

1 Getting Started1-26• SigB: Another multiplexed signal with a multiplex value of 1.• MuxSig: A multiplexor signal, whose value determines which of th

Page 291

14 Block Reference14-48ParametersConfig nameSelect the name of XCP configuration you want to use. The list displays all availablenames specified in th

Page 292

XCP Data Acquisition14-49Toggle buttonsUse the toggle buttons to reorder the selected measurements.Sample timeSpecify the sampling time of the bloc

Page 293 - Timestamp

14 Block Reference14-50XCP Data StimulationPerform data stimulation on selected measurementsLibraryXCP CommunicationDescriptionThe XCP Data Stimulatio

Page 294 - TransceiverName

XCP Data Stimulation14-51ParametersConfig nameSelect the name of XCP configuration you want to use. The list displays all availablenames specified in

Page 295 - TransceiverState

14 Block Reference14-52a configuration displays events and measurements available in this configuration’sA2L file.Note: You can stimulate measurements

Page 296

XCP CAN Transport Layer14-53XCP CAN Transport LayerTransport XCP messages via CANLibraryVehicle Network Toolbox: CAN CommunicationVehicle Network Too

Page 297 - TransmitErrorCount

14 Block Reference14-54Device+Select a CAN device from the list of devices available to your system.Bus speedSet the bus speed property for the select

Page 298

XCP CAN TL Receive14-55XCP CAN TL ReceiveReceive XCP messages via CAN deviceDescriptionThe XCP CAN Transport Layer Receive block receives XCP message

Page 299

14 Block Reference14-56Sample timeSpecify the sampling time of the block during simulation, which is the simulationtime as described by the Simulink d

Page 300 - UserData

XCP CAN TL Transmit14-57XCP CAN TL TransmitTransmit queued XCP MessagesDescriptionThe XCP CAN Transport Layer Transmit block connects to a CAN Transm

Page 301

Vehicle Network Communication Examples1-27MuxSig is the multiplexor signal, whose value determines which of the twomultiplexed signals are active in

Page 302 - Measurements

14 Block Reference14-58Maximum number of messagesEnter the maximum number of messages the block can transmit. Value must be apositive integer.Sample t

Page 303

1 Getting Started1-28This ensures that you are not using an invalid value because the toolbox does notprevent or protect reading or writing inactive m

Page 304 - SlaveName

Vehicle Network Communication Examples1-29stop(canch1)2Check the channel status:canch1MATLAB displays the channel status:...Status: Offline - Waitin

Page 306 - FilePath

1 Getting Started1-30clear value

Page 307 - ProtocolLayerInfo

Access the Toolbox1-31Access the ToolboxIn this section...“Explore the Toolbox” on page 1-31“Get Help” on page 1-31“View Examples” on page 1-31Explor

Page 309 - A2LFileName

2Hardware Support PackageInstallation• “Vector CAN Device Support” on page 2-2• “National Instruments NI-CAN Device Support” on page 2-5• “National In

Page 310 - SeedKeyDLL

2 Hardware Support Package Installation2-2Vector CAN Device SupportUse this process to add support for Vector CAN devices to Vehicle Network Toolbox.

Page 311 - TransportLayer

Vector CAN Device Support2-31Follow the support package installer prompts. When prompted, log into yourMathWorks® account.Note: You need write privil

Page 312 - TransportLayerDevice

2 Hardware Support Package Installation2-4At any time during this process, you can click Help for more information aboutdownloading support packages.

Page 313

National Instruments NI-CAN Device Support2-5National Instruments NI-CAN Device SupportUse this process to add support for NI-CAN devices to Vehicle

Page 314 - CAN Configuration

2 Hardware Support Package Installation2-61Follow the support package installer prompts. When prompted, log into yourMathWorks account.Note: You need

Page 315 - Dialog Box

National Instruments NI-CAN Device Support2-7At any time during this process, you can click Help for more information aboutdownloading support packag

Page 316 - 14 Block Reference

vContentsGetting Started1Vehicle Network Toolbox Product Description . . . . . . . . . . . 1-2Key Features . . . . . . . . . . . . . . . . . . . . . .

Page 317

2 Hardware Support Package Installation2-8National Instruments NI-XNET Device SupportUse this process to add support for NI-XNET devices to Vehicle Ne

Page 318

National Instruments NI-XNET Device Support2-91Follow the support package installer prompts. When prompted, log into yourMathWorks account.Note: You

Page 319 - Code Generation

2 Hardware Support Package Installation2-10At any time during this process, you can click Help for more information aboutdownloading support packages.

Page 320

Kvaser CAN Device Support2-11Kvaser CAN Device SupportUse this process to add support for Kvaser devices to Vehicle Network Toolbox. After youdownloa

Page 321

2 Hardware Support Package Installation2-122Follow the support package installer prompts. When prompted, log into yourMathWorks account.Note: You need

Page 322 - CAN Pack

PEAK-System CAN Device Support2-13PEAK-System CAN Device SupportUse this process to add support for PEAK-System CAN devices to Vehicle NetworkToolbox

Page 323

2 Hardware Support Package Installation2-141Follow the support package installer prompts. When prompted, log into yourMathWorks account.Note: You need

Page 324

PEAK-System CAN Device Support2-15At any time during this process, you can click Help for more information aboutdownloading support packages.

Page 326

3CAN Communication Workflows• “CAN Transmit Workflow” on page 3-2• “CAN Receive Workflow” on page 3-5

Page 327

vi ContentsFilter Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24Multiplex Signals . . . . . . . . . . . . . . . . .

Page 328

3 CAN Communication Workflows3-2CAN Transmit WorkflowThis workflow helps you create a CAN channel and transmit messages.

Page 329

CAN Transmit Workflow3-3

Page 330

3 CAN Communication Workflows3-4See AlsoFunctionscanChannel | canDatabase | canMessage | canMessageImport | configBusSpeed| pack | start | stop | tran

Page 331 - Conversion Formula

CAN Receive Workflow3-5CAN Receive WorkflowUse this workflow to receive and unpack CAN messages.

Page 332 - CAN Receive

3 CAN Communication Workflows3-6

Page 333

CAN Receive Workflow3-7See AlsoFunctionsattachDatabase | canDatabase | configBusspeed | extractAll |extractRecent | extractTime | receive | stop | un

Page 335 - CAN Receive

4Using a CAN Database• “Vector CAN Database Support” on page 4-2• “Load .dbc Files and Create Messages” on page 4-3• “Other Uses of the CAN Database”

Page 336

4 Using a CAN Database4-2Vector CAN Database SupportA CAN database contains physical message and signal definitions. Using a CANdatabase, you can repr

Page 337 - CAN Replay

Load .dbc Files and Create Messages4-3Load .dbc Files and Create MessagesIn this section...“Load the CAN Database” on page 4-3“Create a CAN Message”

Page 338

viiLoad .dbc Files and Create Messages . . . . . . . . . . . . . . . . . . . 4-3Load the CAN Database . . . . . . . . . . . . . . . . . . . . . . . .

Page 339

4 Using a CAN Database4-4> VNTDemos subfolder in your MATLAB installation folder. This database has amessage, EngineMsg. To try this example, creat

Page 340

Load .dbc Files and Create Messages4-5canch.Database = canDatabase('Mux.dbc') For more information, see the Database property.Update Databa

Page 341 - CAN Transmit

4 Using a CAN Database4-6 'DoorControlMsg' 'EngineMsg' 'SunroofControlMsg' 'TransmissionMsg' &a

Page 342

Load .dbc Files and Create Messages4-7signalInfo(db, 'EngineMsg', 'EngineRPM')ans = Name: 'EngineRPM'

Page 343

4 Using a CAN Database4-8 Multiplexed MultiplexModeCreate a Message Using Database DefinitionsSpecify the name of the message when you create a

Page 344

Load .dbc Files and Create Messages4-9Change Signal InformationWrite directly to the signal to change a value and read its current value back.msgEngi

Page 345 - CAN Unpack

4 Using a CAN Database4-10 Properties: ID: 100 Extended: 0 Name: 'EngineMsg' Database: [1x1 can.Database]

Page 346

Load .dbc Files and Create Messages4-11 Filter History: Standard ID Filter: Allow All | Extended ID Filter: Allow AllReceive MessagesStart the

Page 347 - Parameters

4 Using a CAN Database4-12ans = can.Message handle Package: can Properties: ID: 100 Extended: 0 Name: 'EngineMsg'

Page 348

Load .dbc Files and Create Messages4-13 Timestamp: 5.5749 Data: [64 62 0 0] Signals: [1x1 struct] UserData: []Extract All Instanc

Page 349 - CAN Unpack

viii ContentsA2L File7A2L File Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2Access an A2L File . . . . . . . .

Page 350

4 Using a CAN Database4-14signals = 1x225 struct array with fields: VehicleSpeed EngineRPM

Page 351

Other Uses of the CAN Database4-15Other Uses of the CAN DatabaseIn this section...“View Message Information in a CAN Database” on page 4-15“View Sign

Page 352

4 Using a CAN Database4-16 ID: 100 Extended: 0 Length: 8 Signals: {2x1 cell}Here the function returns information about message w

Page 353

Other Uses of the CAN Database4-17To attach a database to a message, type: attachDatabase(message name, database name)Note: If your message is an arr

Page 355

5Monitoring Vehicle CAN Bus• “Vehicle CAN Bus Monitor” on page 5-2• “Using the Vehicle CAN Bus Monitor” on page 5-8

Page 356 - XCP Configuration

5 Monitoring Vehicle CAN Bus5-2Vehicle CAN Bus MonitorIn this section...“About the Vehicle CAN Bus Monitor” on page 5-2“Opening the Vehicle CAN Bus Mo

Page 357 - XCP Configuration

Vehicle CAN Bus Monitor5-3File Menu• Save Messages — Saves messages to a log file.• Clear Messages — Clears messages in the Vehicle CAN Bus Monitor w

Page 358 - XCP Data Acquisition

5 Monitoring Vehicle CAN Bus5-4• Exit CAN Tool — Click to exit the CAN Tool window.Configure Menu• Channel — Displays all available CAN devices and ch

Page 359 - XCP Data Acquisition

Vehicle CAN Bus Monitor5-5• Block All — Select to block all standard ID messages.• Allow only — Select to set up custom filtering of messages. Type t

Page 360

ixCAN Communication in Simulink . . . . . . . . . . . . . . . . . . . . . . 9-3Message Transmission Workflow . . . . . . . . . . . . . . . . . . . . .

Page 361

5 Monitoring Vehicle CAN Bus5-6select this option, the tool displays all instances of all messages in the order that theselected channel receives them

Page 362 - XCP Data Stimulation

Vehicle CAN Bus Monitor5-7Undocking Click this button to undock the Vehicle CAN Bus Monitor from the MATLABdesktop. To dock, click this button.Messag

Page 363

5 Monitoring Vehicle CAN Bus5-8Using the Vehicle CAN Bus MonitorIn this section...“View Messages on a Channel” on page 5-8“Configure the Channel Bus S

Page 364

Using the Vehicle CAN Bus Monitor5-9Filter CAN Messages in Vehicle CAN Bus MonitorFilter CAN messages to allow or block messages displayed in the Veh

Page 365 - XCP CAN Transport Layer

5 Monitoring Vehicle CAN Bus5-104Click the plus (+) sign to see the details of the message.

Page 366

Using the Vehicle CAN Bus Monitor5-11The tool displays the signal name as defined in the attached database and the signal'sphysical value.Change

Page 367 - XCP CAN TL Receive

5 Monitoring Vehicle CAN Bus5-12Use this feature to get a snapshot of message IDs that the selected channel receives. Usethis information to analyze s

Page 368

6XCP Communication Workflows

Page 369 - XCP CAN TL Transmit

6 XCP Communication Workflows6-2XCP Database and Communication WorkflowThis workflow helps you:• Manage an A2L database• Connect to an XCP device• Cre

Page 370

XCP Database and Communication Workflow6-3

Commentaires sur ces manuels

Pas de commentaire