Télécharger Imprimer la page

Keysight Technologies 3458A Guide D'utilisation page 390

Multimètre

Publicité

7
BASIC Language for the 3458A
Filling arrays
Array elements are initialized to zero when they are declared (DIM, REAL, or
INTEGER commands) or are re-sized. Once you have dimensioned an array, use
the FILL command to load your values into the array. The FILL command has the
following syntax:
FILL array_name, list
The following program fills an integer array with integer values.
10 OUTPUT 722; "INTEGER LIST(9)"
20 OUTPUT722; "FILL LIST 0,100,200,300,400,500,600,700,800,900"
30 END
Use the FILL command carefully. It does not work if power is cycled. The
NOTE
command is effectively deleted from the subprogram at this time. Use separate
LET statements for each value assigned.
Array size
The SIZE? query command returns the number of elements in the specified array.
This number is one more than the index of the last element in the array due to the
option base 0 convention used by the 3458AA. Thus, if you dimension a
10-element array (e.g., DIM LIST(9) ), the SIZE? command will return "10".
The following program defines an integer array with 10 elements and then verifies
the array size using the SIZE? command.
10 OUTPUT 722; "INTEGER IARRAY(9)"
20 OUTPUT 722; "SIZE? IARRAY"
30 ENTER 722; A
40 PRINT A
50 END
Purging arrays and variables
All variables and arrays are stored in 3458AA volatile memory. If the 3458AA loses
power, all variables and arrays are lost. The SCRATCH command also purges all
variables, arrays, subprograms, and stored state names (stored states are
explained in chapter 3).
390
Keysight 3458A User's Guide

Publicité

loading