The VSS should be:
CAN ID = 1 (the default, if you have changed this in the settings you need to adjust this to match, of course)
Table = 6 (txbuf) (or 7 for outpc, either should work)
offset = 2 bytes (the values at offsets 0 and 1 are the seconds high and low bytes)
VSS is an 'unsigned int' in the code, so you will want to grab 16 bits, and the value is x10, so you need to divide it by 10 to get the right speed.
However, I believe MS3 has implemented some limiting on what tables it can address, and you might check with the MS3 developers to see if it is allowed to grab table 6 (or 7). Note that CAN can only grab/write table values, and not the code itself (which is not in a table) so limiting the table values to prevent code corruption is not required. For MShift, the tables are:
Code: Select all
// RAM copy FLASH copy Table Size
{ NULL, (unsigned int *)cltfactor_table, sizeof(cltfactor_table), 0x3C },
{ NULL, (unsigned int *)sprfactor_table, sizeof(sprfactor_table), 0x3C },
{ NULL, (unsigned int *)linefactor_table, sizeof(linefactor_table), 0x3C },
{ NULL, (unsigned int *)loadfactor_table, sizeof(loadfactor_table), 0x3C },
{ (unsigned int *)&inpram, (unsigned int *)&in1flash, sizeof(inputs1), 0x3C },
{ (unsigned int *)&in2ram, (unsigned int *)&in2flash, sizeof(inputs2), 0x3C },
{ (unsigned int *)&txbuf, NULL, sizeof(txbuf), 0x3C },
{ (unsigned int *)&outpc, NULL, sizeof(outpc), 0x3C },
{ NULL, (unsigned int *)&outmsg, sizeof(can_outmsg), 0x3C },
{ (unsigned int *)msvar, NULL, sizeof(msvar), 0x3C },
{ NULL, NULL, 0, 0x3C },
{ NULL, NULL, 0, 0x3C },
{ NULL, NULL, 0, 0x3C },
{ NULL, NULL, 0, 0x3C },
{ NULL, NULL, 0, 0x3C },
{ NULL, (unsigned int *)&RevNum, sizeof(RevNum), 0x3C }
Also, on a related matter, the spark/fuel adjustments are described in the manual:
Spark/Fuel/Idle Adjustments: The following give the location in MS-II's memory of the fuel, spark and idle adjustments (that are sent from MShiftâ„¢). Normally you won't change these location parameters, unless the code on MS-II is 'non-standard'.
* MS-II in2ram block: The table number (from the tableDescriptor fields) of the MS-II table containing the external adjustment variables from MShiftâ„¢. The default is 5 (which is the 3.430 code's in2ram table).
* MS-II variable offset: The adjustment variables offset on MS-II from the start of the table. The default is 946.
Note that these values are also used in MicroSquirt®, the Sequencer™, etc.
The code will write the adjustments in the table, starting at the offset entered. It will write eight (8) bytes:
* Fuel adjustment - 2 bytes (default is table 5, offset 946 & 947),
* Spark adjustment - 2 bytes (default is table 5, offset 948 & 949),
* IAC adjustment - 2 bytes (default is table 5, offset 950 & 951),
* spare adjustment - 2 bytes (default is table 5, offset 952 & 953) - unused as of the 2.000 code but still must be available in the engine controller code or the value there will be overwritten.
So the controller for the engine must have 8 bytes set aside (in the order above) in the chosen table for it to read and implement these adjustments. All B&G code since 2.901/3.430 has these bytes reserved as in2ram bytes 946 - 953 (you can find these in 'page 2 of the INI). Other codes may or may not have this already implemented - check with your code's developer.
http://www.msgpio.com/manuals/mshift/V2tune.html#oa
Note that it does not matter if these values get written to flash by an inopportune 'burn', because:
- they are only accessed from RAM,
- the 'accidentally saved' value will be copied from flash to RAM on start up (and only on start-up), BUT
- the RAM Fuel, Spark, and Idle adjustment values are immediately cleared on start-up by MS-II, and every time through the MShift main loop if the operating conditions require it.
So there's no chance the adjustment value will end up being used indefinitely even if it is written to flash memory.
Lance.