Returns the counter connected to the Counter Port, and direction and the loading mode of the port.
Gx5732GetCounterPort (nHandle, pbInOut, pnCounter, pnInLoadControl, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5732 board. |
pbInOut |
PBOOL |
Returned Counter Port direction:0. GX5732_COUNTER_PORT_DIRECTION_IN: Input1. GX5732_COUNTER_PORT_DIRECTION_OUT: Output |
pnCounter |
PSHORT |
Returned Counter number:0. GX5732_COUNTER0: Counter 0.1. GX5732_COUNTER1: Counter 1.2. GX5732_COUNTER2: Counter 2.3. GX5732_COUNTER3: Counter 3. |
pnInLoadControl |
PSHORT |
When input, returns 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. |
Use the Gx5732SetCounterPort to change these settings.
The following example reads the Counter Port settings:
SHORT nCounter, nInLoadControl, nStatus;
BOOL bInOut;
Gx5732GetCounterPort(nHandle, &bInOut,&nCounter,
&nInLoadControl, &nStatus);
Gx5732SetCounterPort, Gx5732LoadCounterCounterPort