Synchronize multiple CAN channel writing

A free API for the communication with control units based on the Universal Measurement and Calibration Protocol (XCP) by ASAM for Windows®
Post Reply
csgyorgy
Posts: 5
Joined: Thu 1. Dec 2016, 17:16

Synchronize multiple CAN channel writing

Post by csgyorgy » Fri 14. Jun 2019, 17:49

I have on same physical CAN bus(CAN wire) 3 PCAN channels initialized with :
1.PCANBasic - simulate Rest Bus fatsest message every 2 msec
2.PCAN-TP - Query diagnostic data
3.PCAN-XCP - Query measurements via XCP
Above 3 channels realized with 3 ports of an PCAN PCI-e 4 channel card connected on same CAN bus.
Randomly diagnostic querys return with timeout, tracing with a 4th PCAN-USB adapter, I can't see the Diagnostic data on the trace , however CanTpApi.Write returned with TPCANTPStatus.PCANTP_ERROR_OK. If once the diagnostic data is lost all following frames are lost.
Question: Is it necessary to synchronise the 3 channels transmition steps or this will be done on low level driver or by the PCANBacis API based on CAN arbitration?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Synchronize multiple CAN channel writing

Post by PEAK-Support » Sat 15. Jun 2019, 10:34

No, you could not "sync" the single channels. The driver itself do not care if you use 4x single channel or 2x dual channel or 1x quad channel. It makes no differnt. Also CAN Bus could not send 2 messages synchron on the Bus - the ID with the lowest value winns ! the other Frame come back after a random time and try again.
But please send an e-mail to our support@peak-system.com we will forward your specific question to our High Layer Automotiv API developers.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

csgyorgy
Posts: 5
Joined: Thu 1. Dec 2016, 17:16

Re: Synchronize multiple CAN channel writing

Post by csgyorgy » Sat 15. Jun 2019, 12:16

Thanks,
My question was if I need to lock example with mutex the writing steps CanTpApi.Write,PCANBasic.Write from multiple threads or this will be handled by APIs.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Synchronize multiple CAN channel writing

Post by PEAK-Support » Sat 15. Jun 2019, 12:29

no, our drivers API are multi thread save - you do not have to take care of that. But as i wrote - best is to contact the support directly, so that we could forward you to the API Developers.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply