06-13-2014 08:31 AM
Hi,
VI attached.
I am using a CSV file with data collected from a load cell. In some of my data, the peak occurs and this is the peak I want to collect. However, in some data, a peak occurs, and then there is a secondary peak, which is higher than the original peak. The original peak is what I need to use to calculate things. Is there a way to selectively choose which peak to record? Or to do some post-hoc analysis/editing after identifying the data which needs to be analysed differently.
Any thoughts would be greatly appreciated.
06-13-2014 08:43 AM
There is a way to do what you want, but first you need to cleanup what is there:
Mike...
06-13-2014 05:12 PM
In addition to Mike's good advice there are several othre things you may need to consider:
1. The file path control on the front panel should be set to allow selection of folders. Look at the Browse Options in the control properties.
2. Search 1D Array will return a useful result only if it gets an exact match. A value of 1e-15 is clsoe to zero and might display that way depending on the display setting but Search will not find it because it is not exactly zero. Threshold 1D Array might be a better choice, although it has its limiations as well. Without seeing your data it is impossible to recommend an approach which will always work.
3. Use Index Array (expanded to three outputs) rather than 3 Delete from Array functions.
4. Move the Write to Spreadsheet File.vi which writes the header outside the loop. There is no need to write the same data N times. With the append to file? input at the default (false) the VI will overwrite the existing file.
5. You can just wire the zero constant to the outputs of the case structure which selects the peak force. No need to multiply by zero.
I do not see anything which looks like an attempt to select the peak. What have you tried? What are the characterstics which define the peak to use? Computers are fast but not too smart. You need to be able to define precisely which peak to use if you want to automate the process.
Please post a typical data file (or a reduced file if the regular files are large). Tell us how many peaks it has and which ones are teh ones you want to measure.
Lynn
06-13-2014 08:46 PM
Thanks for the help so far. I am fairly new to labview.
here is a sample of the data. I need the peak before the valley occurs at the top of the data. not the max value which occurs after the valley
06-14-2014 12:01 PM
Here are the contents of the file you posted:
File name,LL RTD,RL RTD
RTD analysis.csv,Rejected,Rejected
Lynn
06-14-2014 05:59 PM
06-14-2014 07:05 PM
I hate programs which overwrite files without warning.
When I went back to the orginal file, it does have data. This is what I see near the rising edges:
Where is the peak you want to analyze? In the LL force trace the largest peak is the first peak. In the RL force trace it looks like you have some ringing on the rising edge and it it not at all clear what chould be considered the peak. Although not exact the LL force trace looks like the derivative of the RL trace. Is that a reasonable expectation based on the physics of your system?
What is the physical phenomenon you are trying to measure and how does it relate to the choice of peak?
Lynn