Hello all,
I’m working on a CAN gateway that takes traffic in on CAN0, filters down for one particular message ID, modifies 2 data bytes from that message, then retransmits on CAN1 at a different rate and different data format. Works okay so far, except that occasionally the filtered ID matches but the contents in dtaGet array are incorrect. I verified with Peak CAN software that the incoming data bytes are unchanging.
By using additional checks in the MID match I’ve managed to filter out most of the incorrect data bytes, but I’d like to get a proper fix in place.
if ( ( id == 0x0CF091F3 ) && ( byte6 == 0 ) && ( byte7 == 0) ) //found data with extra data bytes filter applied, eliminates most of the error messages
//if ( id == 0x0CF091F3 ) //just filter by id
16 bytes of dtaGet contents each time the if(id==) matches:
|48|21|1|128|0|0|0|0|194|45|0|32|255|255|255|255| |
|128|234|1|16|255|15|0|0|194|45|0|32|255|255|255|255| |
|47|21|1|128|0|0|0|0|3|0|0|0|255|255|255|255| |
|128|234|2|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|128|234|1|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|48|21|1|128|0|0|0|0|3|0|0|0|255|255|255|255| |
|128|234|1|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|88|1|76|0|122|4|253|124|3|0|0|0|255|255|255|255| |
|128|234|1|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|125|4|115|22|0|0|0|0|3|0|0|0|255|255|255|255| |
|128|234|1|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|128|234|2|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|128|234|2|16|255|15|0|0|3|0|0|0|255|255|255|255| |
|128|234|1|16|255|15|0|0|3|0|0|0|255|255|255|255||
The lines starting with 128, 234 match the actual traffic seen at the Peak adapter. You can see some of the incorrect messages still get through with the 2 data byte contents checks in place.
Working on testing and documenting over here. Anybody ever notice something like this?
Thanks,
Mark