Trying to reduce the number of adapters in my setup, and i’m running into an issue with writing the xml I can’t seem to wrap my head around.
If i have
it will send on the canbus fine, and i'll get a response on 0x7E8 as expected.
Problem is i need to write 0x7E0: 02 01 42 00 00 00 00 00 00 00 00 and i can't figure out how to format the frame i guess?
If i go into the can monitor and send that frame, i get a response of
0x7E8: 04 41 42 2F F4 AA AA AA as expected ((B3*256)*B4)/100= 12.276 (volts) in line with my benchtop powersupply output so i know i can get the data on the bus, i just need help formatting the frame being written.
Got everything working to read OBD PID 42 via canbus without an elm327 adapter, going to apply this to some other PIDs as well to test.
For sending the request (data obtained from a scan too and OBD wiki)
0x7E0: 0x02 0x01 0x42 0x00 0x00 0x00 0x00 0x00 you must add writeInterval=“interval in ms” and initial value must be formatted in HEX not in decimal.
<frame id="0x7E0" size="8" writeInterval="300">
<value name="obd request byte 0" offset="0" length="1" initial value="2"></value>
<value name="obd request byte 1" offset="1" length="1" initial value="1"></value>
<value name="obd request byte 2" offset="2" length="1" initial value="66"></value>
<value name="obd request byte 3" offset="3" length="1" initial value="0"></value>
<value name="obd request byte 4" offset="4" length="1" initial value="0"></value>
<value name="obd request byte 5" offset="5" length="1" initial value="0"></value>
<value name="obd request byte 6" offset="6" length="1" initial value="0"></value>
<value name="obd request byte 7" offset="7" length="1" initial value="0"></value>
what i’m running into now as an oddity is applying math to the result from 0x7E8
<frame id="0x7E8" endianess="big">
<value name="0x7E8 B1" offset="0" length="1" conversion="V"></value>
<value name="0x7E8 B2" offset="1" length="1" conversion="V"></value>
<value name="0x7E8 B3" offset="2" length="1" conversion="V"></value>
<value targetID="12" offset="3" length="2" conversion="V/1000"></value>
<value name="0x7E8 B5" offset="4" length="1" conversion="V"></value>
<value name="0x7E8 B6" offset="5" length="1" conversion="V"></value>
<value name="0x7E8 B7" offset="6" length="1" conversion="V"></value>
<value name="0x7E8 B8" offset="7" length="1" conversion="V"></value>
that returns the same 12.3v as my benchtop psu is putting out (moving it to the car later to test)
How is that putting out the same as the OBD parameter which should be ((b3*256)+b4)/1000?
that formula didn’t work as well, it ignored the +b4 part and just returned 12v even.
In any case, hopefully this helps someone else and i can find the answer to why the conversion math isn’t making sense so i can work with it in the future.