機能
基本動作のモータ動作タイプと動作開始方向の設定情報を取得します。
書式
Ret = SmcWGetReady( Id , AxisNo , MotionType , StartDir )
引数
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
]
軸番号を指定します。
MotionType
[ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short)
]
モータ動作タイプを格納する変数のアドレスを指定します。
0 |
動作なし |
1 |
PTP動作 |
2 |
JOG動作 |
3 |
原点復帰動作 |
6 |
Z相カウント動作 |
StartDir
[ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short)
]
モータ動作の開始方向を格納する変数のアドレスを指定します。
0 |
正方向 |
1 |
負方向 |
戻り値
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
0 |
正常終了 |
0以外 |
異常終了 |
参照:エラーコード詳細
説明
この関数は軸が動作中の場合も実行可能です。
使用例
軸番号1の基本動作のモータ動作タイプと動作開始方向の設定情報を取得します。
VB.NET
Dim Ret As Integer
Dim MotionType As Short
Dim StartDir As Short
Ret = SmcWGetReady( Id , 1, MotionType , StartDir )
C, C++
long Ret;
short MotionType ;
short StartDir ;
Ret = SmcWGetReady( Id , 1, &MotionType , &StartDir );
C#
int Ret;
short MotionType ;
short StartDir ;
Ret = Smc.WGetReady( Id , 1, out MotionType , out 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)
)
関連項目