機能
エンコーダのカウント値を取得します。
書式
Ret = SmcWGetCountPulse( Id , AxisNo , CountPulse )
引数
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
]
軸番号を指定します。
CountPulse
[ 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 CountPulse As Integer
Ret = SmcWGetCountPulse( Id , 1, CountPulse )
C, C++
long Ret;
long CountPulse ;
Ret = SmcWGetCountPulse( Id , 1, &CountPulse );
C#
int Ret;
int CountPulse ;
Ret = Smc.WGetCountPulse( Id , 1, out CountPulse );
Python
Ret = ctypes.c_long()
CountPulse = ctypes.c_long()
Ret.value = csmc.SmcWGetCountPulse( Id , 1, ctypes.byref(CountPulse) )
関連項目