© National Instruments Corp.
2-1
NI-488.2M UM for Windows NT
Chapter 2
Application Examples
This chapter contains nine sample applications designed to illustrate specific GPIB
concepts and techniques that can help you write your own applications. The description
of each example includes the programmer's task, a program flowchart, and numbered
steps which correspond to the numbered blocks on the flowchart.
Use this chapter along with your NI-488.2M software, which includes the C source code
for each of the nine examples. The programs are listed in order of increasing complexity.
If you are new to GPIB programming, you might want to study the contents and concepts
of the first sample,
simple.c
, before moving on to more complex examples.
The following example programs are included with your NI-488.2 software:
•
simple.c
is the source code file for Example 1. It illustrates how you can
establish communication between a host computer and a GPIB device.
•
clr_trg.c
is the source code file for Example 2. It illustrates how you can clear
and trigger GPIB devices.
•
asynch.c
is the source code file for Example 3. It illustrates how you can perform
non-GPIB tasks while data is being transferred over the GPIB.
•
eos.c
is the source code file for Example 4. It illustrates the concept of the
end-of-string (EOS) character.
•
rqs.c
is the source code file for Example 5. It illustrates how you can
communicate with GPIB devices that use the GPIB SRQ line to request service.
This sample is written using NI-488 functions.
•
easy4882.c
is the source code file for Example 6. It is an introduction to
NI-488.2 routines.
•
rqs4882.c
is the source code file for Example 7. It uses NI-488.2 routines to
communicate with GPIB devices that use the GPIB SRQ line to request service.
•
ppoll.c
is the source code file for Example 8. It uses NI-488.2 routines to
conduct parallel polls.
•
non_cic.c
is the source code file for Example 9. It illustrates how you can use
the NI-488.2M driver in a non-Controller application.