Hmm that doesnt sound right. If its going great at full pelt, then you should have no worries adding a simple filter.Jayme wrote:so I found some hiccups.... the log where I streamed raw data directly to my text box unformatted and unprocessed, was fine, I was keeping up with the buffer and each read from the avt was about 170 ish bytes long.
as soon as I added in code to format the individual frames and check AVT length codes etc, it started lagging behind the buffer, and each time it was reading data, it was 4096 bytes long and missing data.... so it looks like my processing code is either very ineficcient or .net (C#) is just too slow and too much overhead... as antus told me.. it might be time to go c++ ? either way I dont really care, my goal here was to get the chatter and make an ADX.
So keep your existing code to go at full pelt. But add a simply if statement right at the bottom of your coding after you have compiled the message/frame to check if the header your after is correct.
Im guessing you are reading the header, and then the amount of bytes to read, then reading all those bytes, formatting the message and then putting into a rich text box? Something along those lines?
If so, just have a simply if statement at the end to check if the header matches what you are after.
Oh,oh,oh and make sure you read everything as a byte.. reading everything as a 'string' reeeeeaaaaallllly slows things down. So pull the message into an array (well thats what I do), then once you have pulled the message a simple:
Code: Select all
if CANArray(0) = FilterHeader
Richtextbox.appendtext
else 'if not the header we want
'clear CANArray
endif