Jump to content

Giving a NAME to a task.


Recommended Posts

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?

Link to comment

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.

Link to comment

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.

Link to comment

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.

post-13461-0-26706400-1343086638_thumb.p

I don't have a RT box available to me, but I still expect AQ's guess to hold true.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.