Gx3788AnalogInMeasureChannel

Purpose

Measures the voltage on a particular analog channel.

Syntax

Gx3788AnalogInMeasureChannel (nHandle, nMode, nChannel, nVoltageRange, pdVoltage, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3788 board.
nMode
SHORT
Sets the mode of the input channel to query:
0.      GX3788_ANALOG_IN_DIFFERENTIAL.
1.    GX3788_ANALOG_IN_SINGLE_ENDED.
nChannel
SHORT
Selects the analog input channel to measure.
Use the following constants when using single ended mode:
0.      GX3788_ANALOG_IN_0.       
1.      GX3788_ANALOG_IN_1.       
2.      GX3788_ANALOG_IN_2.       
3.      GX3788_ANALOG_IN_3.       
4.      GX3788_ANALOG_IN_4.      
5.      GX3788_ANALOG_IN_5.       
6.      GX3788_ANALOG_IN_6.       
7.      GX3788_ANALOG_IN_7.       
8.      GX3788_ANALOG_IN_8.       
9.      GX3788_ANALOG_IN_9.       
10.   GX3788_ANALOG_IN_10.
11.   GX3788_ANALOG_IN_11.
12.   GX3788_ANALOG_IN_12.
13.   GX3788_ANALOG_IN_13.
14.   GX3788_ANALOG_IN_14.
15.   GX3788_ANALOG_IN_15.
Use the following constants when using differential mode:
0.      GX3788_ANALOG_IN_DIFF_0_AND_1.           
1.      GX3788_ANALOG_IN_DIFF_2_AND_3.           
2.      GX3788_ANALOG_IN_DIFF_4_AND_5.           
3.      GX3788_ANALOG_IN_DIFF_6_AND_7.           
4.      GX3788_ANALOG_IN_DIFF_8_AND_9.           
5.      GX3788_ANALOG_IN_DIFF_10_AND_11.
6.      GX3788_ANALOG_IN_DIFF_12_AND_13.
7.    GX3788_ANALOG_IN_DIFF_14_AND_15.  
nVoltageRange
SHORT

Returns the analog input Ground Source:

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.    
pdVoltage
PDOUBLE
Returns the measured voltage.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each analog in channel has the ability to be measured for voltage. The detection circuit can be set to use one of 7 voltage ranges (nVoltageRange parameter). The measurement can also be taken as a single ended input or a differential pair of inputs (nMode parameter). When the differential mode is used, a pair of analog input channels are used together to provide the differential input. The differential pairs are defined as channels 0 and 1, channels 2 and 3, etc. For example, if the GX3788_ANALOG_IN_DIFFERENTIAL constant is passed to the nMode and the GX3788_ANALOG_IN_DIFF_4_AND_5 constant is passed in to the nChannel parameter, the differential pair will be channels 4 and 5.

Example

The following example gets the ground source of analog channels 0 through 7:

 

Gx3788AnalogInMeasureChannel (nHandle, GX3788_ANALOG_IN_SINGLE_ENDED, 0, GX3788_ANALOG_IN_RANGE_NEG_10p24V_TO_POS_10p24V, &dVoltage, &nStatus);

printf("Analog In Channel 0 measurement = %f Voltage", dVoltage);

 

See Also

Gx3788AnalogInMeasureChannel, Gx3788AnalogInSetGroundSource, Gx3788Reset, GxFpgaGetErrorString