Adding Bitmasks to Data Association

Submit feature suggestions for future versions of TunerPro here.

Moderators: Mangus, robertisaar, dex

Post Reply
rts91tsi
Posts: 15
Joined: Sat Oct 08, 2011 6:01 am

Adding Bitmasks to Data Association

Post by rts91tsi »

Forgive me if this has been asked as a feature request before (searched, but couldn't find any related info), or if it isn't a possibility, but I was curious if it would be possible to add 'Bitmasks' for Data Association.

The 1g DSM TCU XDF I've been working on has a few very important tables that depend on the 'Current Gear Bit' for the Y axis, and I noticed when I went to Data Associate them that 'Bitmasks' were unavailable as a selectable X, or Y axis DA item.

For the time being I've thought of one way around not having them by breaking the tables down by individual gears, and 'Power/ECO Mode', then just using the X axis for DA. I figured it may be a worthwhile addition to TunerPro for some models, and was worth at least asking.
User avatar
Mangus
TunerPro Author
Posts: 1918
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

How would you prefer this be visualized? If the bit is set, show it as a "1" or, if not, "0"?

If so, create an ADX value that inspects the bit you're interested in (using logical bit operators). Use that for your Y axis.

e.g. the equation in the ADX Value would be:

"(X & <bitmask>) / <bitmask>"

where <bitmask> is the bitmask of the bit you're interested in, e.g. 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, etc.
***************************************
TunerPro Author
1989 Trans Am
rts91tsi
Posts: 15
Joined: Sat Oct 08, 2011 6:01 am

Post by rts91tsi »

The Bitwise Operation for the 'Current Gear Bit' is configured as a Bitwise AND, which displays the current gear when true, or 1.

:oops: I wasn't sure if there was another way to make this work how I was intending, but I'm relatively new to the software, and I know there are probably a few things that I don't know about TunerPro yet.

Thank you for the help Sir, and will apply your suggested solution, as well as add it to my notes for future reference. I definitely appreciate the advice since I wasn't real keen on breaking up the applicable tables because it would hinder the use of the address tracing feature while using the Ostrich 2.0.
rts91tsi
Posts: 15
Joined: Sat Oct 08, 2011 6:01 am

Post by rts91tsi »

I was just thinking as I was about to apply your suggestion that in order for this to work as I was hoping that I will need to associate all four gear bits into one value for the Y axis.

I've included a picture of one of the tables that is dependent on all four gear bits, which has Power/ECO mode bundled together. The PCS Duty table isn't quite as fussy, since it is only dependent on all four gear bits, with a separate modification table for Power/ECO.

Will I be able to associate all four bits into one value? (it's been a long day)

Image
User avatar
Mangus
TunerPro Author
Posts: 1918
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

You could mask off all four bits, and use a lookup table to define the output of those bits.

Say the four gear bits are the 4 upper bits of a byte. Mask them off like this:

(X & 0xF0)

If each bit represents a gear, and only one bit will be set at a time, then the possible values that are output of the above equation are:
0b10000000 (0x80)
0b01000000 (0x40)
0b00100000 (0x20)
0b00010000 (0x10)

Use a lookup table to convert these to 4 (0x80), 3 (0x40), 2 (0x20), and 1 (0x10).

The output from the ADX Value would then be 1, 2, 3, or 4, representing the gears (presumably).

If the bitmask representing the current gear is more complex, then modify the lookup table accordingly. Same concept applies, though.
***************************************
TunerPro Author
1989 Trans Am
rts91tsi
Posts: 15
Joined: Sat Oct 08, 2011 6:01 am

Post by rts91tsi »

Thank you again for the advice!

The bits I'm concerned with are:
0x01(4th gear)
0x02(3rd gear)
0x04(2nd gear)
0x08(1st gear)

I should be able to sort this out thanks to your advice which I much appreciate. Also, please feel free to move this thread topic if you feel it better suites a different section.
rts91tsi
Posts: 15
Joined: Sat Oct 08, 2011 6:01 am

Post by rts91tsi »

Figured I would post an update as to the progress, and slight setback I've encountered while trying to get this to work correctly.

First, I changed the row labeling for the XDF to a single floating point value per row to avoid a conflict with the string data which I was previously using. Then I defined the ADX value, and set the conversion accordingly (X & 0F) which made the "bubble" stay fixed on the 1st gear row. I adjusted the equation to just X, which works to some extent, but exposed an underlying conflict which I've yet to be able to resolve.

The "bubble" for data tracing works correctly for every gear but 4th. When actually in 4th, the bubble reverts to the 1st gear row. I'm not sure why since the data in the item list from the lookup table correctly displays the current gear at all times.

I unchecked the option to send the data to the lookup table, and then just logged the hexadecimal value to ensure that I had not made a mistake while setting up the lookup table.

While logging the raw hex value I noticed that 4th gear actually has two values that will output "4th gear"( 00, and 01, with "Closest" as the Lookup Mode), but I don't think that is causing the conflict since 4th gear is output upon the reading of both values.

Have I exposed some underlying bug/conflict between the input value for 4th (01), and the output value for 1st, (1.00), or is there reasonable explanation as to why this is occurring?

Also, do all of the "Supporting Operators" for editing bin definitions apply to ADX value conversions? I may have found a different variable which I may be able to use to DA the gear based tables, but it's going to be much more difficult to pull off.
User avatar
Mangus
TunerPro Author
Posts: 1918
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

At this point, I think it'd be easiest for you to email me the ADX file and a log file (XDL) recorded with the ADX from your vehicle, so I can take a look.
***************************************
TunerPro Author
1989 Trans Am
Post Reply