SmcWGetStopPosition


 

功能

读取电机的停止位置(总输出脉冲数量)的设置信息。

 

格式

Ret = SmcWGetStopPosition( Id , AxisNo , Coordinate , StopPosition )

 

参数

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

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

 

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

指定轴号。

 

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

指定位置坐标类型。

 

0

绝对坐标

1

相对坐标

 

StopPosition [ C, C++: int * ] [ Python: ctypes.POINTER(ctypes.c_int) ]

指定存取停止位置的变量地址。

 

返回值

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

 

0

正常结束

0以外

异常结束

 

参照:错误代码列表

 

说明

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

 

使用例

读取轴1的电机停止位置(总输出脉冲数)的设置信息。

 

C, C++

long Ret;

short Coordinate ;

int StopPosition ;

Ret = SmcWGetStopPosition( Id , 1, Coordinate , &StopPosition ) ;

 

Python

Ret = ctypes.c_long()

Coordinate = ctypes.c_short()

StopPosition = ctypes.c_int()

Ret.value = csmc.SmcWGetStopPosition( Id , 1, Coordinate , ctypes.byref(StopPosition) )

 

相关函数

SmcWSetStopPosition