Al_getchannellist – Measurement Computing ADLIB WIN User Manual

Page 97

Advertising
background image

Chapter 24 Channel Selections

23-3

23.2 AL_GetChannelList

Prototype

C\C++

ERRNUM

AL_GetChannelList(LHLD

lhld, LPCHANLIST lpchanlist);


Visual Basic for Windows

Function

AL_GetChannelList(ByVal

lhld As Long,

lpchanlist As CHANLIST) As Long


LHLD lhld

handle of the LDSD

LPCHANLIST lpchanlist address of the user channel list structure

The AL_GetChannelList function retrieves the current LDSD channel and gain settings. If a device
supports gain settings, the list is considered a channel and gain list, and will be set in a channel then gain
sequence. See examples below.

Parameter

Description

lhld

Identifies the instance of the logical device subsystem.


lpchanlist Specifies a 32 bit far pointer to a channel information structure. The structure

has been predefined in the ADLIB include file and is defined as follows:


typedef struct tagCHANLIST
{

long

lType; /* 0 = Not Defined */

/* 1 = Use string list */

/* 2 = Use array of numbers */


char

achChannelList[MAX_CHANLIST_STRLEN];


long

lNumElements;

long

alChannelList[MAX_CHANLIST_ARRAYLEN];

}CHANLIST;
typedef CHANLIST FAR * LPCHANLIST;

Returns:
On success ERRNUM is set to 1 and the lpchanlist structure is filled with the device's channel list settings,
otherwise ERRNUM contains the last error code that occurred during the call, and the lpchanlist structure
may contain invalid information.

Related Functions:
AL_SetChannelList
AL_SetMinStartChan
AL_GetMinStartChan
AL_SetMaxEndChan
AL_GetMaxEndChan
AL_SetGainGlobal

Examples:

string

“0,1,2,3,4,5,6,7”

string with gains

“0(1),1(2),2(4),3(8),4(1),5(2),6(4),7(8)”

array {0,1,2,3,4,5,6,7};

array with gains

{0,1,1,2,2,4,3,8,4,1,5,2,6,4,7,8};

Advertising