Page 1 of 1

Invalid handle

Posted: Mon 26. Apr 2021, 13:55
by iisik
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.

Re: Invalid handle

Posted: Mon 26. Apr 2021, 15:46
by M.Heidemann
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