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 #87 background imageLoading...
Page #87 background image
Chapter 8 NI-488.2 Programming Techniques
© National Instruments Corporation 8-15 NI-488.2 User Manual
SRQ and Serial Polling with Device-Level Traditional NI-488.2 Calls
You can use the device-level traditional NI-488.2 call ibrsp to conduct
a serial poll.
ibrsp conducts a single serial poll and returns the serial poll
response byte to the application. If automatic serial polling is enabled, the
application can use
ibwait to suspend program execution until RQS
appears in the status word,
ibsta. The program can then call ibrsp to
obtain the serial poll response byte.
The following example shows you how to use the
ibwait and ibrsp
functions in a typical SRQ servicing situation when automatic serial polling
is enabled:
#include "ni488.h"
char GetSerialPollResponse ( int DeviceHandle )
{
char SerialPollResponse = 0;
ibwait ( DeviceHandle, TIMO | RQS );
if ( ibsta & RQS ) {
printf ( "Device asserted SRQ.\n" );
/* Use ibrsp to retrieve the serial poll response. */
ibrsp ( DeviceHandle, &SerialPollResponse );
}
return SerialPollResponse;
}
SRQ and Serial Polling with Multi-Device NI-488.2 Calls
The NI-488.2 software includes a set of multi-device NI-488.2 calls that
you can use to conduct SRQ servicing and serial polling. Calls pertinent
to SRQ servicing and serial polling are
AllSpoll, ReadStatusByte,
FindRQS, TestSRQ, and WaitSRQ. Following are descriptions of each of
the calls:
AllSpoll can serial poll multiple devices with a single call. It places
the status bytes from each polled instrument into a predefined array.
Then, you must check the RQS bit (bit 6 or hex 40) of each status byte
to determine whether that device requested service.
ReadStatusByte is similar to AllSpoll, except that it only serial
polls a single device. It is similar to the device-level NI-488.2
ibrsp
function.

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.