Skip to Content
On this page

CAN / CAN FD master

CAN and CAN FD frame transceiver, filtering and variable mapping driver

Compatible devices and models

Device series / model examplesConnection requirements
Devices using CAN or CAN FD framesUse a channel or adapter supporting the required CAN frames. Match bitrate, frame IDs, filters and byte mapping. Raw CAN is distinct from CANopen.

Adapter, wiring and frame payload

  1. Connect CAN_H, CAN_L and reference ground according to the adapter manual. Terminate the two bus ends; enable an internal terminator only when supported and needed at that endpoint.
  2. Confirm adapter channel, arbitration rate and frame format in its tool, then enter the matching CanKit endpoint. Default virtual://alpha/0 is virtual and must be replaced for real hardware.
  3. Classical CAN allows up to 8 payload bytes. CAN FD additionally requires the data-phase rate and matching BRS behavior. A mode mismatch is not a variable byte-order problem.
  4. Find a known standard frame, for example ID 0x123, data 01 02 34 12. First read a Byte array at 0x123;L=4, length 4, and compare bytes before interpreting multibyte values.

Offset, response ID and filtering

Offset .2 starts at the third payload byte: 0x123.2;L=2 selects 34 12. Interpret UInt16 using the device-defined byte order. The 0x ID is hexadecimal and byte offsets are zero-based.

Configure R=0xResponseID for request-response devices and include the response ID in hardware filters. Filtering only the request ID drops replies. Extended frames also need E=1; equal numeric standard and extended IDs remain distinct. Payload commands come from the device protocol; CAN has no universal register-read command.

Open the plugin

Enter “Development Configuration → Collection Configuration”, create a device and select “CAN / CAN FD master” in “Device Plugin”.

Supported channels and data types

Channel typePre-configuration check
Plugin built-in connectionConnection parameters are configured in the device dynamic properties and do not use public TCP, UDP or serial channel parameters.

Optional data types: Boolean, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, String, Decimal

This list describes types allowed by the plugin editor. Address width, arrays, string length and read/write restrictions still follow this page; it does not mean that every address supports every type.

Plugin properties

CAN Master opens the bus directly through CanKit; the channel is only used for the common device lifecycle and does not use ordinary TCP, UDP, or serial fields. Configure common timeout, data format, and string-reversal settings through the collection configuration; this page lists CAN-specific fields.

Connection configuration

SettingDescription
Endpoint addressDefault: virtual://alpha/0; fill in: text input. Sets the endpoint address used when establishing connections.

Protocol parameters

SettingDescription
Baud rateDefault: 500000; fill in: digital input. Set the baud rate used for protocol communication.
Data phase baud rateDefault: 2000000; fill in: digital input. Set the data phase baud rate used for protocol communication.
Protocol modeDefault: CAN 2.0; fill in: drop-down selection. Set the protocol mode used for protocol communication.
Enable BRSDefault: No; fill in: switch. Controls whether the “Enable BRS” function is enabled.
Internal termination resistorDefault: Yes; fill in: switch. Controls whether the “internal termination resistor” function is enabled.
Hardware filter CANID listFill in: Integer list dialog box. Set the hardware filter CANID list used for protocol communication.

Protocol mode options are CAN 2.0 (classic CAN) and CAN FD. Classic CAN carries at most 8 data bytes; CAN FD carries at most 64. Data-phase bitrate and BRS apply only to CAN FD. Enable the internal termination resistor only when the adapter hardware provides it and no external resistor already terminates the bus.

Address rules

  • CAN address format: 0xCANID[.start byte][;R=0x response ID][;L=data length][;E=1(extended frame)]
  • Example: 0x123, 0x123.2, 0x123;R=0x456;L=4;E=1
  • Standard-frame CAN IDs are 0x000–0x7FF; set E=1 for an extended frame, whose ID may be up to 0x1FFFFFFF.
  • The .start byte offset is zero-based. L is the read/write length: 1–8 in classic CAN and 1–64 in CAN FD; bytes beyond the frame are truncated.
  • R= selects the response ID for request/response mode; without it the request ID is matched. An empty FilterCanIds list disables hardware filtering; a non-empty list accepts only those IDs.

Standard and extended frames are matched by both CAN ID and frame format. 0x123 and 0x123;E=1 have the same numeric ID but separate received data and read results. Check the request and response frame formats at both ends. Remote-request and error frames are not variable data.

Device debug

Enter “Development Configuration → Collection Configuration”, select the current device then open “Protocol Debug” at the top of the workspace.

CAN / CAN FD master: Operations

Debugging notes

Send a test frame by CAN ID, Hexadecimal Data and Extended Frame options on the dedicated page; first verify the filter and response with a frame that does not affect the device.

The Extended Frame selection applies to both reading the latest received frame and sending. If the same numeric ID carries both formats, read each selection separately and compare its payload and format with the bus traffic.

Functions

FunctionPurpose
Read frameReads the latest received data for the CAN ID and Extended Frame selection. This does not send a control frame.
Send frameUse Send frame with an approved test point and confirm site safety before execution.
Debug resultView the returned value, success state, or error message.

Verify the configuration

Send standard data frame 0x123 with payload 2A from a bus test source; expect 42 and compare with a bus analyzer.

Writes and control operations require an approved test point and the site safety procedure.

Troubleshooting

  • If frames exist but reads are empty, check standard/extended format, filter and bitrate. This example uses neither CAN FD/BRS nor remote-request frames.