LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which file format to choose for writting numerical data into file? Either "Text" or "xlsx"

Solved!
Go to solution

Hello,

 

I have an application where I want to acquire analog input data with NI USB 6352 DAQ; at  sampling rate of 50 ksamples/second, using 8 analog input channels of NI USB 6352 DAQ and I have to display that data on a single Chart and at the same time I have to save that  data into file for future record and analysis.

 

My questions are:      1.    Which file format would be most efficient and suitable for this application? either text or xlsx.

                                   2.    Which preferred execution system to select?  from the category of Execution.

                                   3.    What priority should be set? either normal or time critical.

 

Regards

 

0 Kudos
Message 1 of 10
(3,772 Views)
How about tdms? You can configure a DAQmx acquisition to directly write to a tdms file. With the Excel add-on, you can import it. It's a binary format so much smaller file sizes than either text or native Excel format. At that rate, you probably don't even need to mess around with priority or execution system. A critical point to consider it's how long the acquisition will run. That determines the size of the file. You might need to write to several files to have something reasonable to manage.
0 Kudos
Message 2 of 10
(3,761 Views)

You definitely want a Producer/Consumer design, with the 50KHz acquisition (in large "chunks", say at least 1000 samples) in the Producer loop, sending it (via a Queue) to the Consumer which (a) saves it (I agree that both Excel and Text formats are not what you want for this sort of data -- I haven't used TDMS, myself, but I suspect this will serve you well when you go to get the data back out) and (b) plotting on a Chart.  Note that you do not want to plot all of the points (you can't "see" 50K points/second) -- if, however, you plotted the average of those 1000 samples (easy and quick to compute), you would be updating your chart at 50 Hz, which is not too unreasonable.

 

Bob Schor

0 Kudos
Message 3 of 10
(3,746 Views)
If you use the built in tdms logging, it is not a producer/consumer design. It's configured with DAQmx functions and you don't pass the data via a queue.
0 Kudos
Message 4 of 10
(3,730 Views)

I'm in full agreement with Dennis here.  Use the DAQmx Configure Logging to have DAQmx stream the data straight to a TDMS file.  Makes the programming A LOT simpler.  In fact, you can almost go with just the Analog Input example in the LabVIEW Example Finder (Help->Find Examples).

 

When you install LabVIEW, it should come with a TDMS plugin for Excel.  So you can look at your data in Excel still if you so desire.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 10
(3,725 Views)

 

1. I have to acquire and write data into file for 30 minutes continuously.  I am using LabVIEW 2013 (64 bit) with Windows 8.1 OS.

2. I have to perform post data acquisition analysis into Matlab or Tecplot.

3. I have to update chart every second and I have to keep 5 seconds data display continuously onto chart.

 

I couldn't find "DAQmx data streaming" into "Help--->Find Examples". Could you plz upload a snippet or link to that example? so that I could see how to configure DAQmx data streaming.

 

Regards

0 Kudos
Message 6 of 10
(3,677 Views)

"Voltage - Continuous Input" is the example you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 10
(3,652 Views)

 

I could not find this example "Voltage - Continuous Input" into LabVIEW examples. Could you pls refer the path or just upload VI of that example?

 

Regards

 

Jamal

 

0 Kudos
Message 8 of 10
(3,538 Views)

Jamal,

     Nowhere in the earlier Posts do you show your code, nor do you tell us what version of LabVIEW you are using.  I opened LabVIEW 2015, clicked on Help, Find Examples, did a search on the word Voltage, and chose Voltage - Continuous Input.

 

     Right between the DAQmx Timing and the DAQmx Start Trigger and Start Task functions is the following function (I created the Task control to avoid a broken wire in the Snippet):

DAQmx Logging.png

Hope this helps.

 

Bob Schor

Message 9 of 10
(3,522 Views)
Solution
Accepted by Mr_Engineer

Jamal_IE wrote:  I could not find this example "Voltage - Continuous Input" into LabVIEW examples. Could you pls refer the path or just upload VI of that example?

Either you do not have DAQmx installed for your version of LabVIEW or you just did not do a proper search.  It is right there for me.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 10
(3,510 Views)