SmcWGetReady


 

功能

读取电机的动作类型和转动方向的设置信息。

 

格式

Ret = SmcWGetReady( Id , AxisNo , MotionType , StartDir )

 

参数

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

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

 

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

指定轴号。

 

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

指定保存电机动作类型的变量地址。

 

0

不动作

1

PTP动作

2

JOG动作

3

原点复位动作

6

Z相计数移动

 

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

指定保存电机转动方向的变量地址。

 

0

正方向

1

负方向

 

返回值

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

 

0

正常结束

0以外

异常结束

 

参照:错误代码列表

 

说明

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

 

使用例

读取轴1电机动作类型和转动方向的设置信息。

 

C, C++

long Ret;

short MotionType ;

short StartDir ;

Ret = SmcWGetReady( Id , 1, &MotionType , &StartDir );

 

Python

Ret = ctypes.c_long()

MotionType = ctypes.c_short()

StartDir = ctypes.c_short()

Ret.value = csmc.SmcWGetReady( Id , 1, ctypes.byref(MotionType) , ctypes.byref(StartDir) )

 

相关函数

SmcWSetReady