Example Of Output In Binary Format - YOKOGAWA TA520 User Manual

Time interval analyzer gp-ib interface
Table of Contents

Advertisement

5.4 Example of Output in BINARY Format

5.4 Example of Output in BINARY Format
'*********************************************************************
'*
'*
'*
'*
'*********************************************************************
'*
'*
'*
'*********************************************************************
'
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 TSTAMP"
CALL IBWRT(TA%, CMD$)
CMD$ = "MEASURE:FUNCTION TI,AB"
CALL IBWRT(TA%, CMD$)
CMD$ = "SAMPLE:GATE:MODE EVENT"
CALL IBWRT(TA%, CMD$)
CMD$ = "SAMPLE:GATE:EVENTSIZE 1000"
CALL IBWRT(TA%, CMD$)
'
CMD$ = "STATUS:FILTER1 RISE"
CALL IBWRT(TA%, CMD$)
CMD$ = "STATUS:EESR?"
CALL IBWRT(TA%, CMD$)
RES$ = SPACE$(100)
CALL IBRD(TA%, RES$)
'
CMD$ = "SSTART"
CALL IBWRT(TA%, CMD$)
CMD$ = "COMMUNICATE:WAIT 1"
CALL IBWRT(TA%, CMD$)
'
CMD$ = "MEMORY:DATASELECT MEASUREDATA"
CALL IBWRT(TA%, CMD$)
CMD$ = "MEMORY:FORMAT BINARY;BYTEORDER LSBFIRST"
CALL IBWRT(TA%, CMD$)
'
ST% = 1: ED% = 1000
FOR I% = ST% TO ED% STEP 50
CMD$ = "MEMORY:START" + STR$(I%) + ";END" + STR$(I% + 49)
CALL IBWRT(TA%, CMD$)
CMD$ = "MEMORY:SEND?"
CALL IBWRT(TA%, CMD$)
RES$ = SPACE$(250)
CALL IBRD(TA%, RES$)
J% = VAL(MID$(RES$, 2, 1))
K% = VAL(MID$(RES$, 3, J%)) / 4
N% = J% + 3
FOR M% = 1 TO K%
NEXT M%
NEXT I%
'
V% = 0: CALL IBSRE(BD%, V%)
'
END
Output Example
1
2
3
4
5
6
7
8
9
10
:
:
5-4
TA520 Sample Program3 for GP-IB interface
Outputs the data measured in time stamp mode in binary format.
L% = CVI(MID$(RES$, N%, 2))
IF L% < 0 THEN D# = L% + 65536# ELSE D# = L%
H% = CVI(MID$(RES$, N% + 2, 2))
IF H% < 0 THEN D# = D# + (H% + 65536#) * 65536# ELSE D# = D# + H% * 65536#
D# = D# * .000000000025#
PRINT I% + M% - 1, D#
N% = N% + 4
.000000024075
.0000000259
.000000027850
.000000024225
.000000030625
.000000026425
.00000002
.0000000322
.00000002785
.0000000268
:
:
Microsoft QuickBASIC 4.0/4.5 Version
'Hardware histogram mode
'Time interval measurement
'Event gate
'Sampling size to 1000 points
'Set transition filter
'Clear extended event register
'Start single measurement
'Wait for measured data to become valid
'Set the type of data to retrieve
'Set the format
'Set the start and end points
'Retrieve 50 points at a time
'Request measured data
'Receive measured data
'Analyze the header section
'Convert binary to real number
'Display measured values
*
*
*
*
*
*
*
IM 704310-12E

Advertisement

Table of Contents
loading

Table of Contents