XR CAN signal decoding

CAN Signal Decoding Pipeline

Conceptually, each CAN signal channel specified by an XR test setup creates a "decoding pipeline" which extracts the value of the signal from received CAN bus messages. The decoding pipeline determines which CAN message(s) carry the signal, how to decode the signal's value from the message's payload, how to scale the signal into engineering units, and when too much time has passed since the signal was last received. At each sample point, the latest known value of the signal is recorded in the SIE file without interpolation. If too much time has passed since the signal was last received, a special invalid value is recorded instead to indicate stale data.

The following diagram illustrates the stages involved in a CAN signal decoding pipeline.

Message Router

The Message Router examines each CAN message observed on the bus to determine whether a signal value should be extracted from the message. CAN signal definitions specify a "Message ID Value" and a "Message ID Mask." The bits of the received message ID specified by the Message ID Mask are checked against the corresponding Message ID Value bits. If all bits match, the message is forwarded to the rest of the pipeline to extract the signal value.

For this check, the message ID is treated as a 32-bit value. The most significant bit is set to 1 to indicate a 29-bit extended CAN message ID, or cleared to 0 to indicate an 11-bit standard CAN message ID. Therefore, values in the range <0x00000000, 0x000007FF> are possible for 11-bit standard CAN frames, and values in the range <0x80000000, 0x9FFFFFFF> are possible for 29-bit extended CAN frames.

The following diagram illustrates the CAN message ID check. In the example illustrated, the least-significant 8 bits of the message ID are ignored (as might be the case if the user wishes to record a signal contained in a J1939 PGN regardless of the Source Address).

NOTE

If the most-significant bit of the Message ID Mask bit is set, then the Message Router will only pass messages that match the CAN frame type (standard or extended) specified by the most-significant bit of the Message ID Value. Set the most-significant mask bit to zero to accept both standard and extended CAN messages.
Examples:
Value 0x00000001, Mask 0xFFFFFFFF will only accept 11-bit-ID standard CAN messages with an ID of 1.
Value 0x00000001, Mask 0x7FFFFFFF will accept both 11-bit-ID and 29-bit-ID CAN messages with an ID of 1.

Demultiplexor

The demultiplexor is an optional pipeline stage used to handle multiplexed signals. Signals are multiplexed when they appear in a particular message only if a value somewhere else in the message payload has a specific value. In this situation, the CAN signal definition specifies the position, length and data format of the multiplexor value, and a value which the multiplexor field must hold in order for the message to be decoded. The decoding of the multiplexor value is performed in the same manner as the signal value decoding; refer to the Value Decoder section below for more information.

Value Decoder

Once a message has been determined to contain a signal value by the Message Router and (optionally) the Demultiplexor, the message is passed to the Value Decoder to extract the raw (unscaled) signal value from the message payload. The CAN signal definition specifies a bit position, length and data format which are used to convert the appropriate payloads bits into a raw numeric value.

Scaler

The scaler stage applies a multiplicative scale factor and a linear offset in order to convert the raw signal value to an engineering value. The CAN signal definition specifies the appropriate scale factor, offset and unit name.

Sampler

The sampler tracks the latest received value of a signal. At each sample point at the sample rate specified by the user in the test setup definition, the last-received value is recorded. If too much time has passed since a value was received, a user-specified invalid data value is recorded instead of the last-received value.

Data File

The data file (SIE) also stores additional metadata from the CAN signal definition, such as the message name, signal name and description, and min/max measurement range. This information is not interpreted or used by the system other than to record the information in the metadata.

CAN Signal Definition Parameters

Parameter Descriptions

  • Metadata Parameters
    • Name - The name of the signal. When added to a setup as an input channel, the new channel's name is set to this value. For maximum compatibility with other software, use only letters, numbers and underscores (_).
    • Description - A human-readable description of the signal. When added to a setup as an input channel, the new channel's description is set to this value.
    • Message name - The name of the CAN message which carries this signal.
    • Min - The minimum allowable signal value.
    • Max - The maximum allowable signal value.
  • Message Router Parameters
    • Message ID - The CAN message ID of the message(s) which contain this signal. See the Message Router section above for more information on how this value is interpreted.
    • Mask - The bit mask to apply to the message ID before comparing it to a received message ID. See the Message Router section above for more information on how this value is interpreted.
  • Demultiplexor Parameters (Optional)
    • Mode bit start - The bit position of the multiplexor signal value; see Bit start below for a description of how bit position is reckoned.
    • Mode bit length - The width of the multiplexor signal in bits, including any sign bit.
    • Mode data format - The format of the multiplexor signal value encoding; see Data format below for a description of the supported values. Note that FMSB/FLSB are not supported for multiplexor signals.
    • Mode value - The value which the multiplexor signal must contain in order for the main signal value to be extracted from the message.
  • Value Decoder Parameters
    • Bit start - The standard bit number of the signal's most-significant bit (for Motorola byte order signals) or least-significant bit (for Intel byte order signals); i.e. the Motorola Forward MSB or Intel Standard bit positions, respectively. See CAN database decoding and numbering for more information.
    • Bit length - The width of the signal in bits, including any sign bit.
    • Data format - The format of the signal value encoding. The supported values are:
      • UMSB - An unsigned number stored in Motorola (big-endian) byte order.
      • ULSB - An unsigned number stored in Intel (little-endian) byte order.
      • SMSB - A signed number stored in Motorola (big-endian) byte order.
      • SLSB - A signed number stored in Intel (little-endian) byte order.
      • FMSB - An IEEE 754 floating-point number stored in Motorola (big-endian) byte order. The bit length must be either 32 or 64 for single-precision or double-precision IEEE 754 formats, respectively.
      • FLSB - An IEEE 754 floating-point number stored in Intel (little-endian) byte order. The bit length must be either 32 or 64 for single-precision or double-precision IEEE 754 formats, respectively.
  • Scaler Parameters
    • Scale - A multiplicative scale factor to apply to the decoded signal value after decoding.
    • Offset - A constant offset value to apply to the decoded signal value after scaling.
    • Units - The name of the units in which the signal's value is measured.
  • Sampler Parameters
    • Sample rate - The number of times per second that the latest signal value should be recorded. This parameter can only be configured after a CAN signal has been added to a test setup as a channel.
    • Expiration time - The time after which, if no signal value has been received, the invalid value should be recorded instead of the latest signal value. This parameter can only be configured after a CAN signal has been added to a test setup as a channel.
    • Invalid value - The value to record if no signal value has been received after the specified expiration time.
  • Other Parameters
    • Request message - Optionally specifies a CAN message which the CX23-R / eDAQXR should transmit on the bus. This field can be used for any purpose, but is commonly used to enter a polling or request message to elicit transmission of certain parameters by a CAN node. The format of the message is a sequence of hexadecimal digits. The first 8 digits specify the CAN message ID. The mostsignificant bit should be set to 1 to transmit a 29-bit-ID extended CAN message, or 0 to transmit an 11-bit-ID extended CAN message. Following these digits, pairs of digits can be entered to specify the message payload. From 0 to 8 payload bytes may be specified (i.e., 0 to 16 hexadecimal digits).
      • Example: 00000123AABBCC means to transmit an 11-bit-ID standard CAN frame with ID 0x123, a DLC of 3, and payload bytes AA BB CC.
      • Example: 81234567DDEEFF0011 means to transmit a 29-bit-ID extended CAN frame with ID 0x1234567, a DLC of 5, and payload bytes DD EE FF 00 11.
    • Protocol - This field is read-only. It is set by the Vector DBC database importer when a CCP or XCP-on-CAN measurement is loaded. CCP and XCP-on-CAN measurements cannot be configured directly by the user and must always be imported from a Vector DBC database file.

 

Vector DBC Database Import
Parameter Import Source
Name This value is taken from the signal name specified in the DBC file. If the user selected the "Prepend message names to signal names" option during import, the message name specified in the DBC is prepended to the signal name and separated from it by a delimiter. The delimiter defaults to a double-colon (::) but can be changed in System > Preferences > System > Databases. If a duplicate name is encountered during import, a number is appended to the signal name and separated from it by a delimiter. The delimiter is _duplicate_.
Description This value is taken from the signal name specified in the DBC file. If the DBC file was exported by a CX23-R or eDAQXR, the description previously stored is preserved via a special DBC signal attribute named HBK_SIGNAL_DESCRIPTION.
Message name This value is taken from the message name specified in the DBC file.
Min This value is taken from the minimum value specified in the DBC file. If the minimum value is equal to or greater than the maximum value, a new minimum value is calculated which is equal to the minimum representable value given the signal's data type, bit length, scale factor and offset; or, for floating-point signals, -1000000000.
Max This value is taken from the maximum value specified in the DBC file. If the maximum value is equal to or less than the minimum value, a new maximum value is calculated which is equal to the maximum representable value given the signal's data type, bit length, scale factor and offset; or, for floating-point signals, +1000000000.
Message ID This value is taken from the message ID specified in the DBC file. For J1939 PGNs with a NULL source address, the source address bits of the message ID are cleared to zero.
Mask This value is set to 0xFFFFFFFF, except for J1939 PGNs with a NULL source address, in which case the value is set to 0xFFFFFF00. If the DBC file was exported by a CX23-R or eDAQXR, the mask previously stored is preserved via a special DBC signal attribute named HBK_SIGNAL_MESSAGE_ID_MASK.
Mode bit start For multiplexed (m) signals, this value is taken from the bit position specified for the corresponding multiplexor (M) signal in the DBC file.
Mode bit length For multiplexed (m) signals, this value is taken from the bit length specified for the corresponding multiplexor (M) signal in the DBC file.
Mode data format For multiplexed (m) signals, this value is taken from the data format specified for the corresponding multiplexor (M) signal in the DBC file.
Mode value For multiplexed (m) signals, this value is taken from the multiplexor value specified in the DBC file.
Bit start This value is taken from the bit position specified in the DBC file.
Bit length This value is taken from the bit length specified in the DBC file.
Data format This value is taken from the data format specified in the DBC file.
Scale This value is taken from the scale factor specified in the DBC file.
Offset This value is taken from the offset specified in the DBC file.
Units This value is taken from the unit value specified in the DBC file.
Invalid vlaue If the DBC file was exported by a CX23-R or eDAQXR, the invalid value previously entered is preserved via a special DBC signal attribute named HBK_SIGNAL_INVALID_DATA_VALUE. Otherwise, a default value is calculated. For signals with length 8, 16, 32 or 64, the default value is the maximum representable value. For signals with other lengths, the default value is the maximum representable value plus the scale factor. For floating-point signals, the default value is 1e15.
Request message This value is blank, unless the DBC file was exported by a CX23-R or eDAQXR, in which case the request message previously stored is preserved via a special DBC signal attribute named HBK_SIGNAL_REQUEST_MSG.
Protocol This value is set to CCP or XCP if the DBC specifies that the signal is acquired via CCP or XCP-on-CAN. In either case, additional CCP /XCP parameters are stored in the signal definition. These additional parameters are not accessible to the user.

 

eDAQ Text Database Import
Parameter Import Source
Name This value is taken from the id column.
Description This value is taken from the description column.
Message name This value is set to a string of the form MSG_0xHHHHHHHH where HHHHHHHH is the message ID specified in the value column.
Min This value is taken from the min column.
Max This value is taken from the max column.
Message ID This value is taken from the value column. If the value column also contains payload bytes beyond the message ID, they are removed.
Mask This value is taken from the mask column. If the mask column also describes payload bytes beyond the message ID, those bytes are removed.
Mode bit start This values are set automatically if the importer detects that the value and mask columns implement multiplexing by including and masking out payload bits. Only one multiplexor is supported. If the value and mask include two or more gaps for multiplexor values, a warning is issued and the extended multiplexing is not honored.
Mode bit length
Mode data format
Mode value
Bit start This value is taken from the bitpos column, after appropriate translation from legacy eDAQ bit position reckoning to DBC reckoning (Motorola Forward MSB / Intel Standard).
Bit length This value is taken from the bitlength column.
Data format This value is taken from the dataformat column.
Scale This value is taken from the scale column.
Offset This value is taken from the offset column.
Units This value is taken from the units column.
Invalid vlaue This value is calculated as the maximum representable value given the signal's data type, bit length, scale factor and offset.
Request message This value is taken from the request column.
Protocol This value is always blank (CCP and XCP-on-CAN signals cannot be stored in an eDAQ text database).

Live Data Capture in Database Editor

The XR's CAN database signal editor includes a Data capture tool that allows the user to capture live data from a CAN bus in order to see how the signal being edited will be decoded. The data capture view has the following parameters:

  • Bit rate - Specify the desired CAN bus bit rate in bits per second.
  • Termination - Select true to install an internal termination resistor.
  • Module - Select the module to which the CAN bus is connected.
  • Port - Select the port number to which the CAN bus is connected on the selected module.

Click the Apply button to apply the selected parameters.

Data may be temporarily captured. Click the Capture button to open the dialog. Pull-down menus allow the Time or Value column to be hidden (one must stay visible) and contents sorted (ascending or descending). Limit the data capture by entering a value in the field for Time (7200 seconds is the maximum) or Number (20000 samples is the maximum).

Click the Capture button and a dialog shows. If no value is entered in the Time or Number field, 10000 messages may be captured. To stop capture before this limit, the Time or Number is reached, click the Close button. After capture, the number of captured samples shows in parentheses after Value at the top of the column.

To find data among captured samples, enter data in the Search field. Search field content is highlighted among the data samples.

To filter data, enter data in the Filter field. Only matching data among the samples shows in the columns. Clear the Filter field to see all captured data. At the top of the Value column, the number of filtered samples shows in parentheses with the number of captured samples, such as (2/15). Captured data may be searched or filtered before export. Search results are not highlighted in the exported file.

Select rows with the mouse or keyboard and click the Export button. Selected rows may be saved as a Text Document (named capture.txt unless renamed by the user). The number of rows exported shows in parentheses at the top of the text document. An exported file may be opened in Microsoft Excel with tab delimited columns.

When editing is completed, click OK. The information entered in the dialog will show in the spreadsheet grid cells.