Returns the counter value and the terminal count state.
Gx5732GetCounterValue (nHandle nCounter, pucValue, pbTerminalCountState, pnStatus)
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 |
pbTerminalCountState |
PBOOL |
Returned terminal counter state:0. FALSE: Not overflow.1. TRUE: Overflow. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx5732SetCounterValue to initialize the counter value.
The following example reads counter 2 value:
SHORT nStatus;
BOOL bTCState;
BYTE ucValue;
Gx5732GetCounterValue (nHandle, GX5732_COUNTER2, &ucValue,
&bTCState, &nStatus);