Page 1 of 1
Read CAN1 messages from ECU
Posted: Thu 25. Jul 2019, 17:49
by KiranGS
Hello,
I have used PCAN-UDS to read the Diagnostic messages from my PCAN-USB
I could see the CAN1 messages are read continuously in the PCAN-View without any request sent.
How to read these messages that are always sent from the ECU in my C# application. Which API to use ?
Thanks & Regards,
Kiran
Re: Read CAN1 messages from ECU
Posted: Fri 26. Jul 2019, 08:49
by PEAK-Support
If you want to read RAW CAN Frames from the BUS, you should use the PCAN-Basic API. You could use the same Handle that you use for the UDS, but you should know that all Mesages Read by PCAN-Basic API will never be received in any other Higher Layer API. You need exact know when read and when not. If you end a UDS Session, you simply could use the API, when start a UDS Session - never read witth PCAN-Basic API because UDS will then not receive the needed Frames..
Re: Read CAN1 messages from ECU
Posted: Tue 30. Jul 2019, 04:54
by KiranGS
Hello,
Thanks for the response.
Either use PCAN-Basic or UDS is ok at the moment.
But is there a way to do in parallel. ?
Like most of the time, I need the RAW CAN frames, at some intervals (random) I need to get / set the diagnostics data. Any workarounds for this ?
Re: Read CAN1 messages from ECU
Posted: Tue 30. Jul 2019, 08:27
by PEAK-Support
You could run it side by side, but you must be sure that the UDS Session is closed, use RAW CAN Messages , after that start a new UDS Session again. Running at the same time a UDS Session and reading RAW CAN will not work for teh UDS Session (Packages will get lost) - for running both at the same time you need a second CAN Channel.
Re: Read CAN1 messages from ECU
Posted: Tue 30. Jul 2019, 08:58
by K.Wagner
Hello,
KiranGS wrote:But is there a way to do in parallel. ?
The best is to have each API on different channels that are connected to the same . If you only have one device, then you need to do this as my colleague wrote, initialize and use UDS, disconnect it, and then initialize and use PCAN-basic and so on.
Another "not trivial" possibility is to configure UDS to receive raw CAN (a.k.a. UUDT, unacknowledge unsegmened data transfer). For this,
you need to know the IDs you want to read and configure address mappings for those. See the parameters PUDS_PARA_MAPPING_ADD and PUDS_PARAM_MAPPING_REMOVE on pages 35 and 36 of the documentation for PCAN-UDS. Also the chapter 4.3 on pages 338 to 334 give more information on this and you have an example of receiving UUDT messages.
Re: Read CAN1 messages from ECU
Posted: Sat 3. Aug 2019, 19:42
by KiranGS
Thanks for the info. Will work on this.