Returns the counter gate source and polarity.
Gx5732GetCounterGate (nHandle, nCounter, pnGateSource, pbGatePolarity, 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. |
pnGateSource |
PSHORT |
Returned gate source:0. GX5732_COUNTER_GATE_ENABLE_ALWAYS: Always enabled.1. GX5732_COUNTER_GATE_CARRY_COUNTER1: Terminal Count Carryout.2. GX5732_COUNTER_GATE_USER_LINE0: User Line 0.3. GX5732_COUNTER_GATE_USER_LINE1: User Line 1.4. GX5732_COUNTER_GATE_USER_LINE2: User Line 2.5. GX5732_COUNTER_GATE_USER_LINE3: User Line 3.6. GX5732_COUNTER_GATE_USER_LINE4: User Line 4.7. GX5732_COUNTER_GATE_USER_LINE5: User Line 5. |
pbGatePolarity |
PBOOL |
Returned gate polarity:0. GX5732_POSITIVE_EDGE: Count when gate signal is high.1. GX5732_NEGATIVE_EDGE: Count when gate signal is low. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx5732SetCounterGate to setup the counter gate.
The following example reads counter 3 gate settings:
SHORT nGateSource, nGatePolarity, nStatus;
Gx5732GetCounterGate (nHandle, GX5732_COUNTER3, &nGateSource,
&nGatePolarity, &nStatus);
Gx5732SetCounterGate, Gx5732SetCounterClock, Gx5732SetCounterEnable