Parsing data from serial port
이전 댓글 표시
Hi,
I communicate with a DsPIC
i have a constant format for a message:
HEADER1 HEADER2 OPCODE DATA CHECKSUM (no spaces)
in my MATLAB GUI i want to read the incoming message, chk if i get the HEADER1 I EXPCT, then chk to see i get HEADER2 i expect , if so: get OPCODE and DATA and do with that something
how can i split my message?
thought about switch;case
wanted to know if there is something more "elegant"
Thanks
댓글 수: 2
Walter Roberson
2016년 4월 11일
Is that a text format or a numeric format? are the headers variable length? How can you tell when HEADER1 stops and HEADER2 begins?
Daniel
2016년 4월 11일
편집: Walter Roberson
2016년 4월 11일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!