Agilent Technologies 86038A User Manual page 164

Optical dispersion analyzer
Table of Contents

Advertisement

Remote Operation
164
Starting a VB.NET ODA Application
Install Software
Refer to "Recommended Control Sequence" on page
Application Shell
The following steps show you how to build a simple shell to connect to the
ODA.
1 Run Visual Studio .NET.
2 Open a new project and save it to a local directory. Use the default file name of
WindowsApplication1.
This creates a project with a blank frame. To add controls to the frame, click
View > Toolbox (or click the icon on the toolbar.)
3 From the toolbox, add a label with a Caption "ODA Name:" and a text box named
tbOdaName. In the Properties dialog, click on Text and type the network name
of your ODA as the default text.(Refer to ODA Help > About to find your ODA
network name.
4 From the main menu, click Project > Add Reference. This brings up a dialog that
defaults to the .NET tab. You will be adding the .NET incarnation of the ODA.
5 Select Browse, then navigate to C:\Program Files\Agilent\Agilent ODA
Remote Control.
6 Click InstrumentObjects.dll, then ctrl-click on RemoteClient.dll (you can add
both at once.) Select Open, which brings you back to the References dialog. You
will see the two dll's in the Selected Components pane. Select OK, and
InstrumentObjects and RemoteClient will appear in the Solution Explorer on the
right side of the Visual Studio window.
7 Right click on the form and select View Code. This brings up a simple From1.vb
code window. Find the line that reads:
Inherits System.Windows.Forms.Form. and add right after that line the
oda client object as a member:
Private WithEvents odaClient As RemoteClient.Communicator
The odaClient will host all the interaction with the ODA. 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 Form1_Load routine, where
you can insert the following line:
odaClient = New RemoteClient.Communicator()
8 Before you can interface with the ODA, you need to establish a link to it. Place a
Button on the form, name it pbConnect with text Connect. Double click the
button to edit the source code. This will place you at pbConnect_Click. To
establish the connection to the ODA, place the following lines between the
Private Sub ... End Sub block:
Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition
130.

Advertisement

Table of Contents
loading

Table of Contents