you could probably program a work around by detecting if there a zero values in the data that correspond to set unique locations in the data chain.
32546820.0, 129.0, 0.0, 0.0, 0.0, 5.0, 48.0, 220.0, 96.0,
32546820.0, 3.0, 185.0, 0.0, 3.0, 3.0, 0.0, 0.0, 8.0,
32546820.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0,
So if the first value = 0 then discard, it's not required
Then if the second value = 0 the data 32546820.0, 129.0, 0.0, 0.0, 0.0, 5.0, 48.0, 220.0, 96.0 is the 32546819 data, if not then 32546820.0, 3.0, 185.0, 0.0, 3.0, 3.0, 0.0, 0.0, 8.0 is 32546820.
So something like this:
Code: Select all
CAN_map = {
[32546816] = function(data)
map_chan(rpmId, data, 0, 2, 0.39063, 0)
map_chan(tpsId, data, 4, 2, 0.0015259, 0)
map_chan(atsId, data, 6, 1, 1.8, 32)
map_chan(ctsId, data, 7, 1, 1.8, 32)
end,
[32546820] = function(data)
if data[0] ~= 0 then
if data[1] == 0 then
--run data (its 32546819)
map_chan(afrId, data, 1, 1, 0.057227, 7.325)
else
--run data (its 32546820)
map_chan(mapId, data, 0, 2, 0.014504, -14.6960)
map_chan(fpsId, data, 3, 1, 0.580151, 0)
map_chan(opsId, data, 4, 1, 0.580151, 0)
end
else
--drop data (its the third line)
end
end
}
Bit nasty but it's at least one way to work around the issue.