How to change serial timeout to a double number

조회 수: 2 (최근 30일)
Huseyin Berkay Berabi
Huseyin Berkay Berabi 2017년 12월 22일
댓글: Karim 2017년 12월 22일
Hello guys,
I have a simple question. I am reading strings from a board with fscanf.
serial_read_timeout = 1; my_nucleo_board.Timeout = serial_read_timeout;
the problem is matlab converts the variable serial_read_timeout to an integer on its own. How can i change it because i want to set the timeout to few miliseconds.
thnak you so much for your help !
  댓글 수: 4
Huseyin Berkay Berabi
Huseyin Berkay Berabi 2017년 12월 22일
i mean not always but when i pass 0.001 as an argument to set function, it still waits 1 second i assume matlabs converts it to an integer.
for example when i write 2.3 it waits 3 seconds for the time out
Karim
Karim 2017년 12월 22일
At first glance: either you need to change the settings of your board such that it works with milliseconds or you need to change the function that transmits the data to the board.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by