GxCntSetFunctionTotalizeGatedOnce

Purpose

Sets function to Totalize Gated Once.

Syntax

GxCntSetFunctionTotalizeGatedOnce (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.

In this mode the counter won't output any data until the measurement is done (i.e. the gate is closed). It also ensures that intermediate data will not be read back to the control program, just the final result. The program will wait during a read operation until the gate closes.

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;

GxCntSetFunctionTotalizeGatedOnce (nHandle, 0.001, &nStatus)

 

See Also

GxCntSetFunctionAccumulate, GxCntSetFunctionTotalizeGated, GxCntlClear, GxCntTrig, GxCntGetGateTime, GxCntSetAcquisitionTimeInterval, GxCntSetAcquisitionMode, GxCntGetErrorString