Agilent Technologies 86038B User Manual page 188

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

188
Form1: public class From1 ...
Find the block of private declarations of the form
components. There should be a Text Box and a Label. You are
going to add the pdla client object as a member. Insert the
following line after the Text Box and Label declarations:
// Declare a local object to communicate with the PDLA
private RemoteClient.Communicator pdlaClient;
The pdlaClient will host all the interaction with the PDLA.
Before you can use it, though, you have to 'new' the object. Go
back to the Form view, and double click on an unused area of
the form. This takes you to the
you can insert the following line:
pdlaClient = new RemoteClient.Communicator();
9 Before you can talk to the PDLA, you have to establish a link to it. Place a
Button on the form and name it
the button to edit the source code. This will place you at
This is where the connection to the PDLA is established. Place the following
lines inside the curly braces:
pdlaClient.Connectivity.Connect(tbPdlaName.Text);
pbConnect.Enabled = false;
You need to implement a disconnect method, since whenever
you connect, you need to disconnect when you are done. This
avoids a time-consuming clean up when a connection goes
stale and has to be clean out of the PDLA interface.
The second line grays out the Connect button so we don't
forget and connect twice.
10 Go to the Form display window, and click on a blank area of
the form to select the form. Go to the Properties window, and
select events (small yellow lightning bolt at top of form.) Find
and double click on the closing event. This will take you to
the Form1_Closing routine, where you can insert the
following lines:
pdlaClient.Connectivity.Disconnect();
pdlaClient.Connectivity.TerminateSession();
The first line disconnects from the PDLA itself, the second
line cleans up the pdlaClient.
11 Click the
button to compile the application. If there are
Run
errors, fix them before continuing. Once the compile is
successful, the application window will appear. Click the
button, and watch the PDLA front panel. A green
Connect
banner will appear on the PDLA, announcing Remote User
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
routine, where
Form1_Load
with text
pbConnect
Connect
pbConnect_Click
. Double click
.

Advertisement

Table of Contents
loading

Table of Contents