'************************************************************************* '** N7001SKP.BAS ** '** This example program shows how you can scan with the 7001, ** '** interrupt the scan, open all channels, close some very specific ** '** channels, wait some time, open the channels, and resume the ** '** original scan on the next channel where the scan was stopped at. ** '** This example uses the National Instruments AT-GPIB card and the ** '** NI488.2 Driver. ** '** ** '** Author: Jonathan L. Tucker ** '** Date: November 17, 1993 ** '** Copyright (c) Keithley Instruments, Inc. 1993 ** '************************************************************************* '$INCLUDE: 'QBDECL.bas' DIM instruments%(10) ' Instrument addr. space DIM result!(100) ' Allocate data space CLS '*** Initialize interface board CALL SendIFC(0) '*** Declare instrument addresses instruments%(0) = 7 ' 7001 Adrress instruments%(1) = NOADDR ' Null address '*** Reset the 7001 CALL DevClearList(0, instruments%()) '*** Remote Enable all devices CALL EnableRemote(0, instruments%()) '*** Setup 7001 for 40 channels to scan, 10 scans cmd$ = "*RST" ' Perform System Reset CALL Send(0, instruments%(0), cmd$, NLend) SLEEP 1 cmd$ = ":Open All" ' Open all relays CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Arm:Source Immediate" ' Arm layer immediate trig. CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Arm:Layer2:Source Immediate" ' Scan Layer Immediate trig. CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Arm:Layer2:Count INF" ' Set for Infinite scans CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Trigger:Source Timer;Timer .5" ' Channel Layer Timer Trigger CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Trigger:Count 40" ' 40 Triggers in Chan. Layer CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Scan (@1!1:1!40)" ' Set for 40 channels CALL Send(0, instruments%(0), cmd$, NLend) cmd$ = ":Initiate" ' Take 7001 out of idle CALL Send(0, instruments%(0), cmd$, NLend) '*** DO CLS PRINT "Press to interrupt scan..." WHILE INKEY$ = "": WEND '**** Send command to hold trigger process for scan cmd$ = ":trigger:source hold" CALL Send(0, instruments%(0), cmd$, NLend) '**** Send command to open all channels, close specific channels cmd$ = ":Route:Open all;Close (@1!1,1!20,1!35)" CALL Send(0, instruments%(0), cmd$, NLend) SLEEP 5 ' Wait 5 seconds '**** Send command to open all channels, then start the triggering '**** process up again by sending the trigger source command again. cmd$ = ":Route:Open all;:Trigger:Source timer" CALL Send(0, instruments%(0), cmd$, NLend) LOOP UNTIL INKEY$ <> "" END