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
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 Peter Herrmann
      Hello LAVA community,
      I use a USB 6215.
      With two TTL output signals, two different colored lasers are to be triggered.
      TTL 1 activates a blue laser. TTL 2 activates a green laser. 
      This external device also outputs 2 analog signals that I can capture with the USB 6215.
      While the lasers are active, the analog signals output characteristic values.
      The two TTL signals should be output by the USB6215 as follows:
      Both TTLs should be active for 10 ms every 100 ms, one after the other with a 2 ms delay.
      So TTL1 active for 10 ms, then 2 ms delay then TTL 2 active for 10 ms. The times should be adhered to as precisely as possible.
      The two analog signals should be calculated during the time in which both TTL are active (i.e. over the 22ms).
      The analog signals are sampled at 1 kHz.
      The analog data acquisition via DAQmx is clear. 
      I only have problems programming the timing of the digital triggers (TTL) accordingly.
      Does anyone have any idea how to start? 
      Maybe someone has already programmed something similar?
      Thanks in advance
      Pete
    • By nagesh
      I need to use 5 Bytes Hex string as a key, Hex string as a Value. Normally data stored in INI as ASCII.
      What can be the possibilities to store HEX String?
    • By paulofelora
      I have a requirement that I thought would be SIMPLE, but can't get it to work.  I have a 9205 card in a little 9174 cDAQ USB chassis.
      My *intended* behavior is to wait (block) at the DAQmx Trigger/Start Analog Edge on, say channel ai1, until I get a falling edge thru, say, -0.050V.  So I have a little vi (that contains 2 parallel loops) that I want to sit & wait for the trigger to be satisifed.  I'm doing "routine" voltage measurements in another AI loop on a different channel.  I want this vi to run separately from my "routine" voltage measurements because I want the app to respond "instantly" to input voltage exceeding a limit to prevent expensive damage to load cells.  I was afraid that if I used either Finite or Continuous sampling to "catch" an excessive voltage, I might miss it while I'm doing something else.  Yes, yes, a cRIO real-time setup would be better for this, but this is a very cost-sensitive task... I just want to "Arm & Forget" this process until it gets triggered, whereupon it fires an event at me.  SO... I'm also reading the same voltage on channel ai0 for regular-ole voltage measurements, and just jumpering them together.  I did this because I read somewhere that you can't use the same channel for multiple DAQ tasks - I *thought* I would need to set up the tasks differently.  {but now that think about it, the setups can be the same...}.
      I've set up the DAQmx task the same as shipping examples and lots of posts I've seen.  I'm supplying a nice clean DC voltage to a 9205 card using a high quality HP variable power supply.  Using NI-MAX, I've verified that my 9174 chassis & 9205 are working properly.
      THE PROBLEM - When I run it, the vi just sails right through to the end, with no error, and an empty data array out.  No matter WHAT crazy voltage I give the "DAQmx Trigger.vi" (set up for Start Analog Edge), it never waits for the trigger to be satisfied, just breezes on through as if it weren't there.  If I set the Sample Clock for "Finite Samples", the DAQmx Read fails with timeout - makes sense, since the trigger wasn't satisfied.  What could I possibly be doing wrong with such a simple task???????
      So my fundamental misunderstanding still vexes me - does the DAQmx Trigger vi not block and wait for the trigger condition to be satisfied, like the instructions state - "Configures the task to start acquiring or generating samples when an analog signal crosses the level you specify"?
      I stripped my requirement down to the bare essentials - see the 1st snippet, the 2nd is my actual vi.  Any ideas, anybody?


    • By Benoit
      This XML test report library is available for you to modify at your will.
      It is based on the IPC-2547 standard so it is easier for any other application or database to parse.
      The html file report offered by LabVIEW was not sufficient for my need.
      So I created those. enjoy!!!
    • By Benoit
      View File .xml test report Measurements.zip
      This XML test report library is available for you to modify at your will.
      It is based on the IPC-2547 standard so it is easier for any other application or database to parse.
      The html file report offered by LabVIEW was not sufficient for my need.
      So I created those. enjoy!!!
      Submitter Benoit Submitted 02/26/2018 Category *Uncertified* LabVIEW Version  
×
×
  • Create New...

Important Information

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