Modular Variable Optical Attenuator
|
VOA
Blade
Coherent Solutions
|
VOA
Blade (V1.4
)
47
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 45 - MATLAB VISA Session Log
13.8 MATLAB Example Code: Query the MTP1000
% 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)
MTP1000 = 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(MTP1000)
MTP1000 = visa(
'agilent'
,
'TCPIP0::192.168.1.4::inst0::INSTR'
);
else
fclose(MTP1000);
MTP1000 = MTP1000 (1);
end
% Open the connection to the VISA object
fopen(MTP1000);
% Query the MTP1000.
response = query(MTP1000,
'*IDN?'
);
disp(
'The *IDN query response:'
);
disp(response);
response = query(MTP1000,
'*OPT?'
);
disp(
'The *OPT query response:'
);
disp(response);
% Close the connection to the object
fclose(MTP1000);
% Clean up all objects.
delete(MTP1000);
Notes
: 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 MTP1000.
Содержание MTP-1000
Страница 1: ......
Страница 49: ...V1 2 ...