| |||||
Technical Support On-Line Manuals µVision® User's Guide | Process Outgoing MessagesBy using a breakpoint on the CAN0OUT register it is possible to invoke debug functions. The debug function might check the CAN message object and may send a reply to the CAN message or invoke a signal function that sends a delayed reply. The following example shows the usage:
FUNC void CANmessage (void) {
switch (CAN0OUT) {
case 1: printf ("\nSend Message (11-bit ID=%04X)", CAN0ID); break;
case 2: printf ("\nSend Message (29-bit ID=%08X)", CAN0ID); break;
case 3: printf ("\nRequest Message (11-bit ID=%04X)", CAN0ID); return;
case 4: printf ("\nRequest Message (29-bit ID=%08X)", CAN0ID); return;
}
printf ("\nMessage Length %d, Data: ", CAN0L);
printf ("%02X %02X %02X %02X ", CAN0B0, CAN0B1, CAN0B2, CAN0B3);
printf ("%02X %02X %02X %02X \n", CAN0B4, CAN0B5, CAN0B6, CAN0B7);
}
>BS WRITE CAN0OUT, 1, "CANmessage ()" // call CANmessage debug function with outgoing messages
Note: All CAN messages can be review also in the CAN communication dialog page. | ||||
| |||||