06-17-2009 01:12 AM
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?
06-17-2009 02:42 AM
Hi Matthew00...,
what have you done so far? Where do you have problems?
Mike
06-17-2009 03:59 AM
Hi Matthew00...,
attached you'll find an example how it could work for you.
Hope it helps.
Mike
06-18-2009 10:54 AM
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
06-19-2009 12:50 AM
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.
06-19-2009 05:09 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-19-2009 05:19 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks