PCANTP_PARAM_CHANNEL_CONDITION problem

A free API for the transfer of data packages according to ISO-TP (ISO 15765-2)
Post Reply
awild
Posts: 17
Joined: Tue 2. Apr 2019, 13:29

PCANTP_PARAM_CHANNEL_CONDITION problem

Post by awild » Fri 5. Apr 2019, 11:35

Hello to all,

I am using the newest ISO-TP Library together with a just bought PCAN-USB Hardware.
Before calling CANTP_Initialize I usually check the availability of the channel.
However the call

CanTpApi.GetValue(pctpHandle, TPCANTPParameter.PCANTP_PARAM_CHANNEL_CONDITION, out iBuffer, sizeof(UInt32));

returns PCANTP_ERROR_OK with iBuffer = 0!

The PCAN-USB is plugged in correctly.
I verified this by ignoring the iBuffer = 0 value and proceeded to the CANTP_Initialize statement.
The initialisation worked ok, no errors.

In order to track this fault further I just used your two demo software pieces :

- The PCANBasicExample to work with PCAN Basic Library
- The PcanIsoTpExample to work with PCAN ISO-TP Library
The both are NON MODIFIED.

Both examples walk through possible plug and play handles in the beginning.
When I start PCANBasicExample the hardware (Pcan-USB (51h)) is offered in cbbChannel ComboBox for initialisation.
When I start PcanIsoTpExample the hardware (Pcan-USB (51h)) is NOT offered in comboBoxChannel ComboBox for initialisation.

As a conclusion I cannot understand why

CanTpApi.GetValue(pctpHandle, TPCANTPParameter.PCANTP_PARAM_CHANNEL_CONDITION, out iBuffer, sizeof(UInt32));

is not able to deliver a meaningful result in iBuffer.

Thanks for reply

Andy

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

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by K.Wagner » Fri 5. Apr 2019, 12:49

Hello,

The channels that are available for PCAN-Basic should also be available for PCAN-ISO-TP, if they are still not connected.

We cannot reproduce the behavior you describe. Please check first that you are using the latest versions:
  • PCAN-Basic: 4.3.2
  • PCAN-ISO-TP: 2.1.0

If you have these versions, then please give us information about your development system like OS, platform, etc.
Best regards,
Keneth

awild
Posts: 17
Joined: Tue 2. Apr 2019, 13:29

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by awild » Fri 5. Apr 2019, 13:09

Hello,
Regarding the connection status of the channel:
I just start the two demo versions and do not click the "Initialize" button. Therefore the channels are never connected.
Provided this, the PCAN Basic demo detects the hardware, the PCAN ISO-TP doesn´t detect the hardware as I described previously.

I have a 64Bit windows machine with Visual Studio 2017. However I compile for 32Bit, thus using the 32Bit libraries.
The version of the ISO-TP Lib is: 2.10.115
The version of the Basic Lib is 4.3.2.161

best regards
Andy

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

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by K.Wagner » Fri 5. Apr 2019, 14:13

Ok, you have the latest versions.

we have no explanation for the behavior you are seeing :shock:. Note that PCAN-ISO-TP uses internally PCAN-Basic as transport protocol. The call to CANTP_GetValue(PCANTP_PARAM_CHANNEL_CONDITION), is internally forwarded to PCAN-Basic, i.e. it just calls CAN_GetValue(PCAN_CHANNEL_CONDITION) and returns the buffer in name of PCANTP_GetValue, without modifying it. This means, if PCAN-Basic is seeing the channel, then PCAN-ISO-TP too.

Please let us know which sample (programming language) and the OS you are using (Windows 10, Windows 7). We will then test again with that constellation.

Please note, that we cannot check or repair something without reproducing it.
Best regards,
Keneth

awild
Posts: 17
Joined: Tue 2. Apr 2019, 13:29

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by awild » Fri 5. Apr 2019, 15:34

Hello Kenneth,

with your hint that the ISO-TP library does actually use the basic library, I found the reason why the original ISO-TP (CSharp) demo doesn´t work:

In bin/debug there is only the PCAN-ISO-TP.dll.
If you add PCANBasic.dll here, the demo works fine.
But please note that there is no warning message when you use GetValue() that the underlying PCAN Basic dll is missing.

With this result I will again trace my application, because here I still get iBuffer = 0.
I let you know what I will find out.

best regards to you
Andy

awild
Posts: 17
Joined: Tue 2. Apr 2019, 13:29

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by awild » Fri 5. Apr 2019, 16:00

Hello Kenneth,

now everything is ok. In my application the handle was not initialized (= 0).
But as you see in this context the behaviour of the demo program was a bit missleading to me.

The main problem is that, provided there is NO PCAN Basic dll available:
- CanTpApi.GetValue() does´t throw an exception and returns always 0 as a result with no error
- CanTpApi.Initialize() throws an exception when there is no basic dll.

But I am glad I can proceed in my project now.
By the way, where can I find the exact bit locations of Source Adress and Target Adress within the 29bit CAN-ID using normal adressing in ISO-TP? Sorry for asking you that but the ISO 15765-2 norm is just not available in the internet....

Have a nice weekend and thanks a lot for your help
Andy

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

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by K.Wagner » Fri 5. Apr 2019, 16:30

Hello,
awild wrote:The main problem is that, provided there is NO PCAN Basic dll available:
- CanTpApi.GetValue() does´t throw an exception and returns always 0 as a result with no error
Indeed! Thanks for bringing this to our attention. We will schedule a fix for that.
Best regards,
Keneth

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

Re: PCANTP_PARAM_CHANNEL_CONDITION problem

Post by K.Wagner » Fri 5. Apr 2019, 16:59

awild wrote:By the way, where can I find the exact bit locations of Source Adress and Target Adress within the 29bit CAN-ID using normal adressing in ISO-TP?
The source address is the less significant byte.
The target address is the byte next to it
Coding is Intel format - Value Range from 0x00 to 0xFF
Data-Flow
Data-Flow
PCView.PNG (23.15 KiB) Viewed 1947 times
Best regards,
Keneth

Post Reply