Using extractAll command
Show older comments
I am building a script that configures a CAN channel and then listens for and extracts a certain type of message from the traffic on the CAN. However, I am having problems with the extractAll command because it doesn't like the class of any of the arguements that I pass to it. I've tried sending it a double, single, char, and struct but it won't take any of them. Does anyone out there have the same problem? Here is my current script:
%% Create CAN channel, configure properties and initialize variables
canch = canChannel('Vector','CANcaseXL 1', 1);
configBusSpeed(canch, 500000);
msg_num = 100;
message.id = 415;
message.messagename = 'IC_A1';
%% Start the CAN channel and receive messages
for i = 1:msg_num
start(canch)
receive(canch,i);
[msgOut, remainder] = extractAll(message, 415, true);
value = unpack(message, 0, 16, 'LittlegEndian', 'int16');
end
%% Stop the CAN channel
stop(canch)
Accepted Answer
More Answers (0)
Categories
Find more on Vehicle Network Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!