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
 Forum for Origin C
 PasteToPlot & PasteToScript

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
zangyef Posted - 03/06/2006 : 11:06:12 AM
Origin Version (6):
Operating System: Win XP

Hi everyone,
I'm writing some scripts associated to a user defined buttons in order to save time in a series of repetitive action.
One of this consist of a nlsf procedure. The script I wrote is the following:

nlsf.Begin();
nlsf.Init();
nlsf.PasteToPlot=1; \\do not work!
nlsf.PasteToPlot=0; \\do not work!
nlsf.Func$="Log3P1";
nlsf.fitData$="originaldata_D";
nlsf.p1=40;
nlsf.p2=-4;
nlsf.p3=300;
nlsf.v1=1;
nlsf.v2=1;
nlsf.v3=1;
nlsf.Iterate(100);
nlsf.funcx$="originaldata_A";
nlsf.funcCol$="originaldata_I";
nlsf.xBegin=1;
nlsf.xEnd=originaldata!wks.nRows;
nlsf.xPoints = (nlsf.xEnd)-(nlsf.xBegin);
nlsf.xMode=0;
nlsf.makecurve(func);
nlsf.End();
nlsf.unInit();
originaldata!wks.addcol(I);
originaldata!wks.col9.label$="baseline";
copy NLSF1_B originaldata_I;
window -c NLSF1;

The script works well if pastetoplot and pastetoscript doesn't appear but if i add that instruction some the script doesn't work or work improperly (the error "NLSF.PASTETOSCRIPT is an illegal name for defining a variable. It must not start with a number, nor an operator and may not contain a dot." appear, showing that origin interpret it as a user defined variable). Why? Any suggestion is appreciated. Thank you
7   L A T E S T    R E P L I E S    (Newest First)
aeolian1 Posted - 10/30/2013 : 2:03:40 PM
Hello,

I am using the nlsf functions in LabTalk (9.0.0, SR2) since I cannot get the nlbegin/nlfit/nlend functions to work (the X-functions either insist on fitting columns different from those which I specify in a range or give crazy results). My code is now complete and the fitting works just fine. It is done in a loop; one plot is generated for each pass (~50 in all). One small detail is missing, however: I can't get the fitted parameters to paste to the plots. Within the loop, I have tried

1. nlsf.pasteToPlot = 1;
2. nlsf.pasteToPlot = 2;
3. NLSF.PasteParams("P");

but none of these work. Could you please provide another tip? Thank you.

P.S. The "meat" within the for loop looks like

nlsf.begin();
nlsf.init();
nlsf.cleanUpFitData();
...
nlsf.iterate(100);
nlsf.makecurve(func);
** HERE I TRY TO PASTE THE PARAMS TO THE PLOT **
nlsf.unInit();
nlsf.end();
zangyef Posted - 03/08/2006 : 02:59:31 AM
Thanks Myke, strange beasts these softwares (as we say in Italy!)
Mike Buess Posted - 03/07/2006 : 11:20:51 AM
I was afraid you were going to ask that. Somehow NLSF changes the value to 1 after you set it. And if you set to 1 NLSF changes it to 0 which explains why your original script did not work. Try this...

nlsf.PasteToPlot=2;
nlsf.PasteToPlot=; // ask for its value
NLSF.PASTETOPLOT=1

nlsf.PasteToPlot=1;
nlsf.PasteToPlot=;
NLSF.PASTETOPLOT=0

nlsf.PasteToPlot=0;
nlsf.PasteToPlot=;
NLSF.PASTETOPLOT=0

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/07/2006 11:27:50 AM
zangyef Posted - 03/07/2006 : 10:32:05 AM
Thanks a lot, Myke. Now all works well!
But, if I may ask.., why 2 instead of 1? What is the action of 1?
Thanks again!
Mike Buess Posted - 03/07/2006 : 09:05:32 AM
Try nlsf.PasteToPlot=2.

Mike Buess
Origin WebRing Member
zangyef Posted - 03/07/2006 : 03:22:20 AM
Thank you very much Mike. It's an error in the LabTalk Help file. Now the script works well with the property PasteToLog (I set it to 0), but with PasteToPlot nothing happens: I set it to 1 but the log was not paste to graph. Why??
Mike Buess Posted - 03/06/2006 : 11:39:23 AM
There is no nlsf.pastetoscript property, hence the error. You might try nlsf.pastetolog which presumably sends results to the Results log. nlsf.pastetoplot should not give you a problem because it is a valid property which is set to 1 by default.

...Now I see where you got pastetoscript. It was an NLSF property in Origin 5.0 (which does not have a Results log) but was replaced by pastetolog in Origin 6.0 (which does have Results log).

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/06/2006 5:26:57 PM

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