Page 1 of 1
C125 to display Vehicle Can data?
Posted:
Fri Feb 06, 2015 8:02 pm
by nfsve
Hi there,
I want to hook up the 2nd Can port on the Dash into the Vehicle Can to read data from an existing message.
I want to grab Byte 1 and Byte 0 (reverse order), do a calculation on the number and display on the dash.
Is this within the scope of this C125 logger?
I know you can make a look up table but this will be a 16-bit number.
An example for the calculation I would like to perform is E = 27 - (N/250) where N is the 16 bit number read from the Can Message.
Any help would be appreciated... thanks!
Re: C125 to display Vehicle Can data?
Posted:
Sun Feb 08, 2015 5:36 am
by David Ferguson
I believe you should be able to configure the CAN template to do this. You would set the length of the comms channel to be 2 bytes, then use a multiplier of -1, divisor of 250, and Adder of 27. Of course your multiplier may be -10 or -100 depending upon the base units of the channel you are using for the results.
So, to answer your question -- yes a C125 can do this.
Re: C125 to display Vehicle Can data?
Posted:
Tue Feb 10, 2015 7:15 pm
by nfsve
Thanks David,
Very smart how you transposed the formula to suit the Motec Software. I think the only issue might be how to swap the bytes in the word. I'm not sure if you can do this.... You can bring in the bytes separately, but I'm not sure if you can combine them.
Re: C125 to display Vehicle Can data?
Posted:
Tue Feb 10, 2015 8:27 pm
by nfsve
Certain Manufacturers like to Reverse the Order of their word data for some reason?
Re: C125 to display Vehicle Can data?
Posted:
Wed Feb 11, 2015 4:20 am
by David Ferguson
16-bit (two-byte) data is transferred over the CANbus in either big-endian (most significant byte first, this is the typical motorola ordering) or little-endian (least significant byte first - usually found with intel processors).
You can specify the byte order by selecting "Normal" or "Word Swap" from the Alignment field on the Parameters tab of the CAN Template.
You should watch the CAN-communication related webinars on the MoTeC website -- I'm pretty sure they cover these details about CAN data.
Re: C125 to display Vehicle Can data?
Posted:
Wed Feb 11, 2015 7:55 pm
by nfsve
Thanks again David, I have watched all the Can webinars last year but I should watch them again now I have the actual hardware.
I am also thinking this may be the same in the M1 which already has the physical connection to the bus. So that may be another option.