LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Data From Continuous Sampling

Hello,

 

Let me start by saying that I am a new user to Labview, and would appreciate some help.

 

I am using an NI-9237 to aquire strain gage data. I am continuously sampling each channel and have waveform graphs to view the live strain data.

 

What I would like to do is press a button and have 1 second worth of data (or 100 samples for instance...) saved to a file. The idea behind this is that although I am watching the live data over the course of a test that may take 3 hours, I only want to save a small amounts of data at specific times when I press a button.

 

Can someone provide a block diagram with a suggestion as to how to do this?

 

 

 

 

 

0 Kudos
Message 1 of 7
(2,224 Views)

Hi Matthew00...,

what have you done so far? Where do you have problems?

 

Mike

0 Kudos
Message 2 of 7
(2,211 Views)

Hi Matthew00...,

attached you'll find an example how it could work for you.

 

Hope it helps.

Mike

0 Kudos
Message 3 of 7
(2,205 Views)

Hi Matthew000001,

 

Do you want to logging to file to be a fixed period of time (or number of samples) after you press the button or have it start when you press the button and stop when you press it again?

 

Thank you for choosing National Instruments.

 

Aaron Pena

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 4 of 7
(2,178 Views)

Hi Aaron,

 

 

Ideally I would like to press the button just once, and have 'x' number of samples written to a file. I would then average these samples to get my measurement.

 

During my test, there will be several times when I would like to take a reading from the strain gages, so my idea is to click the button just once each time I want to take a measurement.

 

Since I want to collect data at several different times for several different gages, I also need to add a header to the data with the an identifier that specifies the strain gage and the point at which I recorded the data. I have found some examples online that I imagine will be very helpful when it comes to adding appropriate headers.

 

Thanks in advance for any help you can provide.

 

 

 

 

 

 

0 Kudos
Message 5 of 7
(2,164 Views)

 

I would like to press the button just once, and have 'x' number of samples written to a file. I would then average these samples to get my measurement.

 

If what you want is the average, then why spend the time/space to write out the raw samples?

 

 

I would suggest doing the average first, and writing the average out to the file. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 7
(2,155 Views)

Since I want to collect data at several different times for several different gages, I also need to add a header to the data with the an identifier that specifies the strain gage and the point at which I recorded the data.

 

Consider using a Datalog file.

If you need to read the files later using a LabVIEW program (not eyeballs or C or Excel or something), then use a Datalog file.

 

You create a cluster with some info:

 

Gauge Type:  _____

Gauge Serial Number: _____

Notes:  ______

Excitation: _____

Date/Time: _____ 

#Samples: _____

Avg. Value: _____

 

Hint: Make it a TYPEDEF TypeDefs for Beginners.

 

Use a single CREATE FILE function, with that cluster, to open a file.

Use a single WRITE FILE function to write to the file, when you click the button.

Use a single CLOSE FILE function when you're done. 

 

It's just that easy when you want to read a file, too. 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 7
(2,154 Views)