Contents
NI-488.2M SRM for OS/2
vi
© National Instruments Corp.
Chapter 3
Developing Your Application
....................................................... 3-1
Choosing a Programming Method..............................................3-1
Using the NI-488.2 Language Interface....................... 3-1
Using NI-488 Functions: One Device for
Each Board..................................................... 3-2
NI-488 Device-Level Functions ......3-2
NI-488 Board-Level Functions ....... 3-3
Using NI-488.2 Routines: Multiple Boards
and/or Multiple Devices................................. 3-3
Using the OS/2 API Interface....................................... 3-4
Checking Status with Global Variables......................................3-4
Status Word—ibsta ......................................................3-4
Error Variable—iberr ................................................... 3-6
Count Variables—ibcnt and ibcntl............................... 3-6
Using ibic to Communicate with Devices ..................................3-7
Writing Your NI-488 Application ..............................................3-7
Items to Include ............................................................3-7
NI-488 Program Shell ..................................................3-8
General Program Steps and Examples ......................... 3-9
Writing Your NI-488.2 Application ........................................... 3-13
Items to Include ............................................................3-13
NI-488.2 Program Shell ............................................... 3-14
General Program Steps and Examples ......................... 3-15
Compiling and Linking Your Program....................................... 3-20
32-Bit C Applications................................................... 3-20
16-Bit C Applications................................................... 3-21
Running Your Application Program........................................... 3-21
Chapter 4
Debugging Your Application
....................................................... 4-1
Running ibtest............................................................................. 4-1
Presence Test of Driver ................................................4-1
Presence Test of GPIB Board....................................... 4-2
Incorrect Interrupt Level ..............................................4-2
GPIB Cables Connected............................................... 4-2
Debugging with the Global Status Variables ............................. 4-3
Debugging with ibic ................................................................... 4-3
GPIB Error Codes....................................................................... 4-3
Configuration Errors................................................................... 4-4
Reconfiguring the NI-488.2M Software ......................4-5
Timing Errors ............................................................................. 4-5