Driver functions, 1 board handles, 2 physical addressing – Sensoray Smart A/D User Manual

Page 5: 3 required function calls

Advertising
background image

S

ENSORAY

I

NSTRUCTION

M

ANUAL

S

MART

A/D D

RIVER

FOR

W

INDOWS

Page 3

3. Driver Functions

3.1 Board Handles

Each board is assigned a board number, which is referenced in this document as a “handle.” A handle is the logical address of a
board. Most driver functions include the board handle as a parameter so that driver calls will be directed to a specific board.
Since the driver supports up to 16 Smart A/D™ boards, valid handles may have any numerical value in the range 0 to 15.

Board handles are not OS-allocated handles in the traditional Windows sense, but rather are integer values that are assigned by
the application program. When a board is first declared to the driver by the application program, any unused valid handle may
be specified. Once a handle has been assigned to a board, it must not be used by any other board.

3.2 Physical Addressing

In addition to the board handle, which is the “logical” address for a board, each board also has a physical address. In the case of
direct I/O mapped products such as STDbus and ISA boards, the physical address is simply the base I/O address of the board.
Networking Smart A/D™ products, on the other hand, use the IP address as a physical address.

In order to provide a common physical address format for all Smart A/D™ products, a board’s physical address is always
specified as a 32-bit, unsigned integer value, regardless of the Smart A/D™ product family. The following table describes the
characteristics of the physical addresses employed by the driver for the different Smart A/D™ product families:

Four of the driver functions make use of physical board addresses:

• SetBoardAttr() declares a board to the driver in order to establish a connection to the board.
• GetBoardAdrs() returns the physical address of a connected board.
• InetAtoN() converts an IP address from “dot address” format to binary.
• InetNtoA() converts an IP address from binary to “dot address” format.

3.3 Required Function Calls

Some driver functions are used universally in all applications, while other driver functions may or may not be used depending on
the sensor types in use and other considerations. All application programs must, as a minimum, perform the following steps for
each Smart A/D™ board:

1.

Call SetBoardAttr() to declare the Smart A/D™ board type and physical address.

2.

In systems that have multiple PCI or CompactPCI Smart A/D™ boards, call GetBoardAdrs() to get the board’s physical
address.

3.

Call ResetBoard() to initialize the board to a known state.

Product

Family

Physical Address Value

PCI / CPCI

On PCI and CompactPCI models (Model numbers 61x and 71x), the address is a derived value that indicates
both the slot number and bus number that the board resides in. The high word (16 bits) of the address value
represents the bus number and the low word represents the slot number within that bus. For example, the
address 0x0002000A indicates that the board is located in bus number 2, slot 10.

Network

On Networking models (Model numbers 251x), the address value is the board’s IP (Internet Protocol, v.4)
address. The address is always specified in host byte order (versus network byte order). The IP address
value is established as described in the hardware documentation for the specific Network Smart A/D™
product. Note that the software driver includes utility functions that will translate between this binary
address form and the more user-friendly “dot address” format (i.e., “124.105.73.116”).

All Others

On all other models—which are direct I/O mapped products—the address value is the board’s base I/O
address as established by programming shunts or switches on the board.

Advertising