Problem with testTesterPresdent in the Samples

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
momet
Posts: 4
Joined: Mon 14. Oct 2024, 18:05

Problem with testTesterPresdent in the Samples

Post by momet » Mon 14. Oct 2024, 18:32

hello together,

I try to use your examples from the samples (C_C++)
the Peak CAN devices is connected, no controller, I want to use the servier_simulator.cpp!

when I achive the line "status = UDS_SvcTesterPresent_2013(channel, config, &request, PUDS_SVC_PARAM_TP_ZSUBF)," I get the status "PUDS_STATUS_NOT_INITIALIZED"
I am using VS!

my Quation is: why I can't get response from server_simulation?

thanks in Advance!
Attachments
testerPresent.png
testerPresent.png (32.95 KiB) Viewed 4941 times

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

Re: Problem with testTesterPresdent in the Samples

Post by F.Vergnaud » Tue 15. Oct 2024, 09:24

Hello,

You are using samples 05_server_simulator and 06_client_all_request.

Each sample initializes a CAN channel: by default client connects on USBBUS1 and server on USBBUS2.
Your client outputs "Initialize UDS:2" which is PCANTP_STATUS_ALREADY_INITIALIZED (channel is in use).

You cannot re-use the channel of the server simulator in the client example. You need to use 2 different CAN nodes.
Best regards,
Fabrice

momet
Posts: 4
Joined: Mon 14. Oct 2024, 18:05

Re: Problem with testTesterPresdent in the Samples

Post by momet » Wed 16. Oct 2024, 09:00

thaks for the quick response!

I have a PEAKCan with only one channel! if I modify the client_all_request.cpp to "client_handle = PCANTP_HANDLE_USBBUS1" and server_simulator to "tp_handle = PCANTP_HANDLE_USBBUS2"
I get in the screen "05-server_simulator.exe following outputs:
PCAN-UDS API Version - 2.3.2.350: OK
Initialize channel: KO
Set server address: KO
Set ISO 15765-4 timeouts values: KO
Get request timeout value (3435973836ms): KO
Get response timeout value (3435973836ms): KO
Set receive event parameter: KO
Start listening, press Q to quit.
Attachments
Screenshot 2024-10-16 090638.png
Screenshot 2024-10-16 090638.png (35.88 KiB) Viewed 4906 times

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

Re: Problem with testTesterPresdent in the Samples

Post by F.Vergnaud » Wed 16. Oct 2024, 12:01

Hello,

If you don't have a physical UDS ECU connected to your CAN bus, you won't be able to any UDS communication with only one CAN node.
Otherwise you need to plug another PCAN device on your PC and connect both CAN devices with a CAN cable (which must be terminated with 120 ohm resistances on each side).
Best regards,
Fabrice

momet
Posts: 4
Joined: Mon 14. Oct 2024, 18:05

Re: Problem with testTesterPresdent in the Samples

Post by momet » Wed 16. Oct 2024, 14:45

ich thought "05_server_simulator" will take over the role of physical ECU. isn't it?
for what I need "05_server_simulator"?

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Problem with testTesterPresdent in the Samples

Post by M.Heidemann » Wed 16. Oct 2024, 14:51

Hello,

As mentioned by my colleague F.Vergnaud:
Otherwise you need to plug another PCAN device on your PC and connect both CAN devices with a CAN cable


So yes, the example acts as a server, without a client however there won't be much happening.

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

momet
Posts: 4
Joined: Mon 14. Oct 2024, 18:05

Re: Problem with testTesterPresdent in the Samples

Post by momet » Thu 17. Oct 2024, 12:54

hello,

the samples work perfectly with two PeakCAN devices (USB and Pro). thanks for the support and the advice with resistence!

I still have another basic quetion:
I want to connect now a physical ECU to PCAN-USB and I want to reuse your example "\06_client_all_request"
here are my steps:
1. Hardware: connect ECU to PeaCAN USB (in between 120 ohm resistance)
2. Software
  • - Open your \06_client_all_request.cpp code
    - to change:
    • config.nai.source_addr = phys. CAN ID from my tester;
      config.nai.target_addr = phys. CAN ID from my ECU;
    - 05_server_simulator.cpp is not needed because I have a phsycal ECU now
    - I start only "06_lient_all_request.cpp" in VS
have I forgotten something?

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

Re: Problem with testTesterPresdent in the Samples

Post by F.Vergnaud » Mon 21. Oct 2024, 09:55

Hello,

Be careful, source_addr and target_address are adresses defined during network design, it is not related to CAN IDs. CAN IDs are used in ISOTP mappings: it links CAN IDs and ISOTP network addressing.

Please check the documentation §4.3 "UDS and ISO-TP Network Addressing Information", and especially "§4.3.3 PCAN-UDS 2.x Example" if you need to configure non standardized CAN IDs.
Best regards,
Fabrice

Post Reply