CntGetPulseWidth


Function

Gets one-shot pulse width.

Format

Ret = CntGetPulseWidth ( Id , ChNo , PlsWidth )

Parameters

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

ChNo [ C: short ] [ Python: ctypes.c_short ]
Specifies the channel number which you want to get for.
For CNT24-4(PCI)H, CNT24-4D(PCI)H, the width of one-shot pulse is the same for all channels.

PlsWidth [ C: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of buffer which get the coefficient for one-shot pulse width.

Coefficient

Pulse Width

0h

0

1h

Approx. 409.6us

2h

Approx. 819.2us

3h

Approx. 1.23ms

4h

Approx. 4.92ms

5h

Approx. 10.24ms

6h

Approx. 20.07ms

7h

Approx. 29.9ms

8h

Approx. 40.14ms

9h

Approx. 49.97ms

Ah

Approx. 60.2ms

Bh

Approx. 70.04ms

Ch

Approx. 80.28ms

Dh

Approx. 90.11ms

Eh

Approx. 100.35ms

Fh

Approx. 104.45ms

Return Value

Ret [ C: long ] [ Python: ctypes.c_long ]

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normal Complete

CNT_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

CNT_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

CNT_ERR_SYS_CH_NO

20201

Channel number is outside the range.

The other errors: (See also: Details of Error Code)

Initial Value

Coefficient=0

Remarks

Gets the one-shot pulse width when count-match occurs.

Example

C

Ret = CntGetPulseWidth(Id, ChNo, &PlsWidth);
 

Python

Ret = ccnt.CntGetPulseWidth(Id, ChNo, ctypes.byref(PlsWidth))
 

See Also

CntSetPulseWidth