This example uses MATLAB to capture the image on the screen of an Agilent signal analyzer and transfer it to the local PC. The example uses the TCPIP address of the instrument to connect and control the instrument using SCPI commands. For more information on the SCPI commands used to control the instrument, refer to your instrument's programmer's guide.
To execute this function, download the file to a folder on your MATLAB path and type 'saveScreenshot('127.0.0.1','myScreenshot.png')' at the MATLAB command prompt.
Note: Change the TCPIP address to the network address of the instrument.
To view the image, type 'im = imread('myScreenshot.png'); image(im);' at the MATLAB prompt.
This MATLAB example has been tested using an Agilent MXA signal analyzer but should work on all X-series analyzers and the PSA.
To learn more about using or purchasing MATLAB with Agilent signal and spectrum analyzers, visit:
http://www.agilent.com/find/n6171a
To request your free trial of MATLAB and/or Instrument Control Toolbox, visit http://www.mathworks.com/agilent/instrument/tryit.html |