lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: CAN-Do: a CAN-message Analysis Tool

Fri Sep 02, 2011 1:51 pm

Gary,

About the recipe fields, taking the example of SOC

MsgID=5BC D#=0 Mask=0F Equals=05 : D#=1,Mask=FF,Shift=2 + D#=2,Mask=C0,Shift=-6

I would interpret that as SOC = ((D1 & 0xFF) << 2) + ((D2 & 0xC0) >> 6)
But what is the meaning of D#=0 Mask=0F Equals=05 ?

TIA, Sam

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Fri Sep 02, 2011 2:03 pm

In the Recipe, the first "term" (like D#=7 Mask=0F Equals=05)
is a data-byte filter for messages to qualify for the Recipe.
It is enabled when D# is 1-8, disabled when D# = 0.

So, my sample Mask above, it would say use the message only if
D7 AND 0x0F = 0x05

In your example, the filter is disabled (D# = 0), so all the
messages (with the selected Message ID) are plotted.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Mon Sep 05, 2011 12:14 pm

I intend to add a "Scale Factor" and "Zero Value" to each Recipe Item.

This should allow us to compare different data values better.

I hope to use fields in the file that are currently reserved.

Probably, a "Scale Factor" = 0 will turn scaling OFF.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Mon Sep 05, 2011 3:07 pm

CAN-Do version 1.5.0 is now posted at
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

It has a Scale Factor and a Raw Zero Value added to the Recipe Functions.
See examples (SOC Raw, SOC Percent, Pack Out Amps) in
the latest "Recipe File", V1.02 at the same URL.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Mon Sep 05, 2011 3:26 pm

1. While capturing CAN-Messages for a Log, one can watch
the CAN-Do dashboard if the Run Dashboard checkbox is checked.
About 1 million messages per hour are typical from the EV-CAN bus.

2. After Logging is stopped, you can save the in-memory messages
into a Log file, using either ".evc" for EV-CAN messages, or ".alc" for
a single file containing messages from 2 or more CAN buses.
Last edited by garygid on Tue Oct 11, 2011 8:50 pm, edited 2 times in total.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: CAN-Do: a CAN-message Analysis Tool

Tue Sep 06, 2011 2:23 pm

Gary,
I'm trying to implement CAN-Do compatible logging in my CAN reader hardware.
I understand that the format that CAN-Do expects is

Sync Byte, MsgIDLo, MsgIDHi, D1, .... D8
Data count (0 to 8) is in the high nibble of MsgIDHi
Missing data bytes are 0xFF.

What is the value of your Sync Byte?

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: CAN-Do: a CAN-message Analysis Tool

Tue Sep 06, 2011 6:19 pm

OK, I found from an old thread that your sync byte is
msgidLSB XOR msgidMSB XOR 0x53

But CAN-Do is still rejecting my messages.
Here is a sample message I sent to CAN-Do:

5BC 44 43 2C 3F C2 05 40 00

BC XOR 05 XOR 53 = EA

so I send the following byte stream:

EA BC 85 44 43 2C 3F C2 05 40 00

What am I doing wrong?

TIA

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Tue Sep 06, 2011 7:53 pm

Seems correct for the message encoding.

Are you sending the message as eleven 8-bit bytes,
(8,N,1, no flow control) at 115200 baud?
(Not 33 or 22 ASCII characters.)

Have you tested sending "Hello" to a Terminal program?

How is the CAN-Do program reacting?
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: CAN-Do: a CAN-message Analysis Tool

Tue Sep 06, 2011 9:20 pm

Yes, I wrote a small test program to send out the exact 8-bit bytes

EA BC 85 44 43 2C 3F C2 05 40 00

using the comm parameters that you specified. The program just loops continuously, sending the same byte stream out over and over again.

I just verified with a small C++ program under that the PC is receiving the exact bytes that I sent out. Also, as a secondary test, I tried sending out a "Hello" string to a terminal program, and that worked as well.

In CAN-Do, the Input and Output Control screen shows 0 in the field with tool tip "Number of EV-CAN messages received, and under Status of EV-CAN input, the numbers change continuously.

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: CAN-Do: a CAN-message Analysis Tool

Tue Sep 06, 2011 9:56 pm

Perhaps the data is coming too fast for CAN-Do to keep up?

Or, the PC's serial input buffer is having overruns and characters
are gettig lost. How big is the Comm-Port buffer?

Did the characters come into the Test and Terminal program at 115200 baud?

I do not remember what makes the status numbers change,
but it could be counting the number of not-synced events.

So, try putting a 20 ms delay after each message in your sending loop.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

Return to “LEAF CANBus”