功能
读取输出脉冲的输出状态。
格式
Ret = SmcWGetPulseStatus( Id , AxisNo , PulseSts )
参数
Id [ C, C++: short ] [ Python: ctypes.c_short ]
指定由函数SmcWInit获取的硬件设备ID。
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
指定轴号。
PulseSts [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
指定保存输出脉冲输出状态的变量地址。
|
0 |
脉冲输出停止中 |
|
1 |
以开始速度(FL速度)匀速移动中 |
|
2 |
以目标速度(FH速度)匀速移动中 |
|
3 |
同步开始等待状态 |
|
4 |
ERC等待时间中 |
|
5 |
换向等待时间中 |
|
6 |
加速中 |
|
7 |
减速中 |
|
8 |
等待INP信号输入 |
返回值
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
|
0 |
正常结束 |
|
0以外 |
异常结束 |
参照:错误代码列表
说明
本函数可在轴移动期间实行。
使用例
读取轴1的输出脉冲的输出状态。
C, C++
long Ret;
short PulseSts ;
Ret = SmcWGetPulseStatus( Id , 1, &PulseSts );
Python
Ret = ctypes.c_long()
PulseSts = ctypes.c_short()
Ret.value = csmc.SmcWGetPulseStatus( Id , 1, ctypes.byref(PulseSts) )