05-19-2008 10:40 AM - edited 05-19-2008 10:42 AM
05-19-2008 10:45 AM
05-19-2008 01:07 PM
05-20-2008 03:34 AM - edited 05-20-2008 03:39 AM
Thank you smercurio_fc and Mike!
To smercurio_fc: I tried to use a for loop around my whole code, but I can not get more than one reading, so maybe I need to try the while loop which you recommended.
To Mike: Sorry for no reply your messages as I have a lot of stuff to handle these days. and now I'm gonna be OK! Thank you again!
I need to run the whole VI several times to get the different values and then to get the average value. See the attached picture please, These two are the measurement values from which I need the average.
and after I get the different values in several files, How can I get the sum of every measurement and further to get the average value of the whole measurement?
Thank you for any help!
Jing
05-20-2008 04:13 AM - edited 05-20-2008 04:14 AM
05-20-2008 04:39 AM
Mike
You didn't get what I mean, sorry for misunderstanding! the two write fuction files are the files which I want to get the average value, you can see my original VI, there are 4 write function files, please notice the number of files, I only need the average value of "WRITE TO MEASUREMENT FILE" and "WRITE TO MEASUREMENT FILE4"
Every time I run my VI, it can generate a data file in the path of which "WRITE TO MEASUREMENT FILE4" defined, also in "WRITE TO MEASUREMENT FILE". and if I run my VI again, it can generate a new data file in the same path of which these two write function files difined. So if I run my VI in several times, then I can get several data files in the same path of these two write function files.
Now I need to avoid the noise of the data values, so I need to get the average value. for example in the path of "WRITE TO MEASUREMENT FILE4" defined, now in this path, I have several files corresponding to the times I run my VI. now I want to get the sum of the whole values in this path, and then divide the number of files which I already got, then I can get the average value.
That is what I mean, sorry for misunderstanding, Do u have some idea? how to get the average value in this way?
Jing
05-20-2008 04:53 AM
Hi Jing,
here is an example, like i understand what you need. It read all files from the specified folder and calculates an average of the arrays.
Hope it helps. ![]()
Mike
05-20-2008 06:16 AM
05-20-2008 08:19 AM
WOW! Mike
I tried your method just now, This is really a good method.
Danke Schön !!!
Jing
05-21-2008 04:07 AM
Hi Mike
First I need to state I made a mistake yesterday, the average value I want to get is not in the ""WRITE TO MEASUREMENT FILE" but in the "WRITE TO MEASUREMENT FILE2" of my original VI.
I need to get the diagram of the average value to further analyze, so I need the X and Y information of the average value. the VI you gave me yesterday can get the average value for both "WRITE TO MEASUREMENT FILE" and "WRITE TO MEASUREMENT FILE2". The first data file from the "READ FROM MEASUREMENT FILE" have 2 channels corresponding to X and Y information, but the second data file from the "READ FROM MEASUREMENT FILE" have only 1 channel, only corresponding to Y information.
The strange thing is thses two data files look same, I put them into attached file, you can check. The difference between thses two is that the second data file is the FFT transformation of the first one. I also put the "configure write to measurement file" and show the differences for these two, Do you have some idea why I lost the X information for the FFT transformation and how to handle it?
Thank you for any help!
Jing