Function
Acquires transfer status.
Format
Ret = DioDmGetStatus ( Id , Dir , &Status , &Err )
Parameters
Id
[C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.
Dir
[C:unsigned long] [Python: ctypes.c_ulong]
Specify transfer direction.
Definition |
Value [Hex] |
Description |
DIODM_DIR_IN |
0x01 |
Input |
DIODM_DIR_OUT |
0x02 |
Output |
Status
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Status information (status, warning) is returned.
Statuses are expressed as the logical sums shown below.
Definition |
Value |
Input/output |
Contents |
DIODM_STATUS_BMSTOP |
0x01 |
Input/output |
Indicates that BusMaster transfer is complete. |
DIODM_STATUS_PIOSTART |
0x02 |
Input/output |
Indicates that PIO input/output has started. |
DIODM_STATUS_PIOSTOP |
0x04 |
Input/output |
Indicates that PIO input/output has stopped. |
DIODM_STATUS_TRGERR |
0x08 |
Input/output |
Indicates that the start signal is inserted by external start. |
DIODM_STATUS_OVERRUN |
0x10 |
Input/output |
Indicates
that start signals are inserted twice or more by external start. |
Err
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Error information is returned.
Errors are expressed as the logical sum of the values shown below.
Definition |
Value |
Input/output |
Contents |
DIODM_STATUS_FIFOEMPTY |
0x01 |
Output only |
Indicates
that FIFO becomes vacant. |
DIODM_STATUS_FIFOFULL |
0x02 |
Input only |
Indicates
that FIFO is full due to input. |
DIODM_STATUS_SGOVERIN |
0x04 |
Input only |
Indicates
that the buffer has overflowed. |
DIODM_STATUS_TRGERR |
0x08 |
Input/output |
Indicates
that start and stop signals have been inserted simultaneously
by external start. |
DIODM_STATUS_CLKERR |
0x10 |
Input/output |
Indicates
that the next clock is inserted during data input/output by the
external clock. |
DIODM_STATUS_SLAVEHALT |
0x20 |
Input/output |
Forced termination due to a stop factor from the slave device. Please check the error on the slave side. |
DIODM_STATUS_MASTERHALT |
0x40 |
Input/output |
Forced termination due to a stop factor from the master device. Please check the error on the master side. |
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
Each status and error exists per input/output
or board.
Status must be checked after completion of transfer.
Example
C |
Ret = DioDmGetStatus(
Id , DIODM_DIR_IN , &Status , &Err ); |
Python |
Ret = cdio.DioDmGetStatus(
Id , cdio.DIODM_DIR_IN , ctypes.byref(Status) , ctypes.byref(Err)
) |
See Also
None