Can TunerPro RT work with a signed byte?

Discuss anything TunerPro related.

Moderators: Mangus, robertisaar, dex

Post Reply
paramax55
Posts: 28
Joined: Fri Jan 08, 2010 8:55 pm

Can TunerPro RT work with a signed byte?

Post by paramax55 »

I need to be able to tell an equation that a byte is signed such that FF == -1, FE == -2, FD == -3 etc. Right now it's seeing them as 255, 254, 253, etc... Can Tunerpro RT work with a signed byte?
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

Did you try selecting "Byte" as the data type and check the "Signed" check box?

Also, you don't need to email me each time you start a new thread or reply. =)
***************************************
TunerPro Author
1989 Trans Am
paramax55
Posts: 28
Joined: Fri Jan 08, 2010 8:55 pm

Post by paramax55 »

The cell uses two bytes of data to represent the value. The first byte is the decimal value and the second byte is the multiplyer. The first byte isn't signed but the second is. The formula that works for positive values is :(((X>>8)*(10/64))/10)+(4*(A&0xFF)). The formula that I need would be: (((X>>8)*(10/64))/10)+(4*(signed(A&0xFF))).
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

Two options follow. More probably exist.

1) reference by address, specify that the data at the address is 1-byte and signed.

2) Create two XDF scalars - one for one byte, and another for the final value that references the first.
***************************************
TunerPro Author
1989 Trans Am
paramax55
Posts: 28
Joined: Fri Jan 08, 2010 8:55 pm

Post by paramax55 »

Do I need to create a second "no use" map to create the second scalar? I don't see an option to create a second scalar within the same map.
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

If this is for a table, then you would use a table for the auxiliary value instead of a scalar. You can also get the functionality you need using functions. See "General Conversion Editor" in the docs for the list of functions and parameters that you can use in your conversion equations.
***************************************
TunerPro Author
1989 Trans Am
paramax55
Posts: 28
Joined: Fri Jan 08, 2010 8:55 pm

Post by paramax55 »

It desn't work. The problem is that I need to deal with both a signed byte and an unsigned byte in the same equation. This is for a Ford diesel timing map. Each value is represented by two separate bytes that are right next to each other in the bin. The first byte is unsigned and represents decimal values between 0 and 3.98. The second byte is signed and represents positive and negative values in multiples of 4. For example, 2.5 + -4 = -1.5 and 3.5 + 4 =7.5. I set up a separate map to handle the signed byte, but the equation for the unsigned byte overrides the signed value and just sees the raw, unsigned hex value. I can't get both signed and unsigned to work together. The conversion treats every byte as signed or every byte as unsigned with no regard as to how the values are fed to it.
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

There are several ways to do this, given the flexibility outlined in the doc I referenced in my last reply. Send me your XDF and a bin, The address and size of the table, and examples of what the result should look like. I'll take a look when I have some time to spare for it.
***************************************
TunerPro Author
1989 Trans Am
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Post by Mangus »

This simplifies to:

16-bit table
LSB first
Signed
Equation: X/64

That should do it for you.
***************************************
TunerPro Author
1989 Trans Am
Post Reply