-
MATLAB[Recieve CAN message]한국과학기술연구소 인턴 2023. 4. 7. 15:31
배경
매트랩을 활용하여 PEAK System 사의 PCAN-USB 제품을 제어하기 위해 매뉴얼 정리
Receive Messages
rxMsg = receive(rxCh, Inf, "OutputFormat", "timetable");
recieve
//You can receive CAN messages as a timetable or as an array of message objects. //Receive all available messages as a timetable. //Inf : Maximum number of messages to receive canch = canChannel("Vector", "CANCaseXL 1", 1); start(canch) message = receive(canch,Inf,OutputFormat,"timetable"); //Receive up to five messages as an array of message objects. message = receive(canch,5);
// to extract the first few rows of received messages for preview. head(rxMsg)
Stop the Channel
stop(rxCh);
Analyze Received Messages
plot(rxMsg.Time, rxMsg.ID, "x") ylim([0 2047]) xlabel("Timestamp") ylabel("CAN Identifier")
'한국과학기술연구소 인턴' 카테고리의 다른 글
MATLAB [Send CAN message] (0) 2023.04.04 MATLAB [CAN channel creation] (0) 2023.03.28 PCAN-USB manual (0) 2023.03.27 UART (0) 2023.03.26 uCAN Converter (API) (0) 2023.03.25