For IBM PC with PM 2201
Example 1
The following example runs on an IBM compatible PC
equipped with Fluke PM 2201 GPIB interface. The installa-
tion and starting up of the PC program is not described,
only the application program. Line 1 to 100 must contain
the declaration described in the PM 2201 manual.
The program sets up the counter for 10 Period A measure-
ments and presents the average result on the screen.
100
‘DEMO PROGRAM (NO 1)
110
‘PM6666 AND IBM PC
120
‘WITH PM2201 GPIB INTERFACE
130
‘AS CONTROLLER
140
CLS ‘CLEAR SCREEN
150
AD=7 ‘ADAPTOR NUMBER
160
ADDR=710 ‘COUNTER ADDRESS
170
SC=1 ‘SYSTEM CONTROLLER
180
RES$ = SPACE$(25) ‘RESULT
190
ACT = 0 ‘# READ CHARACTERS IN RES$
200
MAX = 24 ‘MAX CHARACTERS TO READ IN RES$
210
CALL IOINIT(AD,SC) ‘INIT INTERFACE
220
TIME=10 ‘TIMEOUT AFTER 10 SECONDS
230
CALL IOTIMEOUT (AD,TIME) ‘SET TIMEOUT
240
CALL IOCLEAR(ADDR) ‘SEND SDC
250
‘SELECT PERIOD A, TRIGGERED MODE
260
‘AND 1 S MEASURING-TIME
270
SEND$ = “PER A,TRIG ON,MTIME 1"
280
LENGTH=LEN(SEND$)
290
CALL IOOUTPUTS(ADDR,SEND$,LENGTH)
300
Z=0
310
‘INPUT 10 SAMPLES
320
FOR i = 1 TO 10
330
CALL IOTRIGGER(ADDR) ‘TRIGGER COUNTER
340
CALL IOENTERS(ADDR,RES$,MAX,ACT) ‘READ
RESULT
350
Z = Z + VAL(MID$(RES$,8,13))
360
NEXT I
370
PRINT “AVERAGE:”;Z/10;"S"
380
CALL IOLOCAL(ADDR) ‘GO TO LOCAL
390
END
Example of a result:
AVERAGE:
9.98004E–06 S
OK
Example 2
This program example illustrates the ‘program data out’
feature of PM 6666. By asking a set of queries, the
counter responds with its current setup. The output format
of these answers to the queries is identical to the program-
ming command format. The answers can be stored and
used later for reprogramming (bus learn).
100
‘DEMO PROGRAM
110
‘PM6666 AND IBM PC WITH PM2201
120
GPIB INTERFACE AS CONTROLLER
130
AD=7 ÁDAPTOR NUMBER
140
ADDR=710 ‘COUNTER ADDRESS
150
SC=1 ‘SYSTEM CONTROLLER
160
CALL IOINIT(AD,SC) ÍNIT INTERFACE
170
TIME=10 ‘TIMEOUT AFTER 10 SECONDS
180
CALL IOTIMEOUT(AD,TIME)
190
CLS ‘CLEAR SCREEN
200
ÁSK FOR AND PRINT PROGRAM DATA
210
PRINT “COUNTING SETTING:”
220
S$ = “FNC?”
230
GOSUB 520
240
A=1
250
GOSUB 550
260
S$ = “MEAC?”
270
GOSUB 520
280
A=2
290
GOSUB 550
300
S$ = “BUS?”
310
GOSUB 520
320
A=2
330
GOSUB 550
340
S$ = “INPA?”
350
PRINT “INPA:”
360
GOSUB 520
370
A=1
380
GOSUB 550
390
S$ = “INPB?”
400
PRINT “INPB:”
410
GOSUB 520
420
A=1
430
GOSUB 550
440
S$ = “ID?”
450
460
PRINT “COUNTER TYPE:”
470
GOSUB 520
480
A=1
490
GOSUB 550
500
CALL IOLOCAL (ADDR) ‘GO TO LOCAL
510
END
520
L=LEN(S$) ‘LENGTH OF STRING TO SEND
530
CALL IOOUTPUTS(ADDR,S$,L) ÓUTPUT STRING
540
RETURN
550
FOR I = 1 TO A
560
MAX=25
570
ACT=0
580
RES$=SPACE$(25)
590
CALL IOENTERS(ADDR,RES$,MAX,ACT)
600
B$ = LEFT$(RES$,ACT)
610
PRINT B$;
620
NEXT I
630
RETURN
Example of a result:
COUNTER SETTING:
TIME A;B
MTIME 1.00,FRUN ON
TOUT 00.0
MSR
000,OUTM 000
EIO OFF,SPR 010
INPA:
TRGSLP NEG
INPB:
TRGSLP POS
COUTER TYPE:
PM6666/016/22
Ok
GPIB-INTERFACE OPERATION
Page: 35
PM 6666 - OPERATORS MANUAL