GxCntSetMeasurementTimeout

Purpose

Sets the timeout allowable for a measurement read operation.

Syntax

GxCntSetMeasurementTimeout (nHandle, dSeconds, pnStatus)

Parameters

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.

Comments

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.

Example

The following example sets the timeout to 20mS:

 

SHORT nHandle, nStatus;

GxCntGetMeasurementTimeout (nHandle, 0.020, &nStatus)

 

See Also

GxCntGetMeasurementTimeout, GxCntGetFunction, GxCntGetErrorString