Bit Position / Bitfield in CANBUS Export in PMU24

The new CRC check feature in the latest PMU software (ref: Creating Checksum Byte on PMU24 ) is great, but I am struggling to export fields to specific bit positions. I am trying to create this export message to a motor controller:

Below is the canx output (after I import the DBC), which has the fidelity of specifying the byteOffset, bitCount, and bitPosition, which aligns with expectations.

[As a side note, I was hoping to use the XML as a means to configure the export, which might avoid any UI limitations, but I did not see an option to import an export canx—the add function only imports an import canx. Right?]

Per section 5 of the CRC manual, I understand that, “If a custom channel uses a bit length that is not a multiple of 8, all channels that follow the custom channel are placed immediately after its data, without byte alignment.” However, the user interface does not seem to allow me to enter more channels to fill out the complete message if the total message is less than 64 bits. So for the message that I am trying to create, I tried to simply add channels to account for the bitPosition. Here is what I think the configuration might look like if I use the UI, which clearly stops before the 64th bit (even if I use 16 bits in channel 0 to span 0,1):

Maybe this is covered in the manuals somewhere and I missed it (if so, happy to be pointed to the specific location for me to dig in and understand better. Anyone have any thoughts? This is not related to the CRC functionality (AFAIK), so I am guessing that this is covered elsewhere already and my ignorance is showing…

Thanks in advance!!

This is a limitation of our export system.

You can, however, work around this.
You must combine all the data you want to send into 8- or 16-bit values.

For bit shifting, you can use multiplication (*2^n).
To shift the number by one bit to the left, you multiply by 2.
Shift by two is multiplication by 4, and shift by 3 is multiplication by 8.
To combine data, first shift the data to the correct positions, then add the shifted data.

Let’s take byte 4, for example.
There are two values: green and grey.

Green value is a single bit and needs to be at bit position 2.
We multiply the green value by 4, which shifts it two bits to the left.
Let’s name it “green_b2”.

Grey value has two bits and must be at bit position 6.
We multiply the grey value by 64 (2^6), which shifts it six bits to the left.
Let’s name it “grey_b6”.

And to finish:
Byte4 = grey_b6 + green_b2

Now you have a single, 8-bit value that contains two channels, and can be sent as byte 4 of that frame.

As Marek wrote, you can create your own bitfield using operations on numbers.

Below you can find examples similar to Marek’s description, but using “choose” and “lookup” operations to save on the total number of operations.

You can do it this way using 2 operations, or (light green * 4) + (blueGrey * 64), but that consumes 2 more operations.(so 4 operations more for CANBus export from this case)

Please check the example below, where you have your entire frame.
bitfieldExample.pmu (3.3 KB)