beautypg.com

Getting started, 9d. getting started, Topics – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 161: Introduction, C language

background image

9D. Getting Started

II. SOFTWARE GUIDES - 9. Driver488/SUB

II-146

Personal488 User’s Manual, Rev. 3.0

2.

If the external device name is specified with its interface name prefixed, then that external device
on that hardware interface is used. If that external device is not attached to the specified hardware
interface, then an error occurs.

Example

Assume there are three IEEE 488 interfaces:

IEEE

,

IEEE2

, and

IEEE3

controlling multiple devices:

SCOPE

(on

IEEE

),

DA

(on

IEEE2

) and

DA

(on

IEEE3

). Since there are two external devices, both

named

DA

, their full name must be used to specify them.

We can communicate with the external devices, according to the two rules above.

scope = OpenName (“SCOPE”) ;

// SCOPE on IEEE (Rule 1)

da = OpenName (“DA”)

// DA on IEEE2 or IEEE3 (not specified)

da = OpenName (“IEEE2:DA”) ;

// DA on IEEE2 (Rule 2)

scope = OpenName (“IEEE2:SCOPE”);

// Error (not IEEE:SCOPE) (Rule 2)

9D. Getting Started

Topics

Introduction................................................................................... II-145

C Language .................................................................................... II-145

Required Headers ........................................................................................ II-146
Required Libraries ...................................................................................... II-146

QuickBASIC ................................................................................... II-148

Required Definition File ............................................................................ II-149
Required Libraries ...................................................................................... II-149

Pascal .............................................................................................. II-149

Required Libraries ...................................................................................... II-149

Introduction

The following text outlines the steps necessary to produce an application program that communicates
with Driver488/SUB. The application is the simplest one possible, it merely requests the revision
number of the resident driver using the

Hello

command. Examples are provided in C, QuickBASIC

and Pascal. Each of these supported languages are described in more detail in each of the next three
Sub-Chapters “C Languages,” “QuickBASIC,” and “Pascal” of this Chapter. For further information
on the

Hello

command, see the “Section III: Command References” of this manual.

C Language

To successfully operate Driver488/SUB, several declarations must be included in the user’s application
program. These declarations are found in two headers which must be included in the main module of
your C program. The two required headers can be found in the language-specific subdirectory at the
end of the path

\IEEE488\SUBAPI

, if installed under the default conditions.

In the same directory as the headers, are the libraries for the different memory models. One of these
libraries must be linked with your C project to resolve Driver488/SUB external references.