4200L Best way to extract uint16 from CAN Message?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

I'm searching for an easy way to extract/put uint16 form/in CAN Messages/Mailboxes

   

Before (with other Platform) I do this:

   

                UB12=(*(short *) &CAN_Receive_Data[1]);
                UB24=(*(short *) &CAN_Receive_Data[3]);

   

        (*(short *) &CAN_Send_Data[1])=UB12;
        (*(short *) &CAN_Send_Data[3])=UB24;

   

Regards,

   

Michael

0 Likes
3 Replies