Skip to main content

Decoding CAN/CANopen logs using your favorite AI prompt

One of the most useful things about text-based AIs like GPT is that you can hand them a piece of data and ask them what they see. 

Kickdrive's own support bot can provide great answers, at least for a limited portion of a CAN Monitor log, since the maximum input length for our support bot is limited.

For the little test below, I relied on a regular ChatGPT prompt, and the result was almost spot on. In short...

TL;DR

GPT or any other (coding) AI is an extremely efficient way to look at CAN bus frame data. It will give you all the high-level information, and more. 

BUT - you as the developer should still verify what you are doing and know the specifics. Because if the log contains unexpected / unusual data - in our case a vendor specific object number in the 0x3500 range - GPT will present an incorrect answer with the same confidence as a real answer.

The ChatGPT prompt

Here is the prompt I used after a Kickdrive customer asked about how the Scan function in Kickdrive Network Manager works on a CAN/CANopen level, and which responses and CANopen objects are required on the device side. I used a MovingCap drive for this test. 

What can I help with?

I have attached a CAN bus log/trace file.  It shows the communication between a CANopen configuration tool (Kickdrive) and a CANopen node (a Fullmo MovingCap servo drive). Please go through the CAN frame sequence and explain step-by-step what they mean on a CANopen level (CiA 301 and CiA 402 standards). Note that the CAN interface used to create this log is a dual channel interface which reads back the TX frames sent by Kickdrive (echo). So the line below a "TX" line is the same data, not a second CAN frame.

The data 

And here is the CAN bus log -  a simple copy/paste from the CAN Monitor screen in Kickdrive,
(But I left out the first frame with a duplicate 82 00 request uses for the Scan, just to not confuse GPT right from the start.)

Frame # t [msec] ID Data Dir Description
2 0h 82 00 TX
3 552.73 0h 82 00
4 559.20 701h 00
5 601h 40 00 10 00 00 00 00 00 TX
6 1555.93 601h 40 00 10 00 00 00 00 00
7 1558.10 581h 43 00 10 00 92 01 02 00
8 601h 40 18 10 01 00 00 00 00 TX
9 2579.64 601h 40 18 10 01 00 00 00 00
10 2581.31 581h 43 18 10 01 01 00 00 00
11 601h 40 18 10 02 00 00 00 00 TX
12 2615.60 601h 40 18 10 02 00 00 00 00
13 2617.07 581h 43 18 10 02 02 00 00 00
14 601h 40 18 10 03 00 00 00 00 TX
15 2649.54 601h 40 18 10 03 00 00 00 00
16 2651.24 581h 43 18 10 03 03 00 00 00
17 601h 40 18 10 04 00 00 00 00 TX
18 2681.50 601h 40 18 10 04 00 00 00 00
19 2682.87 581h 43 18 10 04 bc 45 fc 05
20 601h 40 08 10 00 00 00 00 00 TX
21 2713.47 601h 40 08 10 00 00 00 00 00
22 2714.50 581h 41 08 10 00 0a 00 00 00
23 601h 60 00 00 00 00 00 00 00 TX
24 2729.46 601h 60 00 00 00 00 00 00 00
25 2731.09 581h 00 4d 6f 76 69 6e 67 43
26 601h 70 00 00 00 00 00 00 00 TX
27 2744.45 601h 70 00 00 00 00 00 00 00
28 2746.13 581h 19 61 70 00 00 00 00 00
29 601h 40 0a 10 00 00 00 00 00 TX
30 2776.40 601h 40 0a 10 00 00 00 00 00
31 2777.44 581h 41 0a 10 00 09 00 00 00
32 601h 60 00 00 00 00 00 00 00 TX
33 2792.38 601h 60 00 00 00 00 00 00 00
34 2794.03 581h 00 76 31 2e 30 2e 34 35
35 601h 70 00 00 00 00 00 00 00 TX
36 2811.39 601h 70 00 00 00 00 00 00 00
37 2813.27 581h 1b 31 00 00 00 00 00 00
38 601h 2f 00 35 02 00 00 00 00 TX
39 45948.07 601h 2f 00 35 02 00 00 00 00
40 45949.46 581h 60 00 35 02 00 00 00 00
41 0h 82 01 TX
42 46952.37 0h 82 01
43 46958.91 701h 00
44 601h 2b 40 60 00 80 00 00 00 TX
45 47160.56 601h 2b 40 60 00 80 00 00 00
46 47161.88 581h 60 40 60 00 00 00 00 00
47 601h 2f 60 60 00 00 00 00 00 TX
48 47194.52 601h 2f 60 60 00 00 00 00 00
49 47195.77 581h 60 60 60 00 00 00 00 00
50 601h 23 ff 60 00 00 00 00 00 TX
51 47238.47 601h 23 ff 60 00 00 00 00 00
52 47240.62 581h 60 ff 60 00 00 00 00 00
53 601h 2b 40 60 00 06 00 00 00 TX
54 47271.43 601h 2b 40 60 00 06 00 00 00
55 47273.29 581h 60 40 60 00 00 00 00 00
56 601h 40 40 60 00 00 00 00 00 TX
57 47304.38 601h 40 40 60 00 00 00 00 00
58 47353.20 581h 4b 40 60 00 06 00 00 00
59 601h 2b 40 60 00 07 00 00 00 TX
60 47382.27 601h 2b 40 60 00 07 00 00 00
61 47383.45 581h 60 40 60 00 00 00 00 00
62 601h 40 40 60 00 00 00 00 00 TX
63 47416.24 601h 40 40 60 00 00 00 00 00
64 47417.40 581h 4b 40 60 00 07 00 00 00
65 601h 40 41 60 00 00 00 00 00 TX
66 47841.70 601h 40 41 60 00 00 00 00 00
67 47843.09 581h 4b 41 60 00 23 00 00 00


And below is what ChatGPT had to say about this data with the "Reasoning" option turned on. 

The answer was almost almost spot on, but GPT did hallucinate that the manufacturer specific object 3500h.2h (Control Python script execution on a MovingCap drive) had something to do with homing. 

The answer from ChatGPT

Here’s a walk‑through of your trace, grouping frames into the logical CANopen operations (CiA 301 SDO/NMT/Heartbeat + CiA 402 control/state commands). I’ve decoded each SDO by COB‑ID, command specifier (cs), index/sub‑index and data, and explained what it does in terms of the device profile.


1. Reset Communication & Boot‑up

FrameIDDataMeaning
2 TX0x00082 00NMT “Reset Communication” broadcast (cs=0x82, node=0 = all)
3 RX0x00082 00echo
4 RX0x70100Heartbeat / Boot‑up from node 1: state = 0 (Bootup)
  • What’s happening: Kickdrive tells all nodes to reset their communication state. Node 1 then re‑boots its CANopen stack and issues a Heartbeat (Cob‑ID = 0x700 + nodeID) with value 0 = Boot‑up.


2. SDO Upload: Read “Device Type” (0x1000:00)

FrameIDDataExplanation
5 TX0x60140 00 10 00 00 00 00 00SDO “Initiate Upload” — read Index=0x1000, Sub=0 (cs=0x40)
6 RX0x601(echo)
7 RX0x58143 00 10 00 92 01 02 00SDO “Upload Response” — 4‑byte value = 0x00020192 ⇒ Device Type

Device Type = 0x00020192 identifies the Fullmo MovingCap servo drive.


3. SDO Upload: Read Identity (0x1018 sub‑indexes 1–4)

The Identity Object (0x1018) holds four entries:

  • sub0 = number of entries (4)

  • sub1 = Vendor ID

  • sub2 = Product Code

  • sub3 = Revision Number

  • sub4 = Serial Number

idxsubReq DataResp DataValue
1140 18 10 01 …43 18 10 01 01 00 00 00Vendor ID = 0x00000001
2240 18 10 02 …43 18 10 02 02 00 00 00Product Code = 0x00000202
3340 18 10 03 …43 18 10 03 03 00 00 00Revision No. = 0x00000003
4440 18 10 04 …43 18 10 04 BC 45 FC 05Serial No. = 0x05FC45BC
  • CiA 301 SDO expedite / upload used for each 4‑byte read.


4. SDO Upload: Read Device Name (0x1008)

This is a VISIBLENAME string, so requires segmented upload:

  1. Initiate Upload

    • Frame 20 TX 40 08 10 00… ⇒ read 0x1008 sub0

    • Frame 22 RX 41 08 10 00 0A 00 00 00 ⇒ sub0 = 0x0A = 10 bytes

  2. Segment 1

    • Frame 23 TX 60 00… (segmented‐upload req)

    • Frame 25 RX 00 4D 6F 76 69 6E 67 43 ⇒ “MovingC” (7 chars + “C”)

  3. Segment 2

    • Frame 26 TX 70 00… (next segment)

    • Frame 28 RX 19 61 70 00 00 00 00 00 ⇒ “ap” + padding

Resulting name: “MovingCap”


5. SDO Upload: Read Software Version (0x100A)

Also a string, same segmented pattern:

  1. Initiate Upload

    • Frame 29 TX 40 0A 10 00… ⇒ sub0 = 9

    • Frame 31 RX 41 0A 10 00 09 00 00 00 ⇒ length = 9

  2. Segment 1

    • Frame 32 TX 60 00…

    • Frame 34 RX 00 76 31 2E 30 2E 34 35 ⇒ “v1.0.45”

  3. Segment 2

    • Frame 35 TX 70 00…

    • Frame 37 RX 1B 31 00 00 00 00 00 00 ⇒ trailing “1” + padding

Software version: “v1.0.451”





Comment: Here is the one place where GPT gets it wrong, because of the missing knowledge about this  manufacturer-specific object for Python program control:

6.  SDO Download: Set Homing Parameter (0x3500:02)

FrameIDDataOperation
38 TX0x6012F 00 35 02 00 00 00 00Expedited Download ⇒ write 0x00000000 to index=0x3500, sub=2
40 RX0x58160 00 35 02 00 00 00 00Download Response (confirm write)

Likely clearing or initializing a homing or motion parameter per CiA 402 profile.



7. NMT Reset Communication & Re‑Boot

FrameIDDataMeaning
41 TX0x00082 01NMT “Reset Communication” for node 1
42 RX0x00082 01echo
43 RX0x70100Heartbeat = 0 (Boot‑up) from node 1

8. SDO Downloads: Control‑Word & Mode‑of‑Operation (CiA 402)

a) Fault‑Reset / Shutdown

FrameIDDataMeaning
44 TX0x6012B 40 60 00 80 00 00 00Expedited Download ⇒ write Control‑word (0x6040:0) = 0x0080 (Fault Reset)
46 RX0x58160 40 60 00 00 00 00 00Confirm

b) Set Mode of Operation = 0 (Profile Position)

FrameIDDataMeaning
47 TX0x6012F 60 60 00 00 00 00 00write Mode‑of‑Operation (0x6060:0) = 0
49 RX0x58160 60 60 00 00 00 00 00Confirm

c) (Manufacturer‑specific at 0x60FF:0)

FrameIDDataMeaning
50 TX0x60123 FF 60 00 00 00 00 00Segmented Download ⇒ init write to 0x60FF:0
52 RX0x58160 FF 60 00 00 00 00 00Confirm

9. CiA 402 State Machine: Shutdown → Switch‑On → Ready-to‑Switch‑On

  1. Shutdown Command (Control‑word = 0x0006)

    • Frame 53 TX 2B 40 60 00 06 00 00 00

    • Frame 55 RX 60 40 60 00 00 00 00 00

  2. Verify Control‑word

    • Frame 56 TX 40 40 60 00… (Upload 0x6040:0)

    • Frame 58 RX 4B 40 60 00 06 00 00 00 ⇒ reads back 0x0006

  3. Switch‑On Command (Control‑word = 0x0007)

    • Frame 59 TX 2B 40 60 00 07 00 00 00

    • Frame 61 RX 60 40 60 00 00 00 00 00

  4. Verify Control‑word

    • Frame 62 TX 40 40 60 00…

    • Frame 64 RX 4B 40 60 00 07 00 00 00 ⇒ reads back 0x0007

  5. Read Status‑word (0x6041:0)

    • Frame 65 TX 40 41 60 00…

    • Frame 67 RX 4B 41 60 00 23 00 00 00 ⇒ Status = 0x0023

Status 0x0023 means “Ready to Switch On” (bits: Ready, Switched On, Voltage Enabled but Operation Disabled) per CiA 402.


Summary of Drive Initialization Sequence

  1. Reset communication → node boots

  2. Read basic identity (Device Type, Vendor, Product, SW version, Name) via SDO Upload

  3. Configure homing parameter (0x3500:02 → 0)

  4. Reset communication (again) → node boots

  5. CiA 402 drive setup

    • Fault‑reset (Control‑word=0x0080)

    • Set Mode‑of‑Operation = Profile Position (0x6060=0)

    • [Vendor‑specific write at 0x60FF]

    • Move through Shutdown (0x0006) → Switch‑On (0x0007)

    • Read Status‑word = 0x0023 → drive is “Ready to Switch On”

At this point the drive is in the “Ready to Switch On” state and ready for further commands (enable operation, start motion, etc.) under CiA 402.



Comments

Popular posts from this blog

A free CANopen tool for Windows - Kickdrive Zero

Flachmann & Heggelbacher, an industrial software engineering company based in Germany, have released a new Windows software tool, Kickdrive Zero, for configuration and testing of CANopen networks and devices. Kickdrive Zero offers multiple features for CANopen networks, position drives and other motion-oriented applications in the automation industry. With a clean and easy to use interface, Kickdrive Zero provides an essential set of tools for basic configuration, setup and testing of CAN/CANopen networks and devices. A powerful CAN bus monitor is included, with advanced search and filter functionality, as well as a trace file recorder, for later review of monitored data.  Kickdrive Zero also offers a robust SDO Object Editor and a DS402 servo drive configuration tool. The Object Editor allows importing XDD and XDC files, the standard file formats for CANopen device description and configuration. The most relevant configuration objects, which are typically only a small...

Free CANopen windows tool updated (and fullmo Kickdrive, too)

During the winter break we freshened up our Kickdrive software releases. So new versions v2.0 are available for  Kickdrive Zero, our freeware CANopen windows tool. fullmo Kickdrive, which allows you to do so much more .  You can grab a copy of the updated software from here: http://kickdrive.de/en/index.html?download.htm Changes include: Added support for CANopen data types REAL32 and  OCTET_STRING  Windows 10 compatibility adjustments(especially for fullmo USB2Drive hardware) Baud/Node scan uses now "Reset Nodes" instead of "Start Nodes" Object Editor: Export actual values to .xdc and additional formats (.csv, .cdcf, .txt) The UI Panel now uses the updated QML2 language Other minor corrections and fixes. For a complete overview see the Kickdrive Release Notes .  We'd like to thank the Kickdrive users for their encouraging and helpful feedback. We do realize that Kickdrive releases come a bit slowly. This is because we are v...

Portable hand washing station in times of COVID-19

The current worldwide health crisis many times requires some creativity and some locally sourced solutions, with materials readily at hand. When it came to establishing additional hygiene routines, Fullmo GmbH in Markdorf decided to place a portable hand washing station outside the main entrance. So before anyone enters the building or even touches the main door handle, it's about washing hands according to the well-known recommendations.  Luckily, our talented and resourceful student at Fullmo came up with a clever solution based on two MovingCap 349 drives and a standard (low) pressure washer. The first MovingCap 349 drive acts as a master. It implements a "wash-your-hands cycle" and is started via a standard footswitch connected to one digital input. This drive controls the water flow, and via digital I/O it activates the second drive, which works as a contact-less soap dispenser. The "wash cycle" with fixed waiting times will make sure the soa...