Agilent Technologies 86038A User Manual page 128

Optical dispersion analyzer
Table of Contents

Advertisement

Remote Operation
How to Use This Chapter
N O TE
128
Depending on your familiarity with programming client/server models, you
will want to use this chapter differently. If the subject is new to you, read
the background material in this chapter and then go through Example 1
step-by-step for a complete introduction to creating a client application. If
the client/server model is familiar, you may wish to start with "Complete
Source Code" on page 179, then review the "Recommended Control
Sequence" on page 130. You will find the "Front Panel Maps" on page 147
very useful for identifying specific commands.
Note that
"Example 1: Simple Application for Controlling the ODA"
consists of the same simple program implemented three times: once in VB
6.0, VB.NET and C# respectively. Choose the version for the language you
are most likely to use.
Example 1 is presented in a series of steps, meant to be manually typed in
(or pasted from the electronic version of this manual). The example shows
you how to create a project and all the steps it takes to interface with the
ODA.
Example 2 demonstrates how to transfer data directly into Microsoft Excel,
using Excel 2000 or later. Example 2 uses a VBA macro which is very
similar to VB 6.0.
Example 3 provides a set of LabView vi's allowing you to easily control the
ODA from LabView.
Example 4 is a complete application for taking ODA measurements at
specific intervals over a period of time. It demonstrates proper error
handling and includes considerably more safety checking than the other
examples do.
A VC++ remote programming example has not been provided because:
• .NET passes its arrays to COM as Safe Arrays. This is easily handled by
VB 6.0 but VC++ takes a lot of extra work. The Class Wizard cannot handle them
all. Programmatically it takes a bit of code to do this on the VC++ side (but ac-
cording to the documentation it can be done). This primarily affects the retrieval
of the raw data array.
• VC++ has difficulty dealing with two DLLs that have interdependencies. The Re-
moteClient DLL uses data types in the InstrumentObjects DLL. One example
used the Class Wizard and converted all the data types to basic data types, for
example, int, double, and long. The InstrumentObjects data types are much eas-
ier to use.
• Events may not be threadsafe in VC++. Internally in the RemoteClient, code has
been added to pass the events to the clients GUI thread. This may not work in
VC++ and the client may have to do this.
Agilent 86038A Optical Dispersion Analyzer, Third Edition
Overview

Advertisement

Table of Contents
loading

Table of Contents