E-2
Example Programs
Programming examples
All examples assume QuickBASIC version 4.5 or higher and a CEC IEEE-488 interface card
with CEC driver version 2.11 or higher, with the Model 6514 at address 14 on the IEEE-488 bus.
Changing function and range
The Model 6514 has independent range control for each of its four measurement functions.
This means, for example, that autorange can be turned on for Volts while leaving it off for the
rest of the functions.
Another difference is in the parameter for the range command. The parameter value for the
:RANGe command is given as “the maximum value to measure”. The instrument interprets this
parameter and goes to the appropriate range. When you query the range with :RANGe?, the
instrument sends back the full scale value of its present range.
Note that the Model 6514 rounds the range parameter to an integer before choosing the appro-
priate range. Sending VOLTage:RANGe 21.6 will set the Volts function to the 200V range. The
parameter 21.6 is rounded to 22, which exceeds the 20V range.
The following program demonstrates range and function changes. A measurement will be
taken while on the Amps and Ohms function:
‘ For QuickBASIC 4.5 and CEC PC488 interface card, edit the follow-
ing
‘ line where the QuickBASIC libraries are on your computer:
‘$INCLUDE: ‘c:\qb45\ieeeqb.bi’
‘ Initialize the CEC interface as address 21:
CALL initialize(21, 0)
‘ Restore RST defaults:
CALL SEND(14, “*rst”, status%)
‘ Set Amps for 20uA range and Ohms for 2MW range:
CALL SEND(14, “curr:rang 20e-6”, status%)
CALL SEND(14, “res:rang 2e6”, status%)
‘ Switch to Amps function and take reading. Each READ?
‘ will trigger one reading:
CALL SEND(14, “func ‘curr’”, status%)
CALL SEND(14, “read?”, status%)
reading%$ = SPACE$(80)
CALL ENTER(reading$, length%, 14, status%)
PRINT reading$
‘ Switch to Ohms function and take reading:
CALL SEND(14, “func ‘res’”, status%)
CALL SEND(14, “read?”, status%)
reading%$ = SPACE$(80)
CALL ENTER(reading$, length%, 14, status%)
PRINT reading$
Содержание 6514
Страница 203: ...14 CommonCommands...
Страница 207: ...15 SCPISignalOriented MeasurementCommands...
Страница 235: ...18 PerformanceVerification...
Страница 254: ...19 Calibration...
Страница 274: ...20 RoutineMaintenance...
Страница 278: ...A Specifications...
Страница 282: ...B StatusandErrorMessages...
Страница 288: ...C GeneralMeasurement Considerations...
Страница 294: ...D DDCEmulationCommands...
Страница 299: ...E ExamplePrograms...
Страница 306: ...F IEEE 488BusOverview...
Страница 320: ...G IEEE 488andSCPI ConformanceInformation...
Страница 324: ...H CalibrationOptions...