The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 NLSF External Object script example returns Errors
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Loksley

France
18 Posts

Posted - 03/29/2009 :  05:10:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. : OriginPro8 Sr4
Operating System: Xp Sp2

Hi everybody!
I tried the example script which is provided with the NLSF External Object help command.
nlsf.func$ = ExpDecay2; 
A1 = 10; //initialize parameter values 
t1 = 1; 
x0 = 0; 
y0 = 0; 
nlsf.cleanupfitdata(); 
nlsf.fitdata$ = exp_b; 
nlsf.iterate(20); 
nlsf.xmode = 2; 
nlsf.funcx$ = exp_A; //use as X dataset 
nlsf.funccol$ = exp_Fit; //dataset to store fitted Y values 
nlsf.makecurve(func); //dataset generated for the fitted curve

I rename the Wks and the column as set in the script.
In a Book1, There is wks.name$=exp, which contains 3 columns: A, B & Fit
But when I run the script it always returns 3 errors and computes nothing:
Error1 : Error ! No Column exists. Create it first
Error2 : Error ! No exp_A Column exists. Create it first
Error3 : Error ! Parameter(s) A2, t2 is(are) not properly initialized. Check their values.

Ive check with the DLL l command that the NLSF external object was listed. It s OK.


Any ideas why I get these errors and why the script isnt executed properly?

greg

USA
1379 Posts

Posted - 03/29/2009 :  10:32:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In versions prior to 8, the Worksheet name was synonymous with the Page/Window name. For backwards compatibilty it is still true that dataset names consist of Page/WindowName_ColumnName. For single sheet workbooks there should be no compatability issues. The mechanism introduced in v5.0 for addressing Excel sheets is used for worksheets in v8 : Page/WindowName_ColumnName@SheetNumber - where 1 is not needed for the first sheet.

So just rename your Workbook (the Page name) 'exp' and your script will work.
Go to Top of Page

Loksley

France
18 Posts

Posted - 04/07/2009 :  12:54:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Greg for answering.

But it doesnt work that much! At least It suppress one error for an another:
In a workbook : exp
Two Sheet : Sheet1 and Sheet2 (active)
In the active sheet :
Col(1) : A 1024points from 1 to 200
Col(2) : B simulated curve with ExpDecay2 function :
Parameters for the simulated curve are: y0=1 ; x0=10 ; A1=100 ; t1= 5; A2=40 ; t2=50 ;
+ 2% noise.

First point: it seams that some parameters initialization A2, t2 are missing!

I run the following script:
nlsf.func$ = ExpDecay2; 
A1 = 120;
x0 =12; 
y0 = 2; ;
A2=43;
t1=7;
t2=52;
nlsf.cleanupfitdata(); 
nlsf.fitdata$ = exp_b; 
nlsf.iterate(40); 
nlsf.xmode = 2; 
nlsf.funcx$ = exp_A; 
nlsf.funccol$ = exp_Fit;
nlsf.makecurve(func);
And I get the following error :
Error ! Too few data points, or the data step is too big
???
And the script exits without computing anything.
Someone understand what is wrong?
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000