Using Interactive Control To Communicate With Devices; Programming Models; Applications That Communicate With A Single Gpib Device; Items To Include - National Instruments NI-488.2 NI-488.2 User Manual

National instruments network hardware - networking hardware user manual
Hide thumbs Also See for NI-488.2 NI-488.2:
Table of Contents

Advertisement

Using Interactive Control to Communicate with Devices

Programming Models

Applications That Communicate with a Single GPIB Device

© National Instruments Corporation
If you are reading data, the count variables indicate the number of bytes
read. If you are sending data or commands, the count variables reflect the
number of bytes sent.
Before you begin writing your application, you might want to use the
Interactive Control utility to communicate with your instruments
interactively by typing in commands from the keyboard rather than from
an application. You can use the Interactive Control utility to learn to
communicate with your instruments using the NI-488.2 API. For specific
device communication instructions, refer to the user manual that came with
your instrument. For information about using the Interactive Control utility
and detailed examples, refer to Chapter 7,
This section describes items you should include in your application and
provides general program steps with an NI-488.2 example.

Items to Include

Include the following items in your application:
Header files—In a C application, include the header file
which contains prototypes for the NI-488.2 calls and constants that
you can use in your application.
Error checking—Check for errors after each NI-488.2 call.
Error handling—Declare and define a function to handle NI-488.2
errors. This function takes the device offline and closes the application.
If the function is declared as:
void gpiberr (char * msg); /*function prototype*/
then your application invokes it as follows:
if (ibsta & ERR) {
gpiberr("NI-488.2 error");
}
Chapter 4
Interactive Control
4-7
Developing Your NI-488.2 Application
Utility.
ni488.h
NI-488.2 User Manual
,

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents