Automating Measurements
Operator Interaction
Using
a
Foot
Switch
or
Button
Box
You can connect a foot switch, button box, or custom keyboard which has a
few function keys that are custom-labeled, and use this in conjunction with
IBASIC
to allow consistent, error-free step-by-step measurement control. The
operator presses one key, then the next, in order.
The foot-switch simply connects two wires together, grounding the center pin
of the analyzer’s USER TTL IN/OUT rear panel connector. (See Figure 7-6.)
The status of the USER TTL IN/OUT can be read using the SCPI commands:
30 OUTPUT
716;“DIAG:PORT:READ?
15,l”
40 ENTER
716;X
or the
IBASIC
command:
30
X=READIO(lS,l)
When the foot-switch is open, the variable “X” will be set to 1. When it is
closed, the variable
“X”
will be set to 0. Switch
debounce
is generally not a
problem, due to the relatively slow polling rate of the program.
Refer to the section titled “Analyzer Port Numbers” for tables describing the
various analyzer ports that you can access using SCPI or
IBASICcommands.
Below are two example programs which shows how to display a message
and read the foot switch to control your measurements. The first program
uses the SCPI “DIAG:PORT:READ” query, while the second uses the
IBASIC
READ10
function.
Following is an example program which shows how to display a message and
read the foot switch to control your measurements. This program is named
TTL-IO on your Example Programs Disk.
For an example which uses the
IBASIC
READ10
command, refer to the
program USER-BIT on your
IBASIC
Example Programs Disk.
100
! Filename: TTL-IO
110 !
120
! This program reads the USER TTL IO
130
! port,
and counts how many times a
140
! switch connected to the port is pressed.
150 !
7-35