Page 1 of 1

PCUClient and PCUServer Communication Problem

Posted: Tue 16. Jun 2020, 09:17
by Shail
Hello,

We want to communicate between PCUClient and PCUServer.
Example Code C++
1) PCUClient
2) PCUServer

Current Setup :
-> Two PEAK connected to PC for client and server communication
-> In Example code PCU Server connected to Channel = PUDS_USBBUS2 but we have changed to Channel = PUDS_USBBUS1 same as client;

(1) May I know first server need to run or client?
(2) Currently we are facing problem of PUDS_ERROR_ALREADY_INITIALIZED error in PCAN UDS Initialized in PCUServer. how to solve this error?
Kindly find the attachment for more details.

#define PUDS_ERROR_OK 0x00000 // No error
#define PUDS_ERROR_NOT_INITIALIZED 0x00001 // Not Initialized
#define PUDS_ERROR_ALREADY_INITIALIZED 0x00002 // Already Initialized

(3) May I know what the steps require to communicate between client and server of example code?

Thanks in advance.

Re: PCUClient and PCUServer Communication Problem

Posted: Tue 16. Jun 2020, 09:28
by F.Vergnaud
Hello,

(1) PCUServer needs to be launched first as it listens to client requests.
(2) (3) Two applications cannot use the same channel, see PCAN-UDS documentation, function UDS_Initialize page 259 :
The Initialization process will fail if an application tries to initialize a PUDS‐Channel that has already been initialized within the same process.
That is why PCUClient initializes PCAN_USB1 and PCUServer uses PCAN_USB2, please change the channel value of either the client or the server

Re: PCUClient and PCUServer Communication Problem

Posted: Wed 17. Jun 2020, 14:45
by Shail
Hello,

Thanks for your reply.

UDS initialization has been done correctly.

Can u tell how hardware connection need to be done via PCAN to PC?
How two PCAN need to be connected via 120 ohm terminal register?

Thanks

Re: PCUClient and PCUServer Communication Problem

Posted: Wed 17. Jun 2020, 15:08
by F.Vergnaud
You need to:
1. plug your 2 PCAN devices to your PC,
2. connect a PCAN-Term (120ohm termination adapter) to the first PCAN device,
3. connect a PCAN-Cable 1 to it then
4. add a PCAN-Term to the end of the cable
5. finally connect it to the other PCAN-device.

Note that you can use a PCAN-Cable 2 that includes the 2 CAN termination.