beautypg.com

Sensoray Smart A/D User Manual

Page 11

background image

S

ENSORAY

I

NSTRUCTION

M

ANUAL

S

MART

A/D D

RIVER

FOR

W

INDOWS

Page 9

3.6.2 GetBoardAdrs()

Function:

Returns the physical address of a Smart A/D™ board. The address value is always returned as a 32-bit integer, but
the interpretation of the address value depends upon the board type. See “Physical Addressing” on page 3 for
details.

This function serves primarily as a utility to help determine the slot and bus numbering conventions of any PCI or
CompactPCI system. In PCI and CPCI systems that have multiple Smart A/D™ boards, the ability to reference a
specific board is critical. For example, one Smart A/D™ board might monitor a heater while a second board
monitors a cooler. For obvious reasons an application must be able to distinguish between these boards, and the
only way to do this in a PCI/CPCI system is to assign fixed slot locations to each board.

Prototype:

long GetBoardAdrs( long hBD );

Example:

/////////////////////////////////////////////////////////////////////////////

// Determine the physical addresses of all Model 619 PCI Smart A/D boards.

/////////////////////////////////////////////////////////////////////////////

#define MAXBOARDS 16 // Maximum number of Smart A/D boards supported by driver.

short nboards; // Number of detected Model 619 boards.

long adrs[MAXBOARDS]; // Addresses of all detected Model 619 boards.

// Find and register all Model 619 boards.

for ( nboards = 0; nboards < MAXBOARDS; nboards++ )

{

if ( !SetBoardAttr( nboards, 619, 0 ) ) // If no more boards,

break; // terminate seek loop.

}

// Get the physical addresses of all Model 619 boards.

for ( short boardnum = 0; boardnum < nboards; boardnum++ )

adrs[boardnum] = GetBoardAdrs( boardnum );

3.6.3 GetFWVersion()

Function:

Returns the Smart A/D™ board firmware version number, times 100. For example, a call to this function that
returns the value 223 indicates that the Smart A/D™ board is running firmware version number 2.23.

This function is useful when it is necessary to automatically determine whether a board feature—which may be
available only in specific firmware releases—is accessible in an installed Smart A/D™ product.

Prototype:

long GetFWVersion( long hBD );

Example:

///////////////////////////////////////////////////////////////////////////

// Get the Smart A/D firmware version that board number 2 is running.

///////////////////////////////////////////////////////////////////////////

double smartadversion = GetFWVersion( 2 ) / 100.0;

Parameter

Type

Description

hBD

long

Board handle.

return value

long

Board’s physical address as described in section 3.2.

Parameter

Type

Description

hBD

long

Board handle.

return value

long

Board’s Smart A/D™ firmware version number, times 100.