필터 지우기
필터 지우기

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

댓글을 달려면 로그인하십시오.

채택된 답변

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 CenterFile Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by