CANbus switch state TX and switch feedback RX

Hello, as i didn’t find any good solution to Send and receive Canbus buttons im seeking for help.

What i need:
6 buttons (bitfield) transmit
6 button actual sate receive (bitfield)

whats problem right now:
if switch 1 toggled in realdash, byte 6 Bit (0, 1, 2, 3) will be 1
but in xml file its configured that byte 6 bit 0 should be 1.

if switch 2 toggled in realdash correct bit will be flipped but momentary and then self resets to 0.

<frame id="0x645" endianess="little" writeInterval="100">
    <value name="EMU Black: Analog #1" offset="0" length="2" units="V"></value>
    <value name="EMU Black: Analog #2" offset="2" length="2"></value>
    <value name="EMU Black: CALPOT 1" offset="4" length="1"></value>
    <value name="EMU Black: CALPOT 2" offset="5" length="1"></value>
    <value name="EMU Black: Switch 1" offset="6" length="1" units="bit" startbit="0" bitCount="1"></value>
    <value name="EMU Black: Switch 2" offset="6" length="1" units="bit" startbit="1" bitCount="1"></value>
    <value name="EMU Black: Switch 3" offset="6" length="1" units="bit" startbit="2" bitCount="1"></value>
    <value name="EMU Black: Switch 4" offset="6" length="1" units="bit" startbit="3" bitCount="1"></value>
   
    
</frame>
    <frame id="0x656" endianess="little">

    <value name="EMU Black: Switch 1 FEEDBACK" offset="6" length="1" units="bit" startbit="0" bitCount="1"></value>
    <value name="EMU Black: Switch 2 FEEDBACK" offset="6" length="1" units="bit" startbit="1" bitCount="1"></value>
    <value name="EMU Black: Switch 3 FEEDBACK" offset="6" length="1" units="bit" startbit="2" bitCount="1"></value>
    <value name="EMU Black: Switch 4 FEEDBACK" offset="6" length="1" units="bit" startbit="3" bitCount="1"></value>

Update well if i map one button it works, soon as i add another button in xml everything brakes.

for now there is no issue with receiving button state, only sending button state is problem.

I will run some tests on setting a bitfield with a button.

1 Like

any news on that?
right now im limited only with one button:/

Its on todo list. Did not make it to 2.4.9 release.

I ran this scenario on simulator but found no issues. Unfortunately I do not have Ecumaster ECU to test on.

1 Like

i will try fresh file only sending and reviving buttos, its nothing to do with ecumaster because im using can bus logger to see if code woks correctly for now.

Here i made video of my problem.

SW.xml (843 Bytes)

That is exactly the scenario what we ran on our simulator and it worked fine.

You are absolutely certain that no other device, like ECU is setting those bits?

nothing is connected on canbus just logging data with can logger what comes out from realdash

Alright, I found the issue. In your XML you have ‘bitCount’, but it should be all lowercase ‘bitcount’.

Most of the values on our XML files are case sensitive for faster parsing.

1 Like

thank youu, yes it works now!