06-23-2010 05:25 AM
Hello,
I'm try to change array size dinamically.
I do a calibration of an instrument and from time to time I read 3 parameters and try write to an empty array (not zeroed), and caclulate interpolation polinom according to my measured data,
The array must be empty because I use the same array as input to calibration procedure and it can not contain the zero but only measured values and it grow as my measurement flows.
I hope that my question is clear,
Regards,
Sasa
Solved! Go to Solution.
06-23-2010 06:06 AM
Hi
What problem you are facing?
According to your question is the array not becoming clear every time?
Please state all the aspects
06-23-2010 06:17 AM
Hi Sasa,
your question ins't clear at all...
You read 3 parameters. That is fine. But how do you write to an empty array?
Why do you need an empty array "as input to calibration procedure"? When it is empty why should it contain "zero" values?
Why does it grow when you "write to the array"?
Please explain in more detail and attach a (sample) VI!
06-23-2010 07:19 AM
Thanks for very fast reply.
how do I write to an empty array ?
Nohow, but I would like to do it. I will try to explain.
My calibration procudure accept X , Y , Z, (never equal to zero ) and calculate interpolation polinom as function Z=f(X,Y).
The array should contain those three values many times and the rest should be empty. I the rest of array is not empty e.g equal to zero because previous initialization then the calibration procedure will take this value and calculate bad function.
One way is to eliminate/delete zero values/row from 2D array and i'm trying that now.
The better would be that during my measurement I collect data X,Y, Z, in this way.
1. measurement . array=x1, y1, z1
2.meas array=x1, y1, z1
x2, y2, z2
3.meas array=x1, y1, z1
x2, y2, z2
x3, y3, z3
and so....
As you ca see during my meas. the array grow and keep history.
As my measurement continue I get more value and more precious interpolation polynom and I can decide on fly which point I should measure again to be even better. I know that array must/should be initialized before becuse of memory allocation but I dont wont to be filled with zero eg it can not be as
array=x1, y1, z1
x2, y2, z2
0, 0, 0
I atach vi, not to much useful
Thanks in advance
Sasa
06-23-2010 07:35 AM
Hi Sasa,
two possible solutions come to my mind:
1) Use BuildArray to "grow" your array of measurement points. Add only "non-zero" points to the array...
2) Search the forum for threads on "delete elements from array", you will find something like this...
06-23-2010 09:01 AM
sasko wrote:I atach vi, not to much useful
A few comments to your VI.
06-24-2010 02:41 AM
Thank you altenbach for sugestions,
I do agree that I should use a shift register, only my final program will use case structure. also latch actions can not be inside of event.
please find attached a screen
thanks again
S
06-24-2010 09:24 AM
sasko wrote:I do agree that I should use a shift register, only my final program will use case structure. also latch actions can not be inside of event.
Noooo. This is all wrong! Never hide an event structure inside a case structure. Why do you even need the event structure? There is a 0 ms timeout so it will execute the same event case as if "save data" has been pressed. Are there other event cases?
I would strongly recommend to re-think your code once more. There are a lot of useless constructs. Can you attach the VI instead of a picture?
06-24-2010 09:51 AM
Hello altenbach
Yes , it was another event connected with "highest order" but I give up and did not remove event structure.
I attach main VI, the whole project is much bigger
Regards
S
06-24-2010 10:01 AM
Hi Sasa,
I was interested to help on your problem - but that interest went drastically down after opening your VI...
That is just a bunch of local variables, wires crossing left and right, numerous stacked structures - and all of that several times the size of my notebook screen. No way...