beautypg.com

3 ieee sample host program – INFICON IC/5 Thin Film Deposition Controller User Manual

Page 187

background image

7 - 45

IP

N 07

4-

23

7A

E

IC/5 Operating Manual

7.8.2.3 IEEE Sample Host Program

This program demonstrates IEEE488 communications with an IC/5. This example
program was written using QuickBasic version 4.0 and used a national instruments
PCIIA IEEE488 card and drivers.

Below is a listing of the program’s variables:

bd0% . . . . . . unit descriptor identifying the GPIB

bd1% . . . . . . unit descriptor identifying the IC/5

CNT%. . . . . . size of command or maximum size of response

IBCNT% . . . . number of bytes read

CMD$ . . . . . . command string entered by user to be sent to IC/5

status%. . . . . status returned by national Instrument drivers

‘<<<<<<<<<< INITIALIZATION >>>>>>>>>>

REM $INCLUDE: ‘QBDECL4.BAS’

‘National Instruments include library

‘<<<<<<<<< OPEN DEVICES >>>>>>>>>>

begin:

bd0% = ILFIND(“gpib0”)

‘Open the GPIB.

bd1% = ILFIND(“ic5”)

‘Open the IC/5.

‘<<<<<<<<<< CLEAR DEVICES >>>>>>>>>>>

CALL IBCLR(bd0%)

‘Clear the GPIB.

CLS

‘Clear screen.

lup:

‘<<<<<<<<<< SEND COMMAND >>>>>>>>>>

PRINT

CALL IBCLR(bd1%)

‘Clear the IC/5.

INPUT “ENTER COMMAND STRING ”; CMD$

CMD$ = CMD$ + CHR$(&HA)

‘Add EOS character to command.

CNT% = LEN(CMD$)

‘Find length of command.

status% = ILWRT(bd1%, CMD$, CNT%)

‘Write command.

‘<<<<<<<<<< READ RESPONSE >>>>>>>>>>

msg$ = SPACE$(2000)

‘Make room for largest response.

CNT% = LEN(msg$)

status% = ILRD(bd1%, msg$, CNT%)

‘Read response.

‘<<<<<<<<< PRINT RESPONSE >>>>>>>>>>

msg$ = LEFT$(msg$, IBCNT%)

PRINT msg$;

GOTO lup

‘Get next command

END

To implement serial polling of the message available (MAV) bit the following lines
may be added to the IEEE488 program listed above. These lines would be added
immediately before the line: