11-05-2008 07:19 AM
Hi there!
I'm desperately trying to get just one mean value out of one row of numbers in a spreadsheet file and write it to a text file when I'm pushing the button.
The process himself works pretty fine, but it alway writes many numbers at once down, and I need only one single mean value of these numbers.
I already tried different loops and mean.vi's but it's alway the same: way too much values.
So I hope someone can help me with this, because I'm already trying since two days...
11-05-2008 08:19 AM
Hi once again,
I think the problem is the timing of the button I use to activate the case-loop. If i adjust is as latch when pressed, no data is written. And if I adjust it as latch when released, too much data is written. With a timer activating the case-loop, also nothing is written down.
So, is it possible to adjust the timing of a button or the timing of the case-loop? Because I think I can solve this problem through adjusting the time, so it can write down just value.
best,
philsen
11-05-2008 08:51 AM
11-05-2008 09:01 AM
11-05-2008 09:47 AM
Hi!
first of all, thanks for your reply, because I was already despairing!
Currently I'm working with the event-loop. It's really not simple, but I think I can handle it.
I'm a newbie, and this is why I didn't post my whole vi. But if it's possibly helpful, I'll attach it now.
Do I need the Register for Event.vi to activate the event-loop with the Create Mean Button? Because now my whole program isn't working properly...
thanks in advance,
philsen
11-05-2008 10:09 AM
You have several problems with your VI, most of which stem from not understanding dataflow programming. Note that all of this can be found out if you simply run the code with highlight turned on.
11-06-2008 03:32 AM
thanks smercurio for you'r detailed answer!
1. the purpose of the string concatenation in the bottom left is, that with this I'm writing the header of the final file I want to get. The vi get's every half second a value, writes it down, and when the Create Measure Button is pressed, the mean value of these values is written into the final file. Later on there will be the time added with every push of the button.
2. I know the solution with te paths isn't the best, but at the moment it's working... and maybe I can handle the problem with path1 also with an event-structure
3. This Create Mean action is intended to work as a single operation every time I push the button. And this will be several times, but in undefined time intervals. So I think using the button as a latch should be appropriate.
right now I'm figuring out how the use the event structure correctly, but maybe later I will have some further questions... But first of all I'm very grateful for your help, because I think it was the hint I didn't have!