12-21-2010 02:19 PM - edited 12-21-2010 02:26 PM
I could really use some help. I have been attempting to perform Rainflow Analysis some data files but I am having trouble. The files are around 40Mb, so I need to read it in small chunks and analyze the chunks, then combine the analysis data to come up with one rainflow cluster per channel.
Basically when the rainflow VI runs, it outputs 3 arrays. Two of them are 1D settings arrays that never change (Mean vector, Avg vector). The third is a 2D array with each value representing how many peaks or dips have occurred in the signal within a certain range. Without mixing up the data from each channel, I need to sum up the matrices to end up with one single 2D array of counts for each channel for the whole file. I have bundled the 3 arrays for each channel to help me keep the channels straight.
Because of its internal shift register, the rainflow analysis vi will continue summing up all the values you send to it in each iteration of the loop (outputting the updated arrays) until you manually reset the values with the 'init' input. This is why you will see i grab the last row from the first loop, because it should be the sum of all 500 rows for that channel.
Summing up a bunch of 2D arrays seems unbelievably simple but somehow I am messing this up. I keep ending up with a completely empty 'counts' array for each channel at the end of my process and I have to be doing something simple. If you guys could please help me I would be most grateful.
For those of you unfamiliar with the "Rainflow Analysis.vi" of the Fatigue Analysis Package, you can download the Fatigue Analysis Package here. It's not very big but you will probably need it to help me.
As far as coding style goes, I have pulled everything out of subVIs except one to make it easier for you to help.
The zip file contains Rainflow from file.vi and the unit conversion subvi. It also contains a small data file that's about 3.5 mb for you to play with.The data is 12 channels of strain data (the convert values vi eliminates the irrelevant time column). You should be able to use the default rainflow class info settings i have set.
Any help would be greatly appreciated. Once again, you need to download and install the small Fatigue Analysis Package.
12-21-2010 03:03 PM
I am done for the day so can only mention in passing that 2D arrays often bite me since they want to have the same number of elements in all rows etc. That 2d array may be getting padded out because one of the arrays is longer the others.
Take care,
Ben
12-21-2010 03:07 PM
Are you trying to add upp all Counts or for each channel? If so you can just let the Count build up a 4d Array and use a Add Array Elements.
/Y
12-22-2010 10:37 AM - edited 12-22-2010 10:39 AM
It looks like there is a "Ratio to Microstrain.vi . VI that isnt pointing to its location in the labview examples so I have attached it here. Sorry about that.
Ben - I am not sure where the arrays are being padded or why.
Y - I used clusters because 4-D arrays make my head explode. Clusters made more sense to me to keep all the results together from each analysis iteration.
I still haven't found a solution yet. Thanks for the ideas so far.
12-22-2010 01:44 PM
@rex1030 wrote:
It looks like there is a "Ratio to Microstrain.vi . VI that isnt pointing to its location in the labview examples so I have attached it here. Sorry about that.
Ben - I am not sure where the arrays are being padded or why.
Y - I used clusters because 4-D arrays make my head explode. Clusters made more sense to me to keep all the results together from each analysis iteration.
I still haven't found a solution yet. Thanks for the ideas so far.
Where you try to add up the number, you pull out a 2D array of Count. Just connect it through autoindex through the 2 loops. That way you'll have a 4D array which you can use AddArrayElement primitive. I think your test data gave 567ish as result. 🙂
/Y
12-22-2010 01:59 PM - edited 12-22-2010 02:04 PM
Do you think you could attach a modified vi of what you mean? Keep in mind I want to keep the data for each channel separate and end up with a single counts array for each channel. If it was in cluster form like that I should end up with a 1D array of 12 elements, each containing the two vectors and a 2-D counts array for that channel. The mean and amp vectors need to say with the channels because they will actually be unique for each channel when I actually implement it. I will have individual rainflow "class info" settings for each channel, but I haven't implemented that yet for simplicity.
12-29-2010 12:55 AM - edited 12-29-2010 12:59 AM
Hi Rex,
Have had a look at your vi and although at first i was a bit confused about what you wanted i think i understand. If i am right you want to analyse each channel in small chunks. Then add each of these small chunks together outputting a 1D array holding each channels accumulated data. If this is correct then the attached should help.
Not sure what version of labview you have so have attached an image above also so you can draw it yourself if need be. In the False statement of the case structure i just pass the output array from the rainflow loop and also pass a 'False' boolean constant out. If i have misunderstood let me know and i will have another look for you.
Regards,
Lucither
01-13-2011 01:16 PM
Lucither, thank you so much! That VI works very well. I see what I was doing wrong now as well. Thanks for your hard work and good presentation of your code with all the helpful comments everywhere. I can't thank you enough.
I now need to be able to read in the rainflow results from multiple files and combine them. So I have a list of files rather than just one. Each file is an hours worth of data, but I want to combine rainflow results from all the hour files in a day, week, or month.
01-14-2011 02:53 AM
Hi Rex,
I have attached another vi that allows you to read in data from a single or multiple files. It also has a reset input. If set to false then you can call this vi multiple times, each time adding data to the last read. To create new data, set it to true:
I have also attached a small example file based on the event structure you originally had. You will see that if you have the reset set to false every time you read another file it will add to the previous compiled data. If set to True it will restart.
Rgs,
Lucither.