フィルターのクリア

having problem reading data from arduino using instrument toolbox

1 回表示 (過去 30 日間)
ErfanH
ErfanH 2018 年 10 月 11 日
コメント済み: ErfanH 2019 年 5 月 27 日
Hey there well i'm trying to send a constant like 5 to arduino using simulink " to instrument " block and in arduino i have generated a model using "serial recieve" and a "gain" plus a "serial transmit" block and in my laptop i have the "query instrument" block but the thing i get is very weird .
  3 件のコメント
ErfanH
ErfanH 2018 年 10 月 11 日
when i run this model it gives some kind of random numbers
ErfanH
ErfanH 2018 年 10 月 11 日
@WalterRobinson

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

採用された回答

Thomas Jacob
Thomas Jacob 2019 年 5 月 25 日
I hope that you might have figured out by now. In case you haven't, try this:
The problem here is due to the fact that Arduino is sending the ASCII code and Query Instument is reading the binary values. You can change this at the Query block. Double click to open Block Parameters. Under the Query tab, set the data format as ASCII. You may also the set the ASCII format string as '%d', '%f', or '%s' based on the type of data you are sending.
  3 件のコメント
Walter Roberson
Walter Roberson 2019 年 5 月 26 日
To confirm, you are trying to send to more than 4 arduino simultaneously in one model ?
ErfanH
ErfanH 2019 年 5 月 27 日
Yes as a part of HIL simulation each arduino is going to represent a sensor

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInstrument Control Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by