Vector CANcaseXL Uživatelská příručka

Procházejte online nebo si stáhněte Uživatelská příručka pro Výkonové šroubováky Vector CANcaseXL. Vector CANcaseXL User`s guide Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 370
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků

Shrnutí obsahu

Strany 1 - User's Guide

Vehicle Network Toolbox™User's GuideR2015a

Strany 2 - How to Contact MathWorks

x ContentsFunctions — Alphabetical List12Properties — Alphabetical List13Block Reference14

Strany 3 - Revision History

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 9

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 14

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

Strany 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

Strany 16

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

Strany 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

Strany 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

Strany 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

Strany 20

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

Strany 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

Strany 22

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

Strany 23

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

Strany 24

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

Strany 25 - Receive Workflow

9 CAN Communications in Simulink9-4Message Transmission Workflow

Strany 26

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

Strany 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

Strany 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

Strany 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

Strany 30

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

Strany 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

Strany 32

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

Strany 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

Strany 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

Strany 35 - Multiplex Signals

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

Strany 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

Strany 37

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

Strany 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

Strany 39

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

Strany 40

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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 &

Strany 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.

Strany 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

Strany 50

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

Strany 51

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

Strany 52

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

Strany 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

Strany 54

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

Strany 55

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

Strany 56

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

Strany 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

Strany 58

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

Strany 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

Strany 60 - CAN Transmit Workflow

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

Strany 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

Strany 63 - CAN Receive Workflow

12Functions — Alphabetical List

Strany 64

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

Strany 65

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

Strany 66

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

Strany 67

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

Strany 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

Strany 69 - Create a CAN Message

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

Strany 70 - 4 Using a CAN Database

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

Strany 71 - Update Database Information

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

Strany 72

canHWInfo12-9See AlsocanChannel

Strany 73 - Minimum

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

Strany 74

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

Strany 75 - Change Signal Information

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

Strany 76

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

Strany 77

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

Strany 78

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

Strany 79

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

Strany 80

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

Strany 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

Strany 82

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

Strany 83

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

Strany 84

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

Strany 85

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

Strany 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

Strany 87 - File Menu

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

Strany 88 - 5 Monitoring Vehicle CAN Bus

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

Strany 89 - Vehicle CAN Bus Monitor

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

Strany 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

Strany 91

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

Strany 92

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

Strany 93 - Attach a Database

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

Strany 94

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

Strany 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

Strany 96

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

Strany 97

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

Strany 98

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

Strany 99

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

Strany 100 - 6 XCP Communication Workflows

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

Strany 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

Strany 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

Strany 103 - Access an A2L File

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

Strany 104 - Access Event Information

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

Strany 105 - Open an A2L file:

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

Strany 106 - 7 A2L File

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

Strany 107 - Protocol (XCP)

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

Strany 108 - XCP Interface

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

Strany 109 - XCP Hardware Connection

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

Strany 110

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

Strany 111

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

Strany 112

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

Strany 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

Strany 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

Strany 115

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

Strany 116

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

Strany 117

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

Strany 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

Strany 119 - CAN Communication in Simulink

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

Strany 120 - Message Transmission Workflow

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

Strany 121

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

Strany 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

Strany 123

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

Strany 124

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

Strany 125

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

Strany 126

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

Strany 127

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

Strany 128

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

Strany 129

12 Functions — Alphabetical List12-60See AlsogetEventInfo | getMeasurementInfo

Strany 130 - Configure the CAN Pack Block

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

Strany 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

Strany 132

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

Strany 133

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

Strany 134

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

Strany 135

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

Strany 136

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

Strany 137

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

Strany 138

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

Strany 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

Strany 140

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

Strany 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

Strany 142

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

Strany 143 - Create Custom Blocks

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

Strany 144

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

Strany 145 - Hardware Limitations

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

Strany 146 - 10 Hardware Limitations

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

Strany 147

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

Strany 148

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

Strany 149

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

Strany 150

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

Strany 151 - XCP Data Acquisition over CAN

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

Strany 152

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

Strany 153

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

Strany 154

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

Strany 155

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

Strany 156 - Examples

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

Strany 157 - More About

1 Getting Started1-14Transmit Workflow

Strany 158

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

Strany 159 - Properties

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

Strany 160 - See Also

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

Strany 161

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

Strany 162 - Output Arguments

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

Strany 163

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

Strany 164

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

Strany 165

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

Strany 166

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

Strany 167

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

Strany 168

Vehicle Network Communication in MATLAB1-15Receive Workflow

Strany 169

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

Strany 170

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

Strany 171

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

Strany 172

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

Strany 173

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

Strany 174

13Properties — Alphabetical List

Strany 175

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

Strany 176

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

Strany 177

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

Strany 178

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

Strany 179

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

Strany 180

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

Strany 181

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

Strany 182

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

Strany 183

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

Strany 184

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

Strany 185

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

Strany 186

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

Strany 187

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

Strany 188

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

Strany 189

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

Strany 190

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

Strany 191

13 Properties — Alphabetical List13-16PropertiesID

Strany 192

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

Strany 193

13 Properties — Alphabetical List13-18PropertiesExtended

Strany 194

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

Strany 195

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

Strany 196

MessageReceivedFcn13-21PropertiesMessageReceivedFcnCount, MessagesAvailable

Strany 197

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

Strany 198

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

Strany 199

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

Strany 200

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

Strany 201

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

Strany 202

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

Strany 203

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

Strany 204

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

Strany 205

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

Strany 206

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

Strany 207

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

Strany 208

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

Strany 209

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

Strany 210

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

Strany 211

SilentMode13-35See AlsoFunctionscanChannel

Strany 212

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

Strany 213

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

Strany 214

Signals13-37See AlsoFunctionscanMessage, canDatabase

Strany 215

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

Strany 216

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

Strany 217

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

Strany 218

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

Strany 219

13 Properties — Alphabetical List13-42PropertiesTransceiverName

Strany 220

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

Strany 221

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

Strany 222

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

Strany 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

Strany 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

Strany 225

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

Strany 226

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

Strany 227

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

Strany 228

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

Strany 229

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

Strany 230

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

Strany 231

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

Strany 232

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

Strany 233

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

Strany 234

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

Strany 235

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

Strany 236

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

Strany 237

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

Strany 238

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

Strany 239

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

Strany 240

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

Strany 241

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

Strany 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

Strany 243

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

Strany 244

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

Strany 245

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

Strany 246

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

Strany 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

Strany 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

Strany 249

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 257 - BusSpeed

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

Strany 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

Strany 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

Strany 260

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 265 - DeviceChannelIndex

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

Strany 266 - DeviceSerialNumber

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

Strany 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

Strany 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

Strany 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

Strany 270

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

Strany 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

Strany 272

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

Strany 273 - InitializationAccess

14 Block Reference14-32See AlsoCAN Configuration, CAN Pack

Strany 274 - MessageReceivedFcn

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

Strany 275

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

Strany 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

Strany 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,

Strany 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

Strany 279 - MessagesReceived

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 284

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

Strany 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

Strany 286

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

Strany 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

Strany 288 - SilentMode

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

Strany 289

XCP Data Acquisition14-47

Strany 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

Strany 291

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

Strany 292

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

Strany 293 - Timestamp

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

Strany 294 - TransceiverName

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

Strany 295 - TransceiverState

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

Strany 296

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

Strany 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

Strany 298

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

Strany 299

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

Strany 300 - UserData

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

Strany 301

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

Strany 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

Strany 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

Strany 304 - SlaveName

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

Strany 306 - FilePath

1 Getting Started1-30clear value

Strany 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

Strany 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

Strany 310 - SeedKeyDLL

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

Strany 311 - TransportLayer

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

Strany 312 - TransportLayerDevice

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

Strany 313

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

Strany 314 - CAN Configuration

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

Strany 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

Strany 316 - 14 Block Reference

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

Strany 317

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

Strany 318

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

Strany 319 - Code Generation

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

Strany 320

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

Strany 321

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

Strany 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

Strany 323

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

Strany 324

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

Strany 326

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

Strany 327

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

Strany 328

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

Strany 329

CAN Transmit Workflow3-3

Strany 330

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

Strany 331 - Conversion Formula

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

Strany 332 - CAN Receive

3 CAN Communication Workflows3-6

Strany 333

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

Strany 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”

Strany 336

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

Strany 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”

Strany 338

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

Strany 339

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

Strany 340

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

Strany 341 - CAN Transmit

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

Strany 342

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

Strany 343

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

Strany 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

Strany 345 - CAN Unpack

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

Strany 346

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

Strany 347 - Parameters

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

Strany 348

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

Strany 349 - CAN Unpack

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

Strany 350

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

Strany 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

Strany 352

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

Strany 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

Strany 355

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 360

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

Strany 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

Strany 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

Strany 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

Strany 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

Strany 365 - XCP CAN Transport Layer

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

Strany 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

Strany 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

Strany 368

6XCP Communication Workflows

Strany 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

Strany 370

XCP Database and Communication Workflow6-3

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

Žádné komentáře