(01-31-2014, 05:59 AM)malcom2073 Wrote: Are you intending to have everything included in the ECU, or just the datalog format?
You could just have the format itself available by request, which would tell you which values were in which order coming back through the datalog packet, or you could have everything available, field name, scalars, offset, size, etc. The latter would be significantly more difficult to generate and parse, but entirely eliminate the need for a datalog definition file on the tuner side.
I think the main concern is with the ability to change the datalog format, so just having the order of fields coming back would be incredibly useful. I'm not against the tuner having to have a generic definition file that lets it know information about what the different fields are, and then the ECU reports what order the fields are coming back in.
I'm partial to the latter approach, i.e. field name, scalars/conversions, size. As the former approach STILL requires the tuning side to have fore-knowledge in order to be able to parse, and that can change with FW over time. I envision a "master table" of all possible dataloggable vars stored in flash, this table contains the following fields (to be adjusted as needed) that is compiled into the firmware (.i.e. generated as a json string as part of the build process?)
1. ID (numeric, 16 bit, must be unique)
2. Name (charactor, 16 chars?)
3. size (uchar 8 bit enumeration) U08, S08, U16, S16, U32, S32, U64, S64
4. multiplier
5. adder
6. Description. (char, freeform up to 255 chars?)
... ?
Fields 4 and 5 are for conversion of "ECU units" to "real world units". In the cases where those are one in the same, multiplier would be 1, adder would be zero. Notice the lack of an "offset". this is because you can request the values returned in any particular order below.
Several default definitions would be defined that return a subset of the master list, with ID's in a reserved block (let's say ID's 1-10 are "fixed" (compiled it?) lists, and id's 11-99 are user settable lists). I propose API calls to return the master list above (with all details), the current datalog table ID (an ID number), followed by a "detailed datalog table request" that returns a list of each of the 6 fields above for the requested table, and the ability to set datalog "tables", by feeding in a LIST of ID's in the order that you want them returned (i.e. setdataLogID<DatalogTableID><numberofvalues><val1><val2><valN><cksum>. Thus you have maximum flexibility, on the tuning side to say. I only want ID 2, 16, 18,21, and 36, assign that to a datalog table ID X i.e. 42, tell the ECU that's the default datalog table ID to be used and on each datalog request it returns that set.
You would need api calls to do the following:
Return the (compiled in master list), so you know what values are which loggable ID
Return the currently set datalog list ID
Return the list of values in that datalog list ID
Set a list for new loggable ID values for a specific datalog list ID
Set the default datalog list ID
In the UI I envision this is a drag and drop table, left has the master list, right has the way you want them, you drag and drop to suite, then save and you're done.
One big advantage of this method is you can get MUCH faster datalog speed as you're only getting sent what you want to see and nothing that you don't. Teh datalog request SHOULD ALWAYS return the datalog table ID as one of its first parameters so the tuning side knows immediately how to parse it., thus allowing interleaving of multiple datalog request types in the datastream .( i.e. default log type will be streamed continually, but it should be possible to request a different stream type as a "one shot" request to update controls/data sources that don't need ultra fast refresh rates.
Thoughts?
-- David