Agilent Technologies 86038B User Manual page 171

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
In
Step 9
above, the pdlaClient declared used the keyword
"WithEvents". This instructs Visual Basic to find the events and
make them available to you. Go into the code window and click
on the selector in the upper left corner (it probably says Form).
It presents a list of objects you have available. Select the
pdlaClient. Now click on the selector in the upper right corner
(it probably says SweepProgress.) You get a list of events you
can choose to receive and write code for. If the event is in light
gray, this indicates that you have not implemented it yet. If it is
in bold type face, there is code for it. You do not need to
implement all the events, just the ones you find useful.
The steps below walk through adding an event handler for
NewStatus.
1 Add a display line to show user status messages. Add a text
label as wide as the form, and call it lblStatus. Default the
caption to "PDLA Status."
2 Create the event function. Go to the code window. Click the
object selector in the upper left corner of the window, and
select pdlaClient. Now click the event method selector in the
upper right corner of the display, and select NewStatus. This
will take you to a function called pdlaClient_NewStatus, that
will be called when a new status message is displayed on the
PDLA. The first pass parameter is the message itself, the
second pass parameter is an enumerated type telling you if
the message was an error, informational, or a warning. To
display the status, insert the following line inside
pdlaClient_NewStatus:
lblStatus.Caption = Message
3 Click the
button, and connect to the PDLA. The first
Run
message you will see is the Client connected message. Press
on the PDLA and take a sweep. You will see the
Local
progress messages appearing on the application as the
171

Advertisement

Table of Contents
loading

Table of Contents