Example 3
This program prompts the user to input a programming
sequence. The sequence is then sent to the PM 6669
and the corresponding measuring result is read.
Let us as an example select Single Period measure-
ments, without AUTO-triggering (gives faster operation).
100 ’DEMO PROGRAM
110 ’PM6669 AND IBM PC WITH PM2201
120 ’GPIB INTERFACE AS CONTROLLER
130 CLS ’CLEAR SCREEN
140 AD=7 ’ADAPTOR NUMBER
150 ADDR=710 ’COUNTER ADDRESS
160 SC=1 ’SYSTEM CONTROLLER
170 CALL IOINIT(AD,SC) ’INIT INTERFACE
180 TIME=10 ’TIMEOUT AFTER 10 SECONDS
190 CALL IOTIMEOUT (AD,TIME)
200 CALL IOCLEAR(ADDR) ’SEND SDC
210 PRINT "INPUT YOUR PROGRAMMING MESSAGE?"
220 PRINT "(TO QUIT THE PROGRAM, ANSWER *)"
230 LINE INPUT S$
240 L=LEN(S$) ’LENGTH OF STRING TO SEND
250 IF L<>1 GOTO 280
260 IF S$<>"*" GOTO 280
270 END
280 CALL IOOUTPUTS(ADDR,S$,L) ’OUTPUT STRING
290 ’TO BE SURE, TRIGGER COUNTER!
300 CALL IOTRIGGER(ADDR)
310 ’GET THE MEASURING RESULT
320 MAX=25
330 ACT=0
340 RES$=SPACE$(25)
350 CALL IOENTERS(ADDR,RES$,MAX,ACT)
360 PRINT
370 PRINT "RESULT READ AS: ";RES$
380 PRINT
390 GOTO 210
Example of a result:
INPUT YOUR PROGRAMMING MESSAGE?
(TO QUIT THE PROGRAM, ANSWER *)
PER A,MTIME 0
RESULT READ AS: PER 0000001.00E-5
INPUT YOUR PROGRAMMING MESSAGE?
(TO QUIT THE PROGRAM, ANSWER *)
For IBM PC with IBM GPIB
This example runs on an IBM PC with an ‘IBM General
Purpose Interface Bus Adapter’ instead of the Fluke
PM 2201 interface.
The following set of device parameters is suitable for a
PM 6669 with address 10. The device parameters are
set with the configuration program ‘IBCONF’, see the
IBM adapter manual.
Example 1
The following program sets up the counter for 10 Period
A measurements and presents the average result on the
screen.
100 ’DEMO PROGRAM
110 ’PM6669 AND IBM PC WITH IBM
120 ’GPIB ADAPTOR AS CONTROLLER
130 CLS ’CLEAR SCREEN
140 ’INIT
150 ADNAME$ = "COUNTER"
160 CALL IBFIND(ADNAME$,CNT%)
170 ’SEND SDC
180 CALL IBCLR(CNT%)
190 ’SELECT PERIOD A, TRIGGED MODE
200 ’AND MEASURING TIME 1 S
210 WRT$ = "PER A,TRIG ON,MTIME 1"
220 CALL IBWRT (CNT%,WRT$)
230 ’INPUT 10 SAMPLES
240 Z=0
250 FOR I= 1 TO 10
260 CALL IBTRG(CNT%) ’TRIGGER COUNTER
270 CALL IBRD(CNT%,RD$) ’READ RESULT STRING
280 Z = Z + VAL (MID$(RD$,8,13))
290 NEXT I
300 PRINT "AVERAGE:";Z/10;"S"
310 CALL IBLOC(CNT%) ’GO TO LOCAL
320 END
Example of a result:
AVERAGE: 9.980422E-06 S
Ok
Device Name: COUNTER DEVICE PARAMETERS Number: D 0
DESCRIPTION NEW VALUE VALID NAME
Access Adapter Name? GPIB0 [GPIBx]
Primary GPIB Address? 0AH [0H to 1EH]
Secondary GPIB Address? 00H [60H to 7EH; 0H disables]
Timeout setting? T10s
EOS Byte? 0AH [0H to FFH or '<character>]
Terminate Read on EOS? Yes [Yes or No]
Send EOI with EOS byte? No [Yes or No]
Use 8-bit Compare on EOS? No [Yes or No]
Send EOI w/last Byte of Write? Yes [Yes or No]
[T10us to T1000s;TNONE disables]
±
±
±
±
±
±
Page: 34 GPIB-INTERFACE OPERATION
PM 6669 - OPERATORS MANUAL