I am trying to get the DAQmxGetSysDevNames to work using NI-DAQmx 8.3 and VB6 but the function is returning an empty string when trying against a USB-6008. The DAQmxGetDevProductType also returns an empty string. I can reset the device if I manually tell the software the device name with no issues. I can also get the Major and Minor of the the DAQ version. I have attached my code that I have been using to get this information in case anyone can see what I am doing wrong.
/Start code
Dim DeviceFoundCheck As Boolean
Dim DeviceNames As String
Dim DeviceType As String
Dim ErrorCode As Long
Dim DeviceBuffer As Long
Dim DAQMajorVersion As Long
Dim DAQMinorVersion As Long
'Device name is a Global String Variable
DeviceName = "Dev1"
'Get Device list
ErrorCode = DAQmxGetSysDevNames(DeviceNames, DeviceBuffer)
If ErrorCode < 0 Then
MsgBox "Error detecting any DAQ devices"
Exit Sub
End If
MsgBox DeviceNames
'Get Type
ErrorCode = DAQmxGetDevProductType(DeviceName, DeviceType, DeviceBuffer)
If ErrorCode < 0 Then
MsgBox "Error detecting DAQ device type"
Exit Sub
End If
MsgBox DeviceType
'Get DAQ version
ErrorCode = DAQmxGetSysNIDAQMajorVersion(DAQMajorVersion)
If ErrorCode < 0 Then
MsgBox "Error detecting DAQ Major"
Exit Sub
End If
ErrorCode = DAQmxGetSysNIDAQMinorVersion(DAQMinorVersion)
If ErrorCode < 0 Then
MsgBox "Error detecting DAQ Minor"
Exit Sub
End If
MsgBox "You have DAQ version " & CStr(DAQMajorVersion) & "." & CStr(DAQMinorVersion)
'Reset Device
DeviceFoundCheck = ResetDevice(DeviceName)
If DeviceFoundCheck = False Then
MsgBox "USB Device not found, Please check status."
End If
/End code
Thanks,
Lee