EasyManua.ls Logo

National Instruments NI-488.2 NI-488.2 User Manual

National Instruments NI-488.2 NI-488.2
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #79 background imageLoading...
Page #79 background image
Chapter 8 NI-488.2 Programming Techniques
© National Instruments Corporation 8-7 NI-488.2 User Manual
0); // EOS mode disabled
if (ud < 0) {
printf ("ibdev failed.\n");
return 0;
}
// Issue a request to the device to send the data. If the ERR bit
// is set in ibsta, then print an error message that the call failed
// and exit the program.
ibwrt (ud, "SEND DATA", 9L);
if (ibsta & ERR) {
printf ("unable to write to device.\n");
return 0;
}
// set up the asynchronous event notification on RQS
ibnotify (ud, RQS, MyCallback, NULL);
if (ibsta & ERR) {
printf ("ibnotify call failed.\n");
return 0;
}
while ((ReadingsTaken < 1000) && !(DeviceError)) {
// Your application does useful work here. For example, it
// might process the device readings or do any other useful work.
}
// disable notification
ibnotify (ud, 0, NULL, NULL);
// Call the ibonl function to disable the hardware and software.
ibonl (ud, 0);
return 1;
}
int __stdcall MyCallback (int LocalUd, int LocalIbsta, int LocalIberr,
long LocalIbcntl, void *RefData)
{
char SpollByte;
char ReadBuffer[40];

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the National Instruments NI-488.2 NI-488.2 and is the answer not in the manual?

National Instruments NI-488.2 NI-488.2 Specifications

General IconGeneral
Operating SystemsWindows, Linux, macOS
Programming LanguagesC, C++, Python, LabVIEW
InterfaceGPIB
Supported StandardsIEEE 488.2
FunctionalityGPIB instrument control, data acquisition, and analysis

Summary

Chapter 1 Introduction

Setting Up and Configuring Your System

Describes how to set up and configure your GPIB system.

Chapter 2 Measurement & Automation Explorer (Windows)

Troubleshoot NI-488.2 Problems

Instructions for using the NI-488.2 Troubleshooting Utility.

Chapter 3 GPIB Explorer (Mac OS X and Linux)

Chapter 4 Developing Your NI-488.2 Application

Interactive Instrument Control

Using the Interactive Control utility for instrument communication.

Choosing How to Use the NI-488.2 API

Guidance on selecting between traditional and multi-device NI-488.2 API calls.

Checking Status with Global Variables

Explains how to use global status variables (ibsta, iberr, etc.).

Chapter 5 Debugging Your Application

NI Spy

Introduction to NI Spy utility for monitoring NI-488.2 calls.

Global Status Variables

Details on global status variables (ibsta, iberr, ibcnt, ibcntl).

NI-488.2 Error Codes

Explanation of error variable (iberr) and error codes.

Chapter 6 NI Spy Utility

Chapter 7 Interactive Control Utility

Chapter 8 NI-488.2 Programming Techniques

High-Speed Data Transfers (HS488)

Describes the HS488 protocol for high-speed GPIB data transfer.

Enabling HS488

Instructions on how to enable the HS488 feature for GPIB interfaces.

Asynchronous Event Notification in NI-488.2 Applications

Using ibnotify for asynchronous notification of GPIB events.

Appendix C Error Codes and Solutions

GPIB Error Codes

Lists and describes GPIB error codes and their meanings.

EDVR (0)

Explains the EDVR error and provides solutions for accessing issues.