10-08-2015 10:02 AM
10-08-2015 10:17 AM
Dennis,
I guess you are write, it isn't dynamic. I thought the stripe line was. I still don't know how to input it into a logging feature. I'm about the try the TDMS logging VI to see if I can do better with that. Here is a snapshot of what I have been talking about. Pardon how condensed it is. I tried to fit it into a snapshot.
10-08-2015 12:12 PM
10-08-2015 12:33 PM
@NIerrors wrote:
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?
Sorry, I'm attending a conference, so can't always respond "quickly". Your Producer loop should consist of a DAQmx Read function that feeds its output (which should be an array of samples, so that the loop naturally "fires" at a reasonable rate, say from 1-10 times per second) directly into a Queue (to be sent to the Consumer). This means that the Producer loop has nothing else to detain it, so you can expect that it will reliably fire "on time".
Contrast this with having additional code that tries to write the data to a file inside the same loop. The writing cannot start until the data are present (obviously), so the time required before you can finish the loop and take the next sample is increased by the (possibly variable, and OS-dependent) time it takes to do the write to disk. No guarantee that you will have "an accurate time column".
There are a variety of ways you can choose to write your data to a file. Some are very fast, some embed additional "meta-data" that makes it easier to get the data back out without having to know the format of the data going in, some are inherently "human-readable" (text), others are only "machine-readable" (binary). There are a number of discussions about the pros and cons of the various LabVIEW Data Formats in the LabVIEW Help -- you can also probably find useful information by doing a Web search for LabVIEW File Formats.
Just because an NI Support Engineer suggests something doesn't mean it is the optimal method for you.
Also, you do not need 46 Create Virtual Channel functions. I haven't looked at your VI recently, but if you create a Task, you can designate the channels that the Task utilizes. For example, if you have a 32-channel Analog Input device, you can specify that you want to acquire samples from Channels 0 .. 31. The only "catch" is when you treat channels as a group this way, you need to use a single time base for all of them. Note that you can have individual scaling on a per-channel basis -- experiment with Task creation (you can do this in MAX or from the LabVIEW Project, New/Task).
Bob Schor
10-15-2015 06:46 AM
Bob,
The producer/Consumer while it looks complex, did sound very nice, but the limitation of not a constant sample rate makes it unusable for me. I never would have thought providing a time column would have been this difficult. I completely took the Write to a Measurement File VI for granted.
10-16-2015 04:27 PM
Hi NIerrors,
Just to clarify, what do you mean by "sample rate" in this case? You should still be able to sample from your DAQ cards at a constant rate, even if you are acquiring and processing data using a producer/consumer architecture.
I would also recommend reviewing the documentation on the waveform data type, if you haven't already. It seems like it should be useful for your application: http://digital.ni.com/public.nsf/allkb/B965F316364DE17B862572DF00363B10