Agilent Technologies 86038B User Manual page 193

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

Agilent 86038B Photonic Dispersion and Loss Analyzer, Second 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 new
ODARemoting.NewStatusDelegate, and add 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:
pdlaClient.TriggerProgress += this.TriggerHandler;
To unregister the handler, find the line where you -=
this.NewStatusHandler and add the following line:
pdlaClient.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 PDLA and save it to a file
double[] gainData;
double xStart;
double xStop;
193

Advertisement

Table of Contents
loading

Table of Contents