SmcWGetMoveStatus


 

功能

读取电机的动作状态。

 

格式

Ret = SmcWGetMoveStatus( Id , AxisNo , MoveSts )

 

参数

Id  [ C, C++: short ] [ Python: ctypes.c_short ]

指定由函数SmcWInit获取的硬件设备ID。

 

AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]

指定轴号。

 

MoveSts [ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]

指定保存电机动作状态的变量地址。

 

0

停止中

1

PTP动作中

2

JOG动作中

3

原点复位动作中

4

Bank动作中 (单次)

5

Bank动作中 (循环)

6

Z相计数移动中

 

返回值

Ret [ C, C++: long ] [ Python: ctypes.c_long ]

 

0

正常结束

0以外

异常结束

 

参照:错误代码列表

 

说明

本函数可在轴移动期间实行。

 

原点复归动作中的Z相移动时,电机动作状态为

3 : 返回原点动作中。

 

使用例

读取轴1的电机动作状态。

 

C, C++

long Ret;

short MoveSts ;

Ret = SmcWGetMoveStatus( Id , 1, &MoveSts );

 

Python

Ret = ctypes.c_long()

MoveSts = ctypes.c_short()

Ret.value = csmc.SmcWGetMoveStatus( Id , 1, ctypes.byref(MoveSts) )