Bit Error Rate Tester | BERT 1005
Quantifi Photonics Ltd.
Version
2.04
87
MATLAB® code example
To communicate with a BERT product in MATLAB® the installation of a VISA IO driver is required. These
drivers enable the creation of the Interface Object for instrument communication.
If developing locally on the BERT Platform, then these will already be installed. However, if development
is on a remotely connected system the VISA Libraries, e.g. National Instruments NI-VISA will have to be
installed.
The following example shows how to communicate with a BERT product using MATLAB code. For a list
of supported and valid SCPI commands, refer to the Programming Guide.
% Find a VISA-TCPIP object. This is if the VISA object has already been
% created with tmtool or has been removed from the workspace without
% first being closed (cleanly disconnected).
PXIE_Chassis = instrfind(
'Type'
,
'visa-tcpip'
,
...
'RsrcName'
,
'TCPIP0::10.10.10.89::inst0::INSTR'
,
'Tag'
,
''
);
% Create the ‘agilent’ VIS
A-TCPIP object if it does not exist
% otherwise use the object that was found.
if
isempty(PXIE_Chassis)
PXIE_Chassis = visa(
'agilent'
,
'TCPIP0::10.10.10.89::inst0::INSTR'
);
else
fclose(PXIE_Chassis);
PXIE_Chassis = PXIE_Chassis (1);
end
% Open the connection to the VISA object.
fopen(PXIE_Chassis);
% Query the PXIE_Chassis.
response = query(PXIE_Chassis,
'*IDN?'
);
disp(
'The *IDN query response:'
);
disp(response);
response = query(PXIE_Chassis,
'*OPT?'
);
disp(
'The *OPT query response:'
);
disp(response);
% Replace this with a valid command for your device (read the programming
% guide section for examples)
command =
''
% Close the connection to the object.
fclose(PXIE_Chassis);
% Clean up all objects.
delete(PXIE_Chassis);
MATLAB 2010x or later with the Instrument Control Toolbox is required to execute the code
detailed in this section.