Gx5732SetCounterPort

Purpose

Connects the counter to be connected to the port, and direction and the loading mode of the port.

Syntax

Gx5732SetCounterPortConnection (nHandle, bInOut, nCounter, nInLoadControl, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5732 board.
bInOut
BOOL
Counter Port direction:
0. GX5732_COUNTER_PORT_DIRECTION_IN: Input
1. GX5732_COUNTER_PORT_DIRECTION_OUT: Output
nCounter
SHORT
Counter number:
0. GX5732_COUNTER0: Counter 0.
1. GX5732_COUNTER1: Counter 1.
2. GX5732_COUNTER2: Counter 2.
3. GX5732_COUNTER3: Counter 3.
nInLoadControl
SHORT
When input, sets the signal causes the Counter Port to load:
0. GX5732_COUNTER_PORT_LOAD_CONTROL_NONE: None.
1. GX5732_COUNTER_PORT_LOAD_CONTROL_IMMEDIATE: load Immediate (software control).
2. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE0: User Line 0.
3. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE1: User Line 1.
4. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE2: User Line 2.
5. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE3: User Line 3.
6. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE4: User Line 4.
7. GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE5: User Line 5.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5732GetCounterPort to retrieve these settings.

Example

The following example connects counter 1 to Counter Port and set the port to input. The counter will be load when a signal received from UL0:

 

Gx5732SetCounterPort (nHandle, GX5732_COUNTER_PORT_DIRECTION_IN GX5732_COUNTER1, GX5732_COUNTER_PORT_LOAD_CONTROL_USERLINE0, &nStatus);

 

See Also

Gx5732GetCounterPort, Gx5732LoadCounterCounterPort