Need help with XML and bitflags in EMU Black

Hello Realdash members,

I’m creating XML for CAN Stream from EMU Black. (can’t use bluetooth , don’t ask please)

I have two problems.
One is related to ERRFlags (check engine lights) and the other is related to Custom inputs

Here is my current XML file that in general works pretty fine but i can figure out this one for example:

The emu black help info is like this :



From what i can understand is that the bitlenght is 2 bytes and for example if i need to take Bit 7 then it should be like in the example above.

<?xml version="1.0" encoding="utf-8"?>
<!-- RealDash CAN XML description file, version 2 Requires RealDash version 1.5.8 or newer -->
<!-- EMU Black XML mapping file made by Damtrx                     -->
<!-- Target IDs https://realdash.net/manuals/targetid.php          -->
<!-- ECU Master IDs are located in the HELP file - EMU CAN Stresm  -->
<RealDashCAN version="2">
  <frames baseId="0x00000600">
    <frame id="0" endianess="little"><!--EMU CAN Stream - ID 0-->
      <value targetId="37" offset="0" length="2" rangeMin="500" rangeMax="8000"></value> <!-- RPM -->
      <value targetId="42" offset="2" length="1" conversion="V/2"></value> <!-- TPS -->
      <value targetId="27" offset="3" length="1"></value> <!-- IAT -->
      <value targetId="31" offset="4" length="2" conversion="V-101.3" rangeMin="-100" rangeMax="150"></value> <!--MAP-->
      <value targetId="35" offset="6" length="2" conversion="V*0.016129"></value> <!--Injector PW-->
    </frame>
    <frame id="1" endianess="little"><!--EMU CAN Stream - ID 1-->
       <value name="Analog1-ACPressure" offset="0" length="2" conversion="V*0.0049" units="V"></value><!--Analog 1 (AC Pressur)-->
       <value name="Analog2-OilWarning" offset="2" length="2" conversion="V*0.0049" units="V"></value><!--Analog 2 OIL Warning-->   
       <value name="Analog3-DBW1" offset="4" length="2" conversion="V*0.0049" units="V"></value><!--Analog 3 DBW-->
       <value name="Analog4-MUXSwitch" offset="6" length="2" conversion="V*0.0049" units="V"></value> <!--Analog 4 MUX Switch-->
    </frame>
    <frame id="2" endianess="little"><!--EMU CAN Stream - ID 2-->
      <value targetId="14" offset="6" length="2"></value> <!-- Coolant -->
    </frame>
    <frame id="3" endianess="little"><!--EMU CAN Stream - ID 3-->
      <value targetId="254" offset="2" length="1"conversion="V*0.0078125" ></value> <!-- Lambda 1 -->
      <value targetId="0" offset="2" length="1" conversion="V*14.7*0.0078125"></value> <!-- AFR -->
      <value targetId="38" offset="0" length="1" conversion="0.5*V" rangeMin="-60" rangeMax="60" signed="true" ></value> <!-- Ignition Angle -->
      <value targetId="23" offset="1" length="1" conversion="V*0.05"></value> <!-- Ignition Dwell -->
    </frame>
    <frame id="4" endianess="little"><!--EMU CAN Stream - ID 4-->
      <value targetId="200" offset="0" length="1" conversion="V"></value> <!-- Gear -->
      <value targetId="12" offset="2" length="2"  conversion="V*0.027"></value> <!-- Battery Voltage -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="0" bitCount="1"></value><!--CEL Coolant temperature sensor failed -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="1" bitCount="1"></value><!--CEL IAT sensor failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="2" bitCount="1"></value><!--CEL MAP sensor failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="3" bitCount="1"></value><!--CEL Wide band oxygen sensor failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="4" bitCount="1"></value><!--CEL EGT sensor #1 failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="5" bitCount="1"></value><!--CEL EGT sensor #2 failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="6" bitCount="1"></value><!--CEL EGT too high  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="7" bitCount="1"></value><!--CEL Knocking detected -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="8" bitCount="1"></value><!--CEL Flex Fuel sensor failed  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="9" bitCount="1"></value><!--CEL Drive by wire failure  -->
      <value targetId="65" offset="4" length="2" units="bit" startbit="10" bitCount="1"></value><!--CEL Fuel pressure relative error  -->
      <value targetId="230" offset="6" length="1" unit="bit" startbit="7" bitCount="1" ></value><!--Brake Pedal Percentage-->
    </frame>        
    <frame id="6" endianess="little"><!--EMU CAN Stream - ID 6-->
       <value name="Analog5-AC-Voltage" offset="0" length="2" conversion="V*0.0049" units="V"></value><!--Analog 5(ac state from All4Swap)-->
       <value name="Analog6-DBW2" offset="2" length="2" conversion="V*0.0049" units="V"></value><!--Analog 6-->
       <value targetId="335" offset="7" length="1" units="bit"  startbit="3" bitCount="1"></value><!--AC State-->
    </frame>
    <frame id="7" endianess="little"><!--EMU CAN Stream - ID 7-->
      <value targetId="270" offset="0" length="2" rangeMin="0" rangeMax="250"></value> <!-- Boost Target -->
      <value targetId="256" offset="4" length="1" conversion="V*0.01"></value> <!-- Target Lambda 1 -->
      <value name="Fuel Used" offset="6" length="2" conversion="V*0.1" units="l/100"></value> <!--Fuel used-->
    </frame>
  </frames>
</RealDashCAN>

And my other question is named inputs like this one

I can’t seem to find this one as input for a graph for example.

Aby help will be appreciated.
Once i figure out the BIT problem i will share this in github for other users.
At this stage it works flawlesly

I think the problem is that you would need to have all your errors to be active at the same time, otherwise the other (non-active) error flags will set the check engine light off.

Better approach would be to set the check engine light with ‘any’ error value, and then have separate values for each error code, like:

<value targetId="65" offset="4" length="2"></value> <!-- CEL -->
<value name="EMU Black: CLT Sensor Error" offset="4" length="2" units="bit" startbit="0" bitCount="1"></value>
<value name="EMU Black: IAT Sensor Error" offset="4" length="2" units="bit" startbit="1" bitCount="1"></value>
...

This way your CEL will lit up in case of any error, and you can use the individual values to check what errors are present.

Any value that you specify with ‘name’ instead of ‘targetId’ will appear in ‘ECU Specific’ category of inputs. I recommend that you add prefix into the name to indicate to what this custom value is related to, like ‘EMU Black: …’

I would be great if you’d share your XML so we can add it to RealDash.

Thank you very much
I will give it a try.

Here is my progress so far.

Use it as you wish

https://github.com/damtrx/Real-Dash-CAN-Stream-XML-for-EMU-Black

Tried with that approach but maybe it is not how the BITS are parsed. The data that is coming from the ECU is empty.
I have for example wired Knocking detected to my normal CEL light and when for example knocking is triggered the light comes on. This is not the case when i try to parse the data from real dash.
The same as check engine light parameter. It still doesn’t fire up the CEL on real dash even if it is a global variable.

Maybe i should try B0/7 and not with startbit and bitcount ?

How about this approach:

<value targetId="65" offset="4" length="2"></value> <!-- CEL -->
<value name="EMU Black: CLT Sensor Error" offset="4" length="2" units="bit"></value>
<value name="EMU Black: IAT Sensor Error" offset="4" length="2" units="bit" conversion="V>>1"></value>
...
<value name="EMU Black: Knock Detected" offset="4" length="2" units="bit" conversion="V>>7"></value>
etc ...

Thanks, will give it a try. Sadly, i have to sort out other problems and this project is on hold for the next month. (blown engine)

Oh man, Hotrodding is hard. Ask me how I know.

Hi .
I’m back on track. New engine in the car and running perfectly fine. (twice the size). It took me 9+ months but it was worthy.

What i did is to monitor the byte for the Check engine light.
For example, if Knock occurs the value is 80 in hex and 128in dec. If i set Check engine light like this :

Nothing happens. If i return a value then it shows 128.

Any ideas ?

Decimal 128 = Hex 0x80 = Bin 1000 0000

So, reading that bit should equal to:

Assuming your offset and length are correct, which I cannot verify from here.

Hi ,
Offset is configured like this so it works. The idea is to trigger CEL if condition is met. It will be better if i can distinguish which bit is flipped because i can display the real error

  <value name="EMU Black: Check engine light" offset="4" length="2" units="V"></value><!--Check engine light-->

This line reads the 8th bit only. Notice the units=“bit” and conversion to achieve this.

I will give it a try one more time but I’ve already tested it and it wasn’t working (few posts above)