Function
Sets one-shot pulse width.
Format
Ret = CntSetPulseWidth ( 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 set.
In CNT24-4(PCI)H, CNT24-4D(PCI)H, all of channels are set with the same
pulse width.
PlsWidth
[C: short] [Python: ctypes.c_short]
Specifies the one-shot pulse width by coefficient.
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_DLL_MODE |
10100 |
Invalid mode setting. |
CNT_ERR_SYS_MODE |
20100 |
Invalid mode setting. |
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
Specifies the one-shot pulse width. The one-shot
pulse will be output to the channel when the count value of the channel
matches the value to compare against.
This setting is different from other mode settings, the mode can be changed
while the counter is running.
For "Device with high-performance counter", please use CntSetOutputHardwareEvent.
Example
C |
Ret = CntSetPulseWidth(Id,
ChNo, PlsWidth); |
Python |
Ret = ccnt.CntSetPulseWidth(Id,
ChNo, PlsWidth) |
See Also