DioDmSetInternalClock


Function

Sets the clock value when using the internal clock.

Format

Ret = DioDmSetInternalClock ( Id , Dir , Clock , Unit )

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]
Specify a clock value.
The clock value can be set in combination with the clock value unit within the following range.

Device Type

Available range

DIO-32DM3-PE

20ns  <= Clock <= 21sec(5ns unit)

PIO-32DM(PCI)
DIO-32DM2-PE

50ns  <= Clock <= 107sec(25ns unit)

 

Unit [C:unsigned long] [Python: ctypes.c_ulong]
Clock value unit

Definition

Value

[Dec]

Description

DIODM_TIM_UNIT_S

1

1- second unit

DIODM_TIM_UNIT_MS

2

1ms unit

DIODM_TIM_UNIT_US

3

1us unit

DIODM_TIM_UNIT_NS

4

1ns unit

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_VAL

50004

Clock value is outside of the setting range.

DIO_ERR_SYS_CLOCK_UNIT

50005

Unit of clock value is outside of the setting range.

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

Initial Value

The default is 1us.

Remarks

Clock values must be set for the application operation to be constant.
Fractions of 25ns units can be rounded using the following formula in the event that ns units are used as the setting.
SetClock =(Clock/25)

Example

C

Ret = DioDmSetInternalClock( Id , DIODM_DIR_IN , 1 , DIODM_TIM_UNIT_US );
 

Python

Ret = cdio.DioDmSetInternalClock( Id , cdio.DIODM_DIR_IN , 1 , cdio.DIODM_TIM_UNIT_US )
 

See Also

DioDmSetClockTrg