Contents
NI-488.2 User Manual for Windows vi © National Instruments Corp.
Chapter 3
Developing Your Application
............................................................................ 3-1
Choosing How to Access the NI-488.2 DLL................................................... 3-1
Choosing Between NI-488 Functions and NI-488.2 Routines ........................ 3-1
Using NI-488 Functions: One Device for Each Board..................... 3-2
NI-488 Device Functions .................................................... 3-2
NI-488 Board Functions ..................................................... 3-2
Using NI-488.2 Routines: Multiple Boards and/or Multiple
Devices .............................................................................................. 3-3
Checking Status with Global Variables........................................................... 3-3
Status Word – ibsta ........................................................................... 3-3
Error Variable – iberr ........................................................................ 3-5
Count Variables – ibcnt and ibcntl .................................................... 3-5
Using wibic to Communicate with Devices..................................................... 3-5
Writing Your NI-488 Application ................................................................... 3-6
Items to Include ................................................................................. 3-6
NI-488 Program Shell ....................................................................... 3-7
General Program Steps and Examples .............................................. 3-8
Step 1. Open a Device........................................................ 3-8
Step 2. Clear the Device..................................................... 3-8
Step 3. Configure the Device ............................................. 3-9
Step 4. Trigger the Device ................................................. 3-9
Step 5. Wait for the Measurement ..................................... 3-9
Step 6. Read the Measurement........................................... 3-10
Step 7. Process the Data..................................................... 3-10
Step 8. Place the Device Offline ........................................ 3-10
Writing Your NI-488.2 Application ................................................................ 3-11
Items to Include ................................................................................. 3-11
NI-488.2 Program Shell..................................................................... 3-12
General Program Steps and Examples .............................................. 3-13
Step 1. Initialization ........................................................... 3-13
Step 2. Find All Listeners .................................................. 3-13
Step 3. Identify the Instrument........................................... 3-13
Step 4. Initialize the Instrument ......................................... 3-14
Step 5. Configure the Instrument ....................................... 3-15
Step 6. Trigger the Instrument ........................................... 3-15
Step 7. Wait for the Measurement ..................................... 3-15
Step 8. Read the Measurement........................................... 3-16
Step 9. Process the Data..................................................... 3-16
Step 10. Place the Board Offline........................................ 3-16
Compiling, Linking, and Running Your Application ...................................... 3-17
Microsoft C ....................................................................................... 3-17
Borland C++ ...................................................................................... 3-17
Visual Basic....................................................................................... 3-18
Direct Entry with C ........................................................................... 3-18
Method 1. List Functions in the
Module Definition File..................................... 3-19