Arrays; Variables For Data Storage; Numeric Calculations; Reading Multimeter Values - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

Variables for Data
Storage

Numeric Calculations

Reading Multimeter

Arrays

268
Chapter 7 BASIC Language for the 3458A
OUTPUT 722; "LET TIME_INT =40*3E-3"
Variables can replace numeric parameters in any 3458A command that uses
numeric parameters. Two examples uses are (1) numeric data storage and (2)
numeric calculations. The following sections discuss these two uses.
At power-on, numeric output data generated by the 3458A is placed into the
GPIB output buffer where it can be sent to the system controller. However,
for some applications you may want to store the output data directly into the
multimeter's internal memory. The ENTER command takes one reading out
of reading memory (destructively) and places the value in the specified
variable or array location.
The following program uses the ENTER command within a 3458A
subroutine to store readings.
10 OUTPUT 722; "SUB DMM_CONF"
20 OUTPUT 722; "NRDGS 100"
30 OUTPUT 722; "TRIG SGL"
40 OUTPUT 722; "INTEGER I"
50 OUTPUT 722; "FOR I = 1 TO 100"
60 OUTPUT 722; " ENTER A[I]"
70 OUTPUT 722; "NEXT I"
80 OUTPUT 722; "SUBEND"
90 !
100 OUTPUT 722; "CALL DMM_CONF"
110 END
Any variables, whether simple or array, can be used in numeric calculations.
Several math functions are available in the 3458A command set to allow you
to manipulate data. The 3458A's math functions are described in more detail
later in this supplement.
The OUTPUT command returns the value of a specified variable. An
example is included below to illustrate the use of the OUTPUT command.
Values
10 DIM A$[50]
20 OUTPUT 722; "LET VAL=COS(.5235)!Compute value
30 OUTPUT 722; "OUTPUT VAL"
40 ENTER 722: A$
50 PRlNT A$
60 END
You can allocate memory space in the 3458A for one-dimensional arrays.
For real arrays, use either the DIM name(size) or REAL name(size)
commands to define the array. For integer arrays, use the INTEGER
name(size) command. All arrays have a lower bound of zero (option base 0).
Arrays do not have a default size. For example, to create a 10-element array,
specify a size of 9 as shown below.
OUTPUT 722; "DIM TESTER(9)"
Array names are subject to the same rules as numeric variable names. To
specify a particular array element, you must specify the subscript enclosed
in parentheses. The range of subscripts is an integer from 0 through 999, but
!Dimension controller variable
!Read result into variable
!Enter result
!Print result

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents