294
Chapter 8 Application Programs
Visual BASIC Example Program
8
' Set RS-232 interface parameters when USING_RS232 equals 1.
If USING_RS232 Then
Call viSetAttribute(vi, VI_ATTR_ASRL_BAUD, 9600)
Call viSetAttribute(vi, VI_ATTR_ASRL_DATA_BITS, 8)
Call viSetAttribute(vi, VI_ATTR_ASRL_STOP_BITS,_
VI_ASRL_STOP_ONE)
Call viSetAttribute(vi, VI_ATTR_ASRL_FLOW_CNTRL,_
VI_ASRL_FLOW_NONE)
Call viSetAttribute(vi, VI_ATTR_ASRL_PARITY, VI_ASRL_PAR_NONE)
End If
' Set the 3499A/B/C to SCPI mode.
Call viVPrintf(vi, "SYSMODE SCPI" + Chr$(10), 0)
Call Sleep(4000) ' Wait 4 seconds
' Reset the instrument to a known state.
Call viVPrintf(vi, "*RST" + Chr$(10), 0)
Call Sleep(4000)
' Close channels 100 through 103.
Call viVPrintf(vi, "CLOSE ( @ 100:103)" + Chr$(10), 0)
' Open channels 100 through 103.
Call viVPrintf(vi, "OPEN ( @ 100:103)" + Chr$(10), 0)
' Scanning setup: the following commands make the instrument scan
' channels 100 through 103 two times. The channels are scanned
' continuously and the second scan sweep starts 1 second after the
' start of the first scan sweep.
' Create a scan list 100 through 103.
Call viVPrintf(vi, "SCAN (@100:103)" + Chr$(10), 0)
' Set arm source to TIMER.
Call viVPrintf(vi, "ARM:SOURCE TIMER" + Chr$(10), 0)
' Interval time between two scan sweeps is 1 second.
Call viVPrintf(vi, "ARM:TIMER 1" + Chr$(10), 0)
' Set scan sweep two times.
Call viVPrintf(vi, "ARM:COUNT 2" + Chr$(10), 0)
' Set trigger source to IMM (default).
Call viVPrintf(vi, "TRIG:SOURCE IMM" + Chr$(10), 0)
' Set trigger source to IMM (default).
Call viVPrintf(vi, "CHAN:DELAY 0, (@100:103)" + Chr$(10), 0
' Start scanning.
Call viVPrintf(vi, "INIT" + Chr$(10), 0)
' Set visa time-out value to 10 seconds
Call viSetAttribute(vi, VI_ATTR_TMO_VALUE, 10 * 1000)
' *OPC command will wait until scan finished.
Call viVQueryf(vi, "*OPC?" + Chr$(10), "%t*", retStr)
viClose (vi)' Close session to 3499A/B/C.
viClose (drm)' Close session to default resource manager.
End
Summary of Contents for Agilent 3499A
Page 13: ...1 1 Quick Start ...
Page 27: ...2 2 Front Panel Operation ...
Page 55: ...3 3 System Overview ...
Page 77: ...4 4 Features and Functions ...
Page 113: ...5 5 Remote Interface Reference ...
Page 164: ...164 5 ...
Page 165: ...6 6 Error Messages ...
Page 173: ...7 7 Plug in Modules ...
Page 256: ...256 Chapter 7 Plug in Modules 44475A Breadboard Module 7 ...
Page 261: ...261 Chapter 7 Plug in Modules 44476B Microwave Switch Module 4 7 The 44476B is shown below ...
Page 286: ...286 Chapter 7 Plug in Modules Terminals and Connections Information 7 ...
Page 288: ...288 7 ...
Page 289: ...8 8 Application Programs ...
Page 299: ...9 9 Specifications ...
Page 343: ...343 Chapter 9 Specifications 44475A Breadboard Module 4 9 ...