Application Examples
Chapter 2
NI-488.2M UM for Windows NT
2-2
© National Instruments Corp.
Example 1: Basic Communication
This example focuses on the basics of establishing communication between a host
computer and a GPIB device.
A technician needs to monitor voltage readings using a GPIB multimeter. His computer
is equipped with an IEEE 488.2 interface board. The NI-488.2M software is installed,
and a GPIB cable runs from the computer to the GPIB port on the multimeter.
The technician is familiar with the multimeter remote programming command set. This
list of commands is specific to his multimeter and is available from the multimeter
manufacturer.
He sets up the computer to direct the multimeter to take measurements and record each
measurement as it occurs. To do this, he has written an application that uses some simple
high-level GPIB commands. The following steps correspond to the program flowchart in
Figure 2-1.
1.
The application initializes the GPIB by bringing the interface board in the computer
online.
2.
The application sends the multimeter an instruction, setting it up to take voltage
measurements in autorange mode.
3.
The application sends the multimeter an instruction to take a voltage measurement.
4.
The application tells the multimeter to transmit the data it has acquired to the
computer.
The process of requesting a measurement and reading from the multimeter (Steps 3
and 4) is repeated as long as there are readings to be obtained.
5.
As a cleanup step before exiting, the application returns the interface board to its
original state by taking it offline.