GenGetDeviceSetting


機能

デバイス情報を取得します。

書式

Ret = GenGetDeviceSetting ( AppId , AoChannels, Frequency, FrequencyType, FrequencyUnit )

引数

AppId [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_short ]

GenOpenApplicationで取得したアプリケーションIDを指定します。

AoChannels [ VB.NET: UShort ] [ C++: unsigned short * ] [ C#: out ushort ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]

チャネル数を返します。

Frequency [ VB.NET: Single ] [ C++: float * ] [ C#: out float ] [ Python: ctypes.POINTER(ctypes.c_float) ]

周波数を返します。

FrequencyType [ VB.NET: UShort ] [ C++: unsigned short * ] [ C#: out ushort ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]

周波数のタイプを返します。

値

[Dec]

マクロ

内容

0

GEN_PARAM_FREQTYPE_FREQUENCY

周波数

1

GEN_PARAM_FREQTYPE_PERIOD

周期

FrequencyUnit [ VB.NET: UShort ] [ C++: unsigned short * ] [ C#: out ushort ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]

単位を返します。

値

[Dec]

マクロ

内容

0

GEN_PARAM_FREQUNIT_HZ_SEC

周波数の場合 [ Hz ], 周期の場合 [ sec ]

1

GEN_PARAM_FREQUNIT_KHZ_MSEC

周波数の場合 [ kHz ], 周期の場合 [ msec ]

戻り値

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

定義

戻り値

[Dec]

内容

GEN_ERR_SUCCESS

0

正常終了

その他のエラー(参照:エラーコード一覧)

説明

設定されている周波数、チャネル数を返します。
周波数の値の単位は第三引数、第四引数から確認できます。

使用例

チャネル数、周波数、周波数タイプ、周波数単位を取得します。

VB.NET

Dim Ret As Integer

Dim AoChannels As UShort

Dim Freuency As Single

Dim FrequencyType As UShort

Dim FrequencyUnit As UShort

Ret = GenGetDeviceSetting(AppId, AoChannels, Frequency, FrequencyType, FrequencyUnit)

 

C++

long Ret;

unsigned short AoChannels;

float Frequency;

unsigned short FrequencyType;

unsigned short FrequencyUnit;
Ret = GenGetDeviceSetting(AppId, &AoChannels, &Frequency, &FrequencyType, &FrequencyUnit);

 

C#

int Ret;

ushort AoChannels;

float Freuency;

ushort Frequency;

ushort FrequencyUnit;

Ret = gen.GetDeviceSetting(AppId, out AoChannels, out Frequency, out FrequencyType, out FrequencyUnit);

 

Python

Ret = ctypes.c_long()
AoChannels = ctypes.c_ushort(1)

Frequency = ctypes.c_float(1.0)

FrequencyType = ctypes.c_ushort(0)

FrequencyUnit = ctypes.c_ushort(0)

Ret.value = cgen_api.GenGetDeviceSetting(AppId, ctypes.byref(AoChannels), ctypes.byref(Frequency), ctypes.byref(FrequencyType), ctypes.byref(FrequencyUnit))

 

関連項目

GenSetDeviceSetting