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
 Crash after newsheet command
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Luke89

Germany
1 Posts

Posted - 06/22/2016 :  07:53:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello community,

I use OriginPro 2015 b9.2.272 on Mircrosoft Windows 7 Professional.

I've writen a LabTalk-script to do some polynomial fits to some data. It works fine the first three times of the loop, but at the fourth repetition Origin always crashes completely at the "newsheet"-command after typing "Bugfix 1a".

I tried to stop the script before that fourth repetition, but then Origin crashes just when I tried to save the project.

[Main]
echo = 1234;
// Definition of the variables:
string farbstoff$="Farbstoff";
string polymer$="LRW";
string starter$="BME";
double temp=-30;
int col=4;

loop(ii,1,99999){

// Open window
getn
(Verwendeter Farbstoff) farbstoff$
(Polymer) polymer$
(Starter) starter$
(Temperatur) temp
(Bitte Daten eingeben);

range n=[Farbstoffe]Sheet1!col(A);

loop(ff,1,17){
if(n[ff]$==farbstoff$){
type "%(farbstoff$) ist Nr $(ff)";
break;
}
}
//Open the data of specified conditions
win -a "%(farbstoff$)%(polymer$)%(starter$)";
page.active$="A_$(temp)";
type -b "Bugfind 1";
colmax=(wks.ncols-1)/3;

loop(fff,1,colmax){

//Calculates the number of column
col=(fff*3)+1;
type -b "Bugfind 1a";
newsheet book:="%(farbstoff$)%(polymer$)%(starter$)" name:="A$(col)_$(temp)";
type -b "Bugfind 2";
//Defines the borders of the fit
range g1=[Farbstoffe]Sheet1!col(B);
range m1=[Farbstoffe]Sheet1!col(C);
range m2=[Farbstoffe]Sheet1!col(D);
range g2=[Farbstoffe]Sheet1!col(E);
range x=[%(farbstoff$)%(polymer$)%(starter$)]A_$(temp)!col(A);
range y=[%(farbstoff$)%(polymer$)%(starter$)]A_$(temp)!col($(col));
range cor=[Fit%(farbstoff$)]Fitdiff_Mean_$(temp)!col(B);
range corer=[Fit%(farbstoff$)]Fitdiff_Mean_$(temp)!col(C);
type -b "Bugfind 3";
//Rename the columns
col(1)[L]$=Wavelength;
col(1)[U]$=nm;
col(2)[L]$=Intensity;
col(1)=x;
col(2)=y;
type -b "Bugfind 4";
//Mask unfitted data
mark -w1 wcol(1)[$(m1[ff]):$(m2[ff])];
mark -w1 wcol(1)[$(m1[ff]):$(m2[ff])];
mark -w1 wcol(2)[$(m1[ff]):$(m2[ff])];
mark -w1 wcol(2)[$(m1[ff]):$(m2[ff])];
type -b "Bugfind 5";
//Define the fit range
range xy=(wcol(1)[$(g1[ff]):$(g2[ff])],wcol(2)[$(g1[ff]):$(g2[ff])]);
type -b "Bugfind 6";
//Do the fit
fitpoly iy:=xy polyorder:=5 coef:=3 err:=4;
type -b "Bugfind 7";
//Demask the data
mark -wd col(1);
mark -wd col(2);
type -b "Bugfind 8";
//Calculates the polynom
col(5)[L]$=Intensity;
csetvalue formula:="col(3)[1]+col(3)[2]*col(1)+col(3)[3]*col(1)^2+col(3)[4]*col(1)^3+col(3)[5]*col(1)^4+col(3)[6]*col(1)^5" col:=5;
type -b "Bugfind 9";
//Calculate absorption
col(6)[L]$=Absorption;
col(6)=col(2)-col(5)-cor;
col(7)[L]$=Fehler Absorption;
col(7)=corer;
wks.col7.type=3;

//Löscht alle Rangelisten
del -r;
del -as;
del -al aa;
del -al ss;
del -occlean
}
}

Edited by - Luke89 on 06/22/2016 07:54:46 AM
  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