Logical device allocations, Al_allocatedevice – Measurement Computing ADLIB WIN User Manual
Page 47

Chapter 12 Logical Device String Names
11-1
11. LOGICAL DEVICE ALLOCATIONS
Logical Devices are considered to be individual board subsections that can operate independently. For a
board that supports 1 AtoD port, 2 DtoA ports, 2 Digital input ports and 2 Digital output ports there would
be a total of 7 devices that can be allocated with the AL_AllocateDevice function. These devices consist of
“ADC0”, “DAC0”, “DAC1”, “DIN0”, “DIN1”, “DOT2” and “DOT3”. Each call to AL_AllocateDevice
will load the specified Logical Device per its associated settings specified in the initialization file (.INI)
and returns a LONG HANDLE to the LOGICAL DEVICE (LHLD) which is used in subsequent calls to
the device.
11.1 AL_AllocateDevice
Prototype
C\C++
LHLD
AL_AllocateDevice(LPSTR
lpstrLogDev, long lBoardId);
Visual Basic for Windows
Function
AL_AllocateDevice(ByVal
lpstrLogDev As String,
ByVal lBoardId As Long) As Long
LPSTR lpstrLogDev
address of the device subsystem string type: (i.e. “ADC0”)
long lBoardId
ID of the board
The AL_AllocateDevice function loads a device subsystem into the ADLIB logical device subsystem
database (LDSD). If the ADLIB information file exist (myinfo.ini) as specified in the myenv.con file, then
the LDSD is configured as defined. If the ADLIB information file does NOT exist or a configuration
parameter is not indicated within the myinfo.ini file source, the parameter will be set to its associated
capabilities file default(s) if available, otherwise the parameter is set to an ADLIB internal default. See the
individual function listing for its default behavior. Multiple configurations for the same hardware device
subsystem can also be allocated, but only one can be put into the running state at any time. See section
4.3
LOGICAL DEVICES
for additional details.
Parameter
Description
lpstrLogDev
Points to the logical device subsystem type to be allocated. The actual string is
composed of the following type identifiers (see below) along with the ID
number of the device subsystem to be allocated. The available types are board
dependent and are specified in the [Board] entry section of the specific board’s
capability
file.
“ADC#”
Specifies a specific analog input subsystem on the board to be allocated.
“DAC#”
Specifies a specific analog output subsystem on the board to be allocated.
‘DIN#”
Specifies a specific digital input subsystem on the board to be allocated.
“DOT#”
Specifies a specific digital output subsystem on the board to be allocated.
“COUNTER#”
Specifies a specific COUNTER subsystem on the board to be allocated.
lBoardId
Specifies the specific board ID from which to logical device subsystem will be
allocated.