機能
エンコーダ入力形式の設定情報を取得します。
書式
Ret = SmcWGetEncType( Id , AxisNo , EncType )
引数
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
]
軸番号を指定します。
EncType
[ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short)
]
エンコーダ入力形式を格納する変数のアドレスを指定します。
0 |
A/B 1逓倍 |
1 |
A/B 2逓倍 |
2 |
A/B 4逓倍 |
3 |
U/D |
4 |
使用しない |
戻り値
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
0 |
正常終了 |
0以外 |
異常終了 |
参照:エラーコード詳細
初期値
0 : A/B 1逓倍
説明
この関数は軸が動作中の場合も実行可能です。
使用例
軸番号1のエンコーダ入力形式の設定情報を取得します。
VB.NET
Dim Ret As Integer
Dim EncType As Short
Ret = SmcWGetEncType( Id , 1, EncType )
C, C++
long Ret;
short EncType;
Ret = SmcWGetEncType( Id , 1, &EncType );
C#
int Ret;
short EncType;
Ret = Smc.WGetEncType( Id , 1, out EncType );
Python
Ret = ctypes.c_long()
EncType = ctypes.c_short()
Ret.value = csmc.SmcWGetEncType( Id , 1, ctypes.byref(EncType) )
関連項目