Choose function and CAN Data

I’m missing something – I can’t seem to figure out how to snag and keep data from a multiplexed incoming CAN message. Case in point:
J1979 specifies rpm and coolant data on CAN id 0x7E8, using byte 3. Byte 3 is a 5 when it’s coolant and 13 (0xC) when the data is RPM. I can pick out the data and assign it to a value just fine. The ECU sends coolant temp data about every 5s. And when that specific message is received, my variables update and I can see the right number.

But then the value reverts to 0 when I get another message that’s not for coolant. I’m using the Choose function that returns true when byte 3 is 5, so the coolant variable should only change values when it’s a valid coolant message.

I’m lost. Any help appreciated

Do you have ‘use the previous value’ set for the CAN Input?

In your CAN message Object have you tried to increase the timeout?

Yes, I’ve tried all that without luck. What did work was to move the mux field and data to a “buffer” number (called n_snagDatax) and then test the mux. It seems as if CAN data can get overwritten with zeroes. I am now seeing it in data sent by an EMU Pro where CAN data get periodically overwritten with a zero. And they are sitting next to each other on the CAN bus. ??

I’ve written a simple filter for coolant temperature to ignore any CAN bus data that says it is zero. That’s pretty safe for temperature – but I don’t know how I’m going to deal with rpm and vehicle speeds where 0 happens all the time.

What does your message object look like?

Have you tried setting the compound message to 2 frames (for example) and the multiplexer type to Custom? You would then need two CAN inputs—one for the first frame and another for the second (PIDs 3 and 5). In theory, that should prevent any data loss.

I haven’t tried this myself, but I’m wondering how the frame identifiers are handled. Would receiving frame ID 3 or 5 automatically trigger the two-frame compound message, or is it expecting a sequential pattern such as 1, 2, 3, etc.?

My mistake. Feel free to delete.

Try this way using multiplexed compound MOB:


As you want to retrieve CLT, which is in a CAN frame when value 0x5 is on byte 3, and RPM which has 0xC on byte 3, you have to setup the CAN MOB as shown in the first screenshot. Such MOB covers 8 different values, from 0x5 to 0xC.

Then, just create 2 CANBus inputs, and the value in the red circle is an offset of the multiplexer starting from the CAN Bus Message Object.

For c_CLT, offset 0 means it is value 5, for c_RPM, value 7 means it is value 0xC.

The rest of the CANBus inputs settings you have to setup according to your DBC to get the correct values from the CAN frame.

Wow, that works so much better! I was doing this completely wrong – thinking like a software engineer instead of an engine tuner. You should put this example in the manual.

Yes, there is a lack in this area - we will update this.