I want to read a message from ECU that send by ECU for 1 second period in one thread,and no request message to read it,but I have many threads to read another UDS message,it's failed that i used the UDS API to read it,and I used the PCAN-Basic API read() function it need a long wait to read it successful.So is there any way can read it quickly ?
Any effective method will be greatly appreciated.
you should not use UDS and PCAN-Basic within the same channel for reading. Note that UDS is using the PCAN-Basic channel internally for communication, so that any message you read with PCAN-Basic will not be available for UDS, which leads to communication problems.
If you need to read CAN messages out of the UDS protocol (so called Unacknowledged Unsegmented Data Transfer, UUDT) then you want to use the function UDS_SetValue and register mappings for those Instead (parameter PUDS_PARAM_MAPPING_ADD, page 36 of the help file). Received messages over this mapping will have the message type PUDS_MESSAGE_TYPE_CONFIRM_UUDT.
You will find an example on page 344 of the help file.
as my methods:
1.I used UDS_Read() API to read it ,but it's failed.
2.I used PCAN-Basic Read() API to read it ,it's successful to read the message,but need take a long time to wait.
So if I want to read the message that send by ECU for 1 sec period timely, is the UUDT function that I need to use? or there is any other way can solve it?
not sure why you ask again the same. I already told you how to get such messages
you need to create a mapping to get them as UUDT frames.
I told you already, this cause problems with the UDS communication. Don't do that.
See my first post, and the answer in point 1 above. I gave you even the pages within the help, so please read it.