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.


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.

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.

  • Similar Content

    • By A Scottish moose
      Hello all,
      My question is: what is your preferred non-volatile way of storing daqmx task configurations? 
      Backstory: For a long time I've used ini files to maintain task configurations between executions of a program. This has worked for primarily static DAQmx configurations but I'm looking at creating a test executive with some degree of flexibility, which means daqmx task configurations start to get more complicated.
      If you use MAX for storing your tasks:  Do you run into problems accessing and maintaining these tasks even though you don't have direct access to the file?  Or is there an unlisted storage location for these files?
      If you use ini/text based files:  How do you keep things orderly?  I'm running into all kinds of limitations with the format.
      If you use XML: Where did you find your schema?  Did you write it?  I know NI saves tasks as XML files, and so therefore the schema exists, but I haven't been able to figure out how to use it.  I've created a task in my project and then dug through the XML of the project to find the attached image.  I believe this would be the ideal solution, but a little bit of digging in around NI.com (I know...) and google (actually useful) has resulted in no answers.
      I know there is an elegant answer to this question, I've just not found it yet.  Thanks in advance for your comments. 
      Tim M

    • By bigjoepops
      I have a problem I was hoping you might be able to help me figure out.  I need to be able to create 6 analog output channels that will have separate data files loaded into them.  These channels will be started individually in a timed sequence.
      I am having trouble getting the analog DAQ tasks created.  LabVIEW is complaining when I try to set them up as individual tasks in the same routine.  I used a for loop on an array of data files and an array of channel names.  The error code is suggesting that I set the channels up under one task.  But the problem with that is that I don’t know how to get individual channels of that one task started.
      I created the initial for loop in Main.vi.  This gives me error -50103.  My single instance is in Main_1.vi.
      I am trying to use a PXI-6363 card initially because that is all I have now.  But I will try to upgrade to a PXI-6733 when I get ready for the test.  Is there something with the 6363 that doesn't allow for multiple tasks on the same card for the same function?
      Thanks for your help.
  • Create New...

Important Information

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