Gx3748ComparatorsReadState

Purpose

Returns the specified group channel comparator state.

Syntax

Gx3748ComparatorsReadState (nHandle, nGroup, nChannel, pnComparatorState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3748 board.
nGroup
PSHORT
Group number as follows:
0.      GX3748_GROUP0: J1 input connector pins 2 to 17.
1.      GX3748_GROUP1: J1 input connector pins 23 to 38.
2.    GX3748_GROUP2: J1 input connector pins 44 to 59.
nChannel  
SHORT
Channel number in the group, channel numbers are 0-15:
0.      GX3748_GROUP_CH0: channel 0 in the group.
1.      GX3748_GROUP_CH1: channel 1 in the group.
2.      GX3748_GROUP_CH2: channel 2 in the group.
3.      GX3748_GROUP_CH3: channel 3 in the group.
4.      GX3748_GROUP_CH4: channel 4 in the group.
5.      GX3748_GROUP_CH5: channel 5 in the group.
6.      GX3748_GROUP_CH6: channel 6 in the group.
7.      GX3748_GROUP_CH7: channel 7 in the group.
8.      GX3748_GROUP_CH8: channel 8 in the group.
9.      GX3748_GROUP_CH9: channel 9 in the group.
10.   GX3748_GROUP_CH10: channel 10 in the group.
11.   GX3748_GROUP_CH11: channel 11 in the group.
12.   GX3748_GROUP_CH12: channel 12 in the group.
13.   GX3748_GROUP_CH13: channel 13 in the group.
14.   GX3748_GROUP_CH14: channel 14 in the group.
15.  GX3748_GROUP_CH15: channel 15 in the group.
pnComparatorState  
PSHORT
Returned comparator state.
Group 0: Has two window threshold voltages:
0.      GX3748_COMPARATOR_BELOW_LOW: Input voltage is below the low window voltage.
1.      GX3748_COMPARATOR_WINDOW: Input voltage is below the window upper voltage and above the low window voltage.
3.      GX3748_COMPARATOR_ABOVE_HIGH: Input voltage is above the upper window voltage.
Group 1 and 2: Have one threshold voltages:
0.      GX3748_COMPARATOR_BELOW_LOW: Input voltage is below the threshold voltage.
3.    GX3748_COMPARATOR_ABOVE_HIGH: Input voltage is above the threshold voltage.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns the specified group channel comparator state.

Group 0 has two window threshold voltages, while Group 1 and 2 have one threshold voltages.

Example

The following example sets Group 0 upper and lower window voltages, Group 1 and 2 threshold voltages and returns channel 0 comparator state in each group:

 

SHORT nHandle, nStatus, nComparatorState;

 

Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_LOW_WINDOW, 10.0, pnStatus);

Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_UPPER_WINDOW, 20.0, pnStatus);

Gx3748ComparatorsReadState(nHandle, GX3748_GROUP0, GX3748_GROUP_CH0, &nComparatorState, &nStatus);

Gx3748ComparatorsReadState(nHandle, GX3748_GROUP1, GX3748_GROUP_CH0, &nComparatorState, &nStatus);

Gx3748ComparatorsReadState(nHandle, GX3748_GROUP2, GX3748_GROUP_CH0, &nComparatorState, &nStatus);

 

See Also

Gx3748ComparatorsReadStates, Gx3748ComparatorsSetThreshold, GxFpgaGetErrorString