InterfaceInfo Property (ADriver)

Returns or sets the specified driver info value.

Syntax

Object.InterfaceInfo ( enInfo [, vParam] ) [ = vInfo ]

The InterfaceInfo property syntax has the following parts:

 

Name

Type

Description

Object

ADriver

ADriver object

enInfo

enumADriverInfo

An integer specifying the type of Interface information.

vParam

Variant

Optional parameter which used to pass in the value of the resource number to ISA Interface, e.g., 2 for ISA IO.

vInfo

Variant

Value to set or get.

Where

enumADriverInfo can be one of the following values:

 

Name

Value

Description

adriverInfoAddress

1

Returns or sets the address:
 

Interface Type

Address

aioGpib

GPIB address

aioCom

COM address

aioVxi

VXI address

aioFile

File Handle (only get)

aioIsa

ISA IO address (only get)

aioWinSock

adriverInfoWinSockSocket
(see below, only get)

aioUsb

Handle that returned from UsbOpen call.(v7.0)

adriverInfoInterfaceOpen

2

Returns 0 if the driver interface is closed and 1 if it is open.

adriverInfoOpenOnAccess

3

Returns 1 if the driver is configured as Open On Access and 0 otherwise. Use this to delay initialization of the driver until a command that requires the driver interface is used (i.e. IO Table).

adriverInfoInterfaceEventMask

4

Get/Set InterfaceEventMask

adriverInfoComAddress

10

Get/Set Com Address

adriverInfoFileHandle

30

Returns or sets File Handle

adriverInfoFileMode

31

Returns or sets File Mode

adriverInfoFileName

32

Returns or sets File Name

adriverInfoGpibAddress

40

Returns/Set Gpib Address

adriverInfoIsaDma

50

Returns or sets Isa Dma

adriverInfoIsaIo

51

Returns or sets Isa Io

adriverInfoIsaIrq

52

Returns or sets Isa Irq

adriverInfoIsaMem

53

Returns or sets Isa Mem

adriverInfoVxiAddress

70

Returns or sets Vxi Address

adriverInfoWinSockConnectTimeout

80

Returns or sets WinSock Connect Timeout

adriverInfoWinSockLocalPort

81

Returns or sets WinSock Local Port

adriverInfoWinSockProtocol

82

Returns or sets WinSock Protocol

adriverInfoWinSockRemoteHost

83

Returns or sets WinSock Remote Address

adriverInfoWinSockRemotePort

84

Returns or sets WinSock Remote Port

adriverInfoWinSockServer

85

Returns 1 if this driver is designed to be the Server and return 0 if it is designed to be a client. Sets 0 for client and 1 for server.

adriverInfoWinSockServerSocket

86

Returns a server socket that created by the server. Sets server socket to bind listen and accept

adriverInfoWinSockSocket

87

If client, it returns the socket created for remote connection. If server, it returns socket that the client returns after accepting remote connection. Sets socket accordingly.

adriverInfoWinSockServerAutoAccept (v6.0)

88

Returns Server Auto Accept flag which allows (if checked) for (not Open on Access case) making Accept automatically after the OnInterface is called with enCause Accept without blocking in the background.  (Server Property checked during design time - driver shortcut Interfaces property.)

adriverInfoUsbVendorId (v7)

90

Get/Set Usb Vendor ID

adriverInfoUsbProductId (v7)

91

Get/Set Usb Product ID

adriverInfoUsbSerialNumber (v7)

92

Get/Set Usb Serial Number

adriverInfoUsbTmc (v7)

93

Get/Set Usb TMC

Comments

The InterfaceEventMask is a 32-bit word where each bit represents an interface event which is to be passed to the OnInterfaceEvent event procedure of a driver. The value of the vInfo parameter is made up by the OR operation on the event bits defined in the enumerated type enumAInterfaceType. This mask is initialized to 0xFFFFFF (all events enabled) when execution begin. It is important to only enable the events of interest to avoid the overhead involved in calling the OnInterface event when it will just return without doing anything.

Setting any one of the following Winsock info will cause the socket to be closed and reopened next time when you perform I/O (v 6.0):
 

adriverInfoWinSockConnectTimeout

adriverInfoWinSockLocalPort

adriverInfoWinSockProtocol

adriverInfoWinSockRemoteHost

adriverInfoWinSockRemotePort

adriverInfoWinSockServer

adriverInfoWinSockServerSocket

adriverInfoWinSockSocket

Example

The following fragment from a Winsock driver, which implements the client side of an application protocol to support remote terminals over an IP network, illustrates the use of the InterfaceInfo property:

drv1.OnInterface()

{

! ...

! Notify server that this terminal is now online

m_socket = Driver.InterfaceInfo(adriverInfoWinsockSocket)

WsSend ( m_socket, 10, , "TERMINAL ONLINE "+Str(m_nTerminalNum))

WsReceive ( m_socket, 30, , m_sResponse)

! ...

}

Applies to

ADriver

See Also

InterfaceType, ModuleType, OnInterface