send data continuously
1 回表示 (過去 30 日間)
古いコメントを表示
how to send data every 10 millisecond continuously with serial communication? thanx
0 件のコメント
採用された回答
Gerd
2011 年 6 月 17 日
Hi Paskah,
you can use timers in Matlab to send continously data to your serial device.
t = timer ;
set(t,'ExecutionMode','fixedRate');
set(t,'Period',0.01);
set(t,'TimerFcn',{@mytimer_serial, handles});
start(t)
In the mytimer_serial function you can fire the command to the serial line. But please be careful about the precision as Walter already stated.
Gerd
2 件のコメント
Walter Roberson
2011 年 6 月 17 日
Yes, the timer period will be _approximately_ 0.01 seconds.
I see Gerd has specified fixedRate, which is probably what you want. For more information on the choices, please see
http://www.mathworks.com/help/techdoc/matlab_prog/f9-39719.html
その他の回答 (1 件)
Walter Roberson
2011 年 6 月 14 日
What precision do you need on the 10 milliseconds?
Is there a USB / serial device involved in this, or is it a directly connected serial port?
2 件のコメント
Walter Roberson
2011 年 6 月 17 日
Please note that if any USB device is installed, times of 10 millisecond will require special configuration or special programming.
参考
カテゴリ
Help Center および File Exchange で Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!