10-07-2015 11:37 AM
I have always used Write to Measurement File VI. This creates a X sample rate column that my workplace has grown accustom to. My new data acquisition system is very hardware demanding, and it doesn't seem to work correctly. I switched to writing to a text file, but now I do not have a time column. I believe this is due to the conversion of Dynamic data to an array. Is there another way to log my data? Timing is critical
Hardware: 2 - USB cDAQ 9178 chassis
6 - NI9227 cards
4 - NI9229 cards
10-07-2015 12:51 PM
10-07-2015 12:58 PM
You might be asking the Wrong Question. Maybe the problem is that you are doing acquisition and data saving sequentially rather than in parallel, taking advantage of LabVIEW's Data Flow model that lets tasks (such as Acquisition and File I/O) where considerable amount of time is spent without burdening the CPU (because hardware such as disks, DMA channels, acquisition boards, etc. are handling the tasks).
Consider the Producer/Consumer Design Pattern that allows you to save data (even to a Measurement File) in parallel with DAQmx Reads. You can find a Template for this pattern by opening a new VI with File/New ... (the dots are important), then looking for the Producer/Consumer template. Get that "write data to disk" function out of the DAQ loop!
Bob Schor
10-08-2015 06:47 AM
I completely agree that using the waveform data would be better. It has all the information that I need. I just don't know how. I believe the converting from Dynamic to Array is where I lose stuff. This is my attempt to "remove the training wheels" I am not using DAQ Assistant, and this is the first time not using Write to Measurement File sub VI. Using text files just appeared to me to be the next step. I will attempt to look at producer/consumer architecture which I currently do not know what it even is :).
10-08-2015 06:51 AM
Bob,
You bring up an interesting point about gathering data in parallel rather than sequentially. Please remember I just used an example so I by no means claim that I understand what I am doing. Does this mean that I should write a separate create a channel for every channel? There will be around 46 channels. Thank you for showing me how to get to the producer/consumer template. I will look into this. Hopefully this will also explain how to gether in parallel as well. thanks for the advice, and if there is any more please advise.
the "write data to disk" was included in the loop to get continuous samples. It was suggested from NI support, and appeared to be working. Can you please elaborate on why this is bad?
10-08-2015 08:07 AM
I have another question. Won't I have to worry about synchronization using a producer/consumer architecture? Would I still be able to produce data at a constant rate with an accurate time column?
10-08-2015 08:17 AM
10-08-2015 08:34 AM
So I shouldn't use dynamic data? Dynamic data has been my problem so far. To my knowledge dynamic data stores the data, but also the channel characteristics. This is why I thought it was desirable. I don't know of any way to take that dynamic data to log though. When I log I lose the channel characteristics.
What I need is to log at a constant rate. Data needs to have channel name, time column, and data collected. What data type should I be using?
10-08-2015 08:53 AM
10-08-2015 09:45 AM
Dennis,
I am confused. I am using Daqmx 1DWfm, but it outputs dynamic data which you said to stay away from. How do I use the waveform, but have it output a different form of data?