Invalid handle

A free API for the communication with control units based on the Universal Measurement and Calibration Protocol (XCP) by ASAM for Windows®
Post Reply
iisik
Posts: 1
Joined: Mon 26. Apr 2021, 11:09

Invalid handle

Post by iisik » Mon 26. Apr 2021, 13:55

Hi,

I'm getting an invalid handle error.

result = XCPApi.Connect(m_XcpSession, 0, msg, (ushort)msg.Length);

XCPApi.Connect seems to be working successfully but when I use same handle for AddSlaveOnCan, I get "The given handle is invalid" error. Variables are as below.

private TXCPChannel m_XcpChannel;
private TXCPHandle m_XcpSession;
private TXCPProtocolLayerConfig m_XcpProtocolConfig;
private TXCPTransportLayerCAN m_XcpSlaveData;

result = XCPApi.AddSlaveOnCAN(m_XcpChannel, m_XcpSlaveData, m_XcpProtocolConfig, out m_XcpSession);

Can you help me please? Thanks in advance.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Invalid handle

Post by M.Heidemann » Mon 26. Apr 2021, 15:46

Hello,

Please make sure that you have the latest PCANBasic API and PCAN-XCP API Installed.

PCANBasic API:
https://www.peak-system.com/fileadmin/m ... -basic.zip

PCAN-XCP API:
https://www.peak-system.com/fileadmin/m ... AN-XCP.ZIP

Furthermore, is there a XCP-Slave available on the Bus and is it answering?

Please also check, if the Example appliaction in the PCAN-XCP package works correctly.

(You should see the Slave respond after clicking "Connect Slave")

Please report back to us regarding this.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply