Unable to Received Multiframe CAN Data In MATLAB
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello All, I am unable to receive Multiframe Data in Matlab through J1939 Protocol, Actually when I am Transmit the Multiframe it is not responding the CTS, Could you please help me to solve this problem my code is given below:-
db = canDatabase("J1939.dbc")
pgMultiFrame = j1939ParameterGroup(db, "VehicleDataMulti")
txCh = j1939Channel(db, "MathWorks", "Virtual 1", 1)
rxCh = j1939Channel(db, "MathWorks", "Virtual 1", 2)
start(rxCh);
start(txCh);
transmit(txCh, pgMultiFrame)
pgRx = receive(rxCh, Inf)
when i am going to run this code such kind of warning has been shown
Warning: Transport protocol transmission timed out waiting for Clear To Send notice.
0 commentaires
Réponses (1)
Anurag Ojha
le 25 Jan 2024
Hello Kuber,
According to the warning message after transmitting the multiframe message, you might need to wait for and handle the CTS response explicitly.
Kindly refer to the pseudo code below to handle the CTS response explicitly and modify it as per your requirements.
transmit(txCh, pgMultiFrame)
% Wait for CTS response
ctsResponse = receive(rxCh, Inf);
% Check CTS response and proceed accordingly
if ~isempty(ctsResponse) && ctsResponse.PGN == j1939ParameterGroup.PGN_CTS
% Process CTS response
disp('Received CTS. Proceeding with data transmission.');
% Continue with the data transmission steps
else
% Handle case where CTS was not received
disp('Did not receive CTS. Transmission may have failed.');
end
I hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Vehicle Network Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!