Skip to content

NI DAQMX Error Handling

Greg Stoll edited this page Sep 6, 2021 · 1 revision

Error Handling

DAQmxGetErrorString

int32 DAQmxGetErrorString (int32 errorCode, char errorString[], uInt32 bufferSize);

Purpose

Converts the error number returned by an NI-DAQmx function into a meaningful error message.

If you pass in a valid value for errorString and its bufferSize, this function returns as much of the available data as possible.

If you pass NULL for errorString or 0 for bufferSize, this function returns the number of bytes you need to allocate.

Parameters

Input
Name Type Description
errorCode int32 An error code or warning returned by one of the NI-DAQmx Library functions.
bufferSize uInt32 The size, in bytes, of the buffer passed in the errorString. If you pass 0, this function returns the number of bytes you need to allocate.
Output
errorString char [] The meaningful error message for the error number. If you pass NULL, this function returns the number of bytes you need to allocate.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A negative value indicates an error.
If you pass in a valid value for errorString and its bufferSize, this function returns as much of the available data as possible.
If you pass NULL for errorString or 0 for bufferSize, this function returns the number of bytes you need to allocate.

DAQmxGetExtendedErrorInfo

int32 DAQmxGetExtendedErrorInfo (char errorString[], uInt32 bufferSize);

Purpose

Returns dynamic, specific error information. This function is valid only for the last function that failed; additional NI-DAQmx calls may invalidate this information.

If you pass valid values for errorString and bufferSize, this function returns as much of the available data as possible.

If you pass NULL for errorString or 0 for bufferSize, this function returns the number of bytes you need to allocate.

Parameters

Input
Name Type Description
bufferSize uInt32 The size, in bytes, of errorString. If you pass 0, this function returns the number of bytes you need to allocate.
Output
Name Type Description
errorString char [] Dynamic error information. If you pass NULL, this function returns the number of bytes you need to allocate.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A negative value indicates an error.
If you pass in a valid value for errorString and its bufferSize, this function returns as much of the available data as possible.
If you pass NULL for errorString or 0 for bufferSize, this function returns the number of bytes you need to allocate.

Table of Contents

Internal Development

Creating and Setting Up a gRPC Server

Server Security Support

Creating a gRPC Client

gRPC Client Examples

Session Utilities API Reference

Driver Documentation

gRPC API Differences From C API

Sharing Driver Sessions Between Clients

C API Docs
NI-DAQmx
NI-DCPOWER
NI-DIGITAL PATTERN DRIVER
NI-DMM
NI-FGEN
NI-FPGA
NI-RFmx Bluetooth
NI-RFmx NR
NI-RFmx WCDMA
NI-RFmx GSM
NI-RFmx CDMA2k
NI-RFmx Instr
NI-RFmx LTE
NI-RFmx SpecAn
NI-RFmx TD-SCDMA
NI-RFmx WLAN
NI-RFSA
NI-RFSG
NI-SCOPE
NI-SWITCH
NI-TCLK
NI-XNET
Clone this wiki locally