功能
设置输出脉冲的目标速度。
格式
Ret = SmcWSetTargetSpeed( Id , AxisNo , TargetSpeed )
参数
Id [ C, C++: short ] [ Python: ctypes.c_short ]
指定由函数SmcWInit获取的硬件设备ID。
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
指定轴号。
TargetSpeed [ C, C++: double ] [ Python: ctypes.c_double ]
设置目标速度,单位为[pps]。
指定为-1时,使用缺省值。
可指定的范围: -1 , 速度设置范围
可设置速度范围如下:
SMC-4/8DL系列: 0.29296875~9829800
SMC-4/8DF系列: 0.0732421875~6553500
返回值
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
|
0 |
正常结束 |
|
0以外 |
异常结束 |
参照:错误代码列表
说明
缺省值为1000[pps]。
使用缺省值时,无需实行本函数。
SMC-4/8DL系列中默认分辨率为(1[pps]),可设置范围为1~16383。
速度设置为16384[pps]以上时,请通过函数SmcWSetResolveSpeed更改速度分辨率。
SMC-4/8DF系列中默认分辨率为(1[pps]),可设置范围为1~65535。
速度设置为65535[pps]以上时,请通过函数SmcWSetResolveSpeed更改速度分辨率。
根据函数SmcWSetResolveSpeed设置的速度分辨率,本数值会进行修正。
例如:分辨率为15[pps]时,缺省值会修正为1005[pps]。
目标速度大于开始速度时,进行加速移动。目标速度小于起始速度的情况下,以目标速度进行匀速移动。
使用例
设置轴1的输出脉冲的目标速度。
C, C++
long Ret;
double TargetSpeed
TargetSpeed = 1000;
Ret = SmcWSetTargetSpeed( Id , 1, TargetSpeed );
Python
Ret = ctypes.c_long()
TargetSpeed = ctypes.c_double()
TargetSpeed.value = 1000
Ret.value = csmc.SmcWSetTargetSpeed( Id , 1, TargetSpeed )
相关函数