Azzera filtri
Azzera filtri

Capture image using GPIB on Infiniium DCA86100 Oscilloscope

5 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Andrew Borghesani
Andrew Borghesani il 27 Nov 2018
Modificato: Andrew Borghesani il 27 Nov 2018
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;

Più risposte (0)

Categorie

Scopri di più su Instrument Control Toolbox Supported Hardware in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by