Agilent Technologies 86038A User Manual page 173

Optical dispersion analyzer
Table of Contents

Advertisement

Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition
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 Form1_Load routine, where
you can insert the following line:
odaClient = new RemoteClient.Communicator();
9 Before you can talk to the ODA, you have to establish a link to it. Place a Button
on the form and name it pbConnect with text Connect. Double click the button
to edit the source code. This will place you at pbConnect_Click. This is where
the connection to the ODA is established. Place the following lines inside the
curly braces:
odaClient.Connectivity.Connect(tbOdaName.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 ODA 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:
odaClient.Connectivity.Disconnect();
odaClient.Connectivity.TerminateSession();
The first line disconnects from the ODA itself, the second line cleans up the
odaClient.
11 Click the Run button to compile the application. If there are errors, fix them
before continuing. Once the compile is successful, the application window will
appear. Click the Connect button, and watch the ODA front panel. A green
banner will appear on the ODA, announcing Remote User Connected. If this does
not appear, it is most likely because the ODA Name is incorrect, or the ODA itself
is not properly configured for networking (check the LAN connection). Go to the
ODA front panel and select Help > About. The ODA name is on the About panel.
When the program is exited, it will disconnect from the ODA, leaving it free for
front panel or other remote use.
Remote Operation
173

Advertisement

Table of Contents
loading

Table of Contents