Function
Sets pulse width (duty ratio).
Format
Ret = SmcWSetPulseDuty( Id, AxisNo, DutyType )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
SSpecify the Deice ID retrieved by SmcWInit
function.
AxisNo
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the axis number.
DutyType
[ VB.NET: Short ] [ C, C++: short ] [ 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ 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.
VB.NET
Dim Ret As Integer
Dim DutyType As Short
DutyType = 1
Ret = SmcWSetPulseDuty( Id , 1, DutyType )
C, C++
long Ret;
short DutyType ;
DutyType = 1;
Ret = SmcWSetPulseDuty( Id , 1, DutyType );
C#
int Ret;
short DutyType ;
DutyType = 1;
Ret = Smc.WSetPulseDuty( Id , 1, DutyType );
Python
Ret = ctypes.c_long()
DutyType = ctypes.c_short()
DutyType.value = 1
Ret.value = csmc.SmcWSetPulseDuty( Id , 1, DutyType )
See Also