How to implementation of TesterPresent using python

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
seunghun
Posts: 2
Joined: Mon 13. Feb 2023, 09:14

How to implementation of TesterPresent using python

Post by seunghun » Mon 13. Feb 2023, 09:38

hello,
I want to check Testerpresent service (0x3E) in PCAN Basic API work well.
first, I checked positive response when I submit Testerpresent service (0x3E) after entering Extended Session (10 03).
but there's no interval sending message about 2000 ms. so I wander whether it's work well in PCAN Basic API Tool or tester should add interval sending request.

If the tool itself doesn't send a interval message, How do I write the code?
I'd appreciate it if you could show me an example.

Best Regards,
thanks

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: How to implementation of TesterPresent using python

Post by F.Vergnaud » Mon 13. Feb 2023, 10:14

Hello,

PCANBasic is an API that only supports low-level CAN communication:
- read and write CAN/CANFD frames,
- it does not implement mechanism from higher level protocol like UDS (or ISO-TP which is required by UDS protocol).

Yet if you only want to send a TesterPresent request (which is a Single Frame request), you can do so with PCAN-Basic.
You mentioned entering Extended Session and would like the API to keep alive the session by sending TesterPresent: this is the kind of UDS mechanism that is not handle by PCAN-Basic.
You need to implement it on your own: simply create a thread that transmits a TesterPresent request every 2000ms.

Please be careful: if you intend to make further UDS communication with PCANBasic, you may have to handle segmented communications on your own (ISO-TP protocol).
Best regards,
Fabrice

seunghun
Posts: 2
Joined: Mon 13. Feb 2023, 09:14

Re: How to implementation of TesterPresent using python

Post by seunghun » Tue 14. Feb 2023, 07:30

Dear F.Vergnaud

Hello,
first of all, Thanks to you, I solved these problems.
It's easy to make new thread. but new thread, main thread and tkinter thread are hard to connect each other......
ISO-TP protocol is soooo complicated!!

Thanks so much for your help.
Best Regards,

Post Reply