Application Programs 6
Keysight 34420A User’s Guide 247
Microsoft Visual Basic Language Program
This example was created in Microsoft
®
Visual Basic for Windows
™
. The example
uses the 82335B and GPIB control library. You must set up the GLOBAL.BAS to
provide access to the GPIB.DLL. The GLOBAL.BAS file is included with the
Keysight control libraries. In addition to the global declarations, the subroutine
check_srq is also included in the GLOBAL.BAS file.
The GPIB (IEEE-488) address is set to “22” when the meter is shipped from the
factory. The examples in this chapter assume a GPIB address of 22. When sending
a remote interface command, you append this address to the GPIB interface’s
select code (normally 7). Therefore, with an address of 22 and a select code of 7,
the combination is “722”.
Sub Command1_Click ()
Rem Set up interface variables
isc& = 7
device& = isc& * 100 + 22
swap% = 2
max% = 4000 * swap%
act% = 0
max1% = 50
TimeVal# = 10#
Rem Clear out text boxes
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Rem Set up the meter
errnum% = GpibOpen(isc&, hGpib%)
Call check_srq
errnum% = GpibReset(hGpib%, isc&)
Call check_srq
errnum% = GpibTimeout(hGpib%, isc&, TimeVal#)
Call check_srq
rst$ = "*RST; *CLS; *SRE 32; *ESE 60"
errnum% = GpibOutputS(hGpib%, device&, rst$, Len(rst$))
Call check_srq