xcpChannel unable to set bus speed (baud rate)
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Johan
el 6 de Feb. de 2025
Comentada: Johan
el 24 de Feb. de 2025
I can't find a propper way to set the busspeed when using xcpChannel function. The bus speed is defined in the a2l object that I pass to the function but it still sets the default bus speed (500 kbit/s). When creating a canChannel object I can set the bus speed with the function configBussSpeed() but this can't be used on a xcpChannel object.
The only way I could set the bus speed was to set a break point in the underlying function and call the configBusSpeed function in debug mode.
I have tested with Vector, Kvaser and PCAN usb dongles. Same result, i.e. default bus speed is set.
Is this a bug, since the bus speed is clearly defined in the A2L object? Or how do I set the bus speed in a propper way?
0 comentarios
Respuesta aceptada
Jaskirat
el 19 de Feb. de 2025
There does not seem to be a direct way to use the “configBusSpeed” function with an xcpChannel object. A workaround would be to create a CAN channel and configure the bus speed before establishing the connection on XCP over CAN.
% Step 1: Create a CAN channel
% Replace 'VendorName', 'Device', and 'ChannelNumber' with your specific parameters.
canChannelObj = canChannel('VendorName', 'Device', ChannelNumber);
% Step 2: Configure the bus speed
% Set the desired bus speed in kbit/s, e.g., 250 kbit/s.
configBusSpeed(canChannelObj, 250000);
% Step 3: Create an XCP channel using the configured CAN channel
% Load your A2L file
a2lObj = xcpA2L('path_to_your_file.a2l');
% Create the XCP channel
xcpChannelObj = xcpChannel(a2lObj, canChannelObj);
% Step 4: Connect to the XCP server
connect(xcpChannelObj);
Hope this helps!
Más respuestas (0)
Ver también
Categorías
Más información sobre Motion Planning en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!