CAN-Do: a CAN-message Analysis Tool

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I added several new data fields that the export to CSV file function can write.

1. Session Time: Minutes, 0 to ... many
2. Time Stamp: Seconds (0-59) and ms (0-999) as SS.MMM
3. Longitude: (-)DDDMM to 0.0000 minute
4. Latitude: (-)DDMM to 0.0000 minute
5. Altitude: Meters to 0.0
6. Velocity: Knots to 0.00

The older fields for CSV files were:

1. Any Recipe Item's value
2. Log Number: 0 to about 20,000,000
3. CSV Record Number: 1 to ...
4. Message ID: 0x000 to 0xFFF, in decimal
4. ... I forgot ...
 
I added Logging from a Multi-CAN source (via one Virtual Comm Port).

Normal one-CAN log input has 11 bytes per message:
1. a Sync Byte
2. two Message ID and Data Count bytes
3. eight Data bytes

The Sync Byte is the Exclusive OR (EOR) of 0x53 and the next two bytes.

The Message ID is the low byte of the MsgID followed by the a nM byte, where the "n" is the Data-Count nibble, and M is the high nibble of the 3-nibble MsgID.

The Data Bytes (D1, ... , D8) are 0xFF if not included in the message.

Strip off the Sync Byte and prefix two Time-Code Bytes, and you have the one-CAN Log File format, 12 bytes per message.

The Time Code is Milli-Seconds plus (Seconds * 1024), written High byte first.

The Log entries in the ".alc" (All-CAN) file have one additional byte prefixed to the 12, a Source-Number Byte:
1 = EV-CAN bus
2 = CAR-CAN bus
3 = AV-CAN bus
4 = QC-CAN bus
5 = GPS Logs
0 = Time and other All-CAN messages.

The format of the Multi-CAN log input is the same as the one-CAN (11-byte) input, with an additional 3-byte suffix:
1. a two-byte Time Code
2. a Source-Number byte
 
Hi Gary,

I'm trying to confirm the number of bytes in a one-CAN message, since your last post has two possible byte counts, 11 and 12 bytes.

All your test files appear to contain 12-byte messages regardless of file extension. Is that actually the case? Thanks.

Regards, Bert/KG4BEC
 
Log file contents are slightly different than the format used to
send the messages from the AVR-CAN (in the SOC-Meter) to the
CAN-Do program in the PC.

The basic message data takes 8 bytes for the data and 2 for the
MsgID and data-length. In one-CAN format, a sync byte is added
coming from the Meter, for 11 per message. In a one-CAN log
file, the sync is gone, but 2 time-stamp bytes are added, for 12
bytes per "record" in the evc, can, avc, and qcc files.

In the multi-CAN file, alc, a 13th byte carries the "source" designation.

That's it for log FILES.

Sending a CAN Message from a multi-CAN receiver, like the Mbed,
the same 11 bytes are sent, but 2 Time-Code bytes and 1 Source byte
are added, making 14 bytes from the Black-Box to the PC.

Does this help?
 
Yes sir, that clears things up considerably. I was aware of the sync byte and the time code bytes but I could not see them in your test files. Now I know to expect time code bytes in your test files, and no sync byte, which explains the 12 bytes in each record.

As much as I hate to duplicate effort, your VB program is regrettably not much good to me in a linux environment, so I'm writing a program that will extract the message data and convert it to a format that e.g. Gnuplot can use. If you know of anyone that is already tackling that task, I'd appreciate a heads-up, otherwise I'm happy to co-ordinate the efforts in the linux/unix environment. :)

Happy 4th of July!

Cheers, Bert/KG4BEC
 
Apparently CAN-Do will run under Wine, at least under Ubuntu,
if that helps. I hope to try it myself, soon.

I am working on a Black-Box version of GID-Meter that will log
to files on USB Flash drive, or SDHC card in a USB adapter.
The writing seems to work well, so far, including adding time stamps
of SS.sss seconds on each message, and a Date and Time each minute.

I am hoping that the box will be able to read and log a USB GPS
as well as two CAN buses. I have yet to try adding a USB hub and
reading the GPS while writing to the log file.
 
garygid said:
I am working on a Black-Box version of GID-Meter that will log
to files on USB Flash drive, or SDHC card in a USB adapter.
The writing seems to work well, so far, including adding time stamps
of SS.sss seconds on each message, and a Date and Time each minute.
This sounds great! - I hate having to drag my laptop around whenever I want to grab a log.
 
This "Mbed" project already creates an ".alc" Log file (13 bytes per Message) on a USB "mass storage" (Flash Drive or SDHC card), and sends messages (Multi-CAN 14-byte format) at 115,200 x 8 = 921,600 baud to a new CAN-Do input function.

I have tested it with 5000 messages per second, but not yet actually connected to the LEAF, because of the awkwardness of connecting to the breadboard. However the LEAF's USB "port" does power the Mbed breadboard sufficiently well for testing.

My test firmware for the Mbed-based Black-Box does not yet start Logging without user queries, like "Set Date/Time?" (sets the RTC), but it easily could if the Black-Box function was the only function desired.

Shutting down (closing) the currently-active Log file gracefully when power is lost is the biggest remaining difficulty.

I intend to monitor (via an Analog-In pin, and also Log) the LEAF's "12v" battery voltage, so that should enable the firmware to detect the loss of Power.

Then, I need some fraction of a second of reserve power to shut down gracefully.

I am thinking that Power In through a diode to a "big" 20v capacitor on the input of a good switching 5v regulator might be sufficient.

Pleaee see the "Using Mbed ... SOC-Meter" thread to follow this project. Any suggestions are welcome (preferably in that thread).
 
I just posted version v209 of CAN-Do to my website:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

There was a bug in displaying the dates in the CAN Log files.
They appeared as a date 61 days earlier than they should be.
I am assuming that I made a compensating mistake in
creating the dates that CAN-Do inserted into the Log files,
so that I never detected the error.
Hopefully I fixed both bugs.

You may notice that this version supports the iMiEV, in addition
to the LEAF. The Main (first) screen also has nice new features
for displaying just a selected set of MsgIDs, for seeing any message
in context, and first doing a Select and Copy-to-Clipboard of the
messages displayed in the left-side list.

I hope that you will enjoy the new features of CAN-Do.
 
garygid said:
I just posted version v209 of CAN-Do to my website:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

There was a bug in displaying the dates in the CAN Log files.
They appeared as a date 61 days earlier than they should be.
I am assuming that I made a compensating mistake in
creating the dates that CAN-Do inserted into the Log files,
so that I never detected the error.
Hopefully I fixed both bugs.

You may notice that this version supports the iMiEV, in addition
to the LEAF. The Main (first) screen also has nice new features
for displaying just a selected set of MsgIDs, for seeing any message
in context, and first doing a Select and Copy-to-Clipboard of the
messages displayed in the left-side list.

I hope that you will enjoy the new features of CAN-Do.

:D Thanks Gary, I going to give it a test drive right away. :D
 
Comment from user:
The Fonts need to be resizable.

CAN-Do is not written (at this point, v209) to have the screens resized.
I assume you only got into trouble when you resized a screen?

All the fonts, sizes, and object sizes are not scalable, I believe.
 
Hi all,

I am trying to run CAN-Do (v210) on Windows 7 - 64bit and I take
this error:

Code:
Run-time error 53 - File not foumd

Any suggestions?

Best regards,
Giannis
 
Yes, see the topic CAN-Do on Win7
http://www.mynissanleaf.com/viewtopic.php?f=44&t=12643" onclick="window.open(this.href);return false;

The Recipe file is most likely missing.
 
I have added a multi-variable (Recipe items) graphing ability,
the ability to define, save, and read those definitions, and
the ability to write each graph to a ".bmp" file.
Hopefully, I will get the new CAN-Do version posted
in the next several days.

For now, Paint can be used to "edit" the ".bmp" file and
write a ".jpg" version (much smaller for email or posting).

Later, I hope to be able to write Jpg files directly from VB6.

This is handy for graphing the "many" (usually 4 to 10) variables
involved in the QC process. One can also select sub-sections
of the horizontal axis to expand and Graph, often used to
better examine the startup or shutdown of charging.
 
CAN-Do version 217 of 6 Aug 2013.

Are the new Graph functions well explained in the user manual,
with nice pictures and video tutorials? :mrgreen:

No,...
but you get to the Graph/Graphs screen via a button
on the Filters screen, on the bottom, just left of center.
 
Hi Gary,
I wanted to try out your new features but was unable to install the v210 or v209. I keep getting a "Run-time error '53': File not found" when I execute the file in the zip. I'm running Win7 Home Premium and presently have v208 installed.
 
Back
Top