05-07-2006 10:24 PM
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. |
#include <NIDAQmx.h>
#include <iostream>
int main(int argc, char *argv)
{
int32 size;
int32 error = -2147220712;
char *msg = new char[100];
char msg2[100];
size = DAQmxGetErrorString(error, msg2, 100);
std::cout << msg2 << std::endl;
std::cout << size << std::endl;
size = DAQmxGetErrorString(size, msg2, 100);
std::cout << msg2 << std::endl;
std::cout << size << std::endl;
size = DAQmxGetErrorString(error, msg, 0);
std::cout << size << std::endl;
size = DAQmxGetErrorString(error, NULL, 100);
std::cout << size << std::endl;
size = DAQmxGetErrorString(error, NULL, 0);
std::cout << size << std::endl;
delete [] msg;
return 0;
}
Explanation could not be found for the requested status code.Those zeros should be the size of the character array to properly recieve the message, not 0.
Verify that the requested status cod
200026
Requested string could not fit into the given buffer. Only the first part of the
string was copied
200026
0
0
0
05-08-2006 01:03 PM
Hello asdfwww,
I was capable of reproducing the behavior you reported only when an invalid
(unknown) error code was passed to the function. If I pass error -200324
I get a size returned of 586. However, if I pass the error code you
mentioned (-2147220712)
I get 0 returned since it is not a valid DAQmx error code.
Sorry for the confusion.
Jesse O.
Applications Engineering
National Instruments
05-08-2006 01:40 PM - edited 05-08-2006 01:40 PM
Message Edited by krothman on 05-08-2006 01:40 PM