Sets the specified group comparator programmed threshold or window voltage.
Gx3748ComparatorsSetThreshold (nHandle, nGroup, nComparator, dVoltage, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX3748 board. |
nGroup |
SHORT |
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. |
nComparator |
SHORT |
The specified group comparator threshold or window type:0. GX3748_COMPARATOR_TYPE_THRESHOLD: Threshold comparator no window (Group1 & Group2 only).1. GX3748_COMPARATOR_TYPE_LOW_WINDOW: Threshold comparator lower window (Group0 only).2. GX3748_COMPARATOR_TYPE_UPPER_WINDOW: Threshold comparator upper window (Group0 only). |
dVoltage |
DOUBLE |
Specified group comparator programmed threshold; threshold can be set from 0V to 50V. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Sets the specified group comparator programmed threshold or window voltage.
Group 0: 16 input channels (J1 input connector pins 2 to 17) detect if front channels are within a configurable voltage window, low and high voltage levels. The user can at time read back the channels comparison results using the Gx3748ComparatorsReadStates () API.
The following example sets Group 0 upper and lower window voltages and returns the programmed values:
SHORT nHandle, nStatus;
DOUBLE dLowVoltage, dHighVoltage;
Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_LOW_WINDOW, 10.0, pnStatus);
Gx3748ComparatorsSetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_UPPER_WINDOW, 20.0, pnStatus);
Gx3748ComparatorsGetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_LOW_WINDOW, &dLowVoltage, pnStatus);
Gx3748ComparatorsGetThreshold(nHandle, GX3748_GROUP0, GX3748_COMPARATOR_TYPE_UPPER_WINDOW, &dHighVoltage, pnStatus);
Gx3748ComparatorsReadStates, Gx3748ComparatorsGetThreshold, GxFpgaGetErrorString