Dec-08-2018, 09:17 PM
(Dec-08-2018, 09:14 PM)buran Wrote:(Dec-08-2018, 09:02 PM)yelyah Wrote: It even prints after elif condition can_message[4] as value "d"well, if it raise error on that line, it cannot print after that :-)
EDIT: can you upload sample file that you parse and that cause the error
Yeeep I just got idea what could be the problem and it seems that if message is shorter then 5 elements it will make this error.
Quote:0.001051 1 1 Rx d 8 00 00 00 05 00 00 00 00 Length = 242000 BitCount = 125 ID = 1
0.001301 1 1 Rx d 8 00 00 00 05 00 00 00 00 Length = 242000 BitCount = 125 ID = 1
0.001549 1 6 Rx d 8 03 00 00 00 00 00 00 00 Length = 240000 BitCount = 124 ID = 6
0.001800 1 9 Rx d 8 04 00 00 00 00 00 00 00 Length = 242000 BitCount = 125 ID = 9
0.002050 1 9 Rx d 8 04 00 00 00 00 00 00 00 Length = 242000 BitCount = 125 ID = 9
2.5158 1 OverloadFrame
because my recognizer function is
def message_type_recognizer(can_message): if can_message[0] == "date" or can_message[0] == "base" or can_message[0] == "internal" or can_message[0] == "//" or can_message[0] == "Begin" or can_message[1] == "Start": header_parser(can_message) elif can_message[4] == "d": can_message_parser(can_message) elif can_message[4] == "r": can_remote_frame_parser(can_message) elif can_message[2] == "ErrorFrame": can_error_frame_parser(can_message) elif can_message[2] == "Statistic:": can_statistic_event_parser(can_message) elif can_message[3] == "Status:chip": can_error_event_parser(can_message) elif can_message[8] == "TxErr:": can_error_event_parser(can_message) elif can_message[2] == "OverloadFrame": can_overload_frame_parser(can_message) else: can_end_triggerblock_parser(can_message)