06-28-2008 08:28 PM
06-29-2008 12:23 AM
Hi Melikan,
Right now you keep one array - the Original values. On each loop, the top array (Charted[]) is replaced with the Original array - then the last element is (possibly) modified. Maybe what you want to do is maintain two arrays - Original[] and Changed[](?) If so...
On each loop, append a value to each array. Simply append the random value to the Original array and don't modifiy if further (just wire it to shift register.) Before appending a value to Changed[], decide what value to add. You should not need to use "delete from array" and "insert into array"!
I'm very confused as to what this algorithm is accomplishing, but we can certainly simplify the code!
By the way, is this schoolwork?
Cheers!
06-29-2008 01:51 AM
Why didn't you continue the original thread ?
It is not polite to start new threads, especially with a vi of 800Kb !
06-29-2008 02:04 AM
06-29-2008 11:45 AM
Melikyan wrote:
For example every array start from 0,1,2,3,.....i-1,i..... numbers. In this program i need to compare 'i-1' and 'i' everytime.If abs([i-1]-[i])>0.3 [i] change to [i-1]; "i=i-1", other case continue ....i-1, i, i+1, ....). Please see this attached Vi and help me to find out my mistake...
06-29-2008 11:54 AM - edited 06-29-2008 11:54 AM
06-29-2008 11:57 AM - edited 06-29-2008 12:03 PM
06-29-2008 07:44 PM
Dear Veterans thank you for your help. Sorry i didn't write my problem by details and made it complicated for you.
I tried your Vis, but it doenst work like i want...
In this attached Vi i tried to write explanation and 1example for finit case. Here array size is 9,(but in real time case array size everytime extending) i put this for example, because inside of this program i tried to write what i want. I think now you fully can understand my problem.
With warm regards
Harutyun Melikyan!
06-29-2008 08:51 PM - edited 06-29-2008 08:52 PM
06-29-2008 09:07 PM
Dear Altenbach thank you so much for your help. Please see this attached Vi. I tried to make program again. When i push run, when false keeping the raw data, but if comparision true, in that case need to change last element. In this program on Changed graph first show, but after delete, and keeping exactly raw data, why? Please tell me where is my mistake? Please run example and look 1 minute after you can understand the problem. I make default the correct data, but after next element generate, this last points changes back like raw data.
Thank you!