How can I open and read data from a serial port?
조회 수: 1 (최근 30일)
이전 댓글 표시
To open/read pre-recorded data I have previously used:
fileID = fopen('filename.txt', 'rt'); line = fgetl(fileID);
to read the text file line by line. However, I need to be able to read data from an instrument connected to a serial port.
i have used
fid = serial(COMx,baudrate,9600);
fopen(fid);
Will this work for a live instrument?
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 5월 24일
fid = serial('COMx', 'baudrate', 9600);
댓글 수: 1
islam dib
2020년 12월 9일
hello,
참고 항목
카테고리
Help Center 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!