E4990A Help
272
• Overview
• Sample Program in Excel VBA
Other topics about Starting a Measurement (Trigger) and Detecting the
Completion
Overview
The program listed in the below section is written in VISA-COM with Excel
VBA. It can be executed from the external PC controller. The program
demonstrates how to detect occurrence of an error.
Detecting Occurrence of an Error Sample Program in Excel VBA
Option Explicit
Implements VisaComLib.IEventHandler
Dim ioMgr As VisaComLib.ResourceManager
Dim Ana As VisaComLib.FormattedIO488
Dim SRQ As VisaComLib.IEventManager
Private Sub IEventHandler_HandleEvent(ByVal Ana As VisaComLib.IEventManager, ByVal SRQevent
As VisaComLib.IEvent, ByVal userHandle As Long)
Call readErr
End Sub
Private Sub UserForm_Initialize()
' The variables of the resource manager
Set ioMgr = New VisaComLib.ResourceManager
Set Ana = New VisaComLib.FormattedIO488
Set Ana.IO = ioMgr.Open("GPIB0::17::INSTR")
Set SRQ = Ana.IO
SRQ.InstallHandler EVENT_SERVICE_REQ, Me, 1, 0
SRQ.EnableEvent EVENT_SERVICE_REQ, EVENT_HNDLR
With Ana
.WriteString "*RST"
.WriteString "*ESE 60"
.WriteString "*SRE 32"
.WriteString "*CLS"
End With
End Sub