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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 NLSF External Object script example returns Errors

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Loksley Posted - 03/29/2009 : 05:10:12 AM
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.

I’ve 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 isn’t executed properly?
2   L A T E S T    R E P L I E S    (Newest First)
Loksley Posted - 04/07/2009 : 12:54:37 PM
Thanks Greg for answering.

But it doesn’t 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?
greg Posted - 03/29/2009 : 10:32:09 AM
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.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000