GetDriverAddress Procedure

Returns the address of the specified Driver's name, sDriverName.

Syntax

[ lAddress = ] GetDriverAddress ( [ sDriverName ] )

The GetDriverAddress procedure syntax has the following parts:

 

Name

Type

Description

lAddress

Long

Address of Driver

sDriverName

Val BString

Configuration name of Driver

Comments

The sDriverName is the name specified in the Driver Property Page. When this function is called from within a Driver subroutine and sDriverName is an empty string, the calling Driver is assumed.

The ADriver.InterfaceInfo can also be used to retrieve the driver address among other information items.

 

Driver Type

Description of lAddress

GPIB

See description below.

COM

For RS-232 Drivers, the lAddress is COMn (where n is 1 to 4) and may be used with the ComSetup function.

VXI

For VXI Driver, the lAddress specifies the Logical Address (0-255) and may be used with low-level VXI Functions.

File

If the Driver is a File Driver that uses a file and the file is open, then the lAddress is the file handle associated with that file. This file handle may be used with File I/O functions. Otherwise, the lAddress is -1.

ISA

For an ISA Driver, the lAddress is the ISA I/O address, which is partically configured by jumpers on the driver board. It has a hexadecimal format up to 16 bits, 0x000000 to 0xFFFFFF.

USB

Handle returned from UsbOpen procedure. (v7.0)

Winsock

For a Winsock Driver, the lAddress is the Winsock socket number.

For a GPIB Driver, the hexadecimal format of lAddress is as follows:

0xBBPPSS

Where:

 

BB

The GPIB board used (1 or 2).

PP

The primary address of a GPIB device, this value is between 1 and 30.

SS

The secondary address of a GPIB device, this value can be between 1 and 31, and 0 if not used.

The lAddress may be used with low-level GPIB Functions.

The function returns -1 if sDriverName cannot be found or no interface type has been configured for the driver.

Example

The following example retrieves the address of "DMM", a GPIB Driver, and uses this address to clear the device. The DMM Driver is configured as a GPIB board 2, Primary address of 12, and a secondary address of 4.

lDmmAddress=GetDriverAddress("DMM")

! now lDmmAddress is 0x20C04

GpibClear(lDmmAddress)

See Also

ADriver, ADriver.InterfaceInfo, Driver Variable, GetDriverModule, GetDriverName, GetDriverType, GPIB Procedures, GpibClear, VXI Procedures