GxCntSetFunctionTotalizeGated

Purpose

Sets function to Totalize Gated.

Syntax

GxCntSetFunctionTotalizeGated (nHandle, nMode, nStartSlope, nStopSlope, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a counter board.
nMode
SHORT
Measurement mode:
  • 0 = GXCNT_MEASURE_A_GATED_BY_B:
  • 1 = GXCNT_MEASURE_B_GATED_BY_A:
nStartSlope
SHORT
Measurement Start Slope:
  • 0 = GXCNT_POSITIVE_SLOPE: Rising (Positive) edge.
  • 1 = GXCNT_NEGATIVE_SLOPE: Falling (Negative) edge.
nStopSlope
SHORT
Measurement Stop Slope:
  • 0 = GXCNT_POSITIVE_SLOPE: Rising (Positive) edge.
  • 1 = GXCNT_NEGATIVE_SLOPE: Falling (Negative) edge.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The Totalize Gated function allows events on one input channel to be counted for a period of time determined by events on the second input channel. The second input signal open and close the gate as specified in nStartSlope and nStopSlope.

Only one measurement, over a single gate interval, is performed. A new measurement will be started when the counter receives most commands. The GxCntlClear or GxCntTrig functions are the preferred way to initiate a new measurement.

After the gate closes, the measurement data is held until explicitly cleared (GxCntlClear). In order to identify the final count the GxCntIsMeasurementReady function must be used to check that the gate has opened and closed.

Note: If the counter is already making a measurement when this mode is set counting stops and the count is cleared.

Example

The following example sets the gate time to 1mS:

 

SHORT nHandle, nStatus;

GxCntSetFunctionTotalizeGated (nHandle, 0.001, &nStatus)

 

See Also

GxCntGetGateTime, GxCntSetAcquisitionTimeInterval, GxCntGetAcquisitionTimeInterval, GxCntSetAcquisitionMode, GxCntGetAcquisitionMode, GxCntGetErrorString