Unexpected error: A timeout occurred during the write operation..

14 次查看(过去 30 天)
while sending the data serially i am experiencing a unexpected error:
Error using serial/fprintf (line 156)
Unexpected error: A timeout occurred during the write
operation..
Error in VSigTX (line 28)
fprintf(SendData, '%s',data);
how to remove the error as the sending matrix is a very lagre matrix of about 6400000x1

采纳的回答

Walter Roberson
Walter Roberson 2019-4-20
Increase the serial output buffer size and also send less in one fprintf.
Renegotiate the protocol with the other side so that there is a line terminator from time to time: at present you send all the lines without any breaks unless your data just happens to contain newline.
If your data is binary rather than line oriented then you should be using fwrite instead of fprintf, and you should probably also be using a binary transfer protocol like zmodem or Kermit because serial is not a reliable protocol. Or configure SLIP or PPP or similar over the serial link and use rcp or ftp to copy data.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by