SmcWGetStopPosition


機能

モータの停止位置(総出力パルス数)の設定情報を取得します。

書式

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

引数

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]v SmcWInit 関数で取得したデバイスIDを指定します。

AxisNo [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
軸番号を指定します。

Coordinate [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
位置の座標タイプを指定します。

0

絶対座標

1

相対座標

StopPosition [ VB.NET: Integer ] [ C, C++: long * ] [ C#: out int ] [ Python: ctypes.POINTER(ctypes.c_long) ]
停止位置を取得します。

戻り値

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

0

正常終了

0以外

異常終了

参照:エラーコード詳細

説明

この関数は軸が動作中の場合も実行可能です。

使用例

軸番号1のモータの停止位置(総出力パルス数)の設定情報を取得します。

VB.NET
Dim Ret As Integer
Dim Coordinate As Short
Dim StopPosition As Integer
Ret = SmcWGetStopPosition( Id , 1, Coordinate , StopPosition )

C, C++
long Ret;
short Coordinate ;
long StopPosition ;
Ret = SmcWGetStopPosition( Id , 1, Coordinate , &StopPosition ) ;

C#
int Ret;
short Coordinate ;
int StopPosition ;
Ret = Smc.WGetStopPosition( Id , 1, Coordinate , out StopPosition ) ;

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

関連項目

SmcWSetStopPosition