Example 2: Clearing And Triggering Devices - National Instruments NI-488.2M Software Reference Manual

For os/2
Hide thumbs Also See for NI-488.2M:
Table of Contents

Advertisement

Application Examples

Example 2: Clearing and Triggering Devices

This example illustrates how you can clear and trigger GPIB devices.
Two freshman physics lab partners are learning how to use a GPIB digital
oscilloscope. They have successfully loaded the NI-488.2M software on a
personal computer and connected their GPIB board to a GPIB digital
oscilloscope. Their current lab assignment is to write a small application to
practice using the oscilloscope and its command set using high-level GPIB
commands. The following steps correspond to the program flowchart in Figure
2-2.
1.
The application initializes the GPIB by bringing the interface board in the
computer online.
2.
The application sends a GPIB clear command to the oscilloscope. This
command clears the internal registers of the oscilloscope, reinitializing it to
default values and settings.
3.
The application sends a command to the oscilloscope telling it to read a
waveform each time it is triggered. Predefining the task in this way
decreases the execution time required. Each trigger of the oscilloscope is
now sufficient to get a new run.
4.
The application sends a GPIB trigger command to the oscilloscope. The
GPIB trigger command causes the oscilloscope to acquire data.
5.
The application queries the oscilloscope for the acquired data. The
oscilloscope sends the data.
6.
The application reads the data from the oscilloscope.
7.
The application calls an external graphics routine to display the acquired
waveform.
Steps 4, 5, 6, and 7 are repeated until all the desired data has been acquired
by the oscilloscope and received by the computer.
8.
As a cleanup step before exiting, the application returns the interface board
to its original state by taking it offline.
NI-488.2M SRM for OS/2
2-4
© National Instruments Corp.
Chapter 2

Advertisement

Table of Contents
loading

Table of Contents