Function
Acquires the transfer count number.
Format
Ret = DioDmGetCount ( Id , Dir , &Count , &Carry )
Parameters
Id
[C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.
Dir
[C:unsigned long] [Python: ctypes.c_ulong]
Specify the transfer direction.
Definition |
Value [Hex] |
Description |
DIODM_DIR_IN |
0x01 |
Input |
DIODM_DIR_OUT |
0x02 |
Output |
Count
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable in which the count number is stored.
Carry
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable in which the carry count is stored.
Return Value
Ret[C:long] [Python: ctypes.c_long]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
DIO_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
DIO_ERR_DLL_BUFF_ADDRESS |
10100 |
Invalid data buffer address. |
DIO_ERR_SYS_DIRECTION |
50000 |
I/O direction is outside of the setting range. |
The other errors: (See also: Error code details)
Initial Value
None
Remarks
64-bit count number is returned by adding Count to Carry.
When using the DIO-32DM3-PE, the data is
transferred to the PC side every 2-2048 samplings for optimization.
Therefore, there is such a possibility that the count doesn't work when
the clocks input, but the sampling is performed.
When the transfer is completed, the rest of the data will also be transferred.
Example
C |
Ret = DioDmGetCount(
Id , DIODM_DIR_IN , &Count , &Carry ); |
Python |
Ret = cdio.DioDmGetCount(
Id , cdio.DIODM_DIR_IN , ctypes.byref(Count) , ctypes.byref(Carry)
) |
See Also
Usage of buffer at input transfer