From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

[VB to VB.net] what is the VB.net equivalent of 'NIDAQmxCAPI.DAQmx.DAQmxGetErrorString'?

Hi all,

 

I am working on conversion between VB and VB.net.

Instead of refering to 'NIDAQmxCAPI.DAQmx' which is not valid in VB.net, I am now refering to 'NationalInstruments.DAQmx'

For most of the functions such as creating a task and creating channels, I can find VB.net equivalent.  However, I cannot find the equivalent of 'NIDAQmxCAPI.DAQmx.DAQmxGetErrorString'.

Could anyone help me on this?

 

Attached is the code:

 

If (ErrorCode < 0) Then
' Find out the error message length.
'UPGRADE_ISSUE: COM expression not supported: Module methods of COM objects. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="5D48BAC6-2CD4-45AD-B1CC-8E4A241CDB58"'
bufferSize = NIDAQmxCAPI.DAQmx.DAQmxGetErrorString(ErrorCode, CStr(0), 0)
' Allocate enough space in the string.
errorString = New String(Chr(0), bufferSize)
' Get the actual error message.
'UPGRADE_ISSUE: COM expression not supported: Module methods of COM objects. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="5D48BAC6-2CD4-45AD-B1CC-8E4A241CDB58"'
Status = NIDAQmxCAPI.DAQmx.DAQmxGetErrorString(ErrorCode, errorString, bufferSize)
' Trim it to the actual length, and display the message
errorString = Left(errorString, InStr(errorString, Chr(0)))
End If

 

And the error message is :

'DAQmx' is not a member of 'NIDAQmxCAPI'. 

 

 

Thanks a ton!

0 Kudos
Message 1 of 2
(2,943 Views)

Was there a solution for this problem as I am experiencing the same issues currently.

0 Kudos
Message 2 of 2
(121 Views)