148 Chapter 3
Easy Ways to Control Instruments
Using Direct I/O
Note This example uses the GPIB interface (IEEE488). To configure Serial,
GPIO, or VXI instruments, refer to the VEE Pro Advanced Techniques
manual.
4. To place the object on the screen, make sure that
fgen(@(NOT LIVE))
is still highlighted, and click Create I/O Object ⇒ Direct I/O.
Figure 3-16 shows the Direct I/O object.
Figure 3-16. A Direct I/O Object
To use a Direct I/O object in a program, you have to configure I/O
transactions. The next section explains writing text commands, reading data,
and uploading/downloading instrument states.
Sending a Single Text Command to an Instrument
To send a single text command to an instrument, type in the appropriate
string. Most GPIB instruments use alphanumeric strings for commands sent
to the instrument. For example, to send a command to the HP3325B
Function Generator to set the amplitude to 5 volts, you would enter the
command string
"AM 5 VO".
This exercise uses the HP 3325B function generator configured in the
previous section. If necessary, go back to “Using Direct I/O” on page 147
and configure the instrument before you continue.
1. In the
fgen(@(NOT LIVE))object, double-click the transaction bar to
get the
I/O Transaction dialog box, as shown in Figure 3-17.