找回密码
 注册
搜索
查看: 914|回复: 0

[讨论] GPIB Program NI GPIB-32.dll

[复制链接]
发表于 2007-7-31 15:13:35 | 显示全部楼层 |阅读模式
Chapter 1
Introduction
GPIB Overview ...........................................................................................................1-1
Talkers, Listeners, and Controllers ...............................................................1-1
Controller-In-Charge and System Controller ................................................1-1
GPIB Addressing ...........................................................................................1-2
Sending Messages across the GPIB ..............................................................1-2
Data Lines .......................................................................................1-2
Handshake Lines .............................................................................1-3
Interface Management Lines ...........................................................1-3
Setting up and Configuring Your System .....................................................1-4
Controlling More Than One Board .................................................1-5
Configuration Requirements ...........................................................1-5
The NI-488.2M Software for Windows 95 ..................................................................1-6
NI-488.2M Software for Windows 95 Components .....................................1-6
NI-488.2M Driver and Driver Utilities ...........................................1-6
16-Bit Windows Support Files ........................................................1-7
DOS Support Files ..........................................................................1-7
Microsoft C/C++ Language Interface Files ....................................1-7
Borland C/C++ Language Interface Files .......................................1-8
Microsoft Visual Basic Language Interface Files ...........................1-8
Sample Application Files ................................................................1-8
How the NI-488.2M Software Works with Windows 95 ..............................1-8
Uninstalling the GPIB Hardware from Windows 95 ....................................1-9
Uninstalling the GPIB Software for Windows 95 .........................................1-11
Table of Contents
NI-488.2M User Manual for Windows 95/Windows NT vi © National Instruments Corporation
The NI-488.2M Software for Windows NT ................................................................1-13
NI-488.2M Software for Windows NT Components ....................................1-13
NI-488.2M Driver and Driver Utilities ...........................................1-13
DOS and 16-Bit Windows Support Files ........................................1-13
Microsoft C/C++ Language Interface Files ....................................1-14
Borland C/C++ Language Interface Files .......................................1-14
Microsoft Visual Basic Language Interface Files ...........................1-14
Sample Application Files ................................................................1-14
How the NI-488.2M Software Works with Windows NT ............................1-15
Unloading and Reloading the NI-488.2M Driver for Windows NT .............1-16
Chapter 2
Application Examples
Example 1: Basic Communication .............................................................................2-2
Example 2: Clearing and Triggering Devices .............................................................2-4
Example 3: Asynchronous I/O ....................................................................................2-6
Example 4: End-of-String Mode .................................................................................2-8
Example 5: Service Requests ......................................................................................2-10
Example 6: Basic Communication with IEEE 488.2-Compliant Devices .................2-14
Example 7: Serial Polls Using NI-488.2 Routines .....................................................2-16
Example 8: Parallel Polls ............................................................................................2-18
Example 9: Non-Controller Example .........................................................................2-20
Chapter 3
Developing Your Application
Choosing Your Programming Methodology ...............................................................3-1
Choosing a Method to Access the NI-488.2M Driver ...................................3-1
NI-488.2M Language Interfaces .....................................................3-1
Direct Entry Acess ..........................................................................3-1
Choosing between NI-488 Functions and NI-488.2 Routines .......................3-2
Using NI-488 Functions: One Device for Each Board ...................3-2
NI-488 Device Functions .................................................3-3
NI-488 Board Functions ...................................................3-3
Using NI-488.2 Routines: Multiple Boards and/or
Multiple Devices .........................................................................3-3
Checking Status with Global Variables .......................................................................3-4
Status Word – ibsta .......................................................................................3-4
Error Variable – iberr ....................................................................................3-5
Count Variables – ibcnt and ibcntl ................................................................3-6
Using Win32 Interactive Control to Communicate with Devices ...............................3-6
Programming Model for NI-488 Applications ............................................................3-7
Items to Include .............................................................................................3-7
NI-488 Program Shell ...................................................................................3-8
Table of Contents
© National Instruments Corporation vii NI-488.2M User Manual for Windows 95/Windows NT
NI-488 General Program Steps and Examples ..............................................3-9
Step 1. Open a Device ....................................................................3-9
Step 2. Clear the Device .................................................................3-9
Step 3. Communicate with the Device ...........................................3-9
Step 4. Place the Device Offline Before Exiting Your
Application ..................................................................................3-10
Programming Model for NI-488.2 Applications .........................................................3-11
Items to Include .............................................................................................3-11
NI-488.2 Program Shell .................................................................................3-12
NI-488.2 General Program Steps and Examples ...........................................3-13
Step 1. Initialization .......................................................................3-13
Step 2. Determine the GPIB Address of Your Device ...................3-13
Step 3. Initialize the Device ...........................................................3-14
Step 4. Communicate with the Device ...........................................3-14
Step 5. Place the Device Offline Before Exiting Your
Application ..................................................................................3-15
Language-Specific Programming Instructions ............................................................3-15
Microsoft Visual C/C++ (Version 2.0 or Higher) .........................................3-15
Borland C/C++ (Version 4.0 or Higher) .......................................................3-15
Visual Basic (Version 4.0 or Higher) ............................................................3-16
Direct Entry with C .......................................................................................3-16
gpib-32.dll Exports .........................................................................3-16
Directly Accessing the gpib-32.dll Exports ....................................3-17
Windows 95: Running Existing GPIB Applications ...................................................3-19
Running Existing Win16 GPIB Applications ...............................................3-19
Running Existing DOS GPIB Applications ..................................................3-19
Windows NT: Running Existing GPIB Applications ..................................................3-20
Chapter 4
Debugging Your Application
Debugging with GPIB Spy ..........................................................................................4-1
Debugging with the Global Status Variables ...............................................................4-1
Debugging with Win32 Interactive Control ................................................................4-1
GPIB Error Codes ........................................................................................................4-2
Configuration Errors ....................................................................................................4-3
Timing Errors ...............................................................................................................4-3
Communication Errors .................................................................................................4-4
Repeat Addressing .........................................................................................4-4
Termination Method ......................................................................................4-4
Other Errors .................................................................................................................4-4
Table of Contents
NI-488.2M User Manual for Windows 95/Windows NT viii © National Instruments Corporation
Chapter 5
GPIB Spy Utility
Overview ......................................................................................................................5-1
Starting GPIB Spy .......................................................................................................5-1
Starting GPIB Spy Under Windows 95 .........................................................5-1
Starting GPIB Spy Under Windows NT .......................................................5-1
Using the Online GPIB Spy Help ................................................................................5-2
Locating Errors with GPIB Spy ...................................................................................5-2
Viewing Properties for Recorded Calls .......................................................................5-2
Exiting GPIB Spy ........................................................................................................5-4
Performance Considerations ........................................................................................5-4
Chapter 6
Win32 Interactive Control Utility
Overview ......................................................................................................................6-1
Getting Started with Win32 Interactive Control ..........................................................6-1
Win32 Interactive Control Syntax ...............................................................................6-4
Number Syntax ..............................................................................................6-4
String Syntax .................................................................................................6-4
Address Syntax ..............................................................................................6-5
Win32 Interactive Control Commands ........................................................................6-5
Status Word .................................................................................................................6-9
Error Information .........................................................................................................6-10
Count Information .......................................................................................................6-10
Chapter 7
GPIB Programming Techniques
Termination of Data Transfers .....................................................................................7-1
High-Speed Data Transfers (HS488) ...........................................................................7-2
Enabling HS488 .............................................................................................7-2
System Configuration Effects on HS488 ......................................................7-3
Waiting for GPIB Conditions ......................................................................................7-4
Asynchronous Event Notification in Win32 GPIB Applications ................................7-4
Calling the ibnotify Function .........................................................................7-4
ibnotify Programming Example ....................................................................7-6
Writing Multithreaded Win32 GPIB Applications ......................................................7-9
Device-Level Calls and Bus Management ...................................................................7-11
Talker/Listener Applications .......................................................................................7-11
Serial Polling ...............................................................................................................7-12
Service Requests from IEEE 488 Devices ....................................................7-12
Service Requests from IEEE 488.2 Devices .................................................7-12
Table of Contents
© National Instruments Corporation ix NI-488.2M User Manual for Windows 95/Windows NT
Automatic Serial Polling ...............................................................................7-13
Stuck SRQ State ..............................................................................7-13
Autopolling and Interrupts ..............................................................7-14
SRQ and Serial Polling with NI-488 Device Functions ................................7-14
SRQ and Serial Polling with NI-488.2 Routines ...........................................7-15
Example 1: Using FindRQS ...........................................................7-16
Example 2: Using AllSpoll ............................................................7-16
Parallel Polling .............................................................................................................7-17
Implementing a Parallel Poll .........................................................................7-17
Parallel Polling with NI-488 Functions ..........................................7-17
Parallel Polling with NI-488.2 Routines .........................................7-18
Chapter 8
GPIB Configuration Utility
Overview ......................................................................................................................8-1
Windows 95: Configuring the NI-488.2M Software ...................................................8-2
Windows NT: Configuring the NI-488.2M Software ..................................................8-4
Appendix A
Status Word Conditions
ERR (dev, brd) .............................................................................................................A-2
TIMO (dev, brd) ...........................................................................................................A-2
END (dev, brd) .............................................................................................................A-2
SRQI (brd) ...................................................................................................................A-3
RQS (dev) ....................................................................................................................A-3
CMPL (dev, brd) ..........................................................................................................A-3
LOK (brd) ....................................................................................................................A-3
REM (brd) ....................................................................................................................A-4
CIC (brd) ......................................................................................................................A-4
ATN (brd) ....................................................................................................................A-4
TACS (brd) ..................................................................................................................A-4
LACS (brd) ..................................................................................................................A-5
DTAS (brd) ..................................................................................................................A-5
DCAS (brd) ..................................................................................................................A-5
Appendix B
Error Codes and Solutions
EDVR (0) .....................................................................................................................B-2
ECIC (1) .......................................................................................................................B-2
ENOL (2) .....................................................................................................................B-3
EADR (3) .....................................................................................................................B-4
Table of Contents
NI-488.2M User Manual for Windows 95/Windows NT x © National Instruments Corporation
EARG (4) .....................................................................................................................B-4
ESAC (5) .....................................................................................................................B-5
EABO (6) .....................................................................................................................B-5
ENEB (7) .....................................................................................................................B-5
EDMA (8) ....................................................................................................................B-6
EOIP (10) .....................................................................................................................B-6
ECAP (11) ...................................................................................................................B-7
EFSO (12) ....................................................................................................................B-7
EBUS (14) ...................................................................................................................B-7
ESTB (15) ....................................................................................................................B-8
ESRQ (16) ...................................................................................................................B-8
ETAB (20) ...................................................................................................................B-9
Appendix C
Windows 95: Troubleshooting and Common Questions
Troubleshooting EDVR Error Conditions ...................................................................C-1
EDVR Error with ibcntl Set to 0xE028002C ................................................C-1
EDVR Error with ibcntl Set to 0xE0140025 .................................................C-1
EDVR Error with ibcntl Set to 0xE0140035 .................................................C-1
EDVR Error with ibcntl Set to 0xE0320029 .................................................C-2
EDVR Error with ibcntl Set to 0xE0140004... ..............................................C-2
Troubleshooting Windows 95 Device Manager Status Codes ....................................C-2
Common Questions .....................................................................................................C-3
Appendix D
Windows NT: Troubleshooting and Common Questions
Using Windows NT Diagnostic Tools .........................................................................D-1
Examining NT Devices to Verify the NI-488.2M Installation ......................D-1
Examining the NT System Log Using the Event Viewer .............................D-2
Common Questions .....................................................................................................D-2
Appendix E
Customer Communication .........................................................................................C-1
Glossary .....................................................................................................................Glossary-1
Index .................................................................................................................................Index-1

【文件名】:07731@52RD_GPIB Program.pdf
【格 式】:pdf
【大 小】:975K
【简 介】:
【目 录】:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-9-22 18:32 , Processed in 0.045952 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表