The Ford Guy
Joined: 07 Oct 2004
|Posted: Tue Dec 15, 2009 2:13 am Post subject: QuarterHorse Datalogging Using TunerPro
|Under ‘commands’ in the ADX Editor you will need three basic commands to retrieve data from the vehicle through the QuarterHorse; request the data, receive the data and assign a macro to loop through the request/receive commands.
An example of requesting the data:
Title - Request 0x200->0x2FF
Unique ID - QHREQUEST2
Description - Request data from shadow RAM between 0x200 and 0x2FF
Byte String - 0x52 0x00 0x23 0x02 0x00
Checksum – None
Where the byte string means:
0x52 = ascii character 'R'
0x00 = number of bytes (0x00 means 256)
0x23 = mmsb of QH ram address to read
0x02 = msb of QH ram address to read
0x00 = lsb of QH ram address to read
The second byte (0x00) is the number of bytes to retrieve. 0xFF is 255, here we use 0x00 for 256. The QuarterHorse can only get 256 bytes at a time. The third, fourth, and fifth bytes are the MMSB, MSB, and LSB of the QuarterHorse RAM where the data lives. Note that, for QuarterHorse mode 4, the RAM is shadowed in 0x230000. So in order to retrieve 0x200->0x2FF of ECU RAM, we're requesting 0x230200->0x2302FF in QuarterHorse RAM.
An example of receiving the data:
Title - Get 0x200->0x2FF Reply
Unique ID – QHREPLY2
Description – Receive data from shadow RAM between 0x200 and 0x2FF
Header byte string - <blank>
Footer byte string - <blank>
Packet Type – Static Packet Size
Process Reply - <checked>
Timeout – 400
Payload Offset – 0
Body size – 256
Payload size - 256
An example of the loop macro to combine the request and reply commands:
Title - Monitor Macro
Unique ID – MONMACRO
Description - <blank>
Macro Repeat Count – 1
Command – “Request 0x200->0x2FF” then “Get 0x200->0x2FF Reply”
Entry parameters - <all blank>
The “Monitor Macro” is sent in the main monitor loop and you set it in the ADX Header Data under the "Monitor Command." The baud rate is set to 921600 in the ADX Header Data too.
You will next need to assign values for the parameters you want to datalog from within the packet. Under the ’Values’ in the ADX Editor set up the information about the item you want to datalog. The ‘Packet Offset’ determines the position of the data relative to the start of the packet; e.g. if you have ‘VSBAR’ (average speed) at address 0x250 then the packet offset would be 0x50. The ‘Command Association’ needs to be set to ‘Get 0x200->0x2FF Reply’.
Any values you add need to be added to the "Item List View" list for visualisation.
If you want to add values for data outside of the 0x200->0x2FF that is currently being retrieved, you'll need to add another pair of commands similar to the "Request" and "Get" commands but for the addresses required. Use the above examples as models and just change the address range in the request string. Then add the request and get commands to the existing monitor macro. New values that need info from that new address range should have their parent command set to the new "get" command.
You cannot datalog any data from in the cpu’s registers (0x00 to 0xFF in the eec-iv and 0x00 to 0x1FF in the 8065) and require a patch code that copies the pertinent data out into an address range that the QuarterHorse shadows.
Also, in preferences, set the interface type to "Moates Passthrough" and make sure the QH is attached and initialised before hitting the monitor button (two blue arrows pointing in opposite directions in the toolbar).
For linking, the proper way to link the ADX output to the XDF to trace in tables and what not is to make sure the datatype and units match. As an example, in the ADX set the RPM data type to "Engine Speed" and units to "Revolutions per Minute." Then, for any constant or axis in a table that represents RPM, set its data type and units to the same. From that point, when loading an XDF or ADX, TunerPro will automatically link the items. If a table has both axes defined, and you turn on data tracing (grid with red arrow pointing into it), TunerPro will trace the table with where the vehicle is currently running.