Detailed instructions for use are in the User's Guide.
[. . . ] Vehicle Network ToolboxTM 1 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Vehicle Network ToolboxTM User's Guide © COPYRIGHT 2010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] Parses messages with a timestamp up to the specified end time, including the specified end time. An array of CAN message objects returned with all messages that occur within and including starttime and endtime.
endtime
extracted
Description
extracted = extractTime(message, starttime, endtime, msgRange) parses the array message and returns all messages with a timestamp within the specified starttime and endtime, including the starttime and endtime.
Remarks
Specify the time range in increasing order from starttime to endtime. If you must specify the largest available time, endtime also accepts Inf as a valid value. The earliest acceptable time you can specify for starttime is 0.
msgRange = extractTime(message, 5, 10. 5) msgRange = extractTime(message, 0, 60) msgRange = extractTime(message, 150, Inf) extractAll, extractRecent
Examples
See Also
6-19
filterAcceptRange
Purpose Syntax Arguments
Set range of CAN identifiers to pass acceptance filter
filterAcceptRange(canch, rangestart, rangeend)
canch rangestart rangeend
The CAN channel that you want to set the filter for. The first identifier of the range of message IDs that the filter accepts. The last identifier of the range of message IDs that the filter accepts.
Description
filterAcceptRange(canch, rangestart, rangeend) sets the acceptance filter for standard identifier CAN messages. It allows messages within the given range on the CAN channel canch to pass. rangestart and rangeend establish the beginning and end of the acceptable range. You can use this function with Vector devices only.
Notes · You can configure message filtering only when the CAN channel is offline. · filterAcceptRange supports only standard (11-bit) CAN identifiers. · You must set the values from rangestart through rangeend in increasing order. · filterAcceptRange and filterBlockRange work together by allowing and blocking ranges of CAN messages within a single filter. You can perform both operations multiple times in sequence to custom configure the filter as desired.
6-20
filterAcceptRange
Remarks
When you call filterAcceptRange on an open or reset filter, it automatically blocks the entire standard CAN identifier range, allowing only the desired range to pass. Subsequent calls to filterAcceptRange open additional ranges on the filter without blocking the ranges previously allowed.
canch = canChannel('Vector', 'CANCaseXL 1', 1) filterAcceptRange(canch, 600, 625) filterAcceptRange(canch, 705, 710) filterBlockRange, filterReset, filterSet
Examples
See Also
6-21
filterBlockRange
Purpose Syntax Arguments
Set range of CAN identifiers to block via acceptance filter
filterBlockRange(canch, rangestart, rangeend)
canch rangestart rangeend
The CAN channel that you want to set the filter for. The first identifier of the range of message IDs that the filter starts blocking at. The last identifier of the range of message IDs that the filter stops blocking at.
Description
filterBlockRange(canch, rangestart, rangeend) blocks messages
within a given range by setting an acceptance filter. You can use this function with Vector devices only.
Notes · You can configure message filtering only when the CAN channel is offline. · filterBlockRange supports only standard (11-bit) CAN identifiers. · You must set the values from rangestart through rangeend in increasing order. · filterBlockRange and filterAcceptRange work together by blocking and allowing ranges of CAN messages within a single filter. You can perform both operations multiple times in sequence to custom configure the filter as desired.
6-22
filterBlockRange
Examples
You can set the filter to block or accept messages within a specific range.
canch = canChannel('Vector', 'CANCaseXL 1', 1) filterBlockRange(canch, 500, 750) filterAcceptRange(canch, 600, 625) filterAcceptRange(canch, 705, 710) filterBlockRange(canch, 1075, 1080)
See Also
filterAcceptRange, filterReset, filterSet
6-23
filterReset
Purpose Syntax Description
Open CAN message acceptance filters
filterReset(canch) filterReset(canch) resets the CAN message filters on the CAN channel canch for both standard and extended CAN identifier types.
Then all messages of all identifier types can pass. Make sure that the channel is offline before calling filterReset.
Examples
Reset the message filters as shown:
canch = canChannel('Vector', 'CANCaseXL 1', 1) filterBlockRange(canch, 500, 750) filterAcceptRange(canch, 600, 625) filterAcceptRange(canch, 705, 710) filterBlockRange(canch, 1075, 1080) filterSet(canch, 500, 750, 'Standard') filterReset(canch)
See Also
filterAcceptRange, filterBlockRange, filterSet
6-24
filterSet
Purpose Syntax
Set specific CAN message acceptance filter configuration
filterSet(canch, code, mask, idtype) filterSet(canch, id, idtype)
Arguments
canch code mask id idtype
The CAN channel that you want to set the filter for. [. . . ] In this format you count bits from the start, which is the least significant bit, to the most significant bit. For example, if you pack one byte of data in big-endian format, with the start bit at 20, the data bit table resembles this figure.
9-31
CAN Unpack
Big-Endian Byte Order Counted from the Least Significant Bit to the Lowest Address
Data type Specify how the signal interprets the data in the allocated bits. Choose from: · signed (default) · unsigned · single · double
9-32
CAN Unpack
Multiplex type Specify how the block unpacks the signals from the CAN message at each timestep: · Standard: The signal is always unpacked at each timestep. · Multiplexor: The Multiplexor signal, or the mode signal is always unpacked. [. . . ]