Gx5732GetCounterValue

Purpose

Returns the counter value and the terminal count state.

Syntax

Gx5732GetCounterValue (nHandle nCounter, pucValue, pbTerminalCountState, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5732 board.
nCounter
SHORT
Counter number:
0. GX5732_COUNTER0: Counter 0.
1. GX5732_COUNTER1: Counter 1.
2. GX5732_COUNTER2: Counter 2.
3. GX5732_COUNTER3: Counter 3.
pucValue
PBYTE
Returned counter value: 0-255
pbTerminal
CountState
PBOOL
Returned terminal counter state:
0. FALSE: Not overflow.
1. TRUE: Overflow.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5732SetCounterValue to initialize the counter value.

Example

The following example reads counter 2 value:

 

SHORT nStatus;

BOOL bTCState;

BYTE ucValue;

Gx5732GetCounterValue (nHandle, GX5732_COUNTER2, &ucValue,

&bTCState, &nStatus);

 

See Also

Gx5732SetCounterValue