SmcWGetCounterMode


機能

カウンタの動作設定情報を取得します。

書式

Ret = SmcWGetCounterMode( Id , AxisNo , ClearCntLtc , LtcMode , ClearCntClr , ClrMode )

引数

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 ]
軸番号を指定します。

ClearCntLtc [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
LTC信号がOFF→ONへ変化した時にクリアするカウンタの種類を格納する変数のアドレスを指定します。

0

カウンタをクリアしない

1

出力パルスカウンタをクリア

2

エンコーダカウンタをクリア

3

出力パルスカウンタおよびエンコーダカウンタをクリア

LtcMode [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
LTC信号入力時にラッチするカウンタの種類を格納する変数のアドレスを指定します。

0

ラッチ機能を使用しない

1

出力パルスカウンタをラッチ

2

エンコーダカウンタをラッチ

3

出力パルスカウンタおよびエンコーダカウンタをラッチ

ClearCntClr [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
CLR信号がOFF→ONへ変化した時にクリアするカウンタの種類を格納する変数のアドレスを指定します。

0

カウンタをクリアしない

1

出力パルスカウンタをクリア

2

エンコーダカウンタをクリア

3

出力パルスカウンタおよびエンコーダカウンタをクリア

ClrMode (予約) [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
0固定です。

戻り値

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

0

正常終了

0以外

異常終了

参照:エラーコード詳細

初期値

ClearCntLtc

0H  : クリアしない

LtcMode

0H  : 使用しない

ClearCntClr

0H : クリアしない

ClrMode

0 (固定)

説明

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

使用例

軸番号1のエンコーダカウンタの設定情報を取得します。

VB.NET
Dim Ret As Integer
Dim ClearCntLtc As Short
Dim LtcMode As Short
Dim ClearCntClr As Short
Dim ClrMode As Short
Ret = SmcWGetCounterMode( Id , 1, ClearCntLtc , LtcMode , ClearCntClr , ClrMode )

C, C++
long Ret;
short ClearCntLtc ;
short LtcMode ;
short ClearCntClr ;
short ClrMode ;
Ret = SmcWGetCounterMode( Id , 1, &ClearCntLtc , &LtcMode , &ClearCntClr , &ClrMode );

C#
int Ret;
short ClearCntLtc ;
short LtcMode ;
short ClearCntClr ;
short ClrMode ;
Ret = Smc.WGetCounterMode( Id , 1, out ClearCntLtc , out LtcMode , out ClearCntClr , out ClrMode );

Python
Ret = ctypes.c_long()
ClearCntLtc = ctypes.c_short()
LtcMode = ctypes.c_short()
ClearCntClr = ctypes.c_short()
ClrMode = ctypes.c_short()
Ret.value = csmc.SmcWGetCounterMode( Id , 1, ctypes.byref(ClearCntLtc) , ctypes.byref(LtcMode) , ctypes.byref(ClearCntClr) , ctypes.byref(ClrMode) )

関連項目

SmcWSetCounterMode