LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get error code status

Hello, I work on CVI8.1 and I have a problem to get error code status. I use iStatusErrorCode = DAQmxGetExtendedErrorInfo (errBuff, 2048); to get ErrorCode status when an error occured but when I see iStatusErrorCode value, I have only 0 value instead of -200279 (overwritten error code) for example.

Can you help me. I have to compare iStatusErrorCode to -200279 to count overwritten error.

Thanks.


 
0 Kudos
Message 1 of 3
(3,287 Views)

It seems that there is here a basic misunderstanding: the return value from DAQmxGetExtendedErrorInfo function is the result of the function itself, that is wether the function was able to write the extended informations in the supplied string or it has got some errors while trying to do it. DAQmxGetExtendedErrorInfo function is intended to produce an explicative text (placed in the string received as an argument) that shows additional informations about an error found by any DAQmx function; a fundamental caveat is that it works only if called after a function returns an error, since as it is stated in the online help for the function, "This function is valid only for the last function that failed; additional NI-DAQmx calls may invalidate this information."

To do what you are trying you will need to examine the return value for every DAQmx function you are using in your program and react if this value is <0 (or even >0 if you want to handle warnings as well as errors).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,255 Views)

Thanks for explanation. 🙂


 
0 Kudos
Message 3 of 3
(3,249 Views)