Using fread to read streaming binary data from ethernet using Instrument Control Toolbox
Ältere Kommentare anzeigen
My data are uint8 format. The documentation for fread seems to imply that the "precision" argument can set the output format of fread. But if I try to use precision='*uint8' or 'uint8=>uint8' I get an error. The default output is double, which takes too much memory. I've been using
Output=uint8(fread(TcpipObj,SIZE,'uint8'))
which works, but I'm guessing this generates a large array of doubles then converts to uint8.
My instrument streams data until the buffer is full, so I set up TcpipObj.InputBufferSize to pull in the data I need. I then set SIZE to the same value. I'd like to pull in 40 MB or so, but get a java heap memory error.
Suggestions?
Jim
4 Kommentare
Walter Roberson
am 20 Apr. 2012
What error do you get with those precisions ?
Sean de Wolski
am 20 Apr. 2012
You could increase your java heap memory. But, like Walter, I'm curious what the error message has to say.
James Watson
am 24 Apr. 2012
James Watson
am 18 Jul. 2012
Antworten (1)
Vinod
am 10 Sep. 2012
0 Stimmen
Start here:
It has tips on managing memory and Java heap space.
Kategorien
Mehr zu Instrument Control Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!