The Threadberr is used in multi-thread GPIB applications to check thread status. you can find more information on this function in the "NI-488.2 Help" file. You probably used a thread status variable instead of a global status variable which causes the error.
You can also attach the SPY capture of the error so we can take a look at the "undefined" error you received