Tunable Laser
Source
FLS-2800
FLS-2800 (v1.1)
35
7.
Once commands have been
executed in the ‘
Communicate
’ tab,
clicking on the ‘
Session Log
’ tab
now shows MATLAB script code
that will perform all the commands
that were executed in the
‘
Communicate
’ tab.
8.
By clicking ‘
Save Session…
’ you are
able to save the MATLAB .m file of
these executed commands.
Figure 27 - MATLAB VISA Session Log
MATLAB Example Code: Query the FLS-2800
% Find a VISA-TCPIP object. This is if the VISA object has already be
% created with tmtool etc, or has been removed from the workspace without
% first being closed (cleanly disconnected)
FLS_2800 = instrfind(
'Type'
,
'visa-tcpip'
,
...
'RsrcName'
,
'TCPIP0::192.168.1.4::inst0::INSTR'
,
'Tag'
,
''
);
% Create the ‘agilent’ VISA-TCPIP object if it does not exist
% otherwise use the object that was found.
if
isempty(FLS_2800)
FLS_2800 = visa(
'agilent'
,
'TCPIP0::192.168.1.4::inst0::INSTR'
);
else
fclose(FLS_2800);
FLS_2800 = FLS_2800(1);
end
% Open the connection to the VISA object
fopen(FLS_2800);
% Query the FLS-2800.
response = query(FLS_2800,
'*IDN?'
);
disp(
'The *IDN query response:'
);
disp(response);
response = query(FLS_2800,
'*OPT?'
);
disp(
'The *OPT query response:'
);
disp(response);
% Close the connection to the object
fclose(FLS_2800);
% Clean up all objects.
delete(FLS_2800);
Note
: The IP address (
192.168.1.4
) used in the code is an example only. You will need to substitute
in the IP address of your FLS-2800.