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

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Locked
hrohde
Posts: 2
Joined: Thu 14. Apr 2016, 18:19

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

Post by hrohde » Thu 14. Apr 2016, 18:41

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

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

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

Post by K.Wagner » Fri 15. Apr 2016, 08:31

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.
Best regards,
Keneth

hrohde
Posts: 2
Joined: Thu 14. Apr 2016, 18:19

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

Post by hrohde » Fri 15. Apr 2016, 09:47

Thank you for the fast reply!

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

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

Post by csgyorgy » Thu 1. Dec 2016, 17:36

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

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

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

Post by csgyorgy » Thu 1. Dec 2016, 17:38

Forget to mention I have used a single Peak USB device.

Csaba

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

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

Post by K.Wagner » Fri 2. Dec 2016, 09:16

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.
Best regards,
Keneth

Locked