⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nidaqmxerrorcheck.bas

📁 基于NI PCI-6010采集卡的示波器
💻 BAS
字号:
Attribute VB_Name = "NIDAQmx"


Public Sub DAQmxErrChk(errorCode As Long)
'
'   Utility function to handle errors by recording the DAQmx error code
'   and message.
'
    Dim errorString As String
    Dim bufferSize As Long
    Dim status As Long
    If (errorCode < 0) Then
        ' Find out the error message length.
        bufferSize = DAQmxGetErrorString(errorCode, 0, 0)
        ' Allocate enough space in the string.
        errorString = String$(bufferSize, 0)
        ' Get the actual error message.
        status = DAQmxGetErrorString(errorCode, errorString, bufferSize)
        ' Trim it to the actual length, and display the message
        errorString = Left(errorString, InStr(errorString, Chr$(0)))
        Err.Raise errorCode, , errorString
    End If

    
End Sub



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -