Agilent 86038B Photonic Dispersion and Loss Analyzer,
Second Edition
171
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
Run
button, and connect to the PDLA. The first
message you will see is the Client connected message. Press
Local
on the PDLA and take a sweep. You will see the
progress messages appearing on the application as the
Summary of Contents for 86038B
Page 1: ...Agilent 86038B Photonic Dispersion and Loss Analyzer User s Guide ...
Page 4: ...4 ...
Page 20: ...20 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 34: ...34 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition Figure 2 b Rear Panel ...
Page 78: ...78 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 92: ...92 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 202: ...202 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition End Sub ...
Page 348: ...348 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 349: ......