www.gusucode.com > vnt 源码程序 matlab案例代码 > vnt/receivingFcn.m

    function receivingFcn(rxCh)
% RECEIVINGFCN A CAN channel message receive callback function.
%
%   This is a callback function used to receive CAN message. It receives 
%   messages from the channel RXCH, extracts them by identifier, unpacks 
%   signal values from the messages, and plots the result.
%

% Copyright 2009 The MathWorks, Inc.

    % Receive all available messages.
    rxMsg = receive(rxCh, Inf);

    % Plot the signal values against their message timestamps.
    plot([rxMsg.Timestamp], [rxMsg.ID], 'x');
    ylim([0 2047])
    xlabel('Timestamp');
    ylabel('CAN Identifier');
    hold all;
end