Visual Basic Example Program - Agilent Technologies 3488 User Manual

Switch/control system
Table of Contents

Advertisement

Visual BASIC Example Program

This example program is written in Visual BASIC 6.0 and has been
tested on a PC running WIN95/NT. The example uses the 3488
commands. As the example is currently written, the program
requirements are:
GPIB interface selected and set to the address of 09 from the front-
panel;
Any one of the relay modules installed in Slot 1 of the mainframe;
A GPIB interface card installed in your PC with the VISA library.
Declare Sub Sleep Lib "Kernel32" (ByVal s As Long)
' Sleep( ) function declaration.
Sub main()
Dim drm As Long
Dim vi As Long
Dim status As Long ' VISA function status return code
Dim retStr As String * 128
' String returned from the instrument.
Dim str As String
On Error GoTo ErrorHandler
' Open default resource manager.
drm = -1
status = viOpenDefaultRM(drm)
If (status < VI_SUCCESS) Then GoTo VisaErrorHandler
' Open a session to 3499A/B/C.
INST_ADDR = "GPIB0::9::INSTR"
' Set 3499A/B/C GPIB address to 9 (default).
status = viOpen(drm, INST_ADDR, 0, 0, vi)
If (status < VI_SUCCESS) Then GoTo VisaErrorHandler
' Set 3499A/B/C to 3488A mode.
Call viVPrintf(vi, "SYSMODE HP3488A" + Chr$(10), 0)
Call Sleep(4000)
' Reset the instrument to a known state.
Call viVPrintf(vi, "RESET" + Chr$(10), 0)
Call Sleep( 4000 )
' Close channels 100 through 103.
Call viVPrintf(vi, "CLOSED 100, 101, 102, 103" + Chr$(10), 0)
' Open channels 100 through 103.
Call viVPrintf(vi, "OPEN 100, 101, 102, 103" + Chr$(10), 0)
Chapter 7 Application Programs
Visual BASIC Example Program
' Session to default resource manager.
' Session to instrument.
' String for individual channel number.
' Wait 4 seconds
4
7
141

Advertisement

Table of Contents
loading

This manual is also suitable for:

3499a3499b3499c

Table of Contents