Agilent Technologies 86038A User Manual page 172

Optical dispersion analyzer
Table of Contents

Advertisement

Remote Operation
172
Starting a C# 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 C# project, a windows application. This creates a project with a
blank frame.
3 To add controls to the frame, click View > Toolbox.
4 From the toolbox, add a label with a Caption "ODA Name:" and a text box
named tbOdaName.
5 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 the ODA network name.)
6 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.
Select Browse, then navigate to C:\Program Files\Agilent\Agilent ODA
Remote Control. Click on InstrumentObjects.dll, then ctrl-click on
RemoteClient.dll (you can add both at once.) Click Open, which brings you back
to the References dialog. You will see the two dll's in the Selected Components
pane. Click OK, and InstrumentObjects and RemoteClient will appear in the
Solution Explorer on the right hand side of the Visual Studio window.
7 Controlling the ODA involves using lots of constants such as
eMeasurementType. The 'using' directive at the top of your C-sharp file lets you
use the ODA specific constants without fully qualifying them. At the head of your
C-sharp source file (right click on Form and select View Code), locate the block
of using statements. Add these at the end of the block:
using Agilent.LWD.Ag86038x.InstrumentObjects;
using Agilent.LWD.Ag86038x;
8 In the same source file as above, locate the summary description for
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 oda client object as a member.
Insert the following line after the Text Box and Label declarations:
// Declare a local object to communicate with the ODA
private RemoteClient.Communicator odaClient;
The odaClient will host all the interaction with the ODA. Before you can use it,
Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition
130.

Advertisement

Table of Contents
loading

Table of Contents