Function
Sets pulse width (duty ratio).
Format
Ret = SmcWSetPulseDuty( Id, AxisNo, DutyType )
Parameters
Id [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved by SmcWInit function.
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the axis number.
DutyType [ C, C++: short ] [ Python: ctypes.c_short ]
Set duty ratio.
0 |
Change depending on the pulse out speed |
1 |
50% fixation compared with duty |
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Initial Value
DL series - 1 : 50% fixation
compared with duty
DF series - 0 : Change depending on the pulse out speed
Remarks
The pulse width below output
speed 2.4kpps becomes 50% fixation from 200 usec and it for DutyType =
0.
In the DL series, DutyType = 1 fixation.
This function cannot be executed when the device is in operation.
After "Initial Setting function" is executed, it is necessary to execute SmcWSetInitParam.
Refer to "About Initial Setting function".
Example
Setting of duty ratio of
axis number 1.
50% fixation.
C, C++
long Ret;
short DutyType ;
DutyType = 1;
Ret = SmcWSetPulseDuty( Id , 1, DutyType );
Python
Ret = ctypes.c_long()
DutyType = ctypes.c_short()
DutyType.value = 1
Ret.value = csmc.SmcWSetPulseDuty( Id , 1, DutyType )
See Also