Sets function to Totalize Gated Once.
GxCntSetFunctionTotalizeGatedOnce (nHandle, nMode, nStartSlope, nStopSlope, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a counter board. |
nMode |
SHORT |
Measurement mode:
|
nStartSlope |
SHORT |
Measurement Start Slope:
|
nStopSlope |
SHORT |
Measurement Stop Slope:
|
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
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. |
The following example sets the gate time to 1mS:
SHORT nHandle, nStatus;
GxCntSetFunctionTotalizeGatedOnce (nHandle, 0.001, &nStatus)
GxCntSetFunctionAccumulate, GxCntSetFunctionTotalizeGated, GxCntlClear, GxCntTrig, GxCntGetGateTime, GxCntSetAcquisitionTimeInterval, GxCntSetAcquisitionMode, GxCntGetErrorString