Function
Sets notification of the specified number transfer completion message.
Format
Ret = DioDmSetCountEvent ( Id , Dir , Count , CallBack , Param )
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.c_ulong]
Set for how many data transfer numbers a message is notified.
Device Type |
Available range |
DIO-32DM3-PE |
3 <=Count <=536,870,912(20000000H) |
PIO-32DM(PCI) |
1 <=Count <=16,777,215(FFFFFFH) |
CallBack
[C:PDIO_COUNT_CALLBACK] [Python: PDIO_COUNT_CALLBACK]
Specify the address of callback function.
Param [C:void
*] [Python: ctypes.c_void_p]
Specify the optional parameter that is carried from callback function.
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_DLL_CALLBACK |
10400 |
Invalid address of callback function. |
DIO_ERR_SYS_DIRECTION |
50000 |
I/O direction is outside of the setting range. |
DIO_ERR_SYS_COUNT |
50011 |
Data transfer number is outside of the setting range. |
The other errors: (See also: Error code details)
Initial Value
None
Remarks
Transfer completion of the specified number
can be notified on the callback function during sampling/generating when
this function is used.
If the number specified by Count is too small for the input/output cycle,
message may not be possible to notify as the speed is too fast.
If the number specified by Count is too small for the input/output cycle,
frequent occurrence of interrupt may cause transfer error.
Example
C |
Ret = DioDmSetCountEvent(
Id , DIODM_DIR_IN , 500 , CallBack , Param ); |
Python |
Ret = cdio.DioDmSetCountEvent(
Id , cdio.DIODM_DIR_IN , 500 , CallBack , Param ) |
See Also