GetDriverName Procedure

Returns the Driver name of a specified Driver's number.

Syntax

[ sDriverName = ] GetDriverName ( [ nDriverNum ] )

The GetDriverName procedure syntax has the following parts:

 

Name

Type

Description

sDriverName

BString

Configuration name of Driver.

nDriverNum

Val Short

Number of the Driver in the Drivers submodule under the System.

Comments

The Driver's number represents the index number in the Drivers submodule under the System, starting from 1.

The sDriverName is specific to the Driver's name as specified in the Driver shortcut Property page. If sDriverName is an empty string, then nDriverNum does not exist.

If this function is used within a Driver procedure, a zero can be specified as the nDriverNum parameter. The returned Driver name will be the name of the calling Driver.

Note: This function is very useful, since the developer of the driver may not know the name under which this driver will be configured. The name is required to retrieve the base address of PC-based instruments. Using this function with a zero as nDriverNum in conjunction with the GetDriverModule function is therefore a requirement for PC-based instruments if the driver is to operate properly, regardless of its name.

Example

The following example displays the system drivers names:

Loop

nDriverNum=1

sDrv=GetDriverName(nDriverNum)

If sDrv = "" Then

Exitloop

Endif

Print nDriverNum, sDrv, GetDriverType(sDrv),

Print GetDriverAddress(sDrv),

Print GetDriverModule(sDrv)

nDriverNum=nDriverNum+1

Endloop

See Also

ADriver, ADriver.DefaultName, ADriver.FileName, ADriver.Name, Driver Variable, GetDriverAddress, GetDriverModule, GetDriverType