Function
Gets the counting direction. (Up count/Down count)
Format
Ret = CntGetCountDirection ( Id , ChNo , Dir )
Parameters
Id
[ C: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from CntInit.
ChNo
[ C: short ] [ Python: ctypes.c_short ]
Specifies the channel number which you want to get for.
Dir
[ C: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the counting direction.
As for the counting direction, either of the following defined values
is returned.
Definition |
Value |
Description |
CNT_DIR_DOWN |
0 |
Down count |
CNT_DIR_UP |
1 |
Up count |
Return Value
Ret [ C: long ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normal Complete |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is outside the range. |
The other errors: (See also: Details of Error Code)
Initial Value
Up count
Remarks
Gets the counting direction for the specified channel.
Example
C |
Ret
= CntGetCountDirection(Id, ChNo, &Dir); |
Python |
Ret
= ccnt.CntGetCountDirection(Id, ChNo, ctypes.byref(Dir)) |
See Also
CntSetCountDirection