Gan Uesli Starling Posted July 20, 2012 Report Share Posted July 20, 2012 When trying out a new program most error messages that LabVIEW gives me are not very helpful because they refer to "unnamed task" such and such. And so I would like to give names to my tasks. It ought to be simple but still it illudes me. So now I ask... How do I give a name to a task so that error messages then will be helpful? Quote Link to comment
Ton Plomp Posted July 21, 2012 Report Share Posted July 21, 2012 You can do this in MAX, or with the LabVIEW function 'New DAQmx task': Ton Quote Link to comment
torekp Posted July 22, 2012 Report Share Posted July 22, 2012 But beware: if one of your threads closes the task, and then another tries to access it, you can get the old unnamed task error, I think. I'm pretty sure I've done this bellyflop at times. 1 Quote Link to comment
asbo Posted July 23, 2012 Report Share Posted July 23, 2012 But beware: if one of your threads closes the task, and then another tries to access it, you can get the old unnamed task error, I think. I'm pretty sure I've done this bellyflop at times. If that's true, that's really annoying - the wire of the task has the name of the task in it. Quote Link to comment
Aristos Queue Posted July 23, 2012 Report Share Posted July 23, 2012 The following post is an area I am *not* an expert in. Please contradict me if you know better... asbo: I'm not sure if this is the case with this error, but my understanding is that many of the errors reported by DAQ are designed with real-time in mind where even in the error case they avoid allocating memory -- i.e., no strings in the error code clusters. This means that all you get is the static text that can be obtained from the error code number itself. Much of the DAQ code was written before there was a conditional disable structure, so special casing the behavior on desktop wasn't an option. I have seen some recently written VIs that behave differently and give more helpful errors in the non-RT case. Quote Link to comment
asbo Posted July 23, 2012 Report Share Posted July 23, 2012 Thanks for the insight, AQ. I'm going to write a test case to look into the desktop behavior of this, just out of curiosity, but the point you make about RT use cases makes a lot of sense. Later: In LabVIEW 2011 with DAQmx v9.3.5, you *do* get the task name as part of the error message, in a fairly retrievable way. Further, you can probe task wires to see the task name and you can typecast/coerce task wires to strings to retrieve the task name. Somewhat disappointingly, a property node can no longer retrieve the name. I don't have a RT box available to me, but I still expect AQ's guess to hold true. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.