Gx3788AnalogInScanGetChannelListIndex

Purpose

Return scan channel list entry.

Syntax

Gx3788AnalogInScanGetChannelListIndex (nHandle, dwScanChannelIndex, pdwChannel, pnRange, pnMode, pbIsLastChannel, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3788 board.
dwScanChannelIndex
DWORD
Index of entry in channel list to return (0-63).
pdwChannel
PDWORD
Returns the channel number stored at the selected index in the scan channel list (0-15).  
pnRange
PSHORT
Returns the range of the input channel stored at the selected index in the scan channel list:
0.      GX3788_ANALOG_IN_RANGE_NEG_13p60V_TO_POS_13p60V: ±13.6V.
1.      GX3788_ANALOG_IN_RANGE_NEG_10p24V_TO_POS_10p24V: ±10.24V.
2.      GX3788_ANALOG_IN_RANGE_NEG_5p12V_TO_POS_5p12V: ±5.12V.
3.      GX3788_ANALOG_IN_RANGE_NEG_2p56V_TO_POS_2p56V: ±2.56V.  
4.      GX3788_ANALOG_IN_RANGE_NEG_1p28V_TO_POS_1p28V: ±1.28V.
5.    GX3788_ANALOG_IN_RANGE_NEG_0p64V_TO_POS_0p64V:  ±0.64V.         
pnMode
PSHORT
Returns the mode of the input channel stored at the selected index in the scan channel list:
0.      GX3788_ANALOG_IN_DIFFERENTIAL.
1.    GX3788_ANALOG_IN_SINGLE_ENDED.
pbIsLastChannel
PBOOL
Returns the last channel flag stored at the selected index in the scan channel list.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The analog in scan operation requires that a channel list be set up prior to initiating the operation. This function allows the user to create a channel list, including the analog in channel number, voltage range, and mode. The channel list is then used by the sequencer to acquire samples (one per channel that is defined in the channel list) for each sample clock period. Note that the same channel number can be repeated in a channel list, resulting in multiple samples being taken on the same channel within a sample clock period. Use the bIsLastChannel parameter to indicate which channel list index should be considered by the sequencer to be the last.

Note: see the Gx3788AnalogInScanStart() API for a complete example code.

Example

The following example sets a list of 3 channels, 0, 1 and 2, and returns the analog in scan channel list at index 0:

 

SHORT nRange, nMode, nStatus;

BOOL bIsLastChannel;

// set channel scan list

Gx3788AnalogInScanSetChannelListIndex(nHandle, 0, 0, GX3788_ANALOG_IN_RANGE_NEG_10p24V_TO_POS_10p24V,GX3788_ANALOG_IN_SINGLE_ENDED, false, &nStatus);

Gx3788AnalogInScanSetChannelListIndex(nHandle, 1, 1, GX3788_ANALOG_IN_RANGE_NEG_10p24V_TO_POS_10p24V,GX3788_ANALOG_IN_SINGLE_ENDED, false, &nStatus);

Gx3788AnalogInScanSetChannelListIndex(nHandle, 2, 2, GX3788_ANALOG_IN_RANGE_NEG_10p24V_TO_POS_10p24V,GX3788_ANALOG_IN_SINGLE_ENDED, true, &nStatus);

// returns the analog in scan channel list at index 0

Gx3788AnalogInScanGetChannelListIndex (nHandle, 0, &nRange, &nMode, &bIsLastChannel, &nStatus);

 

See Also

Gx3788AnalogInScanIsRunning, Gx3788AnalogInScanReadMemoryRawData, Gx3788AnalogInScanReadMemoryVoltages, Gx3788AnalogInScanSetChannelListIndex, Gx3788AnalogInScanSetCount, Gx3788AnalogInScanSetSampleRate, Gx3788AnalogInScanStart, GxFpgaGetErrorString