12-28-2009 08:32 AM
Hi everyone! I have a problem with my vi: As I checked the vi, I found that it seems to "slow down" as the vi runs..I mean, the first measures goes as fast as 58 measures per second, +-30 seconds later it runs at 32 measures per second (this is with time between loops 0 ms-the fastest to measure-, delay before read 10 ms. I read some posts similar to this, and it seamed to be solved with time delay in the loops, even though I already have, I tried giving the loops more time, but it takes less measurements at first and similar measurements 30 sec later (I took the 30 sec just to compare)
1. What may be causing this problem? Is it the cases? The buffer? The shift register? The VISA close function? I don´t really know if this can make a vi slower.Ii tried deleting one of this at the time, and even though with some combinations run faster (more measurements per sec) , the problem remains (less measurements every second)... 2. Is it any way to run the vi faster? With 9600 bauds y should be able to collect +-180 measures per second.Instead I can only take +-60 measures per second....what should I consider when I´m programming, so a can take all the measures I can?
I attach my vi, if someone can take a look at it....Thank´s a lot!! |
12-28-2009 09:28 AM
Which one of the VIs you use is your 'VI'?
I see that you have file IO (write to disc) in your VI, try to remove this element and see if the speed improves.
Ton
12-28-2009 09:35 AM
12-28-2009 10:50 AM
You process massive amouts of data with each iteration:
All you probably need is a plain chart and three scalar shift registers (or a shift register with a size=3 array) to do the same statistics.
Would it be sufficient to do keep only the last x values in a table?
01-25-2010 07:45 AM
Hello Ton! How are you? Sorry for the delay of my response, but it´s been crazy the past few weeks, a lot of emergencies at work, plus every time I had the chance to get in the forum, I could´nt reply, some kind of problem with the page I think...
I checked the Example v2.1, and the only I/O I found is the VISA resource name, I could not find anything else, if there is, it might be one of my millions intends to improve the program, but it should not be wired to anything..Anyway if you want to try this VI should work fine....
Thanks Ton for your interest, I appreciate your help...
Cheers!
01-25-2010 08:12 AM
Dear JM! No worries, I had some problems of my own (as I said before) and I could not reply, I been checking what you send me..
I need both, the table, because that way I can check if something is wrong with the information taken, and the wave form graph, for the same reason, with this one I can see very quickly the variations in the measurements...
If I got it right, without this two the VI would be quicker, but it seems to me that it still going slower as it runs, what I really need is to be stable in time, this way I ensure that it im taken the same amount of measurements every "XX" mseg...
I tried the simplest example, basic serial write and read example, with a loop that sends the "M" letter every "XX" Mseg, and read just one string, and is really stable, but as soon as I ask the VI to cumulate the measurements it stars to get slower...Some kind of problem with the shift register solution???
JM, thanks for helping me so much, you´ve been really helpful since the beginning!
01-25-2010 08:27 AM
Altenbach! How are You? You´re right, there´s no need to retain 100000 samples, because what I need is to take measurements during one lap, the slower lap can´t be longer than 1 min, if I take 100 measurements per second, I should take 6000 measurements, I tried with this, and even though it is faster at the beginning, it´s still slowing down...
So basically I need to start the measurements, to take this measurements every (for example) 20mseg (all of them) so I can check what is the mean the max and min distance, I thought it would be easy at first, since the idea is pretty basic, but obviously is not, ja! For example I have no idea How to try
All You probably need is a plain chart and three scalar shift registers (or a shift register with a size=3 array) to do the same statistics.
About your question, I need all the measurements taken during the lap...
Would it be sufficient to do keep only the last x values in a table?
Thanks for your suggestion, if You could give me a few tips on How to do it I can try it...(As I said this is my first use go NI)
Cheers!