Serial Communication involving terminator in MATLAB

1 回表示 (過去 30 日間)
Muhammad Hammad
Muhammad Hammad 2014 年 9 月 3 日
回答済み: Rushikesh Tade 2014 年 9 月 15 日
Hi I am trying to read data from serial port in MATLAB at 115200 baudrate.Serial data has terminator character and i want to read data untill first terminator is reached. Then read data again untill next terminator character and so on.I have tried several function like fread, fgetl, fgets, fscanf etc. But on most occasions when i read data my last character is not terminator but some other character. When i used fgets and fgetl only three characters were read. please suggest solutions.
  1 件のコメント
Muhammad Hammad
Muhammad Hammad 2014 年 9 月 15 日
still waiting for the reply from any resourceful person... :?

サインインしてコメントする。

採用された回答

Rushikesh Tade
Rushikesh Tade 2014 年 9 月 15 日
Use MATLAB Serial port object:
serialObj= serial('COM1','BaudRate',115200,'DataBits',7);
For more info and documentation you can visit:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by