Agilent Technologies 86038A User Manual page 177

Optical dispersion analyzer
Table of Contents

Advertisement

Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition
The TriggerProgress event has two pass parameters – enumStatus and
enumAcquisitionMode to determine the type of trigger event (that is
measurement, normalization, and so on) and then checks the enumStatus to
see if the measurement is finished. To declare the delegate, go to the source
code window and find the line where we declare the NewStatusHandler, and
add this line after it:
private ODARemoting.TriggerProgressDelegate TriggerHandler;
4 Find the line where you
this line after it:
this.TriggerHandler = new ODARemoting.TriggerProgressDelegate(
this.TriggerProgessEvent );
To register the handler, find the line where you += this.NewStatusHandler; and
add the following line:
odaClient.TriggerProgress += this.TriggerHandler;
To unregister the handler, find the line where you -= this.NewStatusHandler
and add the following line:
odaClient.TriggerProgress -= this.TriggerHandler;
5 Create the event function. In this function you have to check the
enumAcquisitionMode to see if the trigger has to do with a measurement (could
be a normalization) and then check the enumStatus to see if the measurement
is finished, indicating data is available. If so, call sendDataToFile().
In the source code file, find where NewStatusEvent is declared, and add this
function after it:
private void TriggerProgressEvent( ODACommon.enumStatus status,
ODACommon.enumAcquisitionMode acqMode )
{
if (acqMode == ODACommon.enumAcquisitionMode.eMeasurement)
{
// Instrument is making a measurement
if (status == ODACommon.enumStatus.COMPLETE)
{
// The measurement is done, transfer data!
sendDataToFile("c:\mydata.txt");
}
}
}
6 Add the sendDataToFile function. This is a very simple implementation using
text streams:
private void sendDataToFile(string fileName)
{
// Transfer the gain data over from the ODA and save it to a file
double[] gainData;
double
xStart;
double
xStop;
double
xStep;
int
npoin;
string
buf;
new
ODARemoting.NewStatusDelegate, and add
Remote Operation
177

Advertisement

Table of Contents
loading

Table of Contents