T O P I C R E V I E W |
tbarrou |
Posted - 02/01/2013 : 06:27:48 AM Origin Ver. and Service Release (Select Help-->About Origin): 9 SR1 Operating System:W7
Hi, I made a template workbook that contains four sheets and some analysis with automatic recalculation selected. - The first sheet is measurement with no formula (no X axes, time define by interval) - The second sheet contains : a "set column value formula" on first column (set as X) that uses reference to xinit and xinc of one column of the first sheet. It also contains statistic on rows. Both calculations are set in automatic mode. - The third sheet contains results of FFT performed on data of sheet 2. - The fourth sheet contains results of FFT performed on data of sheet 1.
when I udpdate the data in sheet 1 : -the first column of of sheet 2 is not recalculated. the statistic on row are. -the FFT of sheet 3 is recalculated but with wrong frequencies as sheet2!col(1) is blank... -the FFT on sheet 4 is correctly recalculated.
When I force manually recalculation of sheet2!col1, the FFT of sheet 3 is not updated... I tried again and again to selected auto mode for calculation in "set column value", but I didn't succeed. when I reopen, It is still set to "none".
would you have an idea of what can be wrong and what could I check ?
Thanks a lot
|
8 L A T E S T R E P L I E S (Newest First) |
easwar |
Posted - 02/11/2013 : 10:35:48 AM Hi Thomas,
Thank you for uploading, let me look at it and try change the script, I will e-mail it back to you.
Easwar
P.S. I have sent you a modified OGW by e-mail |
tbarrou |
Posted - 02/11/2013 : 08:05:42 AM Hi Easwar,
I made the change and it did trigger the calculation of the FFT. I changed the variable type for "real" because this is the type of column and I thought that the data type difference could be the cause for not functioning. sorry for
However, another issue arose. The column of initial data chosen for reading and writing one value (col B in this example) is replaced by zeros on the full range...
I uploaded the files (source book, destination book, script) with filename ending with *_Topic18274.
sorry for this non-ending issue.
Thanks |
easwar |
Posted - 02/08/2013 : 8:31:17 PM Hi Thomas,
Thank you for uploading the OGW.
In the set values formula for the 1st column of the 2nd sheet, I see two errors:
1> You are using data type "real" which does not exist in LabTalk, need to change to "double". 2> You have two lines in the formula edit box, the 2nd line has to be moved into the Before Formula Scripts edit box.
So your formula box at the top should have just one line:
{xinit:xinc:xfinal};
and the Before Formula Scripts box should be:
range r1 = Mesures!C15;
double djunk=r1[2];
double xinit=r1.xinit; // get init time metadata
double xinc=r1.xinc; // get increment time metadata
int nrows=r1.getsize(); // get number of rows
double xfinal=xinit+xinc*(nrows-1); // compute final time
range r2 = Mesures!B;
double toto= r2[1];
r2[1]=toto;
With these changes I am able to turn on the auto update lock.
Now, I don't have your data files, so can you make this change and import new data and see if everything updates correctly? If it does not, please upload a few data files and post again, and I can check again.
Easwar OriginLab
|
tbarrou |
Posted - 02/08/2013 : 05:47:59 AM Hi,
I tried and don't succeed... I do not understand why and I am about to give up. I will upload the last version of the workbook (I already uploaded the project last week for shirley_GZ)
Thanks |
easwar |
Posted - 02/07/2013 : 2:32:59 PM Hi Thomas,
The FFT tool reads the X data to get the sampling interval, but later if only the X column is changed, the operation does not realize this change, so the FFT result does not get updated. The operation goes back and looks at the X again only when the Y also is changed.
This is something we need to fix, thank you for reporting this issue.
In the meantime you could use the following workaround:
In the 2nd sheet, in the 1st column where you are computing the time, add the following lines at the end, which simply reads and writes back some y value in the 1st data sheet:
// read and write back the raw y data
range r2=1!2;
double dd = r2[1];
r2[1] = dd;
This will then trigger the other operation that fills the y values in the 2nd sheet again, and then the FFT output should catch up.
If it is okay for you to share your OPJ, please send to us using the "Send file to tech support" link on top right of this page so we can look at your particular set of operations and see if there is a better workaround.
Easwar OriginLab |
tbarrou |
Posted - 02/07/2013 : 1:53:47 PM Hi, it makes sense. I tried just adding " double djunk=r1[2]" in the before formula section. It worked, the calculation is triggered when importing data. However, the fft that uses this column is calculated before the time column has been updated, resulting in wrong frequencies.
Is it a way to define the order of the automatic calculations within a workbook ?
thanks a lot for your help.
Thomas |
easwar |
Posted - 02/07/2013 : 12:32:53 PM Hi tbarrou,
This is because currently the change in a metadata property of the column does not trigger auto update of other dependent columns.
To get around this issue you could do the following: Just refer to one of the cell values of the source column in your before formula script, even if you don't use it. This will allow the auto update to be set up.
So for example, in the 1st column of the 2nd sheet, you can enter the following for formula:
{xinit:xinc:xfinal}
and the following for Before formula script:
range r1=1!1; // point to col 1 of sheet 1
double djunk=r1[1]; // just refer to a data cell value
double xinit=r1.xinit; // get init time metadata
double xinc=r1.xinc; // get increment time metadata
int nrows=r1.getsize(); // get number of rows
double xfinal=xinit+xinc*(nrows-1); // compute final time
Because the before formula script is referring to a data cell value of the 1st col of 1st sheet, it will then set up the auto update.
Does this solve your problem?
Easwar OriginLab
|
Shirley_GZ |
Posted - 02/04/2013 : 05:12:49 AM Hi Tbarrou,
Please send us the project file and quote this post in the message
http://www.originlab.com/index.aspx?go=Support/SendFilestoSupport
Originlab Technical Service Team |
|
|