GenGetDeviceName


Function

Get the device name.

Format

Ret = GenGetDeviceName ( AppId , DeviceName)

Parameters

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

Specify Application ID retrieved by GenOpenApplication.

DeviceName [ VB.NET: String ] [ C++: char * ] [ C#: out string ] [ Python: ctypes.c_char_p ]

Return the device name.

Return Value

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

Definition

Return Value

Description

GEN_ERR_SUCCESS

0

Normal completed

GEN_ERR_DEVICENAME

10007

A device name isn't stored in DeviceName.

The others (See also: Error Code List)

Remarks

C-WaveformGenerator may use the current device until you select the other device or you terminate C-WaveformGenerator.
This function can be executed even if the device is in operation.

Example

Get the selected device name.

VB.NET

Dim Ret As Integer

Dim DeviceName As New StringBuilder("", 256)
Ret = GenGetDeviceName(AppId, DeviceName)

 

C++

long Ret;

char DeviceName[256];

Ret = GenGetDeviceName(AppId, DeviceName);

 

C#

int Ret;

string DeviceName;

Ret = gen.GetDeviceName(AppId, out DeviceName);

 

Python

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

Ret.value = cgen_api.GenGetDeviceName(AppId, DeviceName)

 

See Also

GenSetDeviceName