Capture image using GPIB on Infiniium DCA86100 Oscilloscope

5 次查看(过去 30 天)
I want to capture the screen of the Infiniium DCA86100 oscilloscope using the GPIB interface.
The command that I am using is " :DISPLAY:DATA? JPEG " . When I query this command I only receive something lke this "#6188443ÿØÿà".
I though this shouldn't be the data for an entire image so I changed the input buffer size to a very large value but I still get something similar and of the same order every time I try.
Also how will I able to retrieve the actual image from this data?

采纳的回答

Andrew Borghesani
Andrew Borghesani 2018-11-27
编辑:Andrew Borghesani 2018-11-27
After playing around with it a little, I was able to get a color image (although in a bitmap not JPEG) doing the following, where visaObj is an open visa connection rather than a GPIB. The SCPI commands and rest of the workflow should be the same though
% send command and get BMP.
fprintf(visaObj,':DISPLAY:DATA? BMP, COLOR');
screenBMP = binblockread(visaObj,'uint8');
fread(visaObj,1);
% save as a BMP file
fid = fopen('test1.bmp','w');
fwrite(fid,screenBMP,'uint8');
fclose(fid);
% Read the BMP and display image
figure;
imageMatrix = imread('test1.bmp','bmp');
image(imageMatrix);
% Adjust the figure so it shows accurately
sizeImg = size(imageMatrix);
set(gca,'Position',[0 0 1 1],'XTick' ,[],'YTick',[]); set(gcf,'Position',[50 50 sizeImg(2) sizeImg(1)]);
axis off; axis image;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Instrument Control Toolbox Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by