CntQueryDeviceName


Function

Retrieves the list of the devices which are available for use.

Format

Ret = CntGetMaxChannels ( Index , DeviceName , Device )

Parameters

Index [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
This parameter should be zero for the first call and then be incremented for subsequent calls.

DeviceName [ VB.NET: String ] [ C, C++: char * ] [ C#: out string ] [ Python: ctypes.c_char_p ]
Returns the device name. (For example: "CNT000")

Device [ VB.NET: String ] [ C, C++: char * ] [ C#: out string ] [ Python: ctypes.c_char_p ]
Returns the board name. (For example: "CNT-3208M-PE")

Return Value

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

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normality completion

CNT_ERR_INFO_NOT_FIND_DEVICE

10051

No more device.
Please make sure that the device was registered in the device manager.

STATUS_SYS_USB_NOT_FOUND_DEVINFO

20032

The device information is not found.

The others: (See also: Details of Error Code)

Remarks

This function can be used when you are creating a general-purpose application about the selected device to be used. Index is set to zero for the first call. And then it should be incremented for subsequent calls until the function returns error.

Example

Retrieves the information of the device by Index=0.

VB.NET

Dim Ret As Integer
Dim DeviceName As String = Space(256)
Dim Device As String = Space(256)
Ret = CntQueryDeviceName ( 0 , DeviceName , Device )
 

C, C++

long Ret;
char DeviceName[256];
char Device[256];
Ret = CntQueryDeviceName ( 0 , DeviceName , Device );
 

C#

int Ret;
string DeviceName;
string Device;
Ret = cnt.QueryDeviceName ( 0 , out DeviceName , out 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 )
 

See Also

None