Defines a CAN message with flexible data rate.
Syntax
typedef struct { DWORD ID; TPCANMessageType MSGTYPE; BYTE DLC; BYTE DATA[64]; } TPCANMsgFD;
TPCANMsgFD = record ID: Longword; MSGTYPE: TPCANMessageType; DLC: Byte; DATA: array[0..63] of Byte; end;
public struct TPCANMsgFD { public uint ID; [MarshalAs(UnmanagedType.U1)] public TPCANMessageType MSGTYPE; public byte DLC; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public byte[] DATA; }
public value struct TPCANMsgFD { UInt32 ID; [MarshalAs(UnmanagedType::U1)] TPCANMessageType MSGTYPE; Byte DLC; [MarshalAs(UnmanagedType::ByValArray, SizeConst = 64)] array<Byte>^ DATA; };
Public Structure TPCANMsgFD Public ID As UInt32 <MarshalAs(UnmanagedType.U1)> _ Public MSGTYPE As TPCANMessageType Public DLC As Byte <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> _ Public DATA As Byte() End Structure
from ctypes import * class TPCANMsgFD (Structure): _fields_ = [ ("ID", c_uint), ("MSGTYPE", TPCANMessageType), ("DLC", c_ubyte), ("DATA", c_ubyte * 64) ]
The members of this structure are sequentially byte aligned.
Name |
Description |
ID |
11/29-bit message identifier. |
MSGTYPE |
Type of the message. Bit mask indicating the type of the message. Several message types can be combined. |
DLC |
Data Length Code of the message (0..15). |
DATA |
Data of the message (DATA[0]..DATA[63]). |
Longer Data field with CAN FD 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 FD messages is different. There are 7 additional codes (from 9 to 15) that allows a FD Messages to transport up to 64 bytes of data. The relationship between DLC and data bytes length is as follow:
DLC |
Data Bytes |
0 |
0 |
1 |
1 |
2 |
2 |
3 |
3 |
4 |
4 |
5 |
5 |
6 |
6 |
7 |
7 |
8 |
8 |
9 |
12 |
10 |
16 |
11 |
20 |
12 |
24 |
13 |
32 |
14 |
48 |
15 |
64 |
CAN_ReadFD (class-method: ReadFD)
CAN_WriteFD (class-method: WriteFD)
Copyright © 2017. PEAK-System Technik GmbH. All rights reserved.
|
Send feedback to this documentation
|