Copying txt PID file from Torque Pro

Hi, I have a txt PID file in Torque Pro with the formatting below, is there a simple way to import this filetype to AutoPi (as it’s quite long) or does it need to be done manually with the Car Explorer at my.autopi.io?

"Name", "ShortName", "ModeAndPID", "Equation", "Min Value", "Max Value", "Units", "Header", 
"startDiagnostic", "stopDiagnostic", "Scale"

"Fuel Trim Aggregate ","AggTrim","","[07]+[06]",-50,50,"%","null","null","null",1
"Intake Air Temp vs Ambient","IAT ∆","","val{zref_IATdt1}- 
val{zref_AmbTdt10}",0,50,"°F","null","null","null",1
 "Intake Manifold Relative Pressure","MRP","","([0B]*10- 
[ff1270])*.01454",-15,25,"PSI","null","null","null",1
 "MX5_A/C Refrigerant Pressure Switch","AC_REQ_SW","0x221104","BIT(A:0)",0,1,"On / 
Off","7e0","null","null",1
"MX5_A/C Relay","ACCS_SW","0x221101","BIT(A:0)",0,1,"On / Off","7e0","null","null",1
"MX5_Accel Pedal Position (full 
range)","APP","0x221340","A*0.3921568627",0,100,"%","7e0","null","null",1
2 Likes

Its manual at the moment. But some hints that I’ve discovered -

To map torque pro variables to autopi python -

  • “a” -> “bytes_to_int(message.data[3:4])”
  • “b” -> “bytes_to_int(message.data[4:5])”
  • “c” -> “bytes_to_int(message.data[5:6])”
  • “aa” -> “bytes_to_int(message.data[29:30])”

Function conversions -

  • “SIGNED(singlebyte)” -> “twos_comp(singlebyte,8)”
  • “SIGNED(doublebyte)” -> “twos_comp(doublebyte,16)”

Mode and pid -

  • “2102” -> “Mode 21” and “Code 2”
  • “220101” -> “Mode 220” and “Code 101”

Header -

  • If set in last column, change default in autopi

Floats -

  • “x/100” -> “x/100.0”

So an example from the Kona electric, torque pro is -

000_Niro_Auxillary Battery Voltage,Aux Batt Volts,2102,(SIGNED(U)*256+T)/1000,11,14.6,V,7E2

autopi is mapped to -

  • Name: Aux_Batt_Volts
  • Description: Auxilliary Battery Voltage
  • Mode: 21
  • Code: 2
  • Header: 7E2
  • Bytes: 64 ( not in torque pro)
  • Formula: twos_comp(bytes_to_int(message.data[22:23])*256+bytes_to_int(message.data[23:24]),16)/1000.0
  • Unit: V
  • Min: 11
  • Max: 14.6
8 Likes

Hello @plord, these hints have been a great helper to getting started, thank you very much. I am trying to get my 2016 Kia Soul EV 27kWh to work with these PID’s: https://github.com/JejuSoul/OBD-PIDs-for-HKMC-EVs/tree/master/Soul%20EV%20-%2027kWh/extendedpids

I got 2-3 working, but can it be that the a, b, c mapping is off by a couple of places? Or is this just differences between the cars?

My mapping looks like this:
a -> 2:3
b -> 3:4
c -> 4:5
etc.

The conversion process is very manual and cumbersome but its getting there.

One question that i hope you got the answer for: Do you know how to map number formula values from the Torque mapping? This formula for example: Bit(j:6)

They only seem to be on the “bit” formulas, all the others are only using letters for the mapping. Maybe they have a special mapping of some kind?
The PID’s in question are here: https://github.com/JejuSoul/OBD-PIDs-for-HKMC-EVs/blob/master/Soul%20EV%20-%2027kWh/extendedpids/Kia_Soul_EV_BMS_data.csv

I found some more hints here: https://github.com/iternio/autopi-link/blob/031f1187da54f12e061dcfa1d083e84912219d7c/my_abrp.py#L239