DioDmSetStartTrg


Function

Sets the start conditions for sampling and generating.

Format

Ret = DioDmSetStartTrg ( Id , Dir , Start )

Parameters

Id [C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.

Dir [C:unsigned long] [Python: ctypes.c_ulong]
Set transfer direction.

Definition

Value

[Dec]

Description

DIODM_DIR_IN

1

Input

DIODM_DIR_OUT

2

Output

Start [C:unsigned long] [Python: ctypes.c_ulong]
Set start conditions.

Definition

Value

[Dec]

Description

DIODM_START_SOFT

1

Software start

DIODM_START_EXT_RISE

2

External rising trigger

DIODM_START_EXT_FALL

3

External falling trigger

DIODM_START_PATTERN

4

Pattern matching (Input only)

DIODM_START_EXTSIG_1

5

SC connector EXTSIG1

DIODM_START_EXTSIG_2

6

SC connector EXTSIG2

DIODM_START_EXTSIG_3

7

SC connector EXTSIG3

EXTSIG1 ~ EXTSIG3 are only valid in the case of slaves.

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_DIRECTION

50000

I/O direction is outside of the setting range.

DIO_ERR_SYS_START

50002

Outside the range of the start conditions.

The other errors: (See also: Error code details)

Initial Value

The default is software start.

Remarks

Start conditions must be set for the application operation to be constant.
In the case where pattern matching is specified as the start condition, comparison patterns should be set by the DioDmSetStartPattern function.

Example

C

Ret = DioDmSetStartTrg( Id , DIODM_DIR_IN , DIODM_START_SOFT );
 

Python

Ret = cdio.DioDmSetStartTrg( Id , cdio.DIODM_DIR_IN , cdio.DIODM_START_SOFT )
 

See Also

DioDmSetStartPattern