Information buried in PIDS that contain only FLAGs represented by Bits being ON/OFF (True or False) can be most difficult to interpret and sort out. Many of these “Flags” can be useful – IF you know which ‘bit’ represents what, such as A/C switch, brake pedal pressed, Parking Brake engaged, Power Steering Pressure sw, etc. Such was the case with PID 1101 on my Ford F150. It contains:
b0-ACCS – Air Conditioning Switch
b1-BPP – Brake Pedal On/Off
b2-4x4L – Driver Requested 4 Wheel Drive
b3-CPP/PNP – Clutch Pedal / Park-Neutral Position Sw
b4-TCS – Trans Control Button depressed (over drive button)
b5-TRFM – Transmission Failure Mode for PRNDL (park/reverse/neutral/drive/low switch not-working)
b6-???? – unknown
b7-PSP – Power Steering Pressure input sw
Once the meaning of the specific “BIT” is identified, a useful ON/OFF or YES/NO button gauge can be added to a dashboard. But one byte has eight bits and depending on its location – a digital gage with formula (simply A) will jump all over the place. Impossible to picture in ones mind which bits are on and off (for example 176 decimal). If you are really quick mathematically you might know that is hexadecimal “B0”. (128+64+16). But you have to be really, really quick to do that then visualize it as being “10110000”.
Torque Pro did not make it easy – it seems that there is no way to force high-order leading Zeros onto a numeric display. So I decided to use a whole number, and represent the binary in the decimal portion as “8.10110000”. But Torque Pro still made it difficult – it will not handle more than 4 decimals, even though you can specify number of decimal places – anything beyond 4 are uncontrollable garbage.
So my workaround was to do upper and lower nibbles in separate PIDs of the same PID No. as follows:
For high order nibble:
Mode/PID – 221101
Name – Test-1101_hi binary
S/Name – Tst1101_hi
Formula – 8+Val{{A:7}}*0.1000000001+Val{{A:6}}*0.0100000001+Val{{A:5}}*0.001000001+Val{{A:4}}*0.000100001
For low order nibble:
Mode/PID – 221101
Name – Test-1101_lo binary
S/Name – Tst1101_lo
Formula – 4+Val{{A:3}}*0.100001+Val{{A:2}}*0.0100001+Val{{A:1}}*0.0010001+Val{{A:0}}*0.0001001
IN EACH OF THE TWO digital gauges, specify 4 significant decimal places. I was able to overlay & bring forward the high-order gauge over the left of the low order one to make it appear as one string of 8 significant decimal digits, displaying “11010010”.
By pressing the brake, turning the steering wheel, pressing the overdrive button, cycling A/C, I was able to identify each one as shown above.
One more NOTE: The reason for the long string of zeros with a 1 at the end is to defeat ‘binary rounding’ in the math function of Android. Of course multiplying by the value of Bit {A:X} will produce ZERO if the bit is false, but if positive then adding all four decimal results together will not grow large enough in the 10^-9 position to carry into the 10^-8 position.
Could ALL be done in one virtual PID if Torque Pro would handle specifying number of decimals of eight (8).
Hope this helps someone. But I suspect it will not be getting lots of follow up posts! Lol
—————
54371019
|