C O M M A N D R E F E R E N C E
Programming Examples
7/01
MPS-8033
73
C H A P T E R
4
!
Programming Example: An MPS-8033 Driver
10
SUB
Mps8033dvr(Device_id,Command$,Response$,Err$)
20
’ A subroutine to drive the ILX Lightwave MPS−8033
Fiber Optic Source. This driver
30
’ provides bus timeout protection and looks for device
dependent errors.
40
50
ON ERROR GOTO handler
’ Watch for software errors
60
CALL Ibtmo(Device_id, 10)
’ Provide 300 mSec timeout on GPIB
70
80
Cmd_len% = LEN(Command$)
’ Get length of command string
90
IF (Cmd_len% > 0) THEN
100
CALL Ibwrt(Device_id,Command$)
’ Send the command
110
END IF
120
130
IF (INSTR(Command$,"?") THEN
’ Is the command a query?
140
CALL Ibrd(Device_id,Response$)
’ Get the response
150
END
160
170
CALL Ibwrt(Device_id,"*STB?")
’ Get the Status Byte
180
CALL Ibrd(Device_id,Status_byte%)
190
Err_bit% = Status_byte% AND 128
’ Is the error queue active bit set?
200
IF (Err_bit% > 0) THEN
210
CALL Ibwrt(Device_id,"ERR?")
’ Get the Error queue
220
CALL Ibrd(Device_id,Err$)
’ Report the Errors
230
PRINT "ERROR IN 8033 COMMUNICATIONS
DEVICE DEPENDENT ERROR"
240
PRINT "ERRORS ARE: " Err?
250
END IF
260
270
IF (Ibsta AND Timo) THEN PRINT "8033 GPIB
TIMEOUT"
’ Did the bus timeout?
280
EXIT SUB
290
300:
Handler
’ Did the software bomb?
310
PRINT "MISC SOFTWARE GENERATED ERRORS
IN 8033 DRIVER SUB"
320
END SUB
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание MPS-8033 Series
Страница 3: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 9: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 11: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 13: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 23: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 53: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 103: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 107: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 111: ...I N D EX iv MPS 8033 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...