fread doesn't work

2 次查看(过去 30 天)
Gianmarco
Gianmarco 2013-11-13
Hi, I tried to use fread with the little script in the 'help fread' in matlab, using my active COM but I get an error!
s = serial('COM3');
fopen(s);
fprintf(s, 'Curve?');
data = fread(s, 512);
The error is:
Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period.

回答(1 个)

David Sanchez
David Sanchez 2013-11-13
You are trying to read data that are not available yet. Try with fscanf.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by