7 example of ieee488 program – INFICON XTC/C Thin Film Deposition Controller User Manual
Page 102
3 - 38
IP
N 07
4-
18
3X
XTC/C - XTC/2 Operating Manual
3.8.7 Example of IEEE488 Program
10 ’----------------------XTC/2 GPIB COMMUNICATIONS PROGRAM--------------------
20 ’------THIS PROGRAM IS DESIGNED TO TRANSMIT INDIVIDUAL COMMANDS TO THE XTC/2
AND ACCEPT THE APPROPRIATE RESPONSE FROM THE XTC/2, WRITTEN IN GWBASIC 2.32.
30 ’
40 ’----THE NEXT 5 LINES DEFINE THE IEEE DRIVERS USED AND ARE SPECIFIC TO THE
PARTICULAR IEEE BOARD IN YOUR COMPUTER AND THE LANGUAGE USED--------
50 ’
60 CLEAR ,55000! : IBINIT1 = 55000! : IBINIT2 = IBINIT1 + 3
70
BLOAD "bib.m",IBINIT1
80 CALL IBINIT1(IBFIND,IBTRG,IBCLR,IBPCT,IBSIC,IBLOC,IBPPC,IBBNA,IBONL,IBRSC,
IBSRE,IBRSV,IBPAD,IBSAD,IBIST,IBDMA,IBEOS,IBTMO,IBEOT,IBRDF,IBWRTF)
90 CALL IBINIT2(IBGTS,IBCAC,IBWAIT,IBPOKE,IBWRT,IBWRTA,IBCMD,IBCMDA,IBRD,IBRDA,
IBSTOP,IBRPP,IBRSP,IBDIAG,IBXTRC,IBRDI,IBWRTI,IBRDIA,IBWRTIA,IBSTA%,IBERR%,IBCNT%)
100 ’
110 GPIB$="GPIB0" :CALL IBFIND(GPIB$,GPIB%)
’--OPEN BOARD FOR COMM
120 CALL IBSIC(GPIB%)
’--SEND INTERFACE CLEAR
130 XTC2$="XTC2" : CALL IBFIND(XTC2$,XTC2%)
’--OPEN DEVICE 0
140 V% = &HA
’--SET THE END OF STRING
150 CALL IBEOS(GPIB%,V%)
’ BYTE TO LINE FEED
160 V%=1 : CALL IBEOT(XTC2%,V%)
’--ASSERT EOI ON WRITE
170 V%=12 : CALL IBTMO(XTC2%,V%)
’--SET THREE SEC TIMEOUT
180 INPUT "ENTER COMMAND";COMMAND$
’--ENTER COMMAND TO XTC/2
190 CALL IBCLR(XTC2%)
’--CLEAR THE XTC/2 COMM
200 GOSUB 240
’--GOTO TRANSMIT COMMAND
SUBROUTINE.
210 PRINT I$
’--PRINT XTC/2 RESPONSE
220 GOTO 180
’--LOOP BACK FOR ANOTHER COMMAND.
230 ’
240 ’----TRANSMIT COMMAND & RECEIVE RESPONSE SUBROUTINE----
250 ’
260 ’----SEND COMMAND MESSAGE STREAM TO THE XTC/2----
270 COMMAND$ = COMMAND$ + CHR$(&HA)
280 CALL IBWRT(XTC2%,COMMAND$)
290 ’
300 ’----RECEIVE RESPONSE MESSAGE FROM THE XTC/2----
310 ’
320 I$=SPACE$(40) : CALL IBRD(XTC2%,I$)
330 IF (IBSTA% AND &H4000) THEN 340 ELSE 350
’--INDICATE IF A RESPONSE
340 PRINT "RECEIVE TIMEOUT": GOTO 180
’ IS NOT RECEIVED WITHIN
350 RETURN
’ 3 SECS.
To implement serial polling of the Message Available (MAV) bit the following
lines may be added to the IEEE488 program listed above.
285 CALL IBRSP (XTC2%,SPR%)
287 B = SPR% / 16: B = INT(B)
289 IF B = 1 THEN 290 ELSE 285
After sending a command to the XTC/2 the Status Byte is polled. The response
to the command is retrieved only after the MAV bit is set (2^4 = 16).
To implement serial polling of the Request for Service bit you need only test for
the RQS bit to be set.