Not getting expected results from PID query

I’m trying to translate proprietary PIDs from Torque into AutoPi. The Torque data looks like this:

Auxiliary Battery Voltage | Aux_Batt_V | 0x21cf | (0.2 * D) - 25.6 | 0 | 15 | Volt | 7.00E+03 | 1

The important parts here are the PID (21CF) and the formula ((0.2 * D) - 25.6).

When I query mode 21 and code CF I get an 18-long bytearray as expected. The Torque documentation says they label the byes alphabetically so D should indicate the byte at index 3. This should read the voltage of my 12V battery. I’ve tried this formula:

(0.2*message.data[3])-25.6 but the result I’m getting back is not in line with my 12V battery voltage. I went through every byte in the array with this formula and index 5 is the only one that returns a sane value but it’s always exactly 14 which I don’t believe is correct.

Here is the full output of 7DF#21CF from the PID Tester:

1:7EB 10 12 61 CF 88 68 80 C6
2:7EB 21 56 AA 00 08 00 00 88
3:7EB 22 68 89 02 89 1A 00 00

Here is the data I’m working with exported from Torque: https://docs.google.com/spreadsheets/d/1oB6wQ5meok-nIg8XHSolNO3ALThMxrZb5LmqvAVadp8/edit?usp=sharing

Let me know if I can provide additional information.

I just realized I wasn’t sending the correct header because the spreadsheet screwed with the formatting thinking it was math. However, after fixing the header and sending 7E3 I’m still getting the same results.

Playing around with different PIDs I noticed I can correctly get the engine RPM with 7E2#21c3 using the formula (256 * message.data[14]) + message.data[15] which corresponds to the letters O and P in the Torque formula: (256 * O) + P but so far this is the only PID and formula that has returned verifiably correct values.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.