
Sample Program
5-1
IM 704310-12E
5
Chapter 5 Sample Program
5.1
Before Writing the Program
Environment
PC
: IBM PC/AT compatible (using the AT-GPIB/TNT IEEE-488.2 board by
National Instruments)
Language : Quick-BASIC
Instrument Settings
Address 1
All sample programs in this chapter use address 1 for the instrument. Therefore, set the
GP-IB address of the instrument to 1 according to the procedures described on page 1-
4.
5.2 Setup Example
'*********************************************************************
'* *
'* TA520 Sample Program1 for GP-IB interface *
'* Microsoft QuickBASIC 4.0/4.5 Version *
'* *
'*********************************************************************
'* *
'* Set the TA520 as follows: *
'* Measurement mode : hardware histogram mode *
'* Measurement function: CHA, period measuremen *
'* Sampling size : 1000 *
'* *
'*********************************************************************
'
REM $INCLUDE: 'qbdecl4.bas'
'
DEVICE$ = "DEV1": CALL IBFIND(DEVICE$, TA%)
CALL IBSIC(TA%)
BORD$ = "GPIB0": CALL IBFIND(BORD$, BD%)
CALL IBSIC(BD%)
V% = 1: CALL IBSRE(BD%, V%)
CALL IBCLR(TA%)
'
CMD$ = "MEASURE:MODE HHISTOGRAM"
'Hardware histogram mode
CALL IBWRT(TA%, CMD$)
CMD$ = "MEASURE:FUNCTION PERIOD,A"
'CHA, period measurement
CALL IBWRT(TA%, CMD$)
CMD$ = "SAMPLE:GATE:MODE EVENT"
'Event gate
CALL IBWRT(TA%, CMD$)
CMD$ = "SAMPLE:GATE:EVENTSIZE 1000"
'Sampling size to 1000 points
CALL IBWRT(TA%, CMD$)
'
V% = 0: CALL IBSRE(BD%, V%)
'
END
5.1 Before Writing the Program/5.2 Setup Example