Returns the counter settings and mode.
Gx5732GetCounterMode (nHandle, nCounter, pbOneShot, pbUpDown,pnTerminalCounterMode, 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. |
pbOneShot |
PBOOL |
Returned mode:0. FALSE: Continuous.1. TRUE: One shot. |
pbUpDown |
PBOOL |
Returned count direction:0. FALSE: Up.1. TRUE: Down. |
pnTerminalCounterMode |
PSHORT |
Returned terminal count mode:0. GX5732_TERMINAL_COUNT_POS_PULSE: Positive pulse.1. GX5732_TERMINAL_COUNT_NEG_PULSE: Negative pulse.2. GX5732_TERMINAL_COUNT_POS_SQUARE: Toggle output, start with low.3. GX5732_TERMINAL_COUNT_NEG_SQUARE: Toggle output, start with high. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx5732SetCounterMode to setup the counter modes.
The function returns whether the counter runs in One-shot mode or continuously, if the counter counts up or down, and the terminal count output mode.
The following example retrieves counter 3 settings:
BOOL bOneShot, bDown, nStatus;
SHORT nTerminalCount;
Gx5732GetCounterMode (nHandle, GX5732_COUNTER3, &bOneShot,
&bDown, &nTerminalCount, &nStatus);
Gx5732SetCounterMode, Gx5732SetCounterEnable