GxCntSetFunctionAccumulate

Purpose

Sets the function mode to Accumulate.

Syntax

GxCntSetFunctionAccumulate (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 Accumulate mode provides total count over multiple gate intervals. External signal determines the gate interval while the count gate can be opened and closed indefinite number of times. Less than 0.5 microsecond of “dead time” is required between the closing of one gate interval and the beginning of the next. Data can be accurately read at any time. The signal slopes that open and close the count gate specified by the nStartSlope and nStopSlope.

Note: Call GxCntlClear function to clear the count and close the gate. The next gating signal edge will restart counting. If the counter is already running when this command is received, counting stops and the count is cleared. At least 0.5 µS and one Acquisition of the counted signal must occur between the closing and reopening of the gate.

Example

The following example sets the function to Accumulate with channel A gated by channel B, negative start slope and positive stop slope:

 

SHORT nHandle, nStatus;

GxCntSetFunctionAccumulate (nHandle, GXCNT_MEASURE_A_GATED_BY_B, GXCNT_NEGATIVE_SLOPE, GXCNT_POSITIVE_SLOPE, &nStatus);

 

See Also

GxCntSetFunctionTotalize, GxCntSetFunctionTotalizeGated, GxCntSetFunctionTotalizeGatedOnce, GxCntGetErrorString