connect(xcpch) not working

4 views (last 30 days)
Lucas Ferreira-Correia
Lucas Ferreira-Correia on 4 Dec 2020
I've been trying to record data from XCP hardware connected over ethernet to my laptop. I'm fairly sure I've I've got the right protocol, ip address and port, I've tripple checked using cmd netstat -a. When I use the function connect(xcpch) the XCP hardware reacts with a welcome message but then the following error is shown in matlab:
Error using asyncio.MessageHandler/onError (line 31)
An established connection was aborted by the software in your host machine
Error in asyncio.Stream/wait (line 183)
Error in asyncio.InputStream/read (line 130)
status = obj.wait(@(obj) obj.getDataAvailable() > 0);
Error in
Error in
Error in
Error in
Error in tcpclient/read (line 243)
data = receive(obj.TCPClientObj, numValuesToRead, dataType);
Error in xcp.transportlayer.TCP/receive (line 64)
msg.Data = uint8(read(obj.Socket, lg, 'uint8'));
Error in xcp.Protocol/executeReceptionTimerCallback (line 700)
msgRx = obj.TransportLayerObject.receive(inf);
Error in xcp.Protocol>@(~,~)(obj.executeReceptionTimerCallback) (line 59)
@(~, ~)(obj.executeReceptionTimerCallback));
Error in internal.IntervalTimer/onCustomEvent (line 154)
notify(obj, 'Executing', internal.TimerInfo(eventData.ExecutionCount));
Error in
(line 115)
Error in asyncio.Channel/onCustomEvent (line 477)
notify(obj, 'Custom', asyncio.CustomEventInfo(type,data));
Error in asyncio.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data)
(line 409)
@(source, data)
obj.onCustomEvent(data.Type, data.Data));
Error in xcp.Protocol/transmitCommand (line 663)
Error in xcp.Protocol/transmitCommand (line 687)
response = obj.transmitCommand(cmdData, 3);
Error in xcp.Protocol/transmitCommand (line 682)
response = obj.transmitCommand(cmdData, 2);
Error in xcp.Protocol/connect (line 98)
response = obj.transmitCommand(cmdData);
Error in xcp.Channel/connect (line 190)
[~, resource, commModeBasic, maxCRO, maxDTO] =
Error using xcp.Protocol/validateResponse (line 620)
Slave did not respond to command CONNECT.
Error in xcp.Protocol/connect (line 100)
obj.validateResponse(obj.CurrentCommand, response);
Error in xcp.Channel/connect (line 190)
[~, resource, commModeBasic, maxCRO, maxDTO] =
My code is as follows:
% Access A2L file
a2l = xcpA2L('Batteriemodell.a2l');
% Create XCP channel
% From cmd netstat -a
protocol = 'TCP';
ip = '';
port = 5001;
xcpch = xcpChannel(a2l,protocol,ip,port);
% Connect XCP channel to slave module
warning ('off','all');
Does anyone have an idea why this error is occuring?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!