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
 Origin Forum
 Programm not executeable since update to 8.6
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JulesOZ

18 Posts

Posted - 03/25/2013 :  9:29:23 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Pro 8.6
Operating System: Win7

I just updated Origin from 8.0 to 8.6 and tried running a program through the command window, which was working fine in the 8.0 version. I used the same data file that I used under 8.0 as well.
I copy the script into the command window and hit enter and nothing happens. No output, no errors, no data generated.
Does anyone have an idea what I have missed?

Here is the code:
//This programm loops through all workbooks and worksheets of the active folder and performs a two-peak Gauss fit on the data.

doc -ef W {

int numWKB = page.nLayers;
int k=1;
int j;
string Bname$ = page.name$;

j=Bname.Find("parameter"); //check if the active workbook is one of the newly generated parameter books
if(j!=0)
{}

else
{
type %(Bname$) has $(numWKB) Worksheets;

//type "Window: %H, layer number: $(page.active)";

string colA$;
string colB$;
string colFit$;


for(k=1; k<=numWKB; k++) // loop through the worksheets of one workbook
{

work -v Fit; // check if worksheet has a column named "Fit", if not it will be created



type "count $(k)";
if(k < 2)
{
colA$ = Bname$+"_A";
colB$ = Bname$+"_B";
colFit$ = Bname$+"_Fit";

}

else
{
string sIndex$ = $(k);
colA$ = Bname$+"_A@"+sIndex$;
colB$ = Bname$+"_B@"+sIndex$;
colFit$ = Bname$+"_Fit@"+sIndex$;

}





nlsf.func$ = gauss;
nlsf.numReplica = 1;
nlsf.cleanupfitdata();

nlsf.fitdata$ = colB$; //defines column used as y values
y0=500; // The following lines define the starting values of the Gauss fits
xc1=42; // They have to be set manually before fitting
w1=0.6;
A1=3000;
xc2=49;
w2=0.5;
A2=3100;

nlsf.iterate(500); // Number of Iterations
nlsf.xmode = 2;

nlsf.funcx$ = colA$; // defines column used as x-values

nlsf.funccol$ = colFit$; //dataset to store fitted Y values
nlsf.makecurve(func); //dataset generated for the fitted curve
nlsf.pasteParams(R);

nlsf.paramWks(parameter);

}
}
}




matthew@originlab.com

73 Posts

Posted - 03/26/2013 :  11:29:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It looks ok, we were able to run your script ok on 8.6. Do you have other scripts you used on 8.0, if so are you able to run them ok on 8.6? Or do they not work either?

Matthew
OriginLab
Go to Top of Page

JulesOZ

18 Posts

Posted - 03/26/2013 :  8:20:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, I tried little snippets of code like this one:
range r1=[paraBF20BT1]Sheet1!col(value); // defines the column containing the desired value as range 1
range r2=[peakposition]Sheet1!col(pos111); // defines the column where the value should be stored as range 2
r2[1]=r1[2];

which worked in Origin8.0 but not in 8.6

I think it might be more some issues with settings or something, because the code is copied from the right-hand side window of the command window to the left hand side window, when I hit Enter, but nothing else is happening.
Just in case it matters, here is the exact name of the version I use:
Origin 8.6.0 (32bit) b70(Academic)
Go to Top of Page

cdrozdowski111

USA
247 Posts

Posted - 03/26/2013 :  9:21:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
One thing I noticed (that may not be directly relevant to your issues) is that you declare an int variable j. j is a reserved variable name (see: http://wiki.originlab.com/~originla/ltwiki/index.php?title=LabTalk:System_Variables&rdfrom=http%3A%2F%2Fwiki.originlab.com%2F%7Eoriginla%2Fwiki%2Findex.php%3Ftitle%3DLabTalk%3ASystem_Variables%26redirect%3Dno#X.2C_Y.2C_Z.2C_I.2C_J.2C_E.2C_T.2C_Count. )

Even if it doesn't fix your issue, it seems that an LT best practice is to name such ints as jj, kk, II, etc.
Go to Top of Page

JulesOZ

18 Posts

Posted - 03/26/2013 :  9:35:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I changed the variable thing, but that did not have an effect.
But I noticed one strange thing:
I have a comment header above the actual code. A few lines behind //
If I copy these lines into the Command window, the code is not executed as I described it. When I just copy the code, it is executing! (Yea!) However, it is not running a perfect as it did under 8.0, e.g it seems to have problems to loop through the various worksheets. But I come back about that, if I can't figure it out.

But: is it possible that a comment header, that should be just ignored while executing, gives such problems????
Go to Top of Page

easwar

USA
1964 Posts

Posted - 03/26/2013 :  9:36:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by JulesOZ
...code is copied from the right-hand side window of the command window to the left hand side window, when I hit Enter, but nothing else is happening.



Hi,

So the history in the left panel of the command window updates, but the command does not execute as expected...

Open the classic script window (menu: Window->Script Window) and then paste the same script lines there, drag and select the lines with mouse, and then press Enter to execute. Does that work? If yes, somehow your command window is misbehaving, we need to try reproduce.

Also for long scripts such as the one you posted earlier, it is better to keep such script in a script file (OGS) and then execute from the file, see the LabTalk guide on how to create and use OGS files and sections.

Easwar
OriginLab
Go to Top of Page

JulesOZ

18 Posts

Posted - 03/26/2013 :  9:41:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,
using the script window as you suggested, works beautifully!
So it's my command window having a bug?

And: the looping though the worksheets works as well again - I just forgot to un-comment a few lines.
Go to Top of Page

Penn

China
644 Posts

Posted - 03/26/2013 :  10:48:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It seems a bug in Origin 8.6 SR0 (b70), please upgrade to SR3 from this page. Or you can run the script in Script Window (open by menu Window: Script Window).

Penn
Go to Top of Page

JulesOZ

18 Posts

Posted - 03/26/2013 :  11:13:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks!
We are using a multi-user license, so I'll have to ask our administrator to do this.

Go to Top of Page

JulesOZ

18 Posts

Posted - 03/27/2013 :  02:36:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I updated to Origin9 and it seems to work now.
Thanks a lot for your help!

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