機能
モータの動作状態を取得します。
書式
Ret = SmcWGetMoveStatus( Id , AxisNo , MoveSts )
引数
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
SmcWInit 関数で取得したデバイスIDを指定します。
AxisNo
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
軸番号を指定します。
MoveSts
[ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short)
]
モータの動作状態を格納する変数のアドレスを指定します。
0 |
停止中 |
1 |
PTP動作中 |
2 |
JOG動作中 |
3 |
原点復帰動作中 |
4 |
バンク動作中 (シングル) |
5 |
バンク動作中 (ループ) |
6 |
Z相カウント動作中 |
戻り値
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
0 |
正常終了 |
0以外 |
異常終了 |
参照:エラーコード詳細
説明
この関数は軸が動作中の場合も実行可能です。
原点復帰動作(ORG動作)に伴うZ相動作の場合は、
3 : 原点復帰動作中
となります。
使用例
軸番号1のモータの動作状態を取得します。
VB.NET
Dim Ret As Integer
Dim MoveSts As Short
Ret = SmcWGetMoveStatus( Id , 1, MoveSts )
C, C++
long Ret;
short MoveSts ;
Ret = SmcWGetMoveStatus( Id , 1, &MoveSts );
C#
int Ret;
short MoveSts ;
Ret = Smc.WGetMoveStatus( Id , 1, out MoveSts );
Python
Ret = ctypes.c_long()
MoveSts = ctypes.c_short()
Ret.value = csmc.SmcWGetMoveStatus( Id , 1, ctypes.byref(MoveSts) )