DioDmGetStatus


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
[Hex]

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.
Transfer can be continued without difficulty.
Ignore it if there is no problem with the external connection signal specification.

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
[Hex]

Input/output

Contents

DIODM_STATUS_FIFOEMPTY

0x01

Output only

Indicates that FIFO becomes vacant.
The main cause is that the system load is high and bus master transfers cannot be completed in time.
Countermeasures such as reducing the transfer rate or reducing the system load are required.

DIODM_STATUS_FIFOFULL

0x02

Input only

Indicates that FIFO is full due to input.
The main cause is that the system load is high and bus master transfers cannot be completed in time.
Reduce the transfer rate and system load.

DIODM_STATUS_SGOVERIN

0x04

Input only

Indicates that the buffer has overflowed.
The amount of data trying to be transferred exceeds the buffer size.
Increase the buffer size.

DIODM_STATUS_TRGERR

0x08

Input/output

Indicates that start and stop signals have been inserted simultaneously by external start.
If this status is generated, transfer is not executed.
Check the insertion style of the external start signal and external stop signal.

DIODM_STATUS_CLKERR

0x10

Input/output

Indicates that the next clock is inserted during data input/output by the external clock.
It is almost impossible for this status to be generated by the board operation speed.
If it occurs, consider reducing 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