DioDmGetStatus


Function

Retrieves the transfer status.

Format

Ret = DioDmGetStatus ( Id , Direction , Status , Err )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.

Direction [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the transfer direction.

Definition

Value

[Dec]

Description

DIODM_DIR_IN

1

Input

DIODM_DIR_OUT

2

Output

Status [ VB.NET: Integer ] [ C, C++: unsigned long * ] [ C#: out uint ] [ Python: ctypes.POINTER(ctypes.c_ulong) ]
Returns the status information (status, warning). Please refer to status list for details.

Symbol

Value

[Hex]

Input/Output

Description

DIODM_STATUS_BMSTOP

0x01

Input/Output

A bus master transfer has completed.

DIODM_STATUS_PIOSTART

0x02

Input/Output

PIO input/output has started.

DIODM_STATUS_PIOSTOP

0x04

Input/Output

PIO input/output has stopped.

DIODM_STATUS_TRGIN

0x08

Input/Output

A start signal has been active by an external start.

DIODM_STATUS_OVERRUN

0x10

Input/Output

The external start signal has been received twice or more. The transfer continues normally.

You can ignore it if there is no issue in your external connection signal.

Err [ VB.NET: Integer ] [ C, C++: unsigned long * ] [ C#: out uint ] [ Python: ctypes.POINTER(ctypes.c_ulong) ]
Returns the error information. Please refer to error list for details.

Symbol

Value

[Hex]

Input/Output

Description

DIODM_STATUS_FIFOEMPTY

0x01

Output

FIFO is empty. The main reason is that the system load is too high and a bus master transfer cannot be done in time. Please consider to slow down the transfer rate or to stop the some high loaded processes.

DIODM_STATUS_FIFOFULL

0x02

Input

FIFO is full. The main reason is that the system load is too high and a bus master transfer cannot be done in time. Please consider to slow down the transfer rate or to stop the some high loaded processes.

DIODM_STATUS_SGOVERIN

0x04

Input

Buffer overflow. The number of transfer data is bigger than the size of buffer. Please consider to increase your buffer size.

DIODM_STATUS_TRGERR

0x08

Input/Output

A start signal and a stop signal has been received at the exact same time. Please check your cable assignment for external start/stop signal.

DIODM_STATUS_CLKERR

0x10

Input/Output

The next clock has been received while the data is being input by the external clock. The sampling cannot be performed with the current specified external clock. Please consider to down the external clock rate.

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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

DIO_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute DioResetDevice function because the device has recovered from standby mode.

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Not call the driver (Failure on DEVICE I/O CONTROL).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This board couldn't use this function.

DIO_ERR_SYS_IODIRECTION

20500

Direction value is out of range.

The others (See also: Details of Error Code)

Initial Value

None

Remarks

All of the status and errors correspond to each I/O operation and each board. It is necessary to check the status after the transfer completed.

Though the DioDmSetStopEvent function is used to confirm transfer completion usually, when this function is used for that purpose, please refer to Using Bus Master Transfer Function(Stop/Transfer).

Example

Retrieves input transfer status.

VB.NET

Dim Ret As Integer
Dim Status As Integer
Dim Err As Integer
Ret = DioDmGetStatus ( Id , DIODM_DIR_IN , Status , Err )
 

C, C++

long Ret;
long Status;
long Err;
Ret = DioDmGetStatus ( Id , DIODM_DIR_IN , &Status , &Err );
 

C#

int Ret;
int Status;
int Err;
Ret = dio.DmGetStatus ( Id , (short)CdioConst.DIODM_DIR_IN , out Status , out Err );
 

Python

Ret = ctypes.c_long()
Status = ctypes.c_ulong()
Err = ctypes.c_ulong()
Ret.value = cdio.DioDmGetStatus ( Id , cdio.DIODM_DIR_IN , ctypes.byref(Status) , ctypes.byref(Err) )
 

See Also

DioDmTransferStart