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.
PCUClient and PCUServer Communication Problem
PCUClient and PCUServer Communication Problem
- Attachments
-
- pcan_error.png (10.16 KiB) Viewed 2984 times
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: PCUClient and PCUServer Communication Problem
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 :
(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 :
That is why PCUClient initializes PCAN_USB1 and PCUServer uses PCAN_USB2, please change the channel value of either the client or the serverThe Initialization process will fail if an application tries to initialize a PUDS‐Channel that has already been initialized within the same process.
Best regards,
Fabrice
Fabrice
Re: PCUClient and PCUServer Communication Problem
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
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
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: PCUClient and PCUServer Communication Problem
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.
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.
Best regards,
Fabrice
Fabrice