Page 1 of 1

Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Thu 14. Apr 2016, 18:41
by hrohde
Hello!

Is it possible to use a PCAN-USB device for normal message transmission via the PCAN-Basic API and communication using the ISO-TP API at the same time?
My application must send and receive periodic CAN messages and also communicate with some nodes via ISO-TP at the same time. After my first experiments it looks like if it is only possible to use either the PCAN-Basic API for normal CAN messages or the ISO-TP API for TP messages but not both at the same time. Is this true?

Thanks in advance and best regards
Holger

Re: Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Fri 15. Apr 2016, 08:31
by K.Wagner
Hello,
hrohde wrote:Is it possible to use a PCAN-USB device for normal message transmission via the PCAN-Basic API and communication using the ISO-TP API at the same time?
NO. A PCAN-Basic channel can only be initialized once. The first API that initializes that channel owns the channel.
hrohde wrote:After my first experiments it looks like if it is only possible to use either the PCAN-Basic API for normal CAN messages or the ISO-TP API for TP messages but not both at the same time. Is this true?
Yes, they are mutual exclusive. Same with the other APIs, PCAN-UDS, PCAN-OBDII, PCAN-PassThru, PCAN-XCP, and PCAN-CCP.
hrohde wrote:My application must send and receive periodic CAN messages and also communicate with some nodes via ISO-TP at the same time.
If you want to do so, then you could connect a second PCAN-USB to the same CAN bus and initialize the second API on that channel.

Re: Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Fri 15. Apr 2016, 09:47
by hrohde
Thank you for the fast reply!

Re: Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Thu 1. Dec 2016, 17:36
by csgyorgy
Hello,
My need was exactly same, beside sending normal frames with ISO-TP, I needed to send periodic ignition frames on different IDs special bytes. Solution was to use same handle for both CanTpApi and PCANBasic. Although here is stated that can't work seems is working. I have initialized the CanTpApi and use that handle to write raw frames with PCANBasic.

code(vbnet):
sts = CanTpApi.Initialize(m_pctpHandle, baudrate, hwType, ioPort, interrupt)
......
stsResult = PCANBasic.Write(m_pctpHandle, CANMsg)

Is there any unforeseen issue I could expect?

Thanks

Csaba

Re: Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Thu 1. Dec 2016, 17:38
by csgyorgy
Forget to mention I have used a single Peak USB device.

Csaba

Re: Mixing RX/TX of normal CAN frames and ISO-TP messages

Posted: Fri 2. Dec 2016, 09:16
by K.Wagner
Hello,

High layer APIs like ISO-TP need to read internally. So, writing messages using PCAN-Basic with a channel that was initialized using ISO-TP may not be a problem, but if you also read over PCAN-Basic with that channel, then ISO-TP will fail to get messages and will abort some transmissions - there is only one receive queue per channel -

We strongly recommend the use of one channel per API. Otherwise you may include malfunction into your solution.