DioDmSetClockTrg


Function

Sets clock conditions for sampling and generating.

Format

Ret = DioDmSetClockTrg ( Id , Dir , Clock )

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

Clock [C:unsigned long] [Python: ctypes.c_ulong]
Set clock conditions.

Definition

Value

[Dec]

Description

DIODM_CLK_CLOCK

1

Internal clock (Timer)

DIODM_CLK_EXT_TRG

2

External trigger

DIODM_CLK_HANDSHAKE

3

Handshake

DIODM_CLK_EXTSIG_1

4

SC connector EXTSIG1

DIODM_CLK_EXTSIG_2

5

SC connector EXTSIG2

DIODM_CLK_EXTSIG_3

6

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_CLOCK

50003

Clock condition is outside of the setting range.

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

Initial Value

The default is internal clock.

Remarks

Clock conditions must be set for the application operation to be constant.

Example

C

Ret = DioDmSetClockTrg( Id , DIODM_DIR_IN , DIODM_CLK_CLOCK );
 

Python

Ret = cdio.DioDmSetClockTrg( Id , cdio.DIODM_DIR_IN , cdio.DIODM_CLK_CLOCK )
 

See Also

DioDmSetInternalClock