功能
设置输出脉冲的开始速度。
格式
Ret = SmcWSetStartSpeed( Id , AxisNo , StartSpeed )
参数
Id [ C, C++: short ] [ Python: ctypes.c_short ]
指定由函数SmcWInit获取的硬件设备ID。
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
指定轴号。
StartSpeed [ 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以外 |
异常结束 |
参照:错误代码列表
说明
缺省值为100[pps]。
使用缺省值时,无需实行本函数。
SMC-4/8DL系列中默认速度分辨率为1[pps]时,可设置范围为1~16383。
速度设置为16384[pps]以上时,请通过函数SmcWSetResolveSpeed更改速度分辨率。
SMC-4/8DF系列中默认速度分辨率为1[pps]时,可设置范围为1~65535。
速度设置为65535[pps]以上时,请通过函数SmcWSetResolveSpeed更改速度分辨率。
根据函数SmcWSetResolveSpeed设置的速度分辨率,本数值会进行修正。
例如:分辨率为15[pps]时,缺省值会修正为105[pps]。
使用例
设置轴1的输出脉冲的开始速度。
C, C++
long Ret;
double StartSpeed ;
StartSpeed = 200;
Ret = SmcWSetStartSpeed( Id , 1, StartSpeed );
Python
Ret = ctypes.c_long()
StartSpeed = ctypes.c_double()
StartSpeed.value = 200
Ret.value = csmc.SmcWSetStartSpeed( Id , 1, StartSpeed )
相关函数