Simultaneous writing of different DAQmx tasks to TDMS files

Hi,
I am using a 6368 to moniter several different voltage readings simultaneously on a circuit. I would like to have each of these channels sampling as close to the 2MS/s limit as possible, while writing the data to disk. From what I've gathered, it is not possible to write 2 separate tasks to the same TDMS file without a dramatic decrease in performance. Is there a way to have 2 or more tasks being written simultaneously to 2 respective TDMS files? I've tried this with no luck (both tasks embedded in the same derterministic loop, maybe they need to be in separate loops?), can anybody point me in the right direction? I am assuming there must be a way, otherwise there'd be no point to the simultaneous sampling...
Thanks!

Hi Daniel,
Here is my code so far. Right now I am just using 1 output channel to send a repeating voltage signal into a circuit, and measure the voltage from 2 other parts on the circuit and record the data. The ultimate goal is to use all 16 channels at the full 2MS/s/ch, and have a record of the data saved to disk at some point.
I am still new to labview so I suspect there are a number of things I am doing wrong.
Attachments:
gimNPC1.vi ‏46 KB

Similar Messages

  • Error -2500 while writing new channel groups / channels to tdm-file

    I'm creating a tdm-file using the express vis provided by LabView. Everything goes fine in opening the file and setting the file parameters.
    When i'm using the write data-express vi to create a new channel group and setting it's parameters i receive an "error -2500" accompanied with the call chain of the vi.
    I'm setting the parameters by using a terminal on the express vi and by using the value setting in the express vi configuration. Any ideas what might cause this error?

    I solved it. I made the error to begine some of the properties names with a number, eg. 1s for 1 sigma. I renamed them to sigma_1s and it works.

  • Writing in different sheets of a .csv file

    Hi,
    Is it possible to write values in different sheets of the same workbook in a .csv / .xls file. When I use the following to write it on to the file. If I have many such sets of data to be written is it possible to write it in different sheets of the file (E.g. sheet1 as text1, sheet2 as text2, etc.)
    out.write(key + "," + hm.get(key));Please do advise.
    PK

    Google for Jakarta POI ^ It has features for writing different sheets in XLS.

  • How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

    I store different channels in a TDMS file.
    I like to have a time channel at the first position with group index 1 and number 1.
    When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
    Here are my questions:
    How does DIADEM import TDMS files?
    How gets every channel his number and groupindex?
    How can I determine which channel has which groupindex and number?
    Best regards
    Joerg

    Hi Jörg,
    i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.
    Did you use the library for creating *.tdms files like in the link ?
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file
    when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.
    When you don´t have Labview you can use the 30 days test of current version 8.5 under following link
    german version download link
    https://lumen.ni.com/nicif/d/lveval/content.xhtml
    english version download link
    https://lumen.ni.com/nicif/us/lveval/content.xhtml
    Hope it helps
    Best Regards

  • Read multiple tdms files

    Two questions:
    1) how can i rename the different signals in the tdms file? Now they are names "untitled x". I am looking for an elegant solution, because i record about 200 different Signals.
    2) Is there an "easy way"  to select, read and concatenate multiple TDMS files to show them in a graph?

    I had a similar goal with grouping plots and  rearranging them on the X-axis, so I put together this pretty quickly to search a range of TDMS files for a specific channel, should be able to adapt it pretty easy to suit your needs, once you manage to rename your channels.
    Attachments:
    Record Grouping.vi ‏48 KB

  • Design Suggestions for Multiple DaqMX Task Streaming App?

    I'm working on a LabVIEW application in which I'm streaming high-speed data to disk from multiple PXI devices simultaneously.  Each device has its own DaqMX task, and all tasks stream to the same file.  The PXI device configuration (which devices are in the chassis, which slots they're in, and which channels to read from each device) is determined at runtime.
    Does anyone have a suggestion for a design model for this?  To make matters worse, I'd like to be able to specify a channel to monitor its data during the streaming.  I'm thinking the Producer-Consumer model is the basic approach, and I'm at the point where I have an array of DaqMX tasks, one for each device.  I could probably extend that array to be an array of clusters containing:
       1) DAQ Command (e.g. Initialize, Start, Stop, Acquire, etc)
       1) Task ID
       2) Control reference to 2-D array (where each DaqMX read can be stored)
       3) Array of channel names (to allow selection of channel to be monitored
    This could be passed as notifier data, to a data collection subVI, but the part I'm struggling with is finding the best way to run X number of tasks in parallel, where X is not known until runtime.
    Any suggestions would be appreciated.

    Thanks for the input.  With regards to the file format, the decision has been made by my superiors not to use TDMS - unfortunate, but NI hasn't provided the information to write a MatLab file reader, which is a requirement.  So, I've created a custom file format tailored to the needs of my application, but generic enough to be used for other apps. With it, I've been able to stream 8 channels at 800KHz (4 channels each from 2 PXI-6120s) without breaking a sweat.  However, the performance varies greatly depending on which slots the cards are in (but that's a whole different discussion - see the PXI forum for that one).  Once NI solves that one, I'll feel a lot more comfortable.
    I have already made reentrant subVIs that can perform a specific DAQ task.  The problem with a for loop is that the VI sits and wait for a start trigger, then acquires the streaming data.  I can't start the next VI because I'm in the first one.  I thought about creating a data collection VI, and this VI would start up to 6 other VIs in parallel, based on how many and which cards were present.  It's a bit messy, because each slot can contain one of two devices, so I'd need to check which type it was before calling it.  I'm thinking I'll have to create the task list and the references to the data in the main GUI loop, and then pass this using a notifier or queue to the data collection loop. 

  • Would you Open and Close DAQmx tasks within a function or Globally

    Hi Guys,
    This should start something.
    The subject is DAQmx Tasks.
    If you were writing a function that is called many times, say MeasureVolts (double *Value) to obtain a reading from an Analogue Input Channel.
    Would you.
    1. open and start the task inside the function, do the measurement and then close the task inside the same function.
    or
    2. open the task globally and later do the measurement inside the function using the global task then close the task only when the application is closed.
    I am mostly concerned with the overhead of task generation and closing, what do you guys and girls out there do?? and what is the general opinion?
    I would appreciate your views.
    Regards
    Paul.

    I would definitely NOT keep configuring and clearing (I think that's what you mean by open and close) the same task over and over.  I would configure once, read many times in my main app, then stop & clear once.
    I typically like to package such data acq into an "Action Engine" that keeps track of its own DAQmx task id so I don't need to sling that task id wire around into multiple parallel loops / vi's.  Attached is a very stripped-down example for Digital Input. 
    I would typically do more with error testing and would make the "Action" enum into a typedef custom control, but this gives you the basic idea.  The action engine approach works very nicely when there's a small # of different kinds of input parameters and output info needed to support all the necessary action cases.   When you start needing a large number of differnent kinds of inputs and outputs to support the desired actions, then you start having difficulty with (1) having enough terminals to wire and (2) remembering which inputs and outputs are meaningful for which actions.
    -Kevin P.
    Attachments:
    DI Action Engine.vi ‏75 KB

  • Examples for good programming practice with multiple DAQmx tasks

    I'm writing a program to continuously log data from 8 counters, 8 encoders, and 8 voltages. The proof of concept VI with a single counter was simple and elegant, but scaling up to all signals resulted in a wiring mess. I've been working through the Labview Core courses, and am currently on Core 3. I still haven't come across a discussion on how to work with multiple DAQmx tasks without making a mess of the block diagram. Can anyone point me in the right direction?
    Also, say I have a state machine that has a configure, idle, and logging states. I need to set the initial values of the encoders during configuration, and keep up with their changes while in the idle state so I have appropriate starting values when entering the logging state. Can anyone point to an example that shows how this might be accomplished?
    Thanks

    I'm very familiar with AE's/Functional Globals - but I have struggled in the past with handling multiple DAQmx tasks - particularly when you're using multiple devices and using different types of measurements which require seperate tasks/handling (e.g. such as thermocouples which require extra compensation).
    I'm not even sure I know whare the requirements are for needing multiple tasks - I know you can need multiple tasks for a single device if the type of measurement is different but can you share an Analogue Input task amongst multiple devices?
    I think in hindsight (and without too much thought now) it looks like a good case for Object Oriented LabVIEW - with a base DAQmx class (initialise, configure, start, acquire, stop, close etc.) and then child classes for each type of measurement (with one task associated with each - and private data unique to that specific class). You then hold an array of objects (one for each task) and iterate through each one with dynamic despatch to get the data.
    I don't know your particular experience level of using LabVIEW (and as such, OO may not be appropriate) - but as a wider discussion of 'best practice' it seems like an appropriate method I would use going forward.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Setting DAQmx Tasks up in project instead of NI Max

    I am writing a labview application to be installed on a PC as an executable file with the Labview Engine.  I can put my DAQmx tasks in my project or NI Max.  If I put them in my project and I build my application, do I lose the ability to change the IO settings in NI Max independent of my application?
    What is the best way to mechanize this with all the features of things like DAQmx tasks being created in my project rather than NI MAX? 

    id wrote:
    I am writing a labview application to be installed on a PC as an executable file with the Labview Engine.  I can put my DAQmx tasks in my project or NI Max.  If I put them in my project and I build my application, do I lose the ability to change the IO settings in NI Max independent of my application?
    What is the best way to mechanize this with all the features of things like DAQmx tasks being created in my project rather than NI MAX? 
    First. Yes persaisting the DAQmx features to the project removes them from MAX.  You will not be able to run them or modifiy them from MAX but only within the Project Context.
    This is not always BAD.  For instance, no one can "Fat Finger" your configuration or install another Task with the same name that uses different settings.  Using the Project provides a context boundary wheras MAX is universally accessable.
    Using the Project to store "Tasks, Scales, etc" DOES NOT remove the ability to modify them though.  Tasks stored in projects built into an EXEs wind up deployed as a text file in the exes support directory (Exe\Support\NI DAQ\<Something.txt>  This is a human readable configuration file that has the tasks settings in it.  If you need to change a setting (like increase a sample rate or change a physical channel) you can edit the file and the exe will use the new settings.
    This is not always GOOD For instance, if the test system suffers a fault, MAX cannot selectively control the IO channels for troubleshooting.
    Knowing the pros and cons of each method will help you work within your team to develop the best approach for your needs.  I've recommended each approach to various clients.  (And been right both ways!) 
    What I've never recommended is creating tasks programatically.  However, I can see some use cases where hiding the configuration from everyone (on a removed BD) might be desired in a highly regulated enviornment where a possible change to a Task Property Could change code validation and the ECO process requires removing any possible "Hidden" access to the config files (Although a hash on the EXE folder could be used to disable testing)
    Jeff

  • Creating a new DAQmx task after building to EXE

    Should I be able to create a new DAQmx Task while running a VI containing the DAQmx Task control that was built as an EXE?
    I can't but would like to know if there is a work around or if I am doing something wrong. See the attached screen shots.
    When I am not running the VI, I can right click the Task front panel control and select "New NI-DAQmx Task" -> "Project" or "MAX", but when it is running or I am using the VI built as an EXE (running or not) I can't. In the EXE I am able to click the Task drop down box -> "Browse..." -> "Create New..." -> "MAX Task" but nothing happens when I click on "MAX Task".
    I would like to be able to create a new task in the software to use different channels and signal types on the fly. The goal is to build a program setup similiar Signal Express but include some on off controls for some machinery and scale it down and customize it so that it is easier to show people how to use it.
    Thanks
    Attachments:
    block diagram.png ‏30 KB
    front panel.png ‏25 KB
    exe front panel.png ‏26 KB

    When running your exe, you'll be able to select from tasks created in MAX.  Instead of right clicking on the task control, try creating the tasks you want directly in MAX (under Data Neighborhood right click on DI-DAQmx Tasks to create a new one).  Tasks that you've saved in MAX will be selectable in the DAQmx Task Name control.

  • I write digital port by 'DAQmx Configure Logging.vi​' and receive TDMS file with 8 boolean channels. How can I write to 1 integer channel?

    Hello!
    I want to write 1 digital port from PXI-6536 with streaming to TDMS file.
    I'm writing by 'DAQmx Configure Logging.vi' and become TDMS file with 8 boolean channels.
    How can I write to 1integer channel?
    Attachments:
    1.JPG ‏27 KB

    Hey Atrina,
    The actual data stored on disk is just the raw data (that is, a byte per sample in your case).  It's really just a matter of how that data is being represented in LabVIEW whenever you read back the TDMS file.
    I'm not sure if there is a better way to do this, but here is a way to accomplish what you're wanting:
    Read back the TDMS file as a digital waveform.  Then there's a conversion function in LabVIEW called DWDT Digital to Binary.  This function will convert that set of digital channels into the "port format" that you're wanting.  I've attached an example of what I mean.
    Note: When looking at this VI, there are a few things that the downgrade process did to the VI that I would not recommend for these TDMS files.  It added a 1.0 constant on the TDMS Open function, and it set "disable buffering" on the TDMS Open function to false; you can get rid of both of those constants.
    Message Edited by AndrewMc on 01-27-2010 11:21 AM
    Thanks,
    Andy McRorie
    NI R&D
    Attachments:
    digitalconvert.vi ‏13 KB

  • DAQmx configure logging (TDMS) and counter

    Hi,
    I'm trying to stream analog data jointly with counter data to one TDMS file with use of DAQmx configure logging vi. This is quite new but powerful function but I can't manage with it successfully. I'm able to acquire analog data only and display no. of counts simultaneously (attached diagram). I have no idea how attach counter data to TDMS stream as separate channel group.
    It is important for me to stream data with this VI bacause I'm sampling analog data with 95kHz per channel (PCI-6143 board).
     Could you post any ideas how to resolve this problem?
    Best regards
    Mark
    Attachments:
    acq_analog_and_contr.PNG ‏44 KB

    Eric, hear is short info about DAQmx configure logging http://zone.ni.com/devzone/cda/tut/p/id/9574.
    Yes I thought about producer/consumer structure, It is first alternative way.
    There is also another very simple way -  connecting encoder to analog input and acquire together with analog signals. Of course It will be neccasary to process sigal from encoder after recording. I'm also concerning such solution
    Ok I have to sleep with this problem  
    Best regards
    Mark

  • PXI - DAQmx tasks will not export to MAX 5.4

    I am in the process of upgrading a PXI 1050 with an 8176 to an MXI bridge. The latest headache is that the CVI program had several DAQmx (tasks) defined in MAX 3.1.1 which will not export to MAX 5.4. I have been posting these additional questions on my original thread MXI not visible in MAX. I have many tasks for installed PXI cards. I was trying to make simple tasks just defining these cards to change the errors I receive in CVI. I do not have the option to define a task for some of these cards like the 4070 DMM. I did not generate the original CVI code. I am not sure what is defined the DAQmx. Can someone provide some insight ? I have viewed the suggested videos and white paper links. They were instructive but of little help.

    Unfortunately; no updates without dollars. While we all work for the same company, we must contract work between departments. There was no defect with the software as delivered. Old age crept in to the hardware. Any upgraded hardware, it turns out,  requires updating of the software. The unit had operated reasonably well, until a couple years ago. An unfortunate selection of network security software caused massive headaches. The software chosen assumed a more advanced level of hardware. Mandatory installation on all network computers rendered these controller inoperable. Our local IT guys shaved down the install to minimal components but the controller lost all available ram to this software, NI-MAX requires 20 minutes to build it's database on reboot. The computer controllers struggle to function. They periodically get lost and require a reboot, causing 30 minutes or more to restart. This is driving a replacement. We decided that it would be more cost effective to move to a standard computer interface. With the MXI, we could have a much more friendly and versatile interface. The upgrade is with a different "color" of corporate money. There isn't enough funding to contract a software upgrade. It is feasible to complete the upgrade in house, once we can identify the players and their function. Second we need the necessary time and access to the equipment. I do not have the ability to expend too many extra hours at work. So it takes time. I have been able to piece together the following. In the development stage back in 2004 - 2005, the developers used both Traditional DAQ and DAQmx. They build tasks for the SCXI in CVI. They have toolboxes making calls to Traditional DAQ. Also at some point in time they must have used the option in 3.1.1 to Convert Traditional NI-DAQ(Legacy)Configuration to NI-DAQmx, which built all the extra DAQmx devices we see in the device tree in the MAX 3.1.1. So beyound the errors there appears to be a few red herrings, just for fun. So there is no tasks to convert from 3.1.1, everything is contained in the CVI code. I have to find a way to use the CVI debugger to lead me to the nested, buried code causing the errors, and simply correct them. Just for another layer of complexity, they are probably logic errors, not syntax errors, or updated code errors where the legacy code no longer functions with the updated drivers. Or, hey, it could be the beta version of NI-DAQ, because it is the only one working with Windows 7 (32).

  • -200428 - Modifying a channel in a predefined DAQmx task

    I was pretty sure I had done this before, but maybe not.  I have a predefined task setup in MAX spanning 3 different analog input modules on a cDAQ chasssis.
    I'm attempting to modify the thermocouple type on one of the TC channels based on configuration setup data.  So I have the task selected as a constant and feed it into a DAQmx Task node to get the Channel List.  I can see the channel list just fine and all the channels are present there, but when I attempt to break the thermocouple channel out of the array and feed it into a DAQmx Channel node, I get an Error -200428, that the value must refer to a valid task or valid virtual channels.
    Any clues?
    Solved!
    Go to Solution.

    Hey Mike,
    Can you please try it like illustrated in the attached jpg.
    Christian
    Attachments:
    hint.jpg ‏36 KB

  • Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

    I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".
    I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.
    Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?
    Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?
    Thanks in advance for any help!
    Attachments:
    pretrigger_loop_new_file.vi ‏29 KB

    I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.
    Applications/Systems/Test
    National Instruments | AWR Group

Maybe you are looking for

  • Best practice for BI-BO 4.0 data model

    Dear all, we are planning to upgrade BOXI 3.1 to BO 4.0 next year and would like to know if Best Practice exists for BI data model. We find out some general BO 4.0 presentations and it seems that enhancements and changes have been implemented: our go

  • Process instance fails to terminate.

    I start a process instance programmatically through a web service call, passing a couple of parameters to the starting instance. But then, when the last activity is completed and the end event is reached, there is a failure. As a consequence, the ins

  • Exception in dataSource lookup

    HI, I get Exception in dataSource lookup everytime in my code. How to solve this problem. I use java,tomcat and sql server ERROR [ajp-apr-8009-exec-9] 08:37:18,898 com.general.EditBean - Exception in dataSource lookup. java.sql.SQLException: Exceptio

  • Passing Parameters to an IAC Iview

    I am trying to fill in a field name for an IAC Iview. It renders the requested transaction, but doesn't fill out the field. I am using the ApplicationParameter property with an IAC Transaction iview. In the ApplicationParameter field I just have one

  • Renaming multiple files

    I just switched from a pc laptop to a mbp i7. I'd like to rename multiple jpg files but can't even figure out how to rename ONE file, let alone multiple files. Example: xxxxx.jpg to trip.jpg where all the files will be named "trip" and numbered. Make