Logical device initializations, Al_initdevice – Measurement Computing ADLIB WIN User Manual

Page 53

Advertising
background image

Chapter 14 Logical Device Start / Stop Operations

12-1

12. LOGICAL DEVICE INITIALIZATIONS

Each Logical Device subsystem requires initialization before it can be used. The initialization consists of
passing the device initialization settings specified in the (.INI) file and ADLIB function call settings to the
specific boards lower level DLL and SYSTEM drivers. For the Pci5500 and PCI 55xx Series Cards, the
next step is to start the device with a call to the AL_StartDevice function for the ADC0, DAC0 or DAC1
devices. All other Pci5500 and PCI55xx devices begin operation after the AL_InitDevice function call.

12.1 AL_InitDevice

Prototype

C\C++

ERRNUM

AL_InitDevice(LHLD

lhld);


Visual Basic for Windows

Function

AL_InitDevice(ByVal

lhld As Long) As Long

LHLD lhld

handle of the LDSD to be initialized


The AL_InitDevice function initializes the actual hardware device to the current ADLIB logical device
subsystem database(LDSD) settings. This function must be called before attempting to call the
AL_StartDevice function, failure to do so will result in an error. Once started, all ADLIB calls that affect
the functional state of the hardware device are still allowed, but the new setting is only reflected in LDSD,
and NOT in the actual hardware device itself. ADLIB functions that control the running state are reflected
in both the LDSD and actual hardware device itself. To update the actual state of the hardware device with
any changes made to the LDSD, AL_InitDevice function must be called once again. This allows changes to
be made to the functionality of the LDSD while the hardware device is still running. Multiple
configurations for the same hardware device subsystem can also be allocated with AL_AllocateDevice, but
only one can be initialized and started at any given time.

Parameter Description

lhld

Identifies the instance of the logical device subsystem to be initialized.


Returns:
On success ERRNUM is set to 1, otherwise ERRNUM contains the last error code that occurred during the
call.

Note

If the device is currently running, an error flag setting determines whether to stop and then reinitialize the
hardware device or to return a non-critical error and keep the device running. See the function
AL_ErrorOnInitRunning for more information.

Related Functions:
NONE

Program References:
ALL

Supported Logical Device Subsystems:
All

Advertising