|
-
February 19th, 2013, 02:22 PM
#21
Re: How to reduce high CPU usage caused by receiver thread of CAN messages?
 Originally Posted by Codeplug
It sounds like you're getting more messages than you expect - ie, way more than the 25 msgs/s that you're interested in.
Do you see any differences in how the port is opened and setup between the new and old code?
Looking at the CAN Application flowchart in the manual, there are setup functions like xlCanSetReceiveMode() and xlCanSetChannelMode() that seems to affect what will be received. Or perhaps it's a settings difference in in the "Vector Hardware Config" tool.
You could write some code that logs all the messages coming across that you are not interested in. Knowing what those are may help with figuring out how to exclude those so that xlReceive() never returns them.
>> 2) there is no need (or should be no need at least) to call the setnotification every call in the receive function.
The manual implies this as well - since the flowchart has this being called in the Setup phase only once.
gg
All the messages which are around 11 of them has to be received in 40 milliseconds.That means approx 4 ms for each messages.But instead of getting all 11 messages once in 40 ms,these are received like almost 10+ times.I don't see much difference between how port is opened and setup between old and new code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|