Gx3748ComparatorsReadStates

Purpose

Returns all the specified group channels comparators states.

Syntax

Gx3748ComparatorsReadStates (nHandle, nGroup, pdwComparatorsStates, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX3748 board.
nGroup
SHORT
Specified group, group number are 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. 
pdwComparatorStates
PDWORD
Returns all the specified group channels comparators states.
Each pair of bits represents one channel’s comparator state. E.g. channel 0 bit 0-1, channel 1 bits 2-3 etc. Each channel’s comparator state can be as follows:
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

Returns all the specified group channels comparators states.

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 Group 0, 1 ns 2 comparators states:

 

SHORT nHandle, nStatus;

DWORD dwComparatorState;

 

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

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

Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP1, GX3748_COMPARATOR_TYPE_THRESHOLD, 10.0, pnStatus);

Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP2, GX3748_COMPARATOR_TYPE_THRESHOLD, 20.0, pnStatus);

Gx3748ComparatorsReadStates(nHandle, GX3748_GROUP0, &dwComparatorState &nStatus);

Gx3748ComparatorsReadStates(nHandle, GX3748_GROUP1, &dwComparatorState &nStatus);

Gx3748ComparatorsReadStates(nHandle, GX3748_GROUP2, &dwComparatorState &nStatus);

 

See Also

Gx3748Initialize, GxFpgaGetErrorString