DioQueryDeviceName


機能

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

書式

Ret = DioQueryDeviceName ( Index , DeviceName , Device )

引数

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

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

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

戻り値

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

定義

[Dec]

意味

DIO_ERR_SUCCESS

0

正常終了

DIO_ERR_INFO_NOT_FIND_DEVICE

10051

利用可能なデバイスが見つかりません。

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

説明

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

使用例

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

C, C++

long Ret;

char DeviceName[256];
char Device[256];

Ret = DioQueryDeviceName(0, DeviceName, Device);
 

Python

Ret = ctypes.c_long()
DeviceName = ctypes.create_string_buffer(256)
Device = ctypes.create_string_buffer(256)

Ret.value = cdio.DioQueryDeviceName(0, DeviceName, Device)

関連項目

なし