Function
Sets the factor of interrupt event.
Format
Ret = DioSetInterruptEvent ( Id , BitNo , Logic )
Parameters
Id
[C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.
BitNo
[C:short] [Python: ctypes.c_short]
Specifies the logical input bit number.
This bit number must be available bit for interrupt on hardware.
Logic [C:short]
[Python: ctypes.c_short]
Specifies the interrupt logic from the defined values as following.
Definition |
Value [Dec] |
Description |
DIO_INT_NONE |
0 |
Mask interrupts |
DIO_INT_RISE |
1 |
Input value 0->1 |
DIO_INT_FALL |
2 |
Input value 1->0 |
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_SYS_NOT_SUPPORTED |
20001 |
This function cannot be used for this device. |
DIO_ERR_SYS_INT_BIT |
20200 |
Interrupt bit is outside of the available range. |
DIO_ERR_SYS_INT_LOGIC |
20201 |
Interrupt logic is outside of the available range. |
The other errors: (See also: Error code details)
Remarks
When starting or stopping the interrupt event,
use the function to specify.
Callback function actually accepts the interrupt.
Specifies the callback function by DioSetInterruptCallBackProc.
It is only one process that can accept the
interrupt event for the USB device.
The message cannot be sent from the same device to two or more processes.
To use this function, hardware should support interrupt.
For Ethernet devices
If communication with the device is lost, the
process will be unregistered and will no longer receive event notifications.
If you want to perform event notification again,
please make the settings again using this function.
You can check the registration status of the current process using the DioGetNetCommunicationInfo function.
Example
C |
Ret = DioSetInterruptEvent(
Id , BitNo , DIO_INT_RISE ); |
Python |
Ret = cdio.DioSetInterruptEvent(
Id , BitNo , cdio.DIO_INT_RISE ) |
See Also
DioSetInterruptCallBackProc
Interrupt
DioGetNetCommunicationInfo