Multiplexed canbus signals

I believe the below description represents a mutiplexed canbus frame, where the first two byte values determine the content of the later bytes, is it possible to separate these in RealDash?

40A	

	note:
	- this id contains multiple data like odometer (total), outside temp, and the full
	car configuration
	- the first and second bytes ( byte 0 and 1 ) play a selector role
	and the rest of them ( bytes 2 .. 7 ) contain the actual payload

	3,4,5		odometer total 			byte[3]*256*256 + byte[4]*256 + byte[5]
							when byte[0] = 0xC0 and byte[1] = 0x01

	7		outside temp			byte[7] - 40
							when byte[0] = 0xC0 and byte[1] = 0x01

	2,3,4,5,6,7	VIN part 1			hex to ascii, when byte[0] == 0xC1 and byte[1] == 0x00
	2,3,4,5,6,7	VIN part 2			hex to ascii, when byte[0] == 0xC1 and byte[1] == 0x01
	2,3,4,5,6,6	VIN part 3			hex to ascii, when byte[0] == 0xC1 and byte[1] == 0x02

Yes, see “Composite ID support” on CAN XML documentation:

RealDash-extras/RealDash-CAN/realdash-can-description-file.md at master · janimm/RealDash-extras

1 Like

Could this format be used for a custom composite ID with a length of 3 bits?

Ah, yes I got it to work by setting COMPOSITE_ID_LENGTH to 1, and setting the COMPOSITE_ID to 16 (0x10)

Like this:

1 Like

@realdashdev My fix has not worked for all circumstances, as sometimes the first byte is not 0x10, but 0x18 or some other value, since the index value is only contained in the first 3 bits of the byte.

Is there a way you could update the format of COMPOSITE_ID_LENGTH message setup so that it could take a bit value rather than a byte value?

Never heard of a CAN device that uses the sub-byte composite ID. What device is it?

A Tesla model 3 drive unit.

The other controllers Im using can handle the message format, as their software is structured to accept the index from start to end bit.

Could you implement similar? It would be great :+1:

Simplest implementation would be adding optional bitmask for the composite id, for example:

defining composite id for frame 0x1234 as 0xff, offset 0, bytes 1
<frame id="0x1234:0xff,0,1">

We could add optional bitmask for composite id
<frame id="0x1234:0xff,0,1,0x0f">

The mask of 0x0f in this example would read only 4 bits on the composite id.

Do you think this would work on your use-cases?

Yes i beleive that would work! In my case I would use 0x07 i belive.

Can i try this now or does it require an update of the software?

0x07 would mask 3 least significant bits from the composite id value from CAN frame.

Update is required. I can make you a test Android APK if you are willing to test before the release. If so, send me an email to contact@realdash.net and I will share a link to pre-release APK.