Sets the timeout allowable for a measurement read operation.
GxCntSetMeasurementTimeout (nHandle, dSeconds, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a counter board. |
dSeconds |
DOUBLE |
Timeout range in seconds, Timeout range is 1mS to 3200 seconds. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
In most measurement functions the counter will wait indefinitely for a measurement to end if the input signal is removed or changes amplitude. If an attempt is made to read data from the board under this condition, the host computer will wait until the data is available. This lockup situation can be avoided by programming the timeout to an interval that is longer than any expected measurement, but will still allow the program to regain control if there is a signal fault.
In cases of measurements with long gate times or low frequency input signals and there is a potential problem, the GxCntIsMeasurementReady or GxCntReadStatusRegister functions can be used to see if data is ready and avoid unnecessary time-outs.
The following example sets the timeout to 20mS:
SHORT nHandle, nStatus;
GxCntGetMeasurementTimeout (nHandle, 0.020, &nStatus)
GxCntGetMeasurementTimeout, GxCntGetFunction, GxCntGetErrorString