Click here for back issues.
https://www.simulationroom999.com/blog/diagnostic-communication-en-back-issue/
Introduction.
Explanation of CAN-FD simulation in python-can.
This is the time to replay with can.player and record with can.logger.
How to replay CAN-FD with can.player
Since we took the liberty of extending can.player last time, let’s review how to use it.
The usage of can.player (CAN-FD mode) is as follows.
> python -m can.player -i vector -c 0 --fd canfd.asc
-m: Operating module specification
-i: Interface specification
-c: Channel specification
-fd: CAN-FD support option (added this time)
No option: Specify replay file
The fourth “-fd” option was added by itself.
How to record CAN-FD with can.logger
And the can.logger is as follows.
> python -m can.logger -i vector -c 0 --fd -f canfdlog.asc
-m: Operating module specification
-i: Interface specification
-c: Channel specification
-fd: CAN-FD support option (added this time)
-f: Specification of recorded file
Format changes depending on the * extension
asc, blf, csv, etc.
The fourth “-fd” option is also self-explanatory.
So, the usage is almost the same.
Results of replay & recording
And let me show you the result of the operation.
The replayed asc is as follows.
Begin Triggerblock
0.000000 Start of measurement
0.000000 CANFD 1 Rx 111 1 1 d 8 11 22 33 44 55 66 77 88
0.001000 CANFD 1 Rx 222 1 1 d 64 21 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79
0.002000 CANFD 1 Rx 333 1 1 d 64 22 7A 7B 7C 7D 7E 7F 01 0A 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36
0.010000 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.011000 1 222 Rx d 8 11 22 33 44 55 66 77 88
0.012000 1 333 Rx d 8 11 22 33 44 55 66 77 88
0.020000 CANFD 1 Rx 111 1 1 d 8 11 22 33 44 55 66 77 88
0.021000 CANFD 1 Rx 222 1 1 d 64 21 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79
0.022000 CANFD 1 Rx 333 1 1 d 64 22 7A 7B 7C 7D 7E 7F 01 0A 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36
0.030000 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.031000 1 222 Rx d 8 11 22 33 44 55 66 77 88
0.032000 1 333 Rx d 8 11 22 33 44 55 66 77 88
End TriggerBlock
In contrast, the recorded asc is as follows.
Begin Triggerblock
0.000000 Start of measurement
0.000000 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.000991 1 222 Rx d 64 21 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79
0.001991 1 333 Rx d 64 22 7A 7B 7C 7D 7E 7F 01 0A 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36
0.008987 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.009953 1 222 Rx d 8 11 22 33 44 55 66 77 88
0.011977 1 333 Rx d 8 11 22 33 44 55 66 77 88
0.018932 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.020980 1 222 Rx d 64 21 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79
0.022970 1 333 Rx d 64 22 7A 7B 7C 7D 7E 7F 01 0A 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36
0.028934 1 111 Rx d 8 11 22 33 44 55 66 77 88
0.030917 1 222 Rx d 8 11 22 33 44 55 66 77 88
0.032907 1 333 Rx d 8 11 22 33 44 55 66 77 88
End TriggerBlock
I think I got it right……..
The result of can.logger is not in CAN-FD format, but in CAN log format….
This is the problem with can.logger that I mentioned last time.
Problems with can.logger
We can use can.logger to record CAN-FD, but the problem is that the format is not CAN-FD.
There are modules called ascreader and ascwriter that are contained within can.player and can.logger, but they are in the following state.
- ascreader supports CAN-FD.
- ascwriter does not support CAN-FD.
*The version at the time of this writing is 3.3.3, so later versions may support it.
Well, I guess it doesn’t matter too much because I can see it by looking at the DLC.
As follows, if the DLC is 8 or less, it will be difficult to distinguish between CAN and CAN-FD, but in this simulation, we have no choice but to close our eyes to it.
Conclusion
- Explanation of how to use the modified versions of can.player and can.logger.
- I just added the option “-fd” to both.
- I used can.player and can.logger to play and record.
- The ascwriter in can.logger does not support CAN-FD format, so I cannot distinguish between CAN and CAN-FD.
- For the time being, we do not care about this in the simulation.
Click here for back issues.
コメント