Keithley Instruments 2001 Specifications Sheet

QuickBASIC 4.5 and Microsoft BASIC 7.1
Quick C2.5
Turbo Pascal 6.0
Model 2001 Multimeter and Model 7001 / 7002 Switch System
Contains Programming Information
IEEE-488 Interfaces Supported
Capital Equipment Corporation, v2.14 or later
National Instruments NI-488 rev C.10 or later
National Instruments NI-488.2 for PC/II/IIA or AT-GPIB rev 1.5
IOtech Driver 488, v2.6 or later
© 1993 Keithley Instruments, Inc.
Test Instrumentation Group
All Rights Reserved
Cleveland, Ohio, U.S.A.
2001-906-01 Rev. A
QuickBASIC 4.5 and Microsoft BASIC 7.1
pages 1 through 84
Quick C2.5
pages 85 through 178
Turbo Pascal 6.0
pages 179 through 262
All Keithley product names are trademarks or registered trademarks of Keithley Instruments, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders.
QuickBASIC 4.5 and
Microsoft BASIC 7.1

Table of Contents

Section 1 — Using the Library Routines............................................................................7
1.1 Installation ..................................................................................................................................................... 7
1.1.1 National Instruments GPIB.COM ....................................................................................................... 7
1.1.2 Capital Equipment Corp....................................................................................................................... 7
1.1.3 IOTech Driver 488 .................................................................................................................................. 7
1.1.4 Microsoft BASIC 7.1 .............................................................................................................................. 7
1.1.5 QuickBASIC 4.5...................................................................................................................................... 8
1.2 General Instructions ..................................................................................................................................... 8
1.2.1 Microsoft BASIC 7.1 .............................................................................................................................. 8
1.2.2 QuickBASIC 4.5...................................................................................................................................... 9
1.2.3 Documentation Notes ........................................................................................................................... 9
Section 2 — Model 2001/7001 IEEE-488 Interface Routines...........................................11
2.1 FUNCTION SetupIEEE%(Device%, Address%).....................................................................................11
2.2 SUB SendSDC2001...................................................................................................................................... 12
SUB SendSDC7001
2.3 FUNCTION Q2001$(Cmd$)...................................................................................................................... 12
FUNCTION Q7001$(Cmd$)
2.4 SUB Send2001(Cmd$) ................................................................................................................................ 13
SUB Send7001(Cmd$)
2.5 SUB SendGET2001...................................................................................................................................... 13
SUB SendGET7001
2.6 FUNCTION Wait2001RQS% ..................................................................................................................... 14
FUNCTION Wait7001RQS%
Section 3 — Model 2001 Buffer Routines .......................................................................15
3.1 FUNCTION BufferSize2001%................................................................................................................... 15
3.2 FUNCTION Take2001BufferReadings% (Func%, BurstMode%, NumDataPoints1%,
Compact%)................................................................................................................................................... 15
3.3 FUNCTION Read2001BufferS% (ArrayName!(), DMA%, Fmt%)....................................................... 16
FUNCTION Read2001BufferD% (ArrayName#(), DMA%, Fmt%)
Section 4 — General Routines ........................................................................................19
4.1 FUNCTION ParseQuery$(Quer$, QuerNum%) .................................................................................... 19
4.2 FUNCTION Str1$(DoubleNumber#)....................................................................................................... 20
4.3 FUNCTION IOTECH$(Address%) .......................................................................................................... 20
4.4 SUB XYGraphS(XArray!(), YArray!(), YStart%, YStop%, XTitle$, YTitle$, Title$,
UseCGA2%, MaxMinScale%).................................................................................................................... 20
SUB XYGraphD(XArray#(), YArray#(), YStart%, YStop%, XTitle$, YTitle$, Title$, UseCGA2%, MaxMinScale%)
1
4.5 SUB DataViewS(DataArray!(), NumDataPoints%)................................................................................ 21
SUB DataViewD(DataArray#(), NumDataPoints%)
4.6 FUNCTION AutoGraphicsMode% (NumYPixels%, NumTextRows%, UseCGA2%)...................... 22
Section 5 — General Model 2001/7001 Routines...........................................................23
5.1 SUB Set2001Function(Func%)................................................................................................................... 23
5.2 FUNCTION Get2001Units$(Func%) ....................................................................................................... 23
5.3 FUNCTION Get2001SaveRecallSize% .................................................................................................... 24
5.4 FUNCTION Get2001FuncHeader$(Func%)............................................................................................ 25
5.5 FUNCTION Get2001Func% ...................................................................................................................... 25
5.6 FUNCTION Check2001Val$(CheckVal#, MinVal#, MaxVal#, CheckMinInf%)................................ 26
5.7 SUB Hit2001Key(HitKey%)....................................................................................................................... 26
5.8 SUB Disp2001(line1$, line2$) .................................................................................................................... 27
SUB Disp7001(line1$, line2$)
5.9 SUB NoDisp2001......................................................................................................................................... 27
SUB NoDisp7001
Section 6 — Model 2001 SENSe[1] Subsystem Commands.............................................29
6.1 Model 2001 Function Change Subroutines ............................................................................................. 29
6.1.1 SUB DCV2001....................................................................................................................................... 29
6.1.2 SUB ACV2001....................................................................................................................................... 29
6.1.3 SUB DCA2001 ...................................................................................................................................... 29
6.1.4 SUB ACA2001....................................................................................................................................... 30
6.1.5 SUB RES2.2001 ..................................................................................................................................... 30
6.1.6 SUB RES4.2001 ..................................................................................................................................... 30
6.1.7 SUB FREQ2001..................................................................................................................................... 30
6.1.8 SUB TEMP2001 .................................................................................................................................... 30
6.2 Return Model 2001 Reading Functions ................................................................................................... 30
6.2.1 FUNCTION Get2001Rdg$.................................................................................................................. 30
6.2.2 FUNCTION GetDCV2001$ ................................................................................................................ 31
6.2.3 FUNCTION GetACV2001$ ................................................................................................................ 31
6.2.4 FUNCTION GetDCA2001$............................................................................................................... 31
6.2.5 FUNCTION GetACA2001$................................................................................................................ 32
6.2.6 FUNCTION Get2RES2001$................................................................................................................ 32
6.2.7 FUNCTION Get4RES2001$................................................................................................................ 32
6.2.8 FUNCTION GetFREQ2001$............................................................................................................... 32
6.2.9 FUNCTION GetTEMP2001$.............................................................................................................. 32
6.3 DC Voltage Functions................................................................................................................................ 33
6.3.1 SUB Set2001DCV(Range#, Time#, Digits#).................................................................................... 33
6.3.2 FUNCTION Set2001DCVQ$.............................................................................................................. 33
6.3.3 SUB Auto2001DCV(AutoRange%, AutoTime%, AutoDigits%).................................................... 34
6.3.4 FUNCTION Auto2001DCVQ$........................................................................................................... 34
6.4 AC Voltage Functions................................................................................................................................. 35
6.4.1 SUB Set2001ACV(Range#, Time#, Digits#) ....................................................................................35
6.4.2 FUNCTION Set2001ACVQ$.............................................................................................................. 35
2
6.4.3 SUB Auto2001ACV(AutoRange%, AutoTime%, AutoDigits%).................................................... 36
6.4.4 FUNCTION Auto2001ACVQ$........................................................................................................... 36
6.5 DC Current Functions................................................................................................................................ 37
6.5.1 SUB Set2001DCA(Range#, Time#, Digits#).....................................................................................37
6.5.2 FUNCTION Set2001DCAQ$.............................................................................................................. 37
6.5.3 SUB Auto2001DCA(AutoRange%, AutoTime%, AutoDigits%).................................................... 38
6.5.4 FUNCTION Auto2001DCAQ$ .......................................................................................................... 38
6.6 AC Current Functions......................................................................................................................... 39
6.6.1 SUB Set2001ACA(Range#, Time#, Digits#).....................................................................................39
6.6.2 FUNCTION Set2001ACAQ$.............................................................................................................. 39
6.6.3 SUB Auto2001ACA(AutoRange%, AutoTime%, AutoDigits%) .................................................. 40
6.6.4 FUNCTION Auto2001ACAQ$ .......................................................................................................... 40
6.7 2-Wire Resistance Functions...................................................................................................................... 41
6.7.1 SUB Set2001R2(Range#, Time#, Digits#)......................................................................................... 41
6.7.2 FUNCTION Set2001R2Q$ .................................................................................................................. 41
6.7.3 SUB Auto2001R2(AutoRange%, AutoTime%, AutoDigits%)........................................................ 42
6.7.4 FUNCTION Auto2001R2Q$............................................................................................................... 42
6.8 4-Wire Resistance Functions...................................................................................................................... 43
6.8.1 SUB Set2001R4(Range#, Time#, Digits#)......................................................................................... 43
6.8.2 FUNCTION Set2001R4Q$ .................................................................................................................. 43
6.8.3 SUB Auto2001R4(AutoRange%, AutoTime%, AutoDigits%)........................................................ 44
6.8.4 FUNCTION Auto2001R4Q$............................................................................................................... 44
6.9 Frequency Functions .................................................................................................................................. 45
6.9.1 SUB Set2001F(Digits#, Source%)....................................................................................................... 45
6.9.2 FUNCTION Set2001FQ$..................................................................................................................... 45
6.10 Temperature Functions .............................................................................................................................. 46
6.10.1 SUB Set2001T(Time#, Digits#)........................................................................................................... 46
6.10.2 FUNCTION Set2001TQ$ .................................................................................................................... 46
6.10.3 SUB Auto2001T(AutoTime%, AutoDigits%) ................................................................................... 47
6.10.4 FUNCTION Auto2001TQ$................................................................................................................. 47
6.10.5 SUB Set2001RTD(Mode%, RType%, Alpha#, Beta#, Delta#, RZero#)......................................... 47
6.10.6 FUNCTION Set2001RTDQ$............................................................................................................... 48
6.10.7 SUB Set2001TC(TType$) ..................................................................................................................... 48
6.10.8 FUNCTION Set2001TCQ$.................................................................................................................. 49
Section 7 — Model 2001/7001 Status Commands..........................................................51
7.1 SUB Stat2001(Event2001%, PTF%, NTF%, SEN%)................................................................................. 51
SUB Stat7001(Event7001%, PTF%, NTF%, SEN%)
7.2 FUNCTION Stat2001Q$(Event2001%) ................................................................................................... 52
FUNCTION Stat7001Q$(Event7001%)
7.3 SUB SRE2001(mask%)................................................................................................................................ 52
SUB SRE7001(mask%)
7.4 SUB ESE2001(mask%) ................................................................................................................................ 53
SUB ESE7001(mask%)
7.5 FUNCTION OPC2001$(UnInterruptable%) ........................................................................................... 53
FUNCTION OPC7001$(UnInterruptable%)
3
7.6 SUB Clear2001 ............................................................................................................................................. 54
SUB Clear7001
Section 8 — Model 2001/7001 Scanning Commands .....................................................55
8.1 SUB Close2001(Channel%)........................................................................................................................ 55
8.2 SUB Close7001(ChanList$) ........................................................................................................................ 55
8.3 FUNCTION Close2001Q$.......................................................................................................................... 56
FUNCTION Close7001Q$
8.4 SUB Open2001(Channel%)........................................................................................................................ 56
8.5 SUB Open7001(ChanList$) ........................................................................................................................ 57
8.6 SUB Scan2001(ChanList$).......................................................................................................................... 57
SUB Scan7001(ChanList$)
8.7 SUB Arm2001(Count1#, Source1$, Count2#, Delay2#, Source2$) ...................................................... 57
SUB Arm7001(Count1#, Source1$, Count2#, Delay2#, Source2$)
8.8 FUNCTION Arm2001Q$ ........................................................................................................................... 58
FUNCTION Arm7001Q$
8.9 SUB Trig2001(Count1#, Delay1#, Source1$)........................................................................................... 59
SUB Trig7001(Count1#, Delay1#, Source1$)
8.10 FUNCTION Trig2001Q$ ............................................................................................................................ 59
FUNCTION Trig7001Q$
8.11 SUB Timers2001(ArmTimer2#, TrigTimer1#)......................................................................................... 60
SUB Timers7001(ArmTimer2#, TrigTimer1#)
8.12 FUNCTION Timers2001Q$....................................................................................................................... 60
FUNCTION Timers7001Q$
8.13 SUB ArmTcon2001(Dir1$, ILine1%, Oline1%, Dir2$, ILine2%, Oline2%)........................................... 61
SUB ArmTcon7001(Dir1$, ILine1%, Oline1%, Dir2$, ILine2%, Oline2%)
8.14 FUNCTION ArmTcon2001Q$ ................................................................................................................... 61
FUNCTION ArmTcon7001Q$
8.15 SUB TrigTcon2001(Dir1$, Synch1$, ILine1%, Oline1%) ........................................................................ 62
SUB TrigTcon7001(Dir1$, Synch1$, ILine1%, Oline1%)
8.16 FUNCTION TrigTcon2001Q$.................................................................................................................... 63
FUNCTION TrigTcon7001Q$
Section 9 — Model 2001 Calculate Commands..............................................................65
9.1 SUB Set2001Calc1MXB(MMFactor#, MBFactor#) ................................................................................. 65
9.2 SUB Set2001Calc1PERC(Percent#)........................................................................................................... 65
9.3 SUB Calc1.2001(State%) ............................................................................................................................. 66
9.4 FUNCTION Set2001Calc1Q$ .................................................................................................................... 66
9.5 FUNCTION Calc1.2001Q$......................................................................................................................... 67
9.6 SUB Set2001Calc2(Format$) ..................................................................................................................... 67
9.7 SUB Calc2.2001(State%) ............................................................................................................................. 68
9.8 FUNCTION Set2001Calc2Q$ ................................................................................................................... 68
9.9 FUNCTION Calc2.2001Q$......................................................................................................................... 68
9.10 SUB Set2001Calc3(Upper1#, Lower1#, Upper2#, Lower2#) ............................................................... 69
9.11 FUNCTION Set2001Calc3Q$ ................................................................................................................... 69
4
9.12 SUB Calc3.2001(State%) ............................................................................................................................. 70
9.13 SUB Set2001Calc3Dig(Du1%, Dl1%, Du2%, Dl2%)................................................................................ 70
9.14 FUNCTION Set2001Calc3DigQ$.............................................................................................................. 70
9.15 FUNCTION Calc3.2001Q$......................................................................................................................... 71
Appendix A — Model 2001/7001 Global Variables.........................................................73
Appendix B — Model 2001/7001 Constants...................................................................75
B.1 Function Constants..................................................................................................................................... 75
B.2 Status Model Constants ............................................................................................................................. 75
B.3 Automatic Constants.................................................................................................................................. 77
B.4 Model 2001 Minimum and Maximum Sense Constants ....................................................................... 77
B.5 Model 2001 Minimum and Maximum Calculate Constants ................................................................ 78
B.6 Model 2001/7001 Scanning Minimum and Maximum Constants ...................................................... 78
B.7 Read2001BufferS% and Read2001BufferD% Constants........................................................................ 78
B.8 Examples ...................................................................................................................................................... 78
Appendix C — Model 2001/7001 Support Software File Names and Routines...............79
C.1 Microsoft BASIC 7.1 File Names............................................................................................................... 79
C.1.1 Header Files.......................................................................................................................................... 79
C.1.2 Model 2001/7001 Demo Program Files............................................................................................ 79
C.1.3 Model 2001/7001 IEEE Interface Independent Files ...................................................................... 80
C.1.4 Capital Equipment Corp. (CEC) IEEE-488 Interface Files ............................................................. 80
C.1.5 IOTech Driver 488 Interface Files ...................................................................................................... 81
C.1.6 National Instruments NI-488 rev C.11 Files..................................................................................... 81
C.1.7 National Instruments NI-488 rev C.12 (and newer) and NI-488.2 Files ...................................... 82
C.2 Microsoft QuickBASIC 4.5 File Names.................................................................................................... 82
C.2.1 Model 2001/7001 IEEE Interface Independent Files ...................................................................... 82
C.2.2 Capital Equipment Corp. (CEC) IEEE-488 Interface Files ............................................................. 83
C.2.3 IOTech Driver 488 Interface Files ...................................................................................................... 83
C.2.4 National Instruments NI-488 rev C.11 Files..................................................................................... 83
C.2.5 National Instruments NI-488 rev C.12 (and newer) and NI-488.2 Files ...................................... 84
5
6
Section 1
Using the Library Routines
1.1 Installation
1.1.1 National Instruments GPIB.COM
You must have Rev C.10 or later of the National Instruments NI-488 Software or Rev 1.0 or later of the Na­tional Instruments NI-488.2 Software to use the Model 2001/7001 Support Software. Some older revisions may work, but they are not guaranteed to do so. Use the following settings to set up your National Instru­ments Card (AT-GPIB card listed here; use all that are applicable) when you are conÞguring GPIB.COM with IBCONF.EXE.
Primary GPIB Address............................................. 0
Secondary GPIB Address ........................................ NONE
Timeout setting......................................................... T10s
EOS byte..................................................................... 0AH
Terminate Read on EOS ........................................... no
Set EOI with EOS on Write...................................... yes
Type of compare on EOS ......................................... 7-bit
Set EOI w/last byte of Write ................................... yes
System Controller..................................................... yes
Assert REN when SC ............................................... yes
Enable Auto Serial Polling ...................................... no
Timing ........................................................................ 350nsec
Enable 488.2 Protocols ............................................. yes
CIC Protocol .............................................................. no
Disable Device Unaddressing................................. no
1.1.2 Capital Equipment Corporation
You must have Rev 2.14 or later of the Capitial Equipment Corp. software to use the Model 2001/7001 Support Software. All older revisions will not work without the removal of SETATNMODE() from SetupIEEE%() in CECQBX.BAS for BASIC 7.1 or in CEC.BAS for QuickBASIC 4.5.
1.1.3 IOTech Driver 488
You must have Rev 2.6 or later of the IOTech Driver 488 software to use the Model 2001/7001 Support Soft­ware. Some older revisions may work, but they are not guaranteed to do so.
1.1.4 Microsoft BASIC 7.1
Type A:INSTALL or B:INSTALL to install the Microsoft BASIC 7.1 Model 2001/7001 support software. The installation program will prompt you for certain information to copy Þles and build the make Þles MAKECEC.BAT, MAKEIOT.BAT, MAKENAT1.BAT, and MAKENAT2.BAT. These Þles will build the *.OBJ, *.LIB, *.QLB, and *.EXE Þles needed to use the routines.
7
Installation Notes:
1. BC.EXE, LINK.EXE, and LIB.EXE must be installed in the BASIC 7.1 Compiler Directory.
2. NMAKE.EXE must be installed in the NMAKE Directory.
3. BCL71EFR.LIB, DTFMTER.LIB, QBXQLB.LIB, QBX.LIB and IEEE488.LIB (if installing CEC) must re­side in the Library Files Directory.
4. FORMAT.BI, MOUSE.BI, MENU.BI, and MOUSE.BI must reside in the Include Files Directory.
5. The Model 2001/7001 Support Software Directory must exist, and you will be prompted to make it if it does not.
1.1.5 QuickBASIC 4.5
Type A:INSTALL or B:INSTALL to install the QuickBASIC 4.5 Model 2001/7001 support software. The in­stallation program will prompt you for certain information to copy Þles and build the make Þles MAKECEC.BAT, MAKEIOT.BAT, MAKENAT1.BAT, and MAKENAT2.BAT. These Þles will build the *.OBJ, *.LIB, and *.QLB Þles needed to use the routines.
Installation Notes:
1. BC.EXE, LINK.EXE, and LIB.EXE must be installed in the QuickBASIC 4.5 Compiler Directory.
2. BQLB45.LIB and IEEEQB.LIB (if installing CEC) must reside in the Library Files Directory.
3. The Model 2001/7001 Support Software directory must exist, and you will be prompted to make it if it does not.
1.2 General Instructions
1.2.1 Microsoft BASIC 7.1
To use a Quick Library in BASIC 7.1, start by issuing at the DOS prompt:
QBX /Lcecqbx.qlb to use CEC QBX /Liotqbx.qlb to use IOTech QBX /Lnatqbx1.qlb to use NI-488 QBX /Lnatqbx2.qlb to use NI-488.2
In your program, use Ô$INCLUDE:Õ20017001.BIÕ which contains the Model 2001/7001 library function def­initions and CONSTants OR use Ô$INCLUDE:Õ2001DEMO.BIÕ to use the BASIC 7.1 User Interface routines (WINDOW.BAS, MOUSE.BAS, MENU.BAS, GENERAL.BAS, UIASM.OBJ, and QBX.LIB), which are in­cluded in the libraries and quick-libraries. A sample setup follows:
Ô To use the BASIC 7.1 Windowing and Menu capabilities use:
Ô$INCLUDE:Õ2001DEMO.BIÕ MenuInit Ô Initialize Menu system (also initializes mouse with MouseInit) WindowInit Ô Initializes Windowing system MouseShow Ô Reveal mouse cursor SetupErr%=SetupIEEE%(0,0) Ô Setup IEEE interface SetupErr%=SetupIEEE%(2001,16) Ô Setup Model 2001 at IEEE address 16 SetupErr%=SetupIEEE%(7001,7) Ô Setup Model 7001 at IEEE address 7 Ô
8
Ô User Program Follows Ô Ô OR: (No Windowing or pop-up error messages) Ô (SEE QuickBASIC 4.5 Example) Ô
Note: When using the National Instruments NI-488 rev C.10 or C.11 interface with BASIC 7.1, the following ibxxx commands are unavailable:
ibrdi, ibrdia, ibwrti, ibwrtia, ilrdi, ilrdia, ilwrti, and ilwrtia.
Also, note that the ibÞnd and ibdev subroutines are now functions like ilÞnd% and ildev%. These limita­tions result from the BASIC 7.1 to Quick C link to support far strings in BASIC 7.1 which are not supported by National Instruments in their older NI-488 drivers (rev C.11 or older). To use the entire line of ibxxx com­mands, National Instruments suggests upgrading to the latest NI-488 driver (rev C.14 as of the time of this printing) and using the NI-488.2/NI-488 rev C.12 or newer Model 2001/7001 Support Software.
1.2.2 QuickBASIC 4.5
To use a Quick Library in QuickBASIC 4.5, start by issuing at the DOS prompt:
QB /Lcec.qlb to use CEC QB /Liotech.qlb to use IOTech QB /Lnat488_1.qlb to use NI-488 QB /Lnat488_2.qlb to use NI-488.2
In your program, use Ô$INCLUDE:Õ20017001.BIÕ , which contains the Model 2001/7001 library function def­initions and CONSTants. A sample setup follows:
Ô$INCLUDE:Õ20017001.BIÕ CONST TRUE = -1 CONST FALSE = 0 SetupErr%=SetupIEEE%(0,0) Ô Setup IEEE interface SetupErr%=SetupIEEE%(2001,16) Ô Setup Model 2001 at IEEE address 16 SetupErr%=SetupIEEE%(7001,7) Ô Setup Model 7001 at IEEE address 7 Ô Ô User Program Follows Ô
1.2.3 Documentation Notes
1. All functions in this document use QuickBASIC 4.5 type cast notation (% Ñ integer, $ Ñ String, etc.).
2. Query forms of a function have the format of function-nameQ$ , which returns a query string containing the results of the speciÞed Model 2001/7001 parameters. Automatic values are returned as 0 for OFF and 1 for ON.
3. If a function query returns more than one parameter, the responses will be separated by a semi-colon (;) within the return string. Use the ParseQuery$ routine to return the speciÞed response string (parameter number 1, 2, 3, etc.) from the query return string.
9
4. Any Model 2001/7001 command parameters out of range will not be sent to the instrument, leaving the previously set or default values in tact. Also, the global variable, OutOfRange% , will be set to TRUE (-1).
5. Most Model 2001/7001 parameters that are double precision values will accept the constants MAXI­MUM, MINIMUM, and DEFAULT. INF will be accepted for Trigger Model Count1# and Count2# pa­rameters.
6. All example programs assume that QuickBASIC 4.5 or BASIC 7.1 setup commands listed above were used before issuing any commands.
7. All string parameters that have their valid parameters listed with mixed case, like IMMediate, accept either the short form (IMM) or the long form (IMMEDIATE) in any combination of case. This is compa­rable to the short and long form notation used for SCPI commands.
8. See Appendix A for a description of the Global Variables used in the Model 2001/7001 support soft­ware.
9. See Appendix B for a description the deÞned CONSTants used in the Model 2001/7001 support soft­ware.
10. See Appendix C for a list of all QuickBASIC 4.5 and BASIC 7.1 Þle names used by the Model 2001/7001 support software.
10
Section 2
Model 2001 / 7001 IEEE-488 Interface Routines
These functions and subroutines control the Models 2001/7001 with low-level IEEE-488 bus commands speciÞc to each IEEE-488 interface manufacturer. If any IEEE-488 timeout errors occur, an error message will be displayed. For BASIC 7.1 the WindowInit command must be issued at start up to see the messages. Also, the TimeOutError% global variable (see Global Variables in Appendix A) will be set TRUE.
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
2.1 FUNCTION SetupIEEE%(Device%, Address%)
Description
Sets up the speciÞc IEEE-488 interface to correctly handle data transfers between the Models 2001/7001 and the host PC computer. Also, initializes either the 2001 or 7001 at the speciÞed addresses. CEC controllers will be at IEEE address 21. IOTech controllers are usually at IEEE address 21. National Instruments controllers are usually at IEEE address 0.
Parameters
Device%
0 Initialize Interface Only 2001 Change the IEEE address of the Model 2001 only 7001 Change the IEEE address of the Model 7001 only
Address%
0-30 if Device% is Model 2001 or 7001 ignored if Device% is 0
Returns
TRUE (-1) if a TimeOutError occurred or a parameter is OutOfRange.
Global V ariables Affected (see Global Variables Appendix A) :
KI2001%, KI7001%, TimeOutError%, OutOfRange%, IeeeInterface% brd0%, Nat2001Addr%, Nat7001Addr% (NatÕl. Instruments only) IeeeIn%, IeeeOut% (IOTech Driver 488 only)
Example
Before using any of the Model 2001 routines, the following commands must be issued:
11
Ô$INCLUDE:Õ20017001.BIÕ SetupErr%=SetupIEEE%(0,0) Ô Setup IEEE interface SetupErr%=SetupIEEE%(2001,16) Ô Setup Model 2001 at IEEE address 16 SetupErr%=SetupIEEE%(7001,7) Ô Setup Model 7001 at IEEE address 7
2.2 SUB SendSDC2001
SUB SendSDC7001
Description
Sends the IEEE bus command SDC (Selected Device Clear) to the Model 2001/7001.
Global V ariables Affected (see Global Variables in Appendix A)
TimeOutError%
2.3 FUNCTION Q2001$(Cmd$)
FUNCTION Q7001$(Cmd$)
Description
Gets a query response from the Model 2001/7001. Cmd$ must be a valid Model 2001/7001 query or else the instrument will TimeOut. Multiple queries are allowed, and responses can be separated using the ParseQuery$ function. If Cmd$=ÓÓ, then the function will still try to read data from the instrument. This feature is good for reading large amounts of data from the Model 2001/7001 since the most that can be read at one time is 2048 bytes.
Parameters
Cmd$
Ò Ò try to read the Model 2001/7001 <> Ò Ò send query and try to read Model 2001/7001
Returns
Query response from the Model 2001/7001 if Cmd$ was valid. ÒError!Ó if Cmd$ not valid (i.e., a timeout error occurred).
12
Global V ariables Affected
TimeOutError%, Resp$
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Q2001$(ÒVOLT:DC:RANGE?Ó) Ô return DC Voltage Range
2.4 SUB Send2001(Cmd$)
SUB Send7001(Cmd$)
Description
Sends IEEE-488.2 and SCPI command strings to the Model 2001/7001.
Parameters
Cmd$ Valid Model 2001/7001 488.2 or SCPI command or query.
Returns
Nothing
Must check the Model 2001/7001 EAV bit in the serial poll register to see if a command was accepted, or look at the front panel of the instrument for an error message.
Global V ariables Affected (see Global Variables in Appendix A)
TimeOutError%, OutOfRange%
Example
Ô BASIC 7.1 or QB45 setup commands called before here Send7001 ÒROUTE:CLOSE (@1!1:1!40)Ó ÔClose channels 1-40 on card 1 of Model 7001
2.5 SUB SendGET2001
SUB SendGET7001
Description
Sends the IEEE bus command GET to the Model 2001/7001.
Global V ariables Affected (see Global Variables in Appendix A)
TimeOutError%
Example
Ô BASIC 7.1 or QB45 setup commands called before here SendGET2001 Ô Trigger the Model 2001 to take reading Reading$ = Q2001$(ÒDATA?Ó) Ô Get Model 2001 reading
13
2.6 FUNCTION Wait2001RQS%
FUNCTION Wait7001RQS%
Description
Waits for the Model 2001/7001 to generate a Request for Service. The routine serial polls the Model 2001/ 7001 to verify that the instrument is indeed generating a Request for Service. The wait can be aborted by pressing the Esc key (QuickBASIC 4.5 and BASIC 7.1) or the right mouse button (BASIC 7.1 only).
Returns
FALSE (0) - if aborted. TRUE (-1) - if a Model 2001/7001 Request for Service.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Poll% = Poll2001% Ô Clear and pending SRQÕs SRE2001 MAV Ô Set up to SRQ on MAV Send2001 ÒFETCH?Ó Ô Fetch a Model 2001 reading DO Ô Set up an uninterruptable wait LOOP UNTIL Wait2001RQS% Reading$ = Q2001$(ÒÒ) Ô Get reading
14
Section 3
Model 2001 Buffer Routines
These routines are used to acquire readings in the Model 2001Õs data buffer. Up to 30,092 readings can be stored in the Model 2001 with the MEM2 option and the compact format.
All routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout error occurs. Functions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables in Appendix A).
3.1 FUNCTION BufferSize2001%
Description
Finds the actual number of data points in the Model 2001 buffer. This function should be used since TRACe:POINts? may not return the correct number of data points if the data buffer acquisition was aborted.
Returns
The actual number of data points in the Model 2001 buffer (anywhere from 2 to 30,092) depending on the memory conÞguration of the Model 2001 being used.
Example
Ô BASIC 7.1 or QB45 setup commands called before here NumPoints% = BufferSize2001% Ô Read Back Readings in double precision DIM BufferData#(1 to NumPoints%) NumPoints% = Read2001BufferD%(BufferData#(), 0, BUFRDGS)
3.2 FUNCTION Take2001BufferReadings% (Func%, BurstMode%,
NumDataPoints1%, Compact%)
Description
Sets up and acquires up to 30,092 readings in the Model 2001Õs data buffer. (Use with Read2001BufferS% or Read2001BufferD% to read data). The data acquisition may be aborted by pressing Esc (QuickBASIC or BA­SIC 7.1) or by pressing the right mouse button (BASIC 7.1 Only).
Parameters
Func%, (also, see Function Constants, Appendix B)
0 Ñ Current Function 1 Ñ DCV 2 Ñ ACV
15
3 Ñ DCA 4 Ñ ACA 5 Ñ 2-wire Resistance 6 Ñ 4-wire Resistance 7 Ñ Frequency 8 Ñ Temperature
BurstMode%
If TRUE (non-zero), uses the fast Burst Mode of Reading acquisition available from the Model 2001. Burst­Mode is only applicable if Func% is 1 to 5.
NumDataPoints1%
2 to TRACE:POINTS? MAX (depends on the setting of Compact% and the memory option installed in the Model 2001).
Compact%
TRUE (non-zero) Ñ use the COMPACT buffer format (readings only). FALSE (zero) Ñ use the FULL buffer format (reading, time stamp, channel number, status, and units).
NOTE
The COMPACT format allows Þve times as many readings as does FULL. If BurstMode% is set, only COMPACT format is valid.
Returns
The actual number of data points read from the Model 2001. If zero, then either a TimeOutError occurred or an OutOfRange error occurred for Func% or NumDataPoints% < 2.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Take 2000 DC Volt Burst Mode Readings: NumPoints% = Take2001BufferReadings%(DCV, TRUE, 2000, TRUE) Ô Read Back data in Single Precision Format: DIM BufferData!(1 to NumPoints%) NumPoints%=Read2001BufferS%(BufferData!(), 0, BUFRDGS)
3.3 FUNCTION Read2001BufferS% (ArrayName!(), DMA%, Fmt%)
FUNCTION Read2001BufferD% (ArrayName#(), DMA%, Fmt%)
16
Description
Retrieves all of the readings (up to 29,908 IEEE754 single or double precision readings) from the Model 2001Õs data buffer and stores them into a single or double precision array.
Parameters
ArrayName!, ArrayName#
Single or double precision array dimensioned large enough to handle the number of data points returned by BufferSize2001% or Take2001BufferReadings%.
DMA%
0 DonÕt use DMA 1 Use DMA (IOTech or National Instruments) 1-7 Use DMA channel conÞgured on CEC IEEE-488 Interface card
Fmt%
1 Return Readings (FULL or COMPact Format) 2 Return TimeStamp (Full Format only) 3 Return Channel (Full Format only) 4 Return Status (Full Format only) 5 Return Units (Full Format only)
Also, see Read2001BufferS% and Read2001BufferD% Constants in Appendix B.
Returns
The actual number of data points transferred to the array. If zero, then either a TimeOutError occurred, an OutOfRange error occurred, or ArrayName!() or ArrayName#() is dimensioned too small.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Take 5000 AC Volt Full Format Mode Readings: NumPoints% = Take2001BufferReadings%(ACV,FALSE,5000,FALSE) Ô Read Back Readings and TimeStamp in double precision DIM BufferData#(1 to NumPoints%), Times#(1 to NumPoints%) NumPoints%=Read2001BufferD%(BufferData#(), 0, BUFRDGS) NumPoints%=Read2001BufferD%(Times#(), 0, BUFTIMESTAMP) DataViewD BufferData#(), NumPoints%
17
18
Section 4
General Routines
These routines provide data display, graphing, and data manipulating functions that make the handling of the returned data from the Models 2001 and 7001 easier to handle.
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
All functions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables in Appendix A).
4.1 FUNCTION ParseQuery$(Quer$, QuerNum%)
Description
Returns the query speciÞed by QuerNum inside Quer$. Queries are separated either by commas or semi­colons. Also, leading and trailing spaces are removed.
Parameters
Quer$ A string returned by any of the Model 2001/7001 query functions. QuerNum% The number of the query to retrieve
Returns
ÒError!Ó if Quer$ = ÒÒ, ÒInvalid Query Number.Ó if QuerNum% <= 0, QuerNum% query in Quer$, or last query if QuerNum% is too large
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Ò100; FFF; oii, 4423.223; 4,000Ó B$ = ParseQuery$(A$, 1) Ô B$ = Ò100Ó B$ = ParseQuery$(A$, 2) Ô B$ = ÒFFFÓ B$ = ParseQuery$(A$, 3) Ô B$ = ÒoiiÓ B$ = ParseQuery$(A$, 4) Ô B$ = Ò4423.223Ó B$ = ParseQuery$(A$, 5) Ô B$ = Ò4Ó B$ = ParseQuery$(A$, 6) Ô B$ = Ò000Ó B$ = ParseQuery$(A$, 7) Ô B$ = Ò000Ó B$ = ParseQuery$(A$, 0) Ô B$ = ÒInvalid Query Number.Ó
19
4.2 FUNCTION Str1$(DoubleNumber#)
Description
Returns a string representation of a double precision number with an E in the exponent instead on a D, if DoubleNumber# is large or small enough to be displayed in exponential format.
Parameters
DoubleNumber# Any valid double precision number
Returns
Double-precision mantissa, E, then exponent, or; Double-precision number
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Str1$(9.9d34) Ô A$ = Ò9.9E+34Ó
4.3 FUNCTION IOTECH$(Address%)
Description
Returns a two-digit number string with a leading 0 for use with IOTechÕs IEEE Addressable commands.
Parameters
Address% 0 to 30 Returns: Ò00Ó,Ó01Ó,..,Ó09Ó,Ó10Ó,Ó11Ó,..,Ó30Ó
Example
Ô BASIC 7.1 or QB45 setup commands called before here PRINT #1, ÒOUTPUT Ò+IOTECH$(9)
4.4 SUB XYGraphS(XArray!(), YArray!(), YStart%, YStop%, XTitle$, YT itle$,
Title$, UseCGA2%, MaxMinScale%) SUB XYGraphD(XArray#(), YArray#(), YStart%, YStop%, XTitle$, YT itle$,
Title$, UseCGA2%, MaxMinScale%)
Description
20
Produces a simple X and Y auto-scaled graph using single (XYGraphS) or double (XYGraphD) precision da­ta. These routines will plot YArray versus XArray if the size of the two arrays are equal. If they are not the same, only the YArray is plotted versus its corresponding data point number. Use YStart and YStop to zoom in on a particular area of the graph. Both the X and Y axes are scalable to the maximum and minimum of the arrays within the speciÞed YStart and YStop interval.
Parameters
XArray!() Single-precision X-axis data array XArray#() Double-precision X-axis data array YArray!() Single-precision Y-axis data array YArray#() Double-precision Y-axis data array YStart% First Y data point to plot YStop% Last Y data point to plot XTitle$ X-axis Title YTitle$ Y-axis Title Title$ Graph Title UseCGA2% If non-zero, use CGA 640x200 mode so that GRAPHICS.COM can do a screen dump. MaxMinScale% If non-zero, scale to the minimum and maximum values of the Y-axis data. This has an
effect only if all of the data points are the same sign.
Example
Ô BASIC 7.1 or QB45 setup commands called before here NumPoints% = Take2001BufferReadings%(ACV,FALSE,5000,FALSE) DIM BufferData#(1 to NumPoints%), Times#(1 to NumPoints%) NumPoints%=Read2001BufferS%(BufferData#(), 0, BUFRDGS) NumPoints%=Read2001BufferD%(Times#(), 0, BUFTIMESTAMP) Ô Plot AC Voltage vs. Time scaled to AC Data XYGraphD BufferData#(), Times#(), 1, NumPoints%, ÒTime (sec)Ó, ÒAC Voltage (Vrms)Ó, ÒAC Voltage vs. TimeÓ, FALSE, TRUE
4.5 SUB DataViewS(DataArray!(), NumDataPoints%)
SUB DataViewD(DataArray#(), NumDataPoints%)
Description
Views a single or double precision array, DataArray, NumDataPoints long using PageUp, PageDn, Home, End, and the Arrow keys. Pressing Esc aborts the data display (QuickBASIC 4.5 and BASIC 7.1) as does clicking the right mouse button (BASIC 7.1 only).
Parameters
DataArray!() Single precision data array to display DataArray#() Double precision data array to display NumDataPoints% Number of data points to display. If zero or more than the number of points actually
in the array, display whole array.
Returns
NumDataPoints% with the maximum number of data points in the array if NumDataPoints% was original­ly a variable and was 0 or larger than the number of points in the array.
Example
Ô BASIC 7.1 or QB45 setup commands called before here
21
NumPoints% = BufferSize2001% Ô Read Back Readings in double precision DIM BufferData#(1 to NumPoints%) NumPoints% = Read2001BufferD%(BufferData#(), 0, BUFRDGS) Ô View all Data Buffer Readings DataViewD BufferData#(), NumPoints%
4.6 FUNCTION AutoGraphicsMode% (NumYPixels%, NumTextRows%,
UseCGA2%)
Description
Automatically detects the best available 80 Column Text graphics mode. Graphics Driver Order of Prece­dence:
SCREEN MODE NumXPixels NumYPixels NumTextCols NumTextRows
11 (VGA) 640 480 80 60 10 (EGA) 640 350 80 43 9 (EGA) 640 350 80 43 8 (EGA) 640 200 80 25 2 (CGA) 640 200 80 25
Parameters
UseCGA2%
TRUE (non-zero) Ñ forces Screen Mode 2. FALSE Ñ Automatically detect highest resolution NumYPixels% Ñ must be a variable name NumTextRows% Ñ must be a variable name
Returns
Screen Mode used. NumYPixels in NumYPixels% if NumYPixels% is a variable. NumTextRows in NumTextRows% if NumTextRows% is a variable.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Given: a PC with a VGA monitor Mode% = AutoGraphicsMode%(NumYPixels%, NumTextRows%, FALSE) Ô Mode% = 11, NumYPixels% = 480, NumTextRows% = 60
22
Section 5
General Model 2001 / 7001 Routines
The following routines perform some extra functions that are not in the Model 2001/7001 and manipulate the Model 2001/7001Õs front panel.
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
All of these routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout Error occurs. Func­tions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables in Appendix A).
5.1 SUB Set2001Function(Func%)
Description
Puts the Model 2001 into the speciÞed measurement function.
Parameters
Func% (1-8) see Function Constants, Appendix B.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô All three of the following put the Model 2001 in AC Volts: Set2001Function ACV ACV2001 Send2001 ÒFUNC ÔVOLT:ACÕÓ
5.2 FUNCTION Get2001Units$(Func%)
Description
Gets the proper Model 2001 units for the function speciÞed.
Parameters
Func% 1-8, see Function Constants, Appendix B.
23
Returns
ÒError!Ó if a TimeOutError occurred, or Func% = 1 (DC Volts): ÒVDC Ò Func% = 2 (AC Volts):
<5-character string> + <0-4 character string>, where: <5-character string> = Ò dB Ò, Ò dBm Ò, or ÒVAC Ò
<0-4 character string> = ÒÒ, ÒAvgÓ, ÒPeakÓ, Ò+PkÓ, Ò- PkÓ, or ÒRMSÓ Func% = 3 (DC Current): ÒADCÓ or ÒADC ICktÓ Func% = 4 (AC Current): ÒAAC AvgÓ or ÒAAC RMSÓ Func% = 5 (2-wire Resistance): Ò2WÓ or Ò2W OcmpÓ Func% = 6 (4-wire Resistance): Ò4WÓ or Ò4W OcmpÓ Func% = 7 (Frequency): ÒHzÓ Func% = 8 (Temperature): Ò¡FÓ, Ò¡CÓ, or Ò KÓ
Example
Ô BASIC 7.1 or QB45 setup commands called before here Send2001 Ò*RSTÓ Ô AC Voltage with the detector set to RMS will Ô return ÒVAC RMSÓ A$ = Get2001Units$(ACV)
5.3 FUNCTION Get2001SaveRecallSize%
Description
Finds the number of Model 2001 Save/Recall (*SAV, *RCL) locations available for storing Model 2001 con­Þgurations.
Returns
Model 2001 Option SaveRecallSize
2001 2001/MEM1 2001/MEM2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Model 2001 with MEM1 option Ô RecNum% = number of setup location to recall IF RecNum% < Get2001SaveRecallSize% AND RecNum% >= 0 THEN
Send2001 Ò*RCLÓ + STR$(RecNum%)
ELSE
PRINT ÒRecall Number is too large!Ó
ENDIF
1 5 10
24
5.4 FUNCTION Get2001FuncHeader$(Func%)
Description
Returns the proper SENSe subsystem SCPI Header string for the function speciÞed.
Parameters
Func% (1-8) see Function Constants, Appendix B.
Returns
Func% Returns
1 VOLT:DC: 2 VOLT:AC: 3 CURR:DC: 4 CURR:AC: 5 RES: 6 FRES: 7 FREQ: 8 TEMP:
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Get2001FuncHeader$(DCV) Ô A$ = ÒVOLT:DC:Ó
5.5 FUNCTION Get2001Func%
Description
Finds the present Model 2001 Function
Returns
The Model 2001 function number from 1 to 8 as speciÞed by the Function Constants, Appendix B.
Example
Ô BASIC 7.1 or QB45 setup commands called before here DCV2001 Func% = Get2001Func% Ô Put Model 2001 in DC Volts mode Ô Func% = 1, which is the CONSTant DCV
25
5.6 FUNCTION Check2001Val$(CheckVal#, MinVal#, MaxVal#,
CheckMinInf%)
Description
Checks a given double precision value (CheckVal#) against the given minimum allowed value (MinVal#) and the maximum allowed value (MaxVal#). It is used internally by the Model 2001/7001 routines to check parameter ranges.
Parameters
CheckVal# Any double precision value or one of the following constants:
INF = 9.9D+37 MINIMUM = 9.8D+37 MAXIMUM = 9.7D+37 DEFAULT = 9.6D+37
CheckMinInf%
0 Ñ DonÕt check for MINIMUM, MAXIMUM, DEFAULT, or INF 1 Ñ Check for MINIMUM, MAXIMUM, or DEFAULT 2 Ñ Check for MINIMUM, MAXIMUM, DEFAULT, or INF
Associated constants: CHECKNONE = 0
CHECKMINMAX = 1 CHECKINF = 2
Returns
A null string and sets OutOfRange global variable to TRUE (-1) if CheckVal# is out of range An ASCII string representation of CheckVal# if in range ÒMAXÓ, ÒMINÓ, ÒDEFÓ, or ÒINFÓ if CheckVal# is equivalent to one of the constants above.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Checks for a value to be between 100# an 1000# inclusive Value$ = Check2001Val$(MINIMUM, 100#, 1000#, CHECKMINMAX) Ô Value$ = ÒMINÓ
5.7 SUB Hit2001Key(HitKey%)
Description
Presses the speciÞed Model 2001 front panel key using SYSTEM:KEY.
Parameters
HitKey% 1-23, 26-31 (OutOfRange% set and does nothing otherwise)
26
DeÞned keys are as follows: UPKEY = 1 TEMPKEY = 2 LEFTKEY = 3
MENUKEY = 4 ACIKEY = 5 STOREKEY = 6 LOCALKEY = 7 PREVIOUSKEY = 8 AUTOKEY = 9 RIGHTKEY = 10 EXITKEY = 11 R2KEY = 12 RECALLKEY = 13 CHANKEY = 14 DCVKEY = 15 NEXTKEY = 16 DOWNKEY = 17 ENTERKEY = 18 R4KEY = 19 FILTERKEY = 20 SCANKEY = 21 ACVKEY = 22 RELKEY = 23 FREQKEY = 26 MATHKEY = 27 CONFIGKEY = 28 DCIKEY = 29 TRIGKEY = 30 INFOKEY = 31
Example
Ô BASIC 7.1 or QB45 setup commands called before here Hit2001Key AUTOKEY Ô Hit Auto Range key on Model 2001
5.8 SUB Disp2001(line1$, line2$)
SUB Disp7001(line1$, line2$)
Description
Immediately displays line1$ on the Þrst line and line2$ on the second line of the Model 2001/7001Õs display.
Parameters
Line1$ maximum of 20 characters Line2$ maximum of 32 characters
Returns
Line1$ truncated to 20 characters if line1$ is a variable name. Line2$ truncated to 32 characters if line2$ is a variable name.
Example
Ô BASCI 7.1 or QB45 setup commands called before here Line1$ = Ò2001/7001 Support SoftwareÓ Disp2001 Line1$,Ó(c) 1992 Keithley InstrumentsÓ Ô Line1$ now = Ò2001/7001 Support SoÓ NoDisp2001 Ô turn off user display
5.9 SUB NoDisp2001
SUB NoDisp7001
Description
Turns off the userÕs displayed messages on the Model 2001/7001.
27
28
Section 6
Model 2001 SENSe[1] Subsystem Commands
All of these routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout Error occurs. Func­tions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables, Appendix A).
See Model 2001 Minimum and Maximum Sense Constants in Appendix B for CONSTants for use with the Model 2001 SENSe[1] Subsystem commands.
6.1 Model 2001 Function Change Subroutines
Theses subroutines change the present function of the Model 2001.
6.1.1 SUB DCV2001
Description
Puts Model 2001 into DC Volts mode.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô All three of the following put the Model 2001 in DC Volts: DCV2001 Set2001Function DCV Send2001 ÒFUNC ÔVOLT:DCÕÓ
6.1.2 SUB ACV2001
Description
Puts Model 2001 into AC Volts mode.
6.1.3 SUB DCA2001
Description
Puts Model 2001 into DC Current mode.
29
6.1.4 SUB ACA2001
Description
Puts Model 2001 into AC Current mode.
6.1.5 SUB RES2.2001
Description
Puts Model 2001 into 2-wire Resistance mode.
6.1.6 SUB RES4.2001
Description
Puts Model 2001 into 4-wire Resistance mode.
6.1.7 SUB FREQ2001
Description
Puts Model 2001 into Frequency mode.
6.1.8 SUB TEMP2001
Description
Puts Model 2001 into Temperature mode.
6.2 Return Model 2001 Reading Functions
Theses subroutines return the latest reading on the speciÞed function of the Model 2001. All routines use the SCPI command, MEASure:(FunctionName)?, except Get2001Rdg$ which uses the SCPI command, ÒFETCh?Ó.
6.2.1 FUNCTION Get2001Rdg$
Description
FETCHes a Model 2001 reading in the present Mode and FORMat.
30
Returns
ÒError!Ó if a TimeOutError occurred, or Reading String.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô The following two statements are equivalent: A$ = Get2001Rdg$ B$ = Q2001$(ÒFETCH?Ó)
6.2.2 FUNCTION GetDCV2001$
Description
Gets a Model 2001 DC Volts Reading
Returns
ÒError!Ó if a TimeOutError occurred, or DC Volts Reading String.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô The following two statements are equivalent: A$ = GetDCV2001$ B$ = Q2001$(ÒMEASURE:VOLT:DC?Ó)
6.2.3 FUNCTION GetACV2001$
Description
Gets a Model 2001 AC Volts Reading
Returns
ÒError!Ó if a TimeOutError occurred, or AC Volts Reading String.
6.2.4 FUNCTION GetDCA2001$
Description
Gets a Model 2001 DC Current Reading
Returns
ÒError!Ó if a TimeOutError occurred, or DC Current Reading String.
31
6.2.5 FUNCTION GetACA2001$
Description
Gets a Model 2001 AC Current Reading
Returns
ÒError!Ó if a TimeOutError occurred, or AC Current Reading String.
6.2.6 FUNCTION Get2RES2001$
Description
Gets a Model 2001 2-wire Resistance Reading
Returns
ÒError!Ó if a TimeOutError occurred, or 2-wire Resistance Reading String.
6.2.7 FUNCTION Get4RES2001$
Description
Gets a Model 2001 4-wire Resistance Reading
Returns
ÒError!Ó if a TimeOutError occurred, or 4-wire Resistance Reading String.
6.2.8 FUNCTION GetFREQ2001$
Description
Gets a Model 2001 Frequency Reading
Returns
ÒError!Ó if a TimeOutError occurred, or Frequency Reading String.
6.2.9 FUNCTION GetTEMP2001$
Description
32
Gets a Model 2001 Temperature Reading
Returns
ÒError!Ó if a TimeOutError occurred, or Temperature Reading String.
6.3 DC V oltage Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs DC Voltage measurement function.
6.3.1 SUB Set2001DCV(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs DC Voltage Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to +1100 MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.4999=>7.5d, 3.5-4.4999=>3.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set DC Voltage MAXIMUM range, 1 Power Line Cycle Ô Integration, and 6-1/2 digits Set2001DCV MAXIMUM, 1/60, 7
6.3.2 FUNCTION Set2001DCVQ$
Description
Queries the Model 2001 for its DC Voltage Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range 0 to +1100 Query 2: Time: 166.667e-6 to .2 Query 3: Digits 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
33
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001DCVQ$ Ô Get 2001 DC Voltage Settings Range$ = ParseQuery$(A$, 1) Ô Extract Range setting AperTime$ = ParseQuery$(A$, 2) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 3) Ô Extract Number of Digits
6.3.3 SUB Auto2001DCV(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs DC Voltage Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn 2001Õs DC Voltage Auto Range ON, Time OFF, Ô and Digits ONCE: Auto2001DCV TON, TOFF, ONCE
6.3.4 FUNCTION Auto2001DCVQ$
Description
Queries the Model 2001 for its DC Voltage Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
34
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Auto2001DCVQ$ Ô Get 2001 DC Voltage Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting
AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
6.4 AC V oltage Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs AC Voltage measurement function.
6.4.1 SUB Set2001ACV(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs AC Voltage Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to +775 (+1100 if Peak, +Peak or -Peak On) MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.4999=>7.5d, 3.5-4.4999=>3.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set AC Voltage MINIMUM range, 10 Power Line Cycle Ô Integration, and 6½ digits Set2001ACV MINIMUM, 1/6, 6.5
6.4.2 FUNCTION Set2001ACVQ$
Description
Queries the Model 2001 for its AC Voltage Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range: 0 to +1100 Query 2: Time: 166.667e-6 to .2 Query 3: Digits: 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
35
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001ACVQ$ Ô Get 2001 AC Voltage Settings Range# = VAL(ParseQuery$(A$, 1)) Ô Extract Range setting AperTime# = VAL(ParseQuery$(A$, 2)) Ô Extract Aperture Time Digits# = VAL(ParseQuery$(A$, 3)) Ô Extract Number of Digits
6.4.3 SUB Auto2001ACV(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs AC Voltage Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn Model 2001Õs AC Voltage Auto Range ON, Time OFF, Ô and Digits unaffected: Auto2001ACV TON, TOFF, NO
6.4.4 FUNCTION Auto2001ACVQ$
Description
Queries the Model 2001 for its AC Voltage Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
36
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Auto2001ACVQ$ Ô Get 2001 AC Voltage Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting
AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
6.5 DC Current Functions
These functions setup and return the settings of the conÞgurable options of the 2001Õs DC Current measure­ment function.
6.5.1 SUB Set2001DCA(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs DC Current Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to +2.1, ignored if In Circuit Mode is enabled. MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.4999=>7.5d, 3.5-4.4999=>3.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set DC Current to .2A range, 10ms Integration, & 6-1/2d Set2001DCA .2, .01, 7.1
6.5.2 FUNCTION Set2001DCAQ$
Description
Queries the Model 2001 for its DC Current Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range: 0 to +2.1 Query 2: Time: 166.667e-6 to .2 Query 3: Digits: 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
37
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001DCAQ$ Ô Get 2001 DC Current Settings Range$ = ParseQuery$(A$, 1) Ô Extract Range setting AperTime$ = ParseQuery$(A$, 2) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 3) Ô Extract Number of Digits
6.5.3 SUB Auto2001DCA(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs DC Current Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
BASIC 7.1 or QB45 setup commands called before here Ô Turn DC Current Auto Range ON, Time OFF, and Digits ONCE: Auto2001DCA 1, 0, 2
6.5.4 FUNCTION Auto2001DCAQ$
Description
Queries the Model 2001 for its DC Current Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
Example
38
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Auto2001DCAQ$ Ô Get 2001 DC Current Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
6.6 AC Current Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs AC Current measurement function.
6.6.1 SUB Set2001ACA(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs AC Current Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to +2.1 MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.4999=>7.5d, 3.5-4.4999=>3.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set AC Current to 2mA range, .1 msec Ô Integration, and 7-1/2 digits Set2001ACA 2e-3, 1e-4, 7.5
6.6.2 FUNCTION Set2001ACAQ$
Description
Queries the Model 2001 for its AC Current Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range: 0 to +2.1 Query 2: Time: 166.667e-6 to .2 Query 3: Digits: 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001ACAQ$ Ô Get 2001 AC Current Settings
39
Range$ = ParseQuery$(A$, 1) Ô Extract Range setting AperTime$ = ParseQuery$(A$, 2) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 3) Ô Extract Number of Digits
6.6.3 SUB Auto2001ACA(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs AC Current Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn 2001Õs AC Current Auto Range ON, Time OFF, Ô and Digits unaffected: Auto2001ACA TON, 0, -1
6.6.4 FUNCTION Auto2001ACAQ$
Description
Queries the Model 2001 for its AC Current Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
Example
Ô Basic 7.1 or QB45 setup commands called before here A$ = Auto2001ACAQ$ Ô Get 2001 AC Current Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
40
6.7 Two-Wire Resistance Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs 2-wire Resis­tance measurement function.
6.7.1 SUB Set2001R2(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs 2-wire Resistance Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to +1.05e9 or 2.1e5 if SENSe1:RESistance:OCOMpensated ON is set. MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.49997.5d, 3.5-4.49993.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set 2-wire Resistance to 200k range, 100 msec Ô Integration, and 5-1/2 digits Set2001R2 1e5, .1, 6.49
6.7.2 FUNCTION Set2001R2Q$
Description
Queries the Model 2001 for its 2-wire Resistance Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range: 0 to +1.05e9 Query 2: Time: 166.667e-6 to .2 Query 3: Digits: 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001R2Q$ Ô Get 2001 2-wire Resistance settings
41
Range$ = ParseQuery$(A$, 1) Ô Extract Range setting AperTime$ = ParseQuery$(A$, 2) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 3) Ô Extract Number of Digits
6.7.3 SUB Auto2001R2(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs 2-wire Resistance Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn 2001Õs 2-wire Resistance Auto Range ON, Time OFF, Ô and Digits ONCE: Auto2001R2 TON, TOFF, ONCE
6.7.4 FUNCTION Auto2001R2Q$
Description
Queries the Model 2001 for its 2-wire Resistance Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
Example
42
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Auto2001R2Q$ Ô Get 2001 2-wire Resistance Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
6.8 Four-Wire Resistance Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs 4-wire Resis­tance measurement function.
6.8.1 SUB Set2001R4(Range#, Time#, Digits#)
Description
Sets the Model 2001Õs 4-wire Resistance Range, Aperture Time, and Number of Digits.
Parameters
Range#
0 to 2.1e5 MAXIMUM, MINIMUM, or DEFAULT
Time# (Aperture Time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 8.4999 (7.5-8.49997.5d, 3.5-4.49993.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set 4-wire Resistance to 20k range, 100 msec Ô Integration, and 5-1/2 digits Set2001R4 15000#, 100d-3, 5.649
6.8.2 FUNCTION Set2001R4Q$
Description
Queries the Model 2001 for its 4-wire Resistance Range, Aperture Time, and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Range: 0 to +2.1e5 Query 2: Time: 166.667e-6 to .2 Query 3: Digits: 4 to 8 (4=3.5d, 8=7.5d, etc.)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here
43
A$ = Set2001R4Q$ Ô Get 2001 4-wire Resistance settings Range$ = ParseQuery$(A$, 1) Ô Extract Range setting AperTime$ = ParseQuery$(A$, 2) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 3) Ô Extract Number of Digits
6.8.3 SUB Auto2001R4(AutoRange%, AutoTime%, AutoDigits%)
Description
Sets the Model 2001Õs 4-wire Resistance Auto Range, Auto Time, and Auto Digits settings.
Parameters
AutoRange%, AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once
The following constants can also be used:
NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn 2001Õs 4-wire Resistance Auto Range ON, Time OFF, Ô and Digits ONCE: Auto2001R4 TON, TOFF, ONCE
6.8.4 FUNCTION Auto2001R4Q$
Description
Queries the Model 2001 for its 4-wire Resistance Auto Range, Auto Time, and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Range: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 3: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
Example
44
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Auto2001R4Q$ Ô Get 2001 4-wire Resistance Auto Settings AutoRange$ = ParseQuery$(A$, 1) Ô Extract Auto Range setting AutoTime$ = ParseQuery$(A$, 2) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 3) Ô Extract Auto Digits
6.9 Frequency Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs Frequency measurement function.
6.9.1 SUB Set2001F(Digits#, Source%)
Description
Sets the Model 2001Õs Frequency Number of Digits and Source settings.
Parameters
Digits#
3.5 to 5.4999 (4.5-5.49994.5d, 3.5-4.49993.5d) MAXIMUM, MINIMUM, or DEFAULT
Source%
0 Ñ Current 1 Ñ Voltage
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set Frequency to 5 digits, Current triggered Set2001F 5.49, 0
6.9.2 FUNCTION Set2001FQ$
Description
Queries the Model 2001 for its Frequency Number of Digits and Measurement Source settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Digits: 4 to 5 (4=3.5d, 5=4.5d) Query 2: Source: VOLT or CURR
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001FQ$ Ô Get Model 2001 Frequency settings Digits$ = ParseQuery$(A$, 1) Ô Extract Number of Digits Source$ = ParseQuery$(A$, 2) Ô Extract Frequency Source
45
6.10 Temperature Functions
These functions setup and return the settings of the conÞgurable options of the Model 2001Õs Temperature measurement function.
6.10.1 SUB Set2001T(Time#, Digits#)
Description
Sets the Model 2001Õs Temperature Aperture Time and Number of Digits.
Parameters
Time# (Aperture time)
166.667e-6s to 166.666667e-3s (60Hz); 2e-4 to .2 (50Hz) MAXIMUM, MINIMUM, or DEFAULT
Digits#
3.5 to 7.4999 (6.5-7.49996.5d, 3.5-4.49993.5d) MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set Temperature to 100msec Integration, and 5½ digits Set2001T .1, 6.49
6.10.2 FUNCTION Set2001TQ$
Description
Queries the Model 2001 for its Temperature Aperture Time and Number of Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Time: 166.667e-6 to .2 Query 2: Digits: 4 to 7 (4=3.5d, 7=6.5d, etc.)
Use ParseQuery$ to separate return string into components.
Example
46
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001TQ$ Ô Get Model 2001 Temperature settings AperTime$ = ParseQuery$(A$, 1) Ô Extract Aperture Time Digits$ = ParseQuery$(A$, 2) Ô Extract Number of Digits
6.10.3 SUB Auto2001T(AutoTime%, AutoDigits%)
Description
Set the Model 2001Õs Temperature Auto Time and Auto Digits settings.
Parameters
AutoTime%, AutoDigits%
-1 = DonÕt set, 0 = Off, +1 = On, +2 = Once The following constants can also be used: NO = -1, TOFF = 0, TON = +1, ONCE = +2
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Turn Model 2001Õs Temperature Auto Time OFF, and Digits ONCE: Auto2001T TOFF, ONCE
6.10.4 FUNCTION Auto2001TQ$
Description
Queries the Model 2001 for its Temperature Auto Time and Auto Digits settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Auto Time: 1 or 0 (1=ON, 0=OFF) Query 2: Auto Digits: 1 or 0 (1=ON, 0=OFF)
Use ParseQuery$ to separate return string into components.
Example
Ô Basic 7.1 or QB45 setup commands called before here A$ = Auto2001TQ$ Ô Get Model 2001 Temperature Auto Settings AutoTime$ = ParseQuery$(A$, 1) Ô Extract Auto Time AutoDigits$ = ParseQuery$(A$, 2) Ô Extract Auto Digits
6.10.5 SUB Set2001RTD(Mode%, RType%, Alpha#, Beta#, Delta#, RZero#)
Description
ConÞgure and use RTDs to make temperature measurements.
47
Parameters
Mode% 2 or 4 (2-wire or 4-wire RTD) Type% 0 = PT385, 1 = PT3916, 2 = USER Alpha# 0.00 to 0.01 (ignored if not USER) Beta# 0.00 to 1.00 (ignored if not USER) Delta# 0.00 to 5.00 (ignored if not USER) RZero# 0.0 to 1000.0 (ignored if not USER)
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set RTD Mode to 4-wire RTD, User, Alpha=.005, Beta= .5 Ô Delta=2.4, and RZero=500 Set2001RTD 4, 2, .005, .5, 2.4, 500
6.10.6 FUNCTION Set2001RTDQ$
Description
Queries the Model 2001 for the Temperature transducer Type, the RTD Type, Alpha, Beta, Delta, and RZero settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Mode: RTD or FRTD or TC Query 2: RType: USER, PT385, or PT3916 Query 3: Alpha: 0.00 to 0.01 Query 4: Beta: 0.00 to 1.00 Query 5: Delta: 0.00 to 5.00 Query 6: RZero: 0 to 1000
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001RTDQ$ Ô Get 2001 RTD settings Mode$ = ParseQuery$(A$, 1) Ô Extract Temp. Device RType$ = ParseQuery$(A$, 2) Ô Extract RTD Type Alpha# = VAL(ParseQuery$(A$, 3)) Ô Extract Alpha setting Beta# = VAL(ParseQuery$(A$, 4)) Ô Extract Beta setting Delta# = VAL(ParseQuery$(A$, 5)) Ô Extract Delta setting RZero# = VAL(ParseQuery$(A$, 6)) Ô Extract RZero setting
48
6.10.7 SUB Set2001TC(TType$)
Description
Sets the thermocouple type and uses TCÕs for temperature measurement.
Parameters
TType$ ÒJÓ, ÒKÓ, ÒTÓ, ÒEÓ, ÒRÓ, ÒSÓ, or ÒBÓ
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Use Type J thermocouples Set2001TC ÒJÓ
6.10.8 FUNCTION Set2001TCQ$
Description
Queries the Model 2001 for the Thermocouple Type.
Returns
ÒError!Ó if a TimeOutError occurred, or ÒJÓ, ÒKÓ, ÒTÓ, ÒEÓ, ÒRÓ, ÒSÓ, or ÒBÓ
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001TCQ$ Ô Get Model 2001 Thermocouple Type
49
50
Section 7
Model 2001 / 7001 Status Commands
These routines control the SCPI Status Model of the Model 2001/7001. Constants (see Status Model Con­stants in Appendix B) are deÞned for all of the registers and their bits to make programming the Model 2001/7001 status model simpler. Please refer to the IEEE-488 Reference Section of the Model 2001 or 7001 manual for more details on the speciÞc bit patterns of these registers and bit patterns.
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
All of these routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout Error occurs. Func­tions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables, Appendix A).
7.1 SUB Stat2001(Event2001%, PTF%, NTF%, SEN%)
SUB Stat7001(Event7001%, PTF%, NTF%, SEN%)
Description
Sets the Model 2001/7001Õs Operation, Trigger, Arm, Sequence, Questionable, or Measurement EventsÕ Pos­itive Transition Filter, Negative Transition Filter, and Status Enable Registers.
Parameters
Event2001%, Event7001%
1 = Operation Event 2 = Trigger Event 3 = Arm Event 4 = Sequence Event 5 = Questionable Event 6 = Measurement Event (Model 2001 Only)
PTF% (Positive Transition Filter) 0 to 32767 NTF% (Negative Transition Filter) 0 to 32767 SEN% (Status Enable Register) 0 to 32767
Example
Ô BASIC7.1 or QB45 setup commands called before here Ô Cause the TRIG and/or ARM bits to be set in the 2001Õs Ô Measurement Event Register when the Model 2001 enters or exits Ô Triggering or Arming Stat2001 MEASUREMENT, TRIG + ARM, TRIG + ARM, TRIG + ARM
51
7.2 FUNCTION Stat2001Q$(Event2001%)
FUNCTION Stat7001Q$(Event7001%)
Description
Queries the Model 2001/7001Õs Operation, Trigger, Arm, Sequence, Questionable, or Measurement EventsÕ Status, Condition, Positive Transition Filter, Negative Transition Filter, and Status Enable Registers.
Parameters
Event2001%, Event7001%
1 = Operation Event 2 = Trigger Event 3 = Arm Event 4 = Sequence Event 5 = Questionable Event 6 = Measurement Event (Model 2001 Only)
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Status Register (0 to 32767) Query 2: Condition Register (0 to 32767) Query 3: Positive Transition Filter (0 to 32767) Query 4: Negative Transition Filter (0 to 32767) Query 5: Status Enable Register (0 to 32767)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Stat7001Q$(OPERATION) Ô Read Model 7001Õs Operation Event Registers StatReg$ = ParseQuery$(A$, 1) Ô Extract Status Register CondReg$ = ParseQuery$(A$, 2) Ô Extract Condition Register PTranReg$ = ParseQuery$(A$, 3) Ô Extract +Transition Reg. NTranReg$ = ParseQuery$(A$, 4) Ô Extract -Transition Reg. SEnableReg$ = ParseQuery$(A$, 5) Ô Status Enable Reg.
7.3 SUB SRE2001(mask%)
SUB SRE7001(mask%)
Description
Enables the Model 2001/7001 to generate a Service Request when the indicated bit(s) of the Status Byte Reg­ister are set. If a bit is already set when this command is given, no Service Request is generated.
Parameters
52
mask% 0 to 255
Example
Ô BASIC 7.1 or QB45 setup commands called before here Poll% = Poll2001% Ô Clear any pending SRQÕs SRE2001 MAV Ô Set up to SRQ on MAV Send2001 ÒFETCH?Ó Ô fetch a 2001 reading DO Ô Set up an uninterruptable wait LOOP UNTIL Wait2001RQS% Reading$ = Q2001$(ÒÒ) Ô Get reading
7.4 SUB ESE2001(mask%)
SUB ESE7001(mask%)
Description
Sets which bits of the Model 2001/7001Õs Standard Event Status Register cause the Event Summary Bit (ESB) of the Status Byte Register to be set.
Parameters
mask% 0 to 255
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Setup an SRQ on OPeration Complete ESE2001 OPC SRE2001 ESB Send2001 ÒVOLTage:DC:RANGe 200;*OPCÓ RQS2001% = Wait2001RQS% Ô Wait until range change complete
7.5 FUNCTION OPC2001$(UnInterruptable%)
FUNCTION OPC7001$(UnInterruptable%)
Description
Performs a Model 2001/7001 *OPC? command which returns a Ò1Ó when the present operation is complete. However, the Ò1Ó may not be output by the 2001/7001 for a long time, which would cause an IEEE timeout on reading data immediately after sending the *OPC?. Thus, this routine waits for a Model 2001/7001 SRQ on MAV after sending the query. The Model 2001/7001 may wait forever to send the Ò1Ó out if :INI­Tiate:CONTinuous ON was explicitly set as in the case of the Factory Defaults. Thus, the :ABORt command would have to be issued before calling these routines.
Parameters
UnInterruptable%
FALSE (0) - the command can be aborted by pressing the Esc key or the right mouse button (BASIC 7.1 only). TRUE (non-zero) - the command cannot be aborted.
53
Returns
ÒError!Ó if a TimeOutError occurred, or Ò1Ó if operation was completed ÒCancelÓ if aborted
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Guarantee that *OPC? will not wait forever. IF Q2001$(ÒINIT:CONT?Ó) = Ò1Ó THEN Send2001 ÒABORTÓ Send2001 ÒVOLTage:DC:RANGe 200Ó OPC$=OPC2001$(TRUE) Ô Wait until range change complete
7.6 SUB Clear2001
SUB Clear7001
Description
Sends the SCPI command *CLS (Clear Status Model) to the 2001/7001.
54
Section 8
Model 2001 / 7001 Scanning Commands
These Routines control the SCPI Trigger Model and Scanning functions of the Model 2001/7001. Please refer to the IEEE-488 Reference Section of the Model 2001 or 7001 manual for more details. All of these routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout Error occurs. Functions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables in Appendix A).
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
See Model 2001/7001 Scanning Minimum and Maximum Constants in Appendix B for CONSTants for use with the Model 2001/7001 Scanning Commands.
8.1 SUB Close2001(Channel%)
Description
Closes a single channel on the Model 2001 scanner card.
Parameters
Channel% 1 to 10
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Take Readings on Channel 3 Close2001 3
8.2 SUB Close7001(ChanList$)
Description
Closes the speciÞed channels on the Model 7001 scanner card.
55
Parameters
ChanList$
Any valid SCPI channel-list like (@1!1, 1!2, 1!4:1!10, 2!1!2) with valid channels depending on the scanner card selected. The Model 7001 EAV bit in the serial poll register must be checked to see if the command was accepted, or watch the front panel of the instrument for an error message.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Close channels 3 to 6 on card 1 Close7001 Ò(@1!3:1!6)Ó
8.3 FUNCTION Close2001Q$
FUNCTION Close7001Q$
Description
Queries the Model 2001/7001 for a list of closed channels. The Model 2001 can have only one channel closed at a time on its internal scanner, whereas the Model 7001 many have none or all channels closed.
Returns
ÒError!Ó if a TimeOutError occurred, or a list of closed channels.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Close2001 2 Ô Close Channel 2 A$ = Close2001Q$ Ô A$ = Ò(@2)Ó
8.4 SUB Open2001(Channel%)
Description
Opens one or all channel(s) on the Model 2001 scanner card.
Parameters
Channel%
0 Ñ Open all channels 1 to 10
56
Example
Ô BASIC 7.1 or QB45 setup commands called before here Open2001 1 Ô Open channel 1 Open2001 0 Ô Open all Model 2001 channels
8.5 SUB Open7001(ChanList$)
Description
Opens the speciÞed channels on the 7001 scanner card.
Parameters
ChanList$
Any valid SCPI channel-list with valid channels depending on the scanner card selected. The Model 7001 EAV bit in the serial poll register must be checked to see if the command was accepted, or watch the front panel of the instrument for an error message.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Open7001 Ò(@1!3:1!6)Ó Ô Open channels 3 to 6 on card 1 Open7001 ÒALLÓ Ô Open all 7001 channels
8.6 SUB Scan2001(ChanList$)
SUB Scan7001(ChanList$)
Description
DeÞnes the Model 2001Õs Internal ScanList or the Model 7001Õs scanlist.
Parameters
ChanList$
Any valid SCPI channel-list like (@1, 2, 4:10) with channels ranging from 1 to 10 for the Model 2001, or like (@1!1:1!40, 2!1:2!40) for the Model 7001. The Model 2001/7001 EAV bit in the serial poll register must be checked to see if the command was accepted, or watch the front panel of the instrument for an error mes­sage.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Scan2001 Ò(@1:10)Ó Ô Scan all Model 2001 channels Scan7001 Ò(@1!1:1!40, 2!1:2!40)Ó Ô Scan all Model 7001 channels
8.7 SUB Arm2001(Count1#, Source1$, Count2#, Delay2#, Source2$)
SUB Arm7001(Count1#, Source1$, Count2#, Delay2#, Source2$)
Description
Sets up the Model 2001/7001Õs Arm Layer 1 (Arm Layer) and Arm Layer 2 (Scan Layer)
57
Parameters
Count1# and Count2#
1 to 99999, 9.9e37 MAXIMUM, MINIMUM, DEFAULT, or INF
Source1$ and Source2$
HOLD Ñ Hold MANual Ñ Manual IMMediate Ñ Immediate TIMEr Ñ Timer (Source2$ only) BUS Ñ IEEE-488 Bus (GET or *TRG) TLINk Ñ Trigger Link EXTernal Ñ External
Delay2#
0 to 999999.999 seconds MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Setup the Model 7001 to do three sets of Þve scans. Each scan starts Ô immediately at 1 hour intervals. Arm7001 3, ÒIMMÓ, 5, MINIMUM, ÒTIMERÓ Timers7001 3600, 1.5
8.8 FUNCTION Arm2001Q$
FUNCTION Arm7001Q$
Description
Queries the Model 2001/7001 for its Arm Layer 1 (Arm Layer) and Arm Layer 2 (Scan Layer) settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Arm Layer 1 Count (1 to 99999, 9.9e+37) Query 2: Arm Layer 1 Source (see Arm2001/7001, short form) Query 3: Arm Layer 2 Count (1 to 99999, 9.9e+37) Query 4: Arm Layer 2 Source (see Arm2001/7001, short form) Query 5: Arm Layer 2 Delay (0 to 999999.999)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Arm7001Q$ Ô Read 7001Õs Arm Layers 1&2 Setup Count1# = VAL(ParseQuery$(A$, 1)) Ô Get Arm Layer 1 Count Source1$ = ParseQuery$(A$, 2) Ô Get Arm Layer 1 Source
58
Count2# = VAL(ParseQuery$(A$, 3)) Ô Get Arm Layer 2 Count Delay2# = VAL(ParseQuery$(A$, 4)) Ô Get Arm Layer 2 Delay Source2$ = ParseQuery$(A$, 5) Ô Get Arm Layer 2 Source
8.9 SUB Trig2001(Count1#, Delay1#, Source1$)
SUB Trig7001(Count1#, Delay1#, Source1$)
Description
Sets up the Model 2001/7001Õs Trigger Sequence (Trigger Layer, i.e., Model 2001 Measure Layer and Model 7001 Channel Layer).
Parameters
Count1#
1 to 99999, 9.9e37 MAXIMUM, MINIMUM, DEFAULT or INF
Delay1#
0 to 999999.999 seconds MAXIMUM, MINIMUM, or DEFAULT
Source1$
HOLD Ñ Hold MANual Ñ Manual IMMediate Ñ Immediate BUS Ñ IEEE-488 Bus (GET or *TRG) TLINK Ñ Trigger Link EXTernal Ñ External
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Setup the 7001 to scan 40 channels with no delay at Ô 1.5 second intervals. Trig7001 40, MINIMUM,ÒTIMÓ Timers7001 3600, 1.5
8.10 FUNCTION Trig2001Q$
FUNCTION Trig7001Q$
Description
Queries the Model 2001/7001 for its Trigger Sequence (Trigger Layer) settings.
59
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Trigger Sequence 1 Count (1 to 99999, 9.9e+37) Query 2: Trigger Sequence 1 Source (see Trig2001/7001, short form) Query 3: Trigger Sequence 1 Delay (0 to 999999.999)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Trig7001Q$ Ô Read 7001Õs Trigger Setup Count1# = VAL(ParseQuery$(A$, 1)) Ô Get Trigger Count Delay1# = VAL(ParseQuery$(A$, 2)) Ô Get Trigger Delay Source1$ = ParseQuery$(A$, 3) Ô Get Trigger Source
8.11 SUB Timers2001(ArmTimer2#, TrigTimer1#)
SUB Timers7001(ArmTimer2#, TrigTimer1#)
Description
Sets the Model 2001/7001Õs Trigger Model timers in Arm Layer 2 (Scan Layer) and Trigger Sequence 1 (Trig­ger Layer).
Parameters
ArmTimer2#, TrigTimer1#
.001 to 999999.999 MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Scan at one hour intervals, trigger at 1.5 seconds intervals. Timers7001 3600, 1.5
8.12 FUNCTION Timers2001Q$
FUNCTION Timers7001Q$
Description
Queries the Model 2001/7001 for its Arm Layer 2 (Scan Layer) and Trigger Sequence 1 (Trigger Layer) timer settings.
Returns
60
ÒError!Ó if a TimeOutError occurred, or Query 1: Arm Layer 2 Timer (see Timers2001/7001)
Query 2: Trigger Sequence Timer (see Timers2001/7001)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Timers7001Q$ Ô Read Arm Layer 1 and Trigger Timers ArmTimer# = VAL(ParseQuery$(A$, 1)) Ô Get Arm Layer 1 Timer TrigTimer# = VAL(ParseQuery$(A$, 2)) Ô Get Trigger Timer
8.13 SUB ArmTcon2001(Dir1$, ILine1%, Oline1%, Dir2$, ILine2%, Oline2%)
SUB ArmT con7001(Dir1$, ILine1%, Oline1%, Dir2$, ILine2%, Oline2%)
Description
Sets the Model 2001/7001Õs Arm Layer 1 (Arm Layer) and Arm Layer 2 (Scan Layer) Trigger conÞgurations. Note that OLine can not be the same as ILine. If they are, the Oline will be made 1 line number (wrapping around to 1 if necessary) higher than the Iline.
Parameters
Dir1$ and Dir2$
ACCeptor Ñ Disable Source Bypass SOURce Ñ Enable Source Bypass
ILine1% and Iline2%
1 to 6 Ñ Trigger Link input line number
OLine1% and Oline2%
1 to 6 Ñ Trigger Link output line number
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô DonÕt bypass Arm Layer 1 source and use Trigger Link Lines Ô 1 and 2 as input and output. Bypass Arm Layer 2 source Ô and use Trigger Link lines 3 and 4 as I/O. ArmTcon7001 ÒACCÓ, 1, 2, ÒSOURCEÓ, 3, 4
8.14 FUNCTION ArmTcon2001Q$
FUNCTION ArmTcon7001Q$
Description
Queries the Model 2001/7001 for its Arm Layer 1 (Arm Layer) and Arm Layer 2 (Scan Layer) trigger con­Þguration settings.
61
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Arm Layer 1 Direction (ACC or SOUR) Query 2: Arm Layer 1 Input Line (1-6) Query 3: Arm Layer 1 Output Line (1-6) Query 4: Arm Layer 2 Direction (ACC or SOUR) Query 5: Arm Layer 2 Input Line (1-6) Query 6: Arm Layer 2 Output Line (1-6)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = ArmTcon7001Q$ ÔGet Arm Layers 1&2 Trigger ConÞguration Dir1$ = (ParseQuery$(A$, 1) Ô Get Arm Layer 1 Direction In1% = VAL(ParseQuery$(A$, 2)) ÔGet Arm Layer 1 Input Line Out1% = VAL(ParseQuery$(A$, 3)) ÔGet Arm Layer 1 Output Line Dir2$ = (ParseQuery$(A$, 4) Ô Get Arm Layer 2 Direction In2% = VAL(ParseQuery$(A$, 5)) ÔGet Arm Layer 2 Input Line Out2% = VAL(ParseQuery$(A$, 6)) ÔGet Arm Layer 2 Output Line
8.15 SUB TrigTcon2001(Dir1$, Synch1$, ILine1%, Oline1%)
SUB TrigTcon7001(Dir1$, Synch1$, ILine1%, Oline1%)
Description
Sets the Model 2001/7001Õs Trigger Sequence 1 and Trigger Sequence 2 trigger conÞgurations. Note that OLine1% can not be the same as ILine1% if Synch1$=ÓASYNÓ. If they are, the Oline1% will be made one line number (wrapping around to 1 if necessary) higher than the Iline1%.
Parameters
Dir1$
ACCeptor Ñ Disable Source Bypass SOURce Ñ Enable Source Bypass
Synch1$
ASYNchronous Ñ Asynchronous Trigger Link SSYNchronous Ñ Semi-Synchronous Link
ILine1%
1-6 Ñ Trigger Link input line number (I/O if SSYN)
OLine1%
62
1-6 Ñ Trigger Link output line number (ignored if SSYN)
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô DonÕt bypass Trigger Sequence 1 source, use the Semi­Ô Synchronous Trigger Link, and use Trigger Link Line 5 as Ô both input and output. TrigTcon7001 ÒACCÓ, ÒSSYNÓ, 5, 6
8.16 FUNCTION TrigTcon2001Q$
FUNCTION TrigTcon7001Q$
Description
Queries the Model 2001/7001 for its Trigger Sequence 1 (Trigger Layer, i.e., Model 2001 Measure Layer and Model 7001 Channel Layer) trigger conÞguration settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Trigger Sequence 1 Direction (ACC or SOUR) Query 2: Trigger Sequence 1 Trigger Link Mode (ASYN or SSYN) Query 3: Trigger Sequence 1 Input Line (1-6) Query 4: Trigger Sequence 1 Output Line (1-6, 0 if SSYN)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = TrigTcon7001Q$ Ô Get Trigger Layer setup from 7001 Dir1$ = (ParseQuery$(A$, 1)) Ô Get Trigger Layer Direction Syn1$ = (ParseQuery$(A$, 2)) Ô Get Trigger Layer Protocol In1% = VAL(ParseQuery$(A$, 3)) Ô Get Trigger Layer Input Line Out1% = VAL(ParseQuery$(A$, 4)) Ô Get Trigger Layer Output Line
63
64
Section 9
Model 2001 Calculate Commands
These Routines control the Model 2001Õs Calculate subsystem capabilities, which include limit testing, mX+B, percent, and data buffer statistics.
All of these routines will set the Global Variable TimeOutError% if an IEEE-488 Timeout Error occurs. Func­tions that have bounded parameters (maximum and/or minimum parameters) will set the Global Variable OutOfRange% if a parameter is not within the limits speciÞed (see Global Variables in Appendix A).
See Model 2001 Minimum and Maximum Calculate Constants in Appendix B for CONSTants for use with the Model 2001 Calculate commands.
9.1 SUB Set2001Calc1MXB(MMFactor#, MBFactor#)
Description
Sets the Model 2001Õs CALCulate1 subsystemÕs Mx+B coefÞcients and enables the Mx+B mode of operation.
Parameters
MMFactor#
-9.999999999e20 to +9.999999999e20
MBFactor#
-9.999999999e30 to +9.999999999e30
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set and use mX+b with slope of 10 and intercept of 5 Set2001Calc1MXB 10, 5
9.2 SUB Set2001Calc1PERC(Percent#)
Description
Sets the Model 2001Õs CALCulate1 SubsystemÕs Percentage target and enables the percentage mode of op­eration.
65
Parameters
Percent# -9.999999999e35 to +9.999999999e35
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set 100% of full scale at 15.24 Set2001Calc1PERC 15.24
9.3 SUB Calc1.2001(State%)
Description
Sets the state of the Model 2001Õs CALCulate1 Subsystem.
Parameters
State%
0, TOFF = Turn CALC1 Off +1, TON = Turn CALC1 On
Example
Ô BASIC 7.1 or QB45 setup commands called before here Calc1.2001 TOFF Ô Turn off CALC1 System
9.4 FUNCTION Set2001Calc1Q$
Description
Queries the Model 2001 for its CALCulate1 SubsystemÕs State, MMFactor, MBFactor, and Percent settings.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: CALCulate1Õs State (1 or 0) Query 2: CALCulate1Õs MMFactor (see Set2001Calc1MXB) Query 3: CALCulate1Õs MBFactor (see Set2001Calc1MXB) Query 4: CALCulate1Õs Percent (see Set2001Calc1PERC)
Use ParseQuery$ to separate return string into components.
Example:
66
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001Calc1Q$ Ô Get 2001 CALC1 settings Calc1State$ = ParseQuery$(A$, 1) Ô Get CALC1Õs State
MMFactor# = VAL(ParseQuery$(A$, 2)) ÔGet slope of mX+b MBFactor# = VAL(ParseQuery$(A$, 3)) Ô Get intercept of mX+b Percent# = VAL(ParseQuery$(A$, 4)) Ô Get 100% value
9.5 FUNCTION Calc1.2001Q$
Description
Queries the Model 2001 for the result of the latest CALCulate1 calculation.
Returns
ÒError!Ó if a TimeOutError occurred, or Model 2001Õs present CALCulate1 calculation.
Example
Ô BASIC 7.1 or QB45 setup commands called before here Set2001Calc1MXB 10, 5 Ô Reading from SENSe:DATA? is 10.4 PRINT Calc1.2001Q$ Ô Outputs 109
9.6 SUB Set2001Calc2(Format$)
Description
Sets up the Model 2001 Data BufferÕs Format and activates the CALCulate2 subsystem.
Parameters
Format$
NONE MEAN SDEViation (Standard Deviation) MAXimum MINimum PKPK (Peak to Peak)
Example
Ô BASIC 7.1 or QB45 setup commands called before here Set2001Calc2 ÒMAXIMUMÓ Ô calculate maximum of data buffer Calc2.2001 TON Ô Data buffer contains 1.122, 10.211, 10.2222 Ô A$ = Calc2.2001Q$ Ô A$ = Ò10.2222Ó
67
9.7 SUB Calc2.2001(State%)
Description
Sets the state of the Model 2001Õs CALCulate2 Subsystem.
Parameters
State%
0, TOFF = Turn CALC2 Off +1, TON = Turn CALC2 On
Example
Ô BASIC 7.1 or QB45 setup commands called before here Calc2.2001 0 Ô Turn off CALC2 System
9.8 FUNCTION Set2001Calc2Q$
Description
Queries the Model 2001 for its CALCulate2 subsystemÕs Format and State.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: CALCulate 2 Format (see Set2001Calc2 above) Query 2: CALCulate 2 State (0 or 1)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001Calc2Q$ Ô Get 2001 CALC2 settings Format$ = ParseQuery$(A$, 1) Ô Get CALC2Õs Format Calc2State$ = ParseQuery$(A$, 2) Ô Get CALC2Õs State
9.9 FUNCTION Calc2.2001Q$
Description
Queries the Model 2001 for the result of the present CALCulate2 subsystemÕs calculation.
Returns
68
ÒError!Ó if a TimeOutError occurred, or the result of the present CALC2 calculation.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Calc2.2001Q$ Ô Get 2001 CALC2Õs last result
9.10 SUB Set2001Calc3(Upper1#, Lower1#, Upper2#, Lower2#)
Description
Sets the Model 2001Õs CALCulate3 subsystems Limit Testing Hi/Lo Limits.
Parameters
Upper1#, Upper2#, Lower1#, Lower2#
-9.999999999e35 to +9.999999999e35 MAXIMUM, MINIMUM, or DEFAULT
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Setup Limit Testing Ranges Ô Limit 1 Range: -100.56 to -10.5 or 10.5 to 100.56 Ô Limit 2 Range: <-100.56 or >100.56 Ô Pass Range: -10.5 to 10.5 Set2001Calc3 10.5, -10.5, 100.56, -100.56
9.11 FUNCTION Set2001Calc3Q$
Description
Queries the Model 2001 for its CALCulate3 subsystems Limit Testing Hi/Lo Limits.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: limit testing Upper Limit 1 Query 2: limit testing Lower Limit 1 Query 3: limit testing Upper Limit 2 Query 4: limit testing Lower Limit 2
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001Calc3Q$ Ô Get Model 2001 CALC3 settings Upper1# = VAL(ParseQuery$(A$, 1)) Ô Get Upper Limit 1 Lower1# = VAL(ParseQuery$(A$, 2)) Ô Get Lower Limit 1 Upper2# = VAL(ParseQuery$(A$, 3)) Ô Get Upper Limit 2 Lower2# = VAL(ParseQuery$(A$, 4)) Ô Get Lower Limit 2
69
9.12 SUB Calc3.2001(State%)
Description
Sets the state of the Model 2001Õs CALCulate3 Subsystem.
Parameters
State%
0, TOFF = Turn CALC3 Off +1, TON = Turn CALC3 On
Example
Ô BASIC 7.1 or QB45 setup commands called before here Calc3.2001 TON Ô Turn on CALC3 System
9.13 SUB Set2001Calc3Dig(Du1%, Dl1%, Du2%, Dl2%)
Description
Sets the Model 2001Õs CALCulate3Õs Limit Testing HI/Lo Digital Output values.
Parameters
Du1% Value (0-15) to place on digital output to indicate Upper 1 Limit Reached Dl1% Value (0-15) to place on digital output to indicate Lower 1 Limit Reached Du2% Value (0-15) to place on digital output to indicate Upper 2 Limit Reached Dl2% Value (0-15) to place on digital output to indicate Lower 2 Limit Reached
Example
Ô BASIC 7.1 or QB45 setup commands called before here Ô Set 1st bit of digital output if Upper Limit 1 Reached Ô Set 2nd bit of digital output if Lower Limit 1 Reached Ô Set 3rd bit of digital output if Upper Limit 2 Reached Ô Set 4th bit of digital output if Lower Limit 2 Reached Set2001Calc3Dig 1, 2, 4, 8
9.14 FUNCTION Set2001Calc3DigQ$
Description
Queries the Model 2001 for its CALCulate3 subsystemÕs Limit Testing HI/LO Digital Output Values.
70
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: digital output Upper Limit 1 value
Query 2: digital output Lower Limit 1 value Query 3: digital output Upper Limit 2 value Query 4: digital output Lower Limit 2 value
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Set2001Calc3DigQ$ Ô Get Model 2001 CALC3 Digital I/O settings Du1% = VAL(ParseQuery$(A$, 1)) Ô Get UpLim1 DigI/O Value Dl1% = VAL(ParseQuery$(A$, 2)) Ô Get LoLim1 DigI/O Value Du2% = VAL(ParseQuery$(A$, 3)) Ô Get UpLim2 DigI/O Value Dl2% = VAL(ParseQuery$(A$, 4)) Ô Get LoLim2 DigI/O Value
9.15 FUNCTION Calc3.2001Q$
Description
Queries the Model 2001 for the result of the present CALCulate3 subsystemÕs calculation.
Returns
ÒError!Ó if a TimeOutError occurred, or Query 1: Upper/Lower Limit Range 1 result (0=PASS or 1=FAIL) Query 2: Upper/Lower Limit Range 2 result (0=PASS or 1=FAIL)
Use ParseQuery$ to separate return string into components.
Example
Ô BASIC 7.1 or QB45 setup commands called before here A$ = Calc3.2001Q$ Ô Get Model 2001 CALC3 Limit Test Results Test1$ = ParseQuery$(A$, 1) Ô Get Upper/Lower 1 Test Result Test2$ = ParseQuery$(A$, 2) Ô Get Upper/Lower 2 Test Result
71
72
Appendix A
Model 2001/7001 Global V ariables
The following is a list of all the global variables used by the Model 2001/7001 Support Software for Mi­crosoft QuickBASIC 4.5 and Professional BASIC 7.1:
KI2001% Global variable that contains the Model 2001Õs IEEE address. KI7001% Global variable that contains the Model 7001Õs IEEE address. TimeOutError% Set to TRUE (-1) when a timeout error occurs. brd0% The location of board ÒGPIB0Ó for National Instruments. Nat2001Addr% Integer value of the actual Model 2001 IEEE Address for use with National Instruments
board commands.
Nat7001Addr% Integer value of the actual Model 7001 IEEE Address for use with National Instruments
board commands.
IeeeIn% Integer value of the Þle handle used for IOTech Driver 488 input operations. IeeeOut% Integer value of the Þle handle used for IOTech Driver 488 output operations. Resp$ 2048 byte Þxed-length string used for the input string on all IEEE-488 read functions. IeeeInterface% Contains a number from 1 to 4 indicating the IEEE interface as deÞned by the constants
below:
IEEECEC (1) Capital Equipment Corp. IEEEIOTECH (2) IOTech Driver 488 IEEENATIONALOLD (3) National Instruments NI-488 (C.10 or C.11) IEEENATIONALNEW (4) NI-488 (C.12 or greater) or NI-488.2
OutOfRange% Set to TRUE (-1) whenever a parameter given to a Set Model 2001/7001 routine is out
of range.
NOTE
These variables also support the Model 7002 Switch System.
73
74
Appendix B
Model 2001 / 7001 Constants
The following Model 2001/7001 Support Software CONSTants are deÞned to make using the support soft­ware easier. The use of these constants are deÞned below and in the appropriate group of routines that use them.
NOTE
These constants also support the Model 7002 Switch System.
B.1 Function Constants
DCV (1) DC Voltage ACV (2) AC Voltage DCA (3) DC Current ACA (4) AC Current R2 (5) 2-wire Resistance R4 (6) 4-wire Resistance FREQ (7) Frequency TEMP (8) Temperature
B.2 Status Model Constants
For use with Stat2001, Stat2001Q$, Stat7001, Stat7001Q$:
OPERATION (1) Operation Event TRIGGER1 (2) Trigger Event ARM1 (3) Arm Event SEQUENCE (4) Sequence Event QUESTIONABLE (5) Questionable Event MEASUREMENT (6) Measurement Event
Constants for use with *STB?, *SRE, *SRE?, and serial poll:
MSB ( 1) Measurement Summary Bit (Model 2001 Only) EAV ( 4) Error Available QSB ( 8) Questionable Summary Bit (in Model 7001 only for SCPI) MAV ( 16) Message Available ESB ( 32) Event Summary Bit RQS1 ( 64) Request for Service (Serial Poll) MSS ( 64) Master Summary Status (Status Byte) OSB (128) Operation Summary Bit
75
Constants for use with *ESR?, *ESE, and *ESE?:
OPC ( 1) Operation Complete RQC ( 2) Request Control (not used in Model 2001/7001) QYE ( 4) Query Error DDE ( 8) Device SpeciÞc Error EXE ( 16) Execution Error CME ( 32) Command Error URQ ( 64) User Request PON (128) Power On
Constants for use with the Operation Event Condition Register, Positive Transition Filter, Negative Transi­tion Filter, Status Register, and Status Enable Register:
CAL ( 1) Calibrating (Model 2001 only) SET ( 2) Settling TRIG ( 32) Waiting for Trigger ARM ( 64) Waiting for Arm CALC ( 512) Calculating (Model 2001 only) SCAN (1024) Scanning (Model 7001 only) IDLE (1024) in IDLE layer (Model 2001 only)
Constants for use with the Trigger Event Condition Register, Positive Transition Filter, Negative Transition Filter, Status Register, and Status Enable Register:
SEQ1 (2) Model 2001/7001 is in the Trigger Layer of Sequence 1.
Constants for use with the Arm Event Condition Register, Positive Transition Filter, Negative Transition Fil­ter, Status Register, and Status Enable Register:
SEQ1 (2) Model 2001/7001 is in the ARM Layer of Sequence 1.
Constants for use with the Sequence Event Condition Register, Positive Transition Filter, Negative Transi­tion Filter, Status Register, and Status Enable Register:
LAY1 (2) Model 2001 or 7001 is in the Arm Layer 1 of Sequence 1. LAY2 (4) Model 2001 or 7001 is in the Arm Layer 2 of Sequence 1.
Constants for use with the Model 2001 Questionable Event Condition Register, Positive Transition Filter, Negative Transition Filter, Status Register, and Status Enable Register:
QTEMP ( 16) Questionable Calibration Process QCAL ( 128) Questionable Calibration Process WARN (16384) Command Warning
76
Constants for use with the Model 2001 Measurement Event Condition Register, Positive Transition Filter, Negative Transition Filter, Status Register, and Status Enable Register:
ROF ( 1) Reading OverFlow LL1 ( 2) Low Limit 1 HL1 ( 4) High Limit 1 LL2 ( 8) Low Limit 2 HL2 ( 16) High Limit 2 RAV ( 32) Reading AVailable BAV ( 128) Buffer AVailable BHF ( 256) Buffer Half Full BFL ( 512) Buffer FuLl BPT (2048) Buffer PreTrigger event occurred
B.3 Automatic Constants
Use these constants with the Model 2001 Auto measurement functions, like AutoDCV, or any Model 2001/ 7001 function that requires an ON or OFF state.
NO (-1) DonÕt set automatic parameter. TOFF (+0) Turn off automatic parameter. TON (+1) Turn on automatic parameter. ONCE (+2) Set auto parameter for the next measurement.
B.4 Model 2001 Minimum and Maximum Sense Constants
MINACA = -2.1# MAXACA = 2.1# MINDCA = -2.1# MAXDCA = 2.1# MINACV = -775# MAXACV = 775# MINDCV = -1100# MAXDCV = 1100# MINR2 = 0# MAXR2 = 1050000000# MINR4 = 0# MAXR4 = 21000# MINFREQ = 0# MAXFREQ = 1500000# MINTEMPF = -328# MAXTEMPF = 3310# MINTEMPC = -200# MAXTEMPC = 1821# MINTEMPK = 73# MAXTEMPK = 2094# MINSIMF = 32# MAXSIMF = 122# MINSIMC = 0# MAXSIMC = 50# MINSIMK = 273# MAXSIMK = 323# MINTCO = -.09999# MAXTCO = .09999# MINALPHA = 0# MAXAPLHA = .01# MINBETA = 0# MAXBETA = 1# MINDELTA = 0# MAXDELTA = 5# MINRZERO = 0# MAXRZERO = 1000# MINDIG = 3.5 MAXDIG = 8.4999 MINNPLC = .01# MAXNPLC = 10#
77
MINAVGCNT = 1# MAXAVGCNT = 100# MINNTOL = 1# MAXNTOL = 100# MINPWIN = .1# MAXPWIN = 9.9# MAXTEMPDIG = 7.4999 MAXFREQDIG = 5.4999 MAXFREQV = 1000# MINFREQV = -1000# MAXFREQI = 1# MINFREQI = -1# MAXFREQPERC = .6# MINRANGE = 0#
B.5 Model 2001 Minimum and Maximum Calculate Constants
MINCALC = -9.999999D+35 MAXCALC = 9.999999D+35 MINPERC = -9.999999D+35 MAXPERC = 9.999999D+35 MINMMF = -9.999999D+20 MAXMMF = 9.999999D+20 MINMBF = -9.999999D+30 MAXMBF = 9.999999D+30 MINDIGITAL = 0 MAXDIGITAL = 15
B.6 Model 2001/7001 Scanning Minimum and Maximum Constants
MINCOUNT = 1 MAXCOUNT = 99999 MINDELAY = 0# MAXDELAY = 999999.999# MINLINE = 1 MAXLINE = 6 MINCHANNEL = 1 MAXCHANNEL = 10 MINTIMER = .001# MAXTIMER = 999999.999#
B.7 Read2001BufferS% and Read2001BufferD% Constants
BUFRDGS = 1 BUFTIMESTAMP = 2 BUFCHANNELS = 3 BUFSTATUS = 4 BUFUNITS = 5
B.8 Examples
To set the Model 2001 to generate a Service Request on EAV or MAV use the following:
SRE2001 EAV OR MAV
To check for MAV being set in the Status Byte:
poll%=val(Q2001$(Ò*STB?Ó)) IF (poll% AND MAV) THEN PRINT ÒMAV is set.Ó
78
Appendix C
Model 2001 / 7001 Support Software
File Names and Routines
C.1 Microsoft Basic 7.1 File Names
C.1.1 Header Files
20017001.BI Ñ 2001/7001 Header File w/CONST & Routine declares 2001DEMO.BI Ñ 2001 Demo program include Þle GENERAL .BI Ñ Revised BASIC 7.1 include Þle
C.1.2 Model 2001/7001 Demo Program Files
2001BUFF.BAS Ñ 2001 Demo Buffer handling routines:
BufferCalc, DisplayReadings, GraphReadings, ReadBuffer, TakeBufferRdgs
2001CFG .BAS Ñ 2001 Demo conÞguration routines:
SetupFunction
2001CFG1.BAS Ñ 2001 Demo conÞguration routines:
AutoButtons, Reset2001, Set2001AutoZero, Set2001LineSynch, TempRef2001, Units2001
2001DEM1.BAS Ñ 2001 Demo Main program module (secondary):
delay1, InputLine, SetupMenu, WindowBox2
2001DEMO.BAS Ñ 2001 Demo Main program module:
CheckMinMaxVal, ColorDisplay, Comline, ConvertMinMaxDef, GetInfoRecord, MonoDisplay
2001FILE.BAS Ñ 2001 Demo File Handling routines:
GetLSAFileName, Load2001Data, RecallStoreSetup, Save2001Data, ViewFile
2001INFO.BAS Ñ 2001 Demo Help routines:
InfoBuffer, InfoCalc, InfoChange2001Function, InfoChange2001Address, InfoConÞg, InfoDeltaRatioConÞg, InfoDemo, InfoDisplay1, InfoGraphData, InfoOpenCloseRelay, InfoPick2001ScanFunc, InfoSendGetSCPI, InfoServiceRequest, InfoSetup2001IntScanList,
InfoSetupLayer, InfoSetViewStatus, InfoStandarEvent, InfoStoreRecall, InfoTempRef, InfoUnits 2001INFO.IDX Ñ 2001 Demo Help File indices 2001INFO.TXT Ñ 2001 Demo Help File Text 2001MEAS.BAS Ñ 2001 Demo measuring routines:
ButtonFlag1, Display2001Rdg, DisplayCurrent3, DisplayVoltage3, Format2001Reading, LimitTesting,
Measure, ReadCalculate, Restore2001Format, Set2001Format, SetupCalculate 2001SCAN.BAS Ñ 2001 Demo Scanning routines:
Change2001ScanFunction, DeltaRatioConÞg, OpenClose2001Relay, OpenClose7001Relay,
Pick2001ScanFunction, Set2001IntExtChannels, Setup2001ExtScanList, Setup2001IntScanList,
Setup7001ScanList, SetupLayer 2001STAT.BAS Ñ 2001 Demo Status Model routines:
ChangeAddress, Check, Checked, ClearStatus, Display1, SendGetSCPI, ServiceRequest, SetViewStatus,
StandardEvent, ViewStatusModel MAKEINFO.BAS Ñ Generates 2001INFO.IDX and 2001INFO.TXT (run from QBX environment):
AddIndex, AddText, Str1
79
C.1.3 Model 2001/7001 IEEE Interface Independent Files
27001 .BAS Ñ 2001/7001 Routines:
2001/7001 Display and General routines:
Disp2001, Disp7001, KIDisp, KINoDisp, NoDisp2001, NoDisp7001, Check2001Val, KIQ, KISend
2001 Function & Buffer routines:
ACA2001, ACV2001, BufferSize2001, DCA2001, DCV2001, FREQ2001, Get2001Func, Get2001FuncHeader, Get2001Rdg, Get2001SaveRecallSize, Get2001Units, Get2RES2001, Get4RES2001, GetACA2001, GetACV2001, GetDCA2001, GetDCV2001, GetFREQ2001, GetTEMP2001, Hit2001Key, Hit2001Key1, RES2.2001, RES4.2001, Set2001Function, Take2001BufferReadings, TEMP2001
2001 Automatic ConÞguration routines:
Auto2001, Auto2001ACA, Auto2001ACAQ, Auto2001ACV, Auto2001ACVQ, Auto2001DCA, Auto2001DCAQ, Auto2001DCV, Auto2001DCVQ, Auto2001Q, Auto2001R2, Auto2001R2Q, Auto2001R4, Auto2001R4Q, Auto2001T, Auto2001TQ
2001 CALCulate Subsytem routines:
Calc1.2001, Calc1.2001Q, Calc2.2001, Calc2.2001Q, Calc3.2001, Calc3.2001Q, Set2001Calc1MXB, Set2001Calc1PERC, Set2001Calc1Q, Set2001Calc2, Set2001Calc2Q, Set2001Calc3, Set2001Calc3Dig, Set2001Calc3DigQ, Set2001Calc3Q
2001 conÞguration routines:
Set2001, Set2001ACA, Set2001ACAQ, Set2001ACV, Set2001ACVQ, Set2001DCA, Set2001DCAQ, Set2001DCV, Set2001DCVQ, Set2001F, Set2001FQ, Set2001Q, Set2001R2, Set2001R2Q, Set2001R4, Set2001R4Q, Set2001RTD, Set2001RTDQ, Set2001T, Set2001TC, Set2001TCQ, Set2001TQ
2001/7001 Status Model routines:
Clear2001, Clear7001, ESE2001, ESE7001, KIESE, KISRE, KIStat, KIStatQ, SRE2001, SRE7001, Stat2001, Stat2001Q, Stat7001, Stat7001Q
2001/7001 Trigger Model routines:
Arm2001, Arm2001Q, Arm7001, Arm7001Q, ArmTcon2001, ArmTcon2001Q, ArmTcon7001, ArmTcon7001Q, Close2001, Close2001Q, Close7001, Close7001Q, KIArm, KIArmQ, KIArmTcon, KIArmTconQ, KICloseQ, KITimers, KITimersQ, KITrig, KITrigQ, KITrigTcon, KITrigTconQ, Open2001, Open7001, Scan2001, Scan7001, Timers2001, Timers2001Q, Timers7001, Timers7001Q, Trig2001, Trig2001Q, Trig7001, Trig7001Q, TrigTcon2001, TrigTcon2001Q, TrigTcon7001, TrigTcon7001Q
GENRLQBX.BAS Ñ 2001/7001 General Routines:
AutoGraphicsMode, IOTECH, ParseQuery, Str1, DataViewS, XYGraphS, DataViewD, XYGraphD GENERAL .OBJ Ñ Object Þle from BASIC 7.1 GENERAL.BAS MAKEFILE. Ñ File for BASIC 7.1 NMAKE program to create various the *.LIB, *.QLB, *.EXE Þles of the
BASIC 7.1 routines MENU .OBJ Ñ Object Þle from BASIC 7.1 MENU.BAS MOUSE .OBJ Ñ Object Þle from BASIC 7.1 MOUSE.BAS QBX .LIB Ñ Library Þle from BASIC 7.1 UIASM .OBJ Ñ Object Þle from BASIC 7.1 WINDOW .OBJ Ñ Object Þle from BASIC 7.1 WINDOW.BAS
80
C.1.4 Capital Equipment Corp. (CEC) IEEE-488 Interface Files
CECQBX .BAS Ñ Basic 7.1 CEC 2001/7001 source
DataInvalid, Gpiberror, OPC2001, OPC7001, Poll2001, Poll7001, Q2001, Q7001, Send2001, Send7001,
SendGET2001, SendGET2001, SendSDC2001, SendSDC7001, Wait2001RQS, Wait7001RQS, SetupIEEE,
Read2001BufferS, Read2001BufferD
CECQBX .LIB Ñ BASIC 7.1 CEC 2001/7001 driver library CECQBX .QLB Ñ BASIC 7.1 CEC 2001/7001 quick library CECQBX .BAT Ñ BASIC 7.1 CEC 2001/7001 QBX environment loader ERRORDIS.CEC Ñ CEC interface detection disabled if this Þle exists. CECB7 .BI Ñ ModiÞed CEC BASIC 7.1 include Þle CECB7 .OBJ Ñ CEC driver library MAKECEC .BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for Capital Equipment Corp. MAKECEC .LNK Ñ Make CEC Demo Program 2001CEC .EXE Ñ 2001 CEC Demo Program
C.1.5 IOTech Driver 488 Interface Files
IOTQBX .BAS Ñ BASIC 7.1 IOTech 2001/7001 driver library source
DataInvalid, Gpiberror, OPC2001, OPC7001, Poll2001, Poll7001, Q2001, Q7001, Send2001, Send7001,
SendGET2001, SendGET2001, SendSDC2001, SendSDC7001, Wait2001RQS, Wait7001RQS, SetupIEEE,
Read2001BufferS, Read2001BufferD IOTQBX .LIB Ñ BASIC 7.1 IOTech 2001/7001 driver library IOTQBX .QLB Ñ BASIC 7.1 IOTech 2001/7001 driver quick library IOTQBX .BAT Ñ BASIC 7.1 IOTEch 2001/7001 QBX environment loader MAKEIOT .BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for IOTech Driver 488. MAKEIOT .LNK Ñ Make IOTech Demo Program 2001IOT .EXE Ñ 2001 IOTech Demo Program
C.1.6 National Instruments NI-488 rev C.11 Files
NATQBX1 .BAS Ñ BASIC 7.1 old NI 2001/7001 driver library source
DataInvalid, Gpiberror, OPC2001, OPC7001, Poll2001, Poll7001, Q2001, Q7001, Send2001, Send7001,
SendGET2001, SendGET2001, SendSDC2001, SendSDC7001, Wait2001RQS, Wait7001RQS, SetupIEEE,
Read2001BufferS, Read2001BufferD NATQBX1 .LIB Ñ BASIC 7.1 old NI 2001/7001 driver library NATQBX1 .QLB Ñ BASIC 7.1 old NI 2001/7001 driver quick library NATQBX1 .BAT Ñ BASIC 7.1 old NI 2001/7001 QBX environment loader NI4881B7.BI Ñ Old NI header Þle NI4881B7.OBJ Ñ Old NI object Þle NI4881B7.C Ñ Old NI-488 BASIC 7.1 to Quick C link C Þle NI4881B7.H Ñ Old NI-488 BASIC 7.1 to Quick C link header Þle NI4881 .LIB Ñ Old NI-488 BASIC 7.1 to Quick C link library NI4881 .OBJ Ñ Old NI-488 BASIC 7.1 to Quick C link object Þle MAKENAT1.BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for National Instruments NI-488 (rev C.11
and older) MAKENAT1.LNK Ñ Make old NI Demo Program 2001NAT1.EXE Ñ 2001 National Instruments (NI-488 rev <= C.11) Demo Program
81
C.1.7 National Instruments NI-488 rev C.12 (and newer) and NI-488.2 Files
NATQBX2 .BAS Ñ BASIC 7.1 new NI 2001/7001 driver library source
DataInvalid, Gpiberror, OPC2001, OPC7001, Poll2001, Poll7001, Q2001, Q7001, Send2001, Send7001, SendGET2001, SendGET2001, SendSDC2001, SendSDC7001, Wait2001RQS, Wait7001RQS, SetupIEEE,
Read2001BufferS, Read2001BufferD NATQBX2 .LIB Ñ BASIC 7.1 new NI 2001/7001 driver library NATQBX2 .QLB Ñ BASIC 7.1 new NI 2001/7001 driver quick library NATQBX2 .BAT Ñ BASIC 7.1 new NI 2001/7001 QBX environment loader NI4882B7.BI Ñ New NI header Þle NI4882B7.OBJ Ñ New NI object Þle. MAKENAT2.BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for NI-488.2 and NI-488 (rev C.12 and
newer) MAKENAT2.LNK Ñ Make new NI Demo Program 2001NAT2.EXE Ñ 2001 NI-488 rev >= C.12 & NI-488.2 Demo Program
C.2 Microsoft QuickBasic 4.5 File Names
C.2.1 Model 2001/7001 IEEE Interface Independent Files
20017001.BI Ñ 2001/7001 Header File w/CONST & Routine declares 2001 .BAS Ñ 2001 Function & Buffer routines:
ACA2001, ACV2001, BufferSize2001, DCA2001, DCV2001, FREQ2001, Get2001Func,
Get2001FuncHeader, Get2001Rdg, Get2001SaveRecallSize, Get2001Units, Get2RES2001, Get4RES2001,
GetACA2001, GetACV2001, GetDCA2001, GetDCV2001, GetFREQ2001, GetTEMP2001, Hit2001Key,
Hit2001Key1, RES2.2001, RES4.2001, Set2001Function, Take2001BufferReadings, TEMP2001 AUTO2001.BAS Ñ 2001 Automatic ConÞguration routines:
Auto2001, Auto2001ACA, Auto2001ACAQ, Auto2001ACV, Auto2001ACVQ, Auto2001DCA,
Auto2001DCAQ, Auto2001DCV, Auto2001DCVQ, Auto2001Q, Auto2001R2, Auto2001R2Q,
Auto2001R4, Auto2001R4Q, Auto2001T, Auto2001TQ CALC2001.BAS Ñ 2001 CALCulate Subsytem routines:
Calc1.2001, Calc1.2001Q, Calc2.2001, Calc2.2001Q, Calc3.2001, Calc3.2001Q, Set2001Calc1MXB,
Set2001Calc1PERC, Set2001Calc1Q, Set2001Calc2, Set2001Calc2Q, Set2001Calc3, Set2001Calc3Dig,
Set2001Calc3DigQ, Set2001Calc3Q SETS2001.BAS Ñ 2001 conÞguration routines:
Set2001, Set2001ACA, Set2001ACAQ, Set2001ACV, Set2001ACVQ, Set2001DCA, Set2001DCAQ,
Set2001DCV, Set2001DCVQ, Set2001F, Set2001FQ, Set2001Q, Set2001R2, Set2001R2Q, Set2001R4,
Set2001R4Q, Set2001RTD, Set2001RTDQ, Set2001T, Set2001TC, Set2001TCQ, Set2001TQ SCPIDISP.BAS Ñ 2001/7001 Display routines:
Disp2001, Disp7001, KIDisp, KINoDisp, NoDisp2001, NoDisp7001 SCPISTAT.BAS Ñ 2001/7001 Status Model routines:
Clear2001, Clear7001, ESE2001, ESE7001, KIESE, KISRE, KIStat, KIStatQ, SRE2001, SRE7001, Stat2001,
Stat2001Q, Stat7001, Stat7001Q SCPITRIG.BAS Ñ 2001/7001 Trigger Model routines:
Arm2001, Arm2001Q, Arm7001, Arm7001Q, ArmTcon2001, ArmTcon2001Q, ArmTcon7001,
ArmTcon7001Q, Close2001, Close2001Q, Close7001, Close7001Q, KIArm, KIArmQ, KIArmTcon,
KIArmTconQ, KICloseQ, KITimers, KITimersQ, KITrig, KITrigQ, KITrigTcon, KITrigTconQ, Open2001,
Open7001, Scan2001, Scan7001, Timers2001, Timers2001Q, Timers7001, Timers7001Q, Trig2001,
Trig2001Q, Trig7001, Trig7001Q, TrigTcon2001, TrigTcon2001Q, TrigTcon7001, TrigTcon7001Q GENERAL1.BAS Ñ 2001/7001 General Routines:
82
AutoGraphicsMode, Check2001Val, IOTECH, OPC2001, OPC7001, ParseQuery, Poll2001, Poll7001,
Q2001, Q7001, Send2001, Send7001, SendGET2001, SendGET7001, SendSDC2001, SendSDC7001, Str1,
Wait2001RQS, Wait7001RQS GENERALS.BAS Ñ 2001/7001 Single Precision General Routines:
DataViewS, XYGraphS GENERALD.BAS Ñ 2001/7001 Double Precision General Routines:
DataViewD, XYGraphD NEWER .EXE Ñ Program used to determine if a .BAS Þle is older than its.OBJ Þle, returns 2 if an error
occurred, 1 if the .BAS is newer than its .OBJ Þle, 0 if the .BAS Þle is older
C.2.2 Capital Equipment Corp. (CEC) IEEE-488 Interface Files
CEC .LIB Ñ QuickBASIC 4.5 CEC 2001/7001 library CEC .QLB Ñ QuickBASIC 4.5 CEC quick library CEC .BAS Ñ QuickBASIC 4.5 CEC 2001/7001 source DataInvalid, Gpiberror, KIOPC, KIPoll, KIQ, KISend,
KISendGET, KISendSDC, KIWaitRQS, ModelNumber, SetupIEEE CECS .BAS Ñ QuickBASIC 4.5 CEC 2001/7001 source Read2001BufferS CECD .BAS Ñ QuickBASIC 4.5 CEC 2001/7001 source Read2001BufferD CECQB .BI Ñ ModiÞed CEC QuickBASIC 4.5 include Þle ERRORDIS.CEC Ñ CEC interface detection is disabled if this Þle exists MAKECEC .BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for Capital Equipment Corp.
C.2.3 IOTech Driver 488 Interface Files
IOTECH .LIB Ñ QuickBASIC 4.5 IOTech 2001/7001 driver library IOTECH .QLB Ñ QuickBASIC 4.5 IOTech 2001/7001 quick library IOTECH .BAS Ñ QuickBASIC 4.5 IOTech 2001/7001 source DataInvalid, Gpiberror, KIOPC, KIPoll, KIQ,
KISend, KISendGET, KISendSDC, KIWaitRQS, ModelNumber, SetupIEEE IOTECHS .BAS Ñ QuickBASIC 4.5 IOTech 2001/7001 source Read2001BufferS IOTECHD .BAS Ñ QuickBASIC 4.5 IOTech 2001/7001 source Read2001BufferD MAKEIOT .BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for IOTech Driver 488.
C.2.4 National Instruments NI-488 rev C.11 Files
NAT488_1.BAS Ñ QuickBASIC 4.5 old NI 2001/7001 source DataInvalid, Gpiberror, KIOPC, KIPoll, KIQ, KISend, KISendGET, KISendSDC, KIWaitRQS, ModelNumber, SetupIEEE
NAT4881S.BAS Ñ QuickBASIC 4.5 old NI 2001/7001 source Read2001BufferS NAT4881D.BAS Ñ QuickBASIC 4.5 old NI 2001/7001 source Read2001BufferD NAT488_1.LIB Ñ QuickBASIC 4.5 old NI 2001/7001 driver library NAT488_1.QLB Ñ QuickBASIC 4.5 old NI 2001/7001 quick library NI4881QB.BI Ñ Old NI header Þle NI4881QB.OBJ Ñ Old NI object Þle MAKENAT1.BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for National Instruments NI-488 (rev C.11
and older)
83
C.2.5 National Instruments NI-488 rev C.12 (and newer) and NI-488.2 Files
NAT488_2.BAS Ñ QuickBASIC 4.5 new NI 2001/7001 source DataInvalid, Gpiberror, KIOPC, KIPoll, KIQ, KISend, KISendGET, KISendSDC, KIWaitRQS, ModelNumber, SetupIEEE
NAT4882S.BAS Ñ QuickBASIC 4.5 new NI 2001/7001 source Read2001BufferS NAT4882D.BAS Ñ QuickBASIC 4.5 new NI 2001/7001 source Read2001BufferD NAT488_2.LIB Ñ QuickBASIC 4.5 new NI 2001/7001 driver library NAT488_2.QLB Ñ QuickBASIC 4.5 new NI 2001/7001 quick library NI4882QB.BI Ñ New NI header Þle NI4882QB.OBJ Ñ New NI object Þle. MAKENAT2.BAT Ñ Makes all *.OBJ, *.LIB, *.QLB, and *.EXE Þles for NI-488.2 and NI-488 (rev C.12 and
newer)
84

Quick C2.5

Table of Contents

Section 1 — Using the Library Routines..........................................................................91
1.1 Installation ................................................................................................................................................... 91
1.1.1 National Instruments GPIB.COM ..................................................................................................... 91
1.1.2 Capital Equipment Corp..................................................................................................................... 91
1.1.3 IOTech Driver 488 ................................................................................................................................ 91
1.1.4 Quick C 2.5............................................................................................................................................ 91
1.2 General Instructions ................................................................................................................................... 92
1.2.1 Quick C 2.5............................................................................................................................................ 92
1.2.2 Documentation Notes ......................................................................................................................... 93
Section 2— Model 2001/7001 IEEE-488 Interface Routines............................................95
2.1 int SetupIEEE( int Device, int Address);.................................................................................................. 95
2.2 int SendSDC2001( void);............................................................................................................................ 96
int SendSDC7001( void);
2.3 char *Q2001( char *response, char *Cmd); .............................................................................................. 96
char *Q7001( char *response, char *Cmd);
2.4 int Send2001( char *Cmd);......................................................................................................................... 97
int Send7001( char *Cmd);
2.5 int SendGET2001( void); ............................................................................................................................ 97
int SendGET7001( void);
2.6 int Wait2001RQS( void);............................................................................................................................. 98
int Wait7001RQS( void);
Section 3 — Model 2001 Buffer Routines .......................................................................99
3.1 int BufferSize2001( void);........................................................................................................................... 99
3.2 int Take2001BufferReadings( int Func, int BurstMode, int NumDataPoints1,
int Compact); ............................................................................................................................................... 99
3.3 int Read2001Buffer( ßoat or double *ArrayName, int DMA, int Fmt); int _Read2001Buffer
( void *ArrayName, unsigned int ArraySize, unsigned int ElementSize, int DMA,
int Fmt); ...................................................................................................................................................... 101
Section 4 — General Routines ......................................................................................103
4.1 char *ParseQuery( char *response, char *Quer, int QuerNum);......................................................... 103
4.2 char *IOTECH( char *response, int Address);....................................................................................... 104
85
4.3 void XYGraphS( ßoat *XArray, ßoat *YArray, unsigned int YStart, unsigned int YStop,
char *XTitle, char *YTitle, char *Title, char UseCGA2, char MaxMinScale); void _XYGraphS( ßoat *XArray, unsigned int NumX, ßoat *YArray, unsigned int NumY, unsigned int StartNum, unsigned int StopNum, char *XTitle, char *YTitle, char *Title, char UseCGA2, char MinMaxScale); void XYGraphD( double *XArray, double *YArray, unsigned int YStart, unsigned int YStop, char *XTitle, char *YTitle, char *Title, char UseCGA2, char MaxMinScale); void _XYGraphD( double *XArray, unsigned int NumX, double *YArray, unsigned int NumY, unsigned int StartNum, unsigned int StopNum, char *XTitle, char *YTitle, char *Title,
char UseCGA2, char MinMaxScale);...................................................................................................... 104
4.4 void DataViewS( ßoat *DataArray, unsigned int NumDataPoints);
void _DataViewS( ßoat *DataArray, unsigned int ArraySize, unsigned int NumDataPoints) void DataViewD( double *DataArray, unsigned int NumDataPoints); void _DataViewD( double *DataArray, unsigned int ArraySize, unsigned int
NumDataPoints); ...................................................................................................................................... 105
Section 5 — General Model 2001/7001 Routines.........................................................107
5.1 int Set2001Function( int Func) ................................................................................................................ 107
5.2 char *Get2001Units( char *response, int Func);.................................................................................... 107
5.3 int Get2001SaveRecallSize( void); .......................................................................................................... 108
5.4 char *Get2001FuncHeader( char *response, int Func);........................................................................ 109
5.5 int Get2001Func( void);............................................................................................................................ 109
5.6 char *Check2001Val( char *response, double CheckVal, double MinVal, double MaxVal,
int CheckMinInf);.......................................................................................................................................110
5.7 int Hit2001Key( int HitKey); ....................................................................................................................111
5.8 int Disp2001( char *line1, char *line2);....................................................................................................111
int Disp7001( char *line1, char *line2);
5.9 int NoDisp2001( void);..............................................................................................................................112
int NoDisp7001( void);
5.10 char *strins( char *dst, char *src);.............................................................................................................112
5.11 char *str_ltrim( char *trim_string);..........................................................................................................113
5.12 char *str_rtrim( char *trim_string);..........................................................................................................113
5.13 char *dtoa( double value, char *result);..................................................................................................114
5.14 char *ftoa( ßoat value, char *result);........................................................................................................114
86
Section 6 — Model 2001 SENSe[1] Subsystem Commands...........................................117
6.1 2001 Function Change Subroutines.........................................................................................................117
6.1.1 int DCV2001( void);............................................................................................................................117
6.1.2 int ACV2001( void);............................................................................................................................117
6.1.3 int DCA2001( void);............................................................................................................................118
6.1.4 int ACA2001( void);............................................................................................................................118
6.1.5 int RES2_2001( void); .........................................................................................................................118
6.1.6 int RES4_2001( void); .........................................................................................................................118
6.1.7 int FREQ2001( void); ..........................................................................................................................118
6.1.8 int TEMP2001( void);..........................................................................................................................119
6.2 Return 2001 Reading Functions...............................................................................................................119
6.2.1 char *Get2001Rdg( char *response);.................................................................................................119
6.2.2 char *GetDCV2001( char *response); ...............................................................................................119
6.2.3 char *GetACV2001( char *response); .............................................................................................. 120
6.2.4 char *GetDCA2001( char *response);.............................................................................................. 120
6.2.5 char *GetACA2001( char *response);.............................................................................................. 120
6.2.6 char *Get2RES2001( char *response);.............................................................................................. 121
6.2.7 char *Get4RES2001( char *response);.............................................................................................. 121
6.2.8 char *GetFREQ2001( char *response);............................................................................................. 121
6.2.9 char *GetTEMP2001( char *response);............................................................................................ 121
6.3 DC Voltage Functions............................................................................................................................... 122
6.3.1 int Set2001DCV( double Range, double Time, double Digits);................................................... 122
6.3.2 char *Set2001DCVQ( char *response);............................................................................................ 122
6.3.3 int Auto2001DCV( int AutoRange, int AutoTime, int AutoDigits); ........................................... 123
6.3.4 char *Auto2001DCVQ( char *response); ........................................................................................ 123
6.4 AC Voltage Functions............................................................................................................................... 124
6.4.1 int Set2001ACV( double Range, double Time, double Digits);................................................... 124
6.4.2 char *Set2001ACVQ( char *response);............................................................................................ 125
6.4.3 int Auto2001ACV( int AutoRange, int AutoTime, int AutoDigits); ........................................... 126
6.4.4 char *Auto2001ACVQ( char *response); ........................................................................................ 126
6.5 DC Current Functions.............................................................................................................................. 127
6.5.1 int Set2001DCA( double Range, double Time, double Digits);................................................... 127
6.5.2 char *Set2001DCAQ( char *response);............................................................................................ 127
6.5.3 int Auto2001DCA( int AutoRange, int AutoTime, int AutoDigits); ........................................... 128
6.5.4 char *Auto2001DCAQ( char *response); ........................................................................................ 129
6.6 AC Current Functions.............................................................................................................................. 129
6.6.1 int Set2001ACA( double Range, double Time, double Digits);................................................... 129
6.6.2 char *Set2001ACAQ( char *response);............................................................................................ 130
6.6.3 int Auto2001ACA( int AutoRange, int AutoTime, int AutoDigits); ........................................... 130
6.6.4 char *Auto2001ACAQ( char *response); ........................................................................................ 131
6.7 2-Wire Resistance Functions.................................................................................................................... 132
6.7.1 int Set2001R2( double Range, double Time, double Digits);....................................................... 132
6.7.2 char *Set2001R2Q( char *response); ................................................................................................ 132
6.7.3 int Auto2001R2( int AutoRange, int AutoTime, int AutoDigits);................................................ 133
6.7.4 char *Auto2001R2Q( char *response);............................................................................................. 133
6.8 4-Wire Resistance Functions.................................................................................................................... 134
6.8.1 int Set2001R4( double Range, double Time, double Digits);....................................................... 134
6.8.2 char *Set2001R4Q( char *response); ................................................................................................ 135
6.8.3 int Auto2001R4( int AutoRange, int AutoTime, int AutoDigits);................................................ 135
6.8.4 char *Auto2001R4Q( char *response);............................................................................................. 136
6.9 Frequency Functions ................................................................................................................................ 136
6.9.1 int Set2001F( double Digits, int Source);......................................................................................... 137
6.9.2 char *Set2001FQ( char *response);................................................................................................... 137
6.10 Temperature Functions ............................................................................................................................ 138
6.10.1 int Set2001T( double Time, double Digits);.................................................................................... 138
6.10.2 char *Set2001TQ( char *response); .................................................................................................. 138
6.10.3 int Auto2001T( int AutoTime, int AutoDigits);.............................................................................. 139
87
6.10.4 char *Auto2001TQ( char *response);............................................................................................... 139
6.10.5 int Set2001RTD( int Mode, int RType, double Alpha, double Beta, double Delta,
double RZero); ................................................................................................................................... 140
6.10.6 char *Set2001RTDQ( char *response);............................................................................................. 141
6.10.7 int Set2001TC( char TType); ............................................................................................................. 141
6.10.8 char *Set2001TCQ( char *response);................................................................................................ 142
Section 7 — Model 2001/7001 Status Commands........................................................143
7.1 int Stat2001( int Event2001, unsigned int PTF, unsigned int NTF, unsigned int SEN);.................. 143
int Stat7001( int Event7001, unsigned int PTF, unsigned int NTF, unsigned int SEN);
7.2 char *Stat2001Q( char *response, int Event2001);................................................................................. 144
char *Stat7001Q( char *response, int Event7001);
7.3 int SRE2001( unsigned int mask);........................................................................................................... 145
int SRE7001( unsigned int mask);
7.4 int ESE2001( unsigned int mask); ........................................................................................................... 145
int ESE7001( unsigned int mask);
7.5 char *OPC2001( char *response, int UnInterruptable); ....................................................................... 146
char *OPC7001( char *response, int UnInterruptable);
7.6 int Clear2001( void); ................................................................................................................................. 147
int Clear7001( void);
Section 8 — Model 2001/7001 Scanning Commands ...................................................149
8.1 int Close2001( int Channel); .................................................................................................................... 149
8.2 int Close7001( char *ChanList);............................................................................................................... 149
8.3 char *Close2001Q( char *response);........................................................................................................ 150
char *Close7001Q( char *response);
8.4 int Open2001( int Channel); .................................................................................................................... 150
8.5 int Open7001( char *ChanList);............................................................................................................... 151
8.6 int Scan2001( char *ChanList); ................................................................................................................ 152
int Scan7001( char *ChanList);
8.7 int Arm2001( double Count1, char *Source1, double Count2, double Delay2,
char *Source2);........................................................................................................................................... 152
int Arm7001( double Count1, char *Source1, double Count2, double Delay2, char *Source2);
8.8 char *Arm2001Q( char *response);......................................................................................................... 153
char *Arm7001Q( char *response);
8.9 int Trig2001( double Count1, double Delay1, char *Source1);............................................................ 154
int Trig7001( double Count1, double Delay1, char *Source1);
8.10 char *Trig2001Q( char *response); .......................................................................................................... 154
char *Trig7001Q( char *response);
8.11 int Timers2001( double ArmTimer2, double TrigTimer1);.................................................................. 155
int Timers7001( double ArmTimer2, double TrigTimer1);
8.12 char *Timers2001Q( char *response); ..................................................................................................... 156
char *Timers7001Q( char *response);
8.13 int ArmTcon2001( char *Dir1, int ILine1, int Oline1, char *Dir2, int ILine2, int Oline2); ............... 156
88
int ArmTcon7001( char *Dir1, int ILine1, int Oline1, char *Dir2, int ILine2, int Oline2);
8.14 char *ArmTcon2001Q( char *response);................................................................................................. 157
char *ArmTcon7001Q( char *response);
8.15 int TrigTcon2001( char *Dir1, char *Synch1, int ILine1, int Oline1);.................................................. 158
int TrigTcon7001( char *Dir1, char *Synch1, int ILine1, int Oline1);
8.16 char *TrigTcon2001Q( char *response); .................................................................................................. 159
char *TrigTcon7001Q( char *response);
Section 9 — Model 2001 Calculate Commands............................................................161
9.1 int Set2001Calc1MXB( double MMFactor, double MBFactor); .......................................................... 161
9.2 int Set2001Calc1PERC( double Percent);............................................................................................... 161
9.3 int Calc1_2001( int State);......................................................................................................................... 162
9.4 char *Set2001Calc1Q( char *response); .................................................................................................. 162
9.5 char *Calc1_2001Q( char *response); ..................................................................................................... 163
9.6 int Set2001Calc2( char *Format);............................................................................................................. 163
9.7 int Calc2_2001( int State);......................................................................................................................... 164
9.8 char *Set2001Calc2Q( char *response); .................................................................................................. 165
9.9 char *Calc2_2001Q( char *response);...................................................................................................... 165
9.10 int Set2001Calc3( double Upper1, double Lower1, double Upper2, double Lower2);................... 165
9.11 char *Set2001Calc3Q( char *response); .................................................................................................. 166
9.12 int Calc3_2001( int State);......................................................................................................................... 167
9.13 int Set2001Calc3Dig( int Du1, int Dl1, int Du2, int Dl2);..................................................................... 167
9.14 char *Set2001Calc3DigQ( char *response);............................................................................................ 168
9.15 char *Calc3_2001Q( char *response);...................................................................................................... 168
Appendix A: Model 2001/7001 Global Variables..........................................................171
Appendix B: Model 2001/7001 Constants.....................................................................173
B.1 Function Constants................................................................................................................................... 173
B.2 Status Model Constants ........................................................................................................................... 173
B.3 Automatic Constants................................................................................................................................ 175
B.4 Model 2001 Minimum and Maximum Sense Constants ..................................................................... 175
B.5 Model 2001 Minimum and Maximum Calculate Constants .............................................................. 176
B.6 Model 2001/7001 Scanning Minimum and Maximum Constants .................................................... 176
B.7 Read2001Buffer Constants....................................................................................................................... 176
B.8 Examples .................................................................................................................................................... 176
Appendix C: Model 2001/7001 Quick C 2.5 Support Software File Names..................177
C.1 Model 2001/7001 IEEE Interface Independent Files ........................................................................... 177
C.2 Capital Equipment Corp. (CEC) IEEE-488 Interface Files .................................................................. 177
C.3 IOTech Driver 488 Interface Files............................................................................................................ 178
C.4 National Instruments NI-488 rev C.11 Files .......................................................................................... 178
C.5 National Instruments NI-488 rev C.12(and newer) and NI-488.2 Files............................................. 178
89
90
Section 1
Using the Library Routines
1.1 Installation
1.1.1 National Instruments GPIB.COM
You must have at least Rev C.10 of the National Instruments NI-488 Software or at least Rev 1.0 of the Na­tional Instruments NI-488.2 Software to use the 2001/7001 Support Software. Some older revisions may work, but they are not guaranteed by Keithley to do so. Use the following settings to set up your National Instruments Card (AT-GPIB card listed here, use all that are applicable) when you are conÞguring GPIB.COM with IBCONF.EXE.
Primary GPIB Address............................................. 0
Secondary GPIB Address ........................................ NONE
Timeout setting......................................................... T10s
EOS byte..................................................................... 0AH
Terminate Read on EOS ........................................... no
Set EOI with EOS on Write...................................... yes
Type of compare on EOS ......................................... 7-bit
Set EOI w/last byte of Write ................................... yes
System Controller..................................................... yes
Assert REN when SC ............................................... yes
Enable Auto Serial Polling ...................................... no
Timing ........................................................................ 350nsec
Enable 488.2 Protocols ............................................. yes
CIC Protocol .............................................................. no
Disable Device Unaddressing................................. no
1.1.2 Capital Equipment Corp.
You must have at least Rev 2.14 of the Capital Equipment Corp. Software to use the 2001/7001 Support Soft­ware. All older revisions will not work without the removal of setatnmode() from SetupIEEE() in CEC.C.
1.1.3 IOTech Driver 488
You must have at least Rev 2.6 of the IOTech Driver 488 Software to use the 2001/7001 Support Software. Some older revisions may work, but they are not guaranteed by Keithley to do so.
1.1.4 Quick C 2.5
Type A:INSTALL or B:INSTALL to install the Quick C 2.5 2001/7001 support software. The installation pro­gram will prompt you for certain information that it needs to copy Þles and build the make Þles
91
MAKECEC.BAT, MAKEIOT.BAT, MAKENAT1.BAT, and MAKENAT2.BAT. These Þles will build the *.OBJ, *.LIB, and *.QLB needed to use the routines.
Installation Notes:
1. QCL.EXE and LIB.EXE must be installed in the Quick C 2.5 Compiler Directory.
2. NMAKE.EXE must be installed in the NMAKE directory.
3. IEEE488.LIB (if installing CEC) and LLIBC7.LIB and/or LLIBCE.LIB must reside in the Library Files Di­rectory to make programs.
4. STRING.H, STDLIB.H, STDIO.H, CONIO.H, DOS.H, TIMR.H, GRAPH.H and FCNTL.H must reside in the Include Files Directory.
5. The 2001/7001 Support Software directory must exist and you will be prompted to build it if not.
6. The Install Source Code Only option will install only the *.C and *.H Þles and not check for any of the Quick C 2.5 Þles listed above. MAKECEC.BAT, MAKEIOT.BAT, MAKENAT1.BAT, and MAKENAT2.BAT will still be created and can be edited later.
7. The Þle GENERAL1.C is the only module that uses Quick C 2.5 speciÞc routines for data and graphical displays. The other modules were made as ANSI-C as possible, which allows for their use on any plat­form with the use of the proper CEC, IOTech, and National Instruments include Þles, object modules, and libraries as supplied by the IEEE-488 interface manufacturers.
1.2 General Instructions
1.2.1 Quick C 2.5
In your program, use #include Ò20017001.HÓ which contains the 2001/7001 library function deÞnitions and CONSTants. Also, make sure that you are compiling in the large or huge data model since the libraries use the huge model. Furthermore, at least 4096 bytes of stack space should be used when creating an executable with ILINK. When creating a *.MAK Þle include your program name and:
¥ CEC.LIB and IEEE488.LIB for CEC,
¥ IOTECH.LIB for IOTech Driver 488,
¥ NAT488_1.LIB for old NI-488, or
¥ NAT488_2.LIB for new NI-488 and NI-488.2.
If using DataViewS, DataViewD, XYGraphS, or XYGraphD make sure to specify GRAPHICS.LIB if it is not included in LLIBC7.LIB or LLIBCE.LIB. A sample setup follows:
#include Ò20017001.hÓ int SetupErr; char response[2048]; /* start of user program here */ SetupErr = SetupIEEE(0,0); /* Setup IEEE Interface */ SetupErr = SetupIEEE(2001,16); /* Setup 2001 at IEEE Address 16 */ SetupErr = SetupIEEE(7001,7); /* Setup 7001 at IEEE Address 7 */ /* User program follows */
92
1.2.2 Documentation Notes
1. Query forms of a function have the format of function-nameQ( char * response, ...) which returns a pointer to response containing a query string of the speciÞed Model 2001/7001 parameters. Automatic values are returned as 0 for OFF and 1 for ON.
2. If a function query returns more than one parameter, the responses will be separated by a semicolon (;) within the return string. Use the ParseQuery routine to return the speciÞed response string (parameter number 1, 2, 3, etc.) from the query return string.
3. Any Model 2001/7001 command parameters out of range will not be sent to the instrument leaving the previously set or default values intact. Most routines that have a return type of int will return a -1 for a parameter out of range.
4. Most Model 2001/7001 parameters that are double precision values will accept the constants MAXI­MUM, MINIMUM, and DEFAULT. INF will be accepted for Trigger Model Count1 and Count2 param­eters.
5. All example code fragments assume that Quick C 2.5 setup commands listed above were used before issuing any commands.
6. All string parameters that have their valid parameters listed with mixed case, like IMMediate, accept either the short form (IMM) or the long form (IMMEDIATE) in any combination of case. This is compa­rable to the short and long form notation used for SCPI commands.
7. See Appendix A for a description of the Global Variables used in the Model 2001/7001 support soft­ware.
8. See Appendix B for a description of the deÞned CONSTants used in the Model 2001/7001 support soft­ware.
9. See Appendix C for a list of all Quick C 2.5 Þle names used by the Model 2001/7001 support software.
93
94
Section 2
Model 2001 / 7001 IEEE-488 Interface Routines
These functions and subroutines control the Models 2001/7001 with low-level IEEE-488 bus commands speciÞc to each IEEE-488 interface manufacturer.
NOTE
These functions and subroutines also support the Model 7002 Switch System. Just send Model 7001 commands to a Model 7002.
2.1 int SetupIEEE( int Device, int Address);
Description
Sets up the speciÞc IEEE-488 interface to correctly handle data transfers between the Models 2001/7001 and the host PC computer. Also, initializes either the 2001 and 7001 at the speciÞed addresses. CEC controllers will be at IEEE address 21. IOTech controllers are usually at IEEE address 21. National Instruments control­lers are usually at IEEE address 0.
Parameters
Device
0 Initialize interface only 2001 Change the IEEE address of the 2001 only 7001 Change the IEEE address of the 7001 only
Address
0-30 if Device is 2001 or 7001 ignored if Device is 0
Returns
0 if no errors.
-1 if a parameter is out of range.
-2 if an IEEE-488 timeout error occurred.
Global V ariables Affected (see Global Variables Appendix A)
KI2001, KI7001, IeeeInterface, brd0, Nat2001Addr, Nat7001Addr (NatÕl. Instruments only), ieee (IOTech Driver 488 only)
95
Loading...