CntQueryDeviceName


機能

使用可能なデバイスの一覧を取得します。

書式

Ret = CntQueryDeviceName( Index , DeviceName , Device )

引数

Index [ C, C++ : short ] [ Python: ctypes.c_short ]
最初に0を指定し、以降+1づつ値を指定します。

DeviceName [ C, C++ : char * ] [ Python: ctypes.c_char_p ]
デバイス名を返します。(例:"CNT000")

Device [ C, C++ : char * ] [ Python: ctypes.c_char_p ]
デバイス名称を返します。(例:"CNT24-4(PCI)H")

戻り値

Ret [ C, C++ : long ] [ Python: ctypes.c_long ]

定義

意味

CNT_ERR_SUCCESS

0

正常終了

CNT_ERR_INFO_NOT_FIND_DEVICE

10051

利用可能なデバイスが見つかりません。 デバイスが、設定ファイルに登録されているかを確認してください。

その他のエラー(参照:エラーコード詳細

説明

使用するデバイスを選択させるような、汎用的なアプリケーションを作成する場合に利用できます。
Indexを0から順に+1していき、エラーになるまで処理を繰り返してください。

使用例

Index = 0で情報を取得します。

C, C++

long Ret;

char DeviceName[256];

char Device[256];

Ret = CntQueryDeviceName(0, DeviceName, Device);
 

Python

Ret = ctypes.c_long()

DeviceName = ctypes.create_string_buffer(256)

Device = ctypes.create_string_buffer(256)

Ret.value = ccnt.CntQueryDeviceName(0, DeviceName, Device)
 

関連項目

なし