TPCANMsgXL Structure

Defines a CAN message with Extended Data-Field Length an XL bit rate.

Definition

Namespace: Peak.Can.Basic.BackwardCompatibility
Assembly: PCANBasic.NET (in PCANBasic.NET.dll) Version: 5.1.0
C#
public struct TPCANMsgXL
Inheritance
Object    ValueType    TPCANMsgXL

Remarks

The members of this structure are sequentially byte aligned.

Relationship between DLC and data length in CAN XL messages:

The length of data bytes contained in a CAN message is given by the DATA LENGTH CODE field (DLC). The coding of the DLC within XL messages is different. The relationship between DLC and data bytes length is as follows: Bytes length is equals to DLC + 1. In this manner, the minimum length of data that can be sent within a CAN XL frame is 1 (DLC equals to 0 plus 1), and the maximum is 2048 (DLC equals 2047 plus 1).

  Important

The TPCANMsgXL structure is intended for reading and writing standard CAN messages, CAN messages with flexible data rate, as well as CAN Messages with extended data-field length on PCAN Channels initialized for standard CAN-XL communication, this is, using the InitializeXL method for initialization and the methods ReadXL and WriteXL for data transmission.

For CAN communication using only the standard CAN 2.0 A/B, the TPCANMsg structure is to be used.

For CAN communication using only the flexible data rate, CAN FD, the TPCANMsgFD structure is to be used.

Methods

EqualsIndicates whether this instance and a specified object are equal.
(Inherited from ValueType)
GetHashCodeReturns the hash code for this instance.
(Inherited from ValueType)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns the fully qualified type name of this instance.
(Inherited from ValueType)

Fields

AF The Acceptance Field, SDU - specific high - layer ID.
DATA The data associated to the CAN message (DATA[0]..DATA[2047]).

  Important

This array must be explicitly created, for instance:
C#
TPCANMsgXL msgXl = new TPCANMsgXL() { DATA = new byte[PCANBasic.MAX_LENGTH_DATA_XL] };
before a variable of this type can be used in any API function.
DLC The Data Length Code of the message (0..2047).
MSGTYPE The kind of CAN frame represented by this value.
PID CAN-XL: The priority ID (physical layer - 0..0x7FF). CAN-CC/CAN-FD: A 11/29-bit CAN message identifier.
RRS The Remote Request Substitution flag (0..1).
SDT The Service Data unit(SDU) protocol Type.
SEC TheSimple Extended Content flag (0..1).
VCID The virtual CAN network ID.

See Also