Specified Amount of data was not returned
5 ビュー (過去 30 日間)
古いコメントを表示
Hi I am trying to read a live video feed from a serial port. It seems no matter what I do, even if I change the Timeout or InputBufferSize or BaudRate, the above error will show up. I am trying to acces a test pattern that was placed on some software through a serial port and then acquired through a camerlink frame grabber. The program I have works for other Com channels perfectly, and I've managed to make this program work once with the serial port, but it won't do it again. I'm wondering what's wrong, why is this error a[pearing? How do I get the video feed and save it?
Whenever I try to use getdata it also shows an error. I'm not sure what I'm supossed to do from here.
Here's the code I'm using to access the serial port and the test patterns:
Pattern = serial('com3', 'BaudRate', 9600, 'Terminator', 'CR/LF', 'Timeout', .50);
Pattern.InputBufferSize = 768;
fopen(Pattern);
fprintf(Pattern,'tp 2');fprintf(Pattern,'go 1000'); char(fread(Pattern,100))
data = fread(Pattern,10,'uint8');
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で National Instruments Frame Grabbers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!