Jump to content

Storing/Importing DAQmx Task Configurations


Recommended Posts

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. 

 

Cheers,

Tim M

SampVolt.PNG

SampVoltXML.PNG

Link to comment

I use MAX as much as I can.  I try to not reinvent the wheel unless there are limitations that I really need to work around, and MAX just does so much that I try to avoid custom things.  I'll still incorporate MAX in my application, by doing things like calling test panels to hardware to open, or creating and editing channels, tasks, and scales using a VI I posted here.

But as for the tasks and how they work in applications.  I'll usually make the tasks in MAX and test them there, then perform an export into an NCE file which can go along with the source code which explains how the channels are all setup.  Then in application builder, you can specify this NCE file to be imported when the installer runs.

I do however remember some issues with editing tasks that have already been opened.  Like I remember having my software opening it, and then trying to edit the scale of a channel and having issues where the new scale wouldn't be applied until I closed and reopened my software.  I must not have been stopping or closing all of the references to the scale, or channel using the scale and that might not be a real limitation of DAQmx but something to look out for.

I've had no experience with INIs or XML as a result.

  • Like 1
Link to comment

Update: 

I can't take credit for this one, as it was recommended to me.  Here's a solution that I believe would work for those wanting a quick and dirty xml solution.  Create a class, add the task to the class private data, and dump the class to xml.  If you do this with just the task you get a nondescript task header, if you do it with a class you get the full task.  Not really sure why this is the case.  Perhaps there is someone with more knowledge of the XML parser who could shed some light on this.  

Capture.PNG

  • Like 1
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.