05-20-2009 08:22 PM
What did you check the results against? Do you have another mechanism for calculating the averages or are you calculating them by hand?
One follow-up comment regarding the code. As I indicated, it's a first crack, and it's not the most efficient, but it at least doesn't crash because of memory issues. While it may not seem too slow, there's room for improvement. One thing that can (and probably should) be done is to do something akin to what the LabVIEW memory manager does when needing to allocate more memory for a growing array. In the while loop when you read 1000 lines then one can also allocate a 1000 x 2500 array and append it to the 2D numeric array prior to feeding it into the for-loop. Then in the for-loop one would use a Replace Array Subset rather than a Build Array. You would need to keep track of where to do the replacing.
05-20-2009 09:16 PM
OK. Found the problem. In my haste in writing the VI I made a dumb mathematics mistake in calculating the average which I spotted when I looked at the VI again. I'm always dividing by 2 which is incorrect since you can't get a new average by simply adding a number to the previous average and dividing by 2. One also needs to keep track of the running count of how many values were used to get the current average. To get the new average it's the ((old_average X previous_count) + new_value) / new_count, where new_count = previous_count + 1.
The attached should provide correct averages.
05-20-2009 10:40 PM
that is great smercurio, i can try to improve things now and make it more tuned to my application.
Best wishes,
M.
05-20-2009 10:41 PM
02-02-2010 07:45 PM
I'm Melvin Koshy a PG student. I'd like to know whether LABVIE can provide soft starting of Induction Motor. Please specify the hardware associated with such an experiment.
Melvin
02-02-2010 08:10 PM
Blondel wrote:I'm Melvin Koshy a PG student. I'd like to know whether LABVIE can provide soft starting of Induction Motor. Please specify the hardware associated with such an experiment.
Melvin
Please create a new post for your question - do not hijack a completely unrelated thread.