DioDmSetClockTrigger


Function

Sets the clock condition for sampling/generating.

Format

Ret = DioDmSetClockTrigger ( Id , Direction , Clock )

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

Clock [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the clock condition.

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, EXTSIG2 and EXTSIG3 are only valid for the slave.

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_SYS_NOT_SUPPORTED

20001

This board couldn't use this function.

DIO_ERR_SYS_IODIRECTION

20500

Direction value is out of range.

DIO_ERR_SYS_CLOCK

21002

Clock conditions are outside the setting range.

The others (See also: Details of Error Code)

Initial Value

The default is internal clock.

Remarks

It is necessary to set the clock condition to make the application operation regular.

Example

Sets internal clock for input transfer.

VB.NET

Dim Ret As Integer
Ret = DioDmSetClockTrigger ( Id , DIODM_DIR_IN , DIODM_CLK_CLOCK )
 

C, C++

long Ret;
Ret = DioDmSetClockTrigger ( Id , DIODM_DIR_IN , DIODM_CLK_CLOCK );
 

C#

int Ret;
Ret = dio.DmSetClockTrigger ( Id , (short)CdioConst.DIODM_DIR_IN , (short)CdioConst.DIODM_CLK_CLOCK );
 

Python

Ret = ctypes.c_long()
Ret.value = cdio.DioDmSetClockTrigger ( Id , cdio.DIODM_DIR_IN , cdio.DIODM_CLK_CLOCK )
 

See Also

DioDmSetInternalClock