Gx5732SetCounterClock

Purpose

Sets the counter clock source and polarity.

Syntax

Gx5732SetCounterClock (nHandle, nCounter, nClockSource, bClockPolarity, 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.
nClockSource
SHORT
Counter clock source:
0. GX5731_CLOCK0: Internal clock 0
1. GX5731_CLOCK1: Internal clock 1
2. GX5732_COUNTER_TO_USER_LINE0: User Line 0.
3. GX5732_COUNTER_TO_USER_LINE1: User Line 1.
4. GX5732_COUNTER_TO_USER_LINE2: User Line 2.
5. GX5732_COUNTER_TO_USER_LINE3: User Line 3.
6. GX5732_COUNTER_TO_USER_LINE4: User Line 4.
7. GX5732_COUNTER_TO_USER_LINE5: User Line 5.
bClockPolarity
BOOL
Clock polarity:
0. GX5732_POSITIVE_EDGE: Count on rising clock edge.
1. GX5732_NEGATIVE_EDGE: Count on falling clock edge.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5732SetCounterClock to set the clock source and polarity.

Example

The following example sets the clock source and polarity for counter 2:

 

Gx5732SetCounterClock (nHandle, GX5732_COUNTER2, GX5731_CLOCK1, GX5732_POSITIVE_EDGE, &nStatus);

 

See Also

Gx5732GetCounterClock, Gx5732SetInternalClock, Gx5732SetCounterEnable