Mac os x, Mac os x -4 – National Instruments NI-488.2 User Manual

Page 41

Advertising
background image

Chapter 4

Developing Your NI-488.2 Application

NI-488.2 User Manual

4-4

ni.com

Modifying existing applications to use the NI4882 API should require
minimal changes. In most cases, using the new include file (

ni4882.h

instead of

windows.h

and

ni488.h

) and linking to the new object file

(

ni4882.obj

instead of

gpib-32.obj

) is sufficient to compile your

application. There may still be warnings due to changes to the status
variable type’s signed property.

Complications may arise in several uncommon use cases. The following
issues have been encountered.

Storing function pointers for the

ibnotify

callback. This causes a

type mismatch on the assignment. To solve this, fix the function
prototype of the callback to use

unsigned long

for the status

parameters.

Using function pointers to

ibfind

. This causes a preprocessor error

because the

ibfind

macro requires a one-parameter argument. To

solve this, point to

ibfindA

or

ibfindW

, depending on the unicode

convention in your application.

Configuration functions show up in NI Spy as

ibconfig

calls. This is

because macros redirect those calls to use

ibconfig

. Avoid confusion

by using

ibconfig

directly.

In most cases, applications written in the NI4882 API will continue to
work on older versions of the NI-488.2 for Windows software, back to
version 1.7. Certain new

ibask

and

ibconfig

options break this

backwards compatibility, and those options are easily avoidable by using
alternative options. Existing applications using the GPIB32 API continue
to execute unchanged. The GPIB32 API will continue to exist, but are
available only for 32-bit applications. Applications written in the NI4882
API compile on both 32-bit and 64-bit environments. To port an application
to a 64-bit environment requires that the application migrate to the NI4882
API and be recompiled.

The following NI4882 API constructs break API compatibility with older
versions of NI-488.2 for Windows.

ibask

(

IbaEOS

)

ibconfig

(

IbcEOS

)

Mac OS X

NI-488.2 has

NI488.framework

Carbon framework for Mac OS X,

which you can use from your C/C++ applications.

Advertising