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
Mixing RX/TX of normal CAN frames and ISO-TP messages
Re: Mixing RX/TX of normal CAN frames and ISO-TP messages
Hello,
NO. A PCAN-Basic channel can only be initialized once. The first API that initializes that channel owns the channel.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?
Yes, they are mutual exclusive. Same with the other APIs, PCAN-UDS, PCAN-OBDII, PCAN-PassThru, PCAN-XCP, and PCAN-CCP.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?
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.hrohde wrote:My application must send and receive periodic CAN messages and also communicate with some nodes via ISO-TP at the same time.
Best regards,
Keneth
Keneth
Re: Mixing RX/TX of normal CAN frames and ISO-TP messages
Thank you for the fast reply!
Re: Mixing RX/TX of normal CAN frames and ISO-TP messages
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
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
Forget to mention I have used a single Peak USB device.
Csaba
Csaba
Re: Mixing RX/TX of normal CAN frames and ISO-TP messages
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.
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
Keneth