Specified Amount of data was not returned
조회 수: 2 (최근 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!