%% Query a TCP/IP Instrument for ID
% Create a TCP/IP client connection to an instrument. In this example, the instrument connected to this network is a Keysight Technologies® (formerly Agilent Technologies®) X-Series Signal Analyzer (N9030A, PXA Signal Analyzer). The specified IP address and port are unique to this example.

t = tcpclient("172.31.165.102",5025)

%
% Write an instrument identification SCPI command to the instrument and read the response.

writeread(t,"*IDN?")

% The instrument response to the *IDN? command identifies the name of the instrument.
% Copyright 2020 The MathWorks, Inc.