Read CAN1 messages from ECU

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
KiranGS
Posts: 6
Joined: Thu 25. Jul 2019, 12:05

Read CAN1 messages from ECU

Post by KiranGS » Thu 25. Jul 2019, 17:49

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

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Read CAN1 messages from ECU

Post by PEAK-Support » Fri 26. Jul 2019, 08:49

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..
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

KiranGS
Posts: 6
Joined: Thu 25. Jul 2019, 12:05

Re: Read CAN1 messages from ECU

Post by KiranGS » Tue 30. Jul 2019, 04:54

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 ?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Read CAN1 messages from ECU

Post by PEAK-Support » Tue 30. Jul 2019, 08:27

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.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Read CAN1 messages from ECU

Post by K.Wagner » Tue 30. Jul 2019, 08:58

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.
Best regards,
Keneth

KiranGS
Posts: 6
Joined: Thu 25. Jul 2019, 12:05

Re: Read CAN1 messages from ECU

Post by KiranGS » Sat 3. Aug 2019, 19:42

Thanks for the info. Will work on this.

Post Reply