Function
Retrieves the sampling status.
Format
Ret = CntGetSamplingStatus ( Id , Status , Err )
Parameters
Id
[ C: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from CntInit.
Status
[ C: unsigned int * ] [ Python: ctypes.POINTER(ctypes.c_uint) ]
Returns the status information (status, warning).
Status will be "0" when none of
the conditions as below.
For example, the sampling has never started, or when a start condition
other than software start is set and the start condition is not satisfied.
Definition |
Value |
Description |
CNTS_STATUS_BMSTOP |
01H |
Indicates
that the data transfer to the sampling buffer has completed. |
CNTS_STATUS_CNTSTART |
02H |
Indicates that counter sampling has been started. |
CNTS_STATUS_CNTSTOP |
04H |
Indicates that counter sampling has been stopped. |
CNTS_STATUS_TRGIN |
08H |
Indicates that the external start signal has been received. |
CNTS_STATUS_OVERRUN |
10H |
Indicates
that external start signal has been received at least twice. |
Err [ C: unsigned int * ] [ Python: ctypes.POINTER(ctypes.c_uint)
]
Returns the error information.
Definition |
Value |
Description |
CNTS_STATUS_FIFOFULL |
02H |
Indicates that FIFO has been full. The main reason is that the overloaded system can not match to the sampling. It is necessary to take measures such as lower the transfer rate and the system load. |
CNTS_STATUS_SGOVERIN |
04H |
Indicates that the buffer is overflow. The number of data to be transferred exceeds the buffer size. Please enlarge the size of the buffer. |
CNTS_STATUS_TRGERR |
08H |
Indicates that external start signal and external stop signal have been received at the same time. The transfer cannot be done when this status occurred. Please confirm how to input external start signal and external stop signal. |
CNTS_STATUS_CLKERR |
10H |
Indicates
that the next clock entered while inputting by external clock. |
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_DLL_BUFF_ADDRESS |
10101 |
Invalid data buffer address. |
CNT_ERR_SYS_MEMORY |
20000 |
It failed in memory allocation for the object preparation. |
CNT_ERR_SYS_USING_OTHER_PROCESS |
20003 |
Cannot use because another process is using the device. |
The other errors: (See also: Details of Error Code)
Remarks
Must check the status after transfer completed. Normally, use the function CntNotifySamplingStop to check transfer completion. But if use this function to check transfer completion, please monitor the status of CNTS_STATUS_BMSTOP.
Example
C |
Ret
= CntGetSamplingStatus (Id, &Status, &Err); |
Python |
Ret
= ccnt.CntGetSamplingStatus (Id, ctypes.byref(Status), ctypes.byref(Err)) |