Page 1 of 1

Problem with testTesterPresdent in the Samples

Posted: Mon 14. Oct 2024, 18:32
by momet
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!

Re: Problem with testTesterPresdent in the Samples

Posted: Tue 15. Oct 2024, 09:24
by F.Vergnaud
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.

Re: Problem with testTesterPresdent in the Samples

Posted: Wed 16. Oct 2024, 09:00
by momet
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.

Re: Problem with testTesterPresdent in the Samples

Posted: Wed 16. Oct 2024, 12:01
by F.Vergnaud
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).

Re: Problem with testTesterPresdent in the Samples

Posted: Wed 16. Oct 2024, 14:45
by momet
ich thought "05_server_simulator" will take over the role of physical ECU. isn't it?
for what I need "05_server_simulator"?

Re: Problem with testTesterPresdent in the Samples

Posted: Wed 16. Oct 2024, 14:51
by M.Heidemann
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

Re: Problem with testTesterPresdent in the Samples

Posted: Thu 17. Oct 2024, 12:54
by momet
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?

Re: Problem with testTesterPresdent in the Samples

Posted: Mon 21. Oct 2024, 09:55
by F.Vergnaud
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.