Modify scan channel list.
Gx3788AnalogInScanSetChannelListIndex (nHandle, dwScanChannelIndex, dwChannel, nRange, nMode, bIsLastChannel, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3788 board. |
dwScanChannelIndex |
DWORD |
Index in channel list to modify (0-63). |
dwChannel |
DWORD |
Channel number to add to the scan channel list (0-15). |
nRange |
SHORT |
Sets the range of the input channel 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. |
nMode |
SHORT |
Sets the mode of the input channel at the selected index in the scan channel list:0. GX3788_ANALOG_IN_DIFFERENTIAL.1. GX3788_ANALOG_IN_SINGLE_ENDED. |
bIsLastChannel |
BOOL |
Marks the channel as the last in the channel list at the selected channel index. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
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.
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);
Gx3788AnalogInScanGetLastRunCount, Gx3788AnalogInScanIsRunning, Gx3788AnalogInScanReadMemoryRawData, Gx3788AnalogInScanReadMemoryVoltages, Gx3788AnalogInScanGetChannelListIndex, Gx3788AnalogInScanSetCount, Gx3788AnalogInScanSetSampleRate,
Gx3788AnalogInScanStart, GxFpgaGetErrorString