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
 Abnormal Program Crashing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MylesKennedy

Germany
1 Posts

Posted - 01/19/2012 :  03:37:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear Origin-Community,

I work with Origin 8.5.1 SR2 and have a strange problem. The LabTalk code, I wrote yesterday, worked perfectly. It still works on my collegues computer (same version, same SR) without any crash. At my computer, Origin crashes sometimes, but not every time and also not always at the same position from the code. I think the best way to attach the code. If I type AnzElem=1 or 2, everything is fine. For AnzElem=3, Origin crashes most of the time.

Can anyone help me fix this problem? I also tried to introduce different sections and combine them with an if-condition, but the problem still remains the same.

Thank you very much.

Here is my code:


[Main]

getn
(Name der Probe) %%N
(Name des exp. WS) %%V
(Absorptionskante) %%O
(Anzahl der Elemente) AnzElem
(Informationen zur Probe); // Information Probe

strPr$=%N;
strKant$=%O;
strExp$=%V;
strF0$="f0";
strFS$="f^2";
strGew$="w";
strDGew$="2w"; // String-Definition

// Abschnitt AnzElem=1

if (AnzElem==1) {type -b "Für ein einfaches System ist keine weitere Berechnung der Gewichtungsfaktoren nötig";

getn
(Elementsymbol der Komponente A) %%P
(Elementsymbole der Komponenten);

strT1$=%P; //String Definiton

newbook name:=strExp$ result:=bn$ option:=1;
layer.name$=strExp$;
wks.ncols=3; //Neues Buch für exp. Datei

dlgFile fname:=path$ group:=*.DAT title:="Bitte exp. S(q) einlesen";

impasc fname:=path$
options.Names.AutoNames:=0
options.Names.FNameToSht:=0
options.Names.FNameToBk:=0
options.Names.FNAmeToBkComm:=0
options.Cols.NumCols:=2
options.FileStruct.NumericSeparator:=0; //Import-Optionen

itest=wks.maxrows;
wks.nrows=itest; //Zählen der Spalten

col(1)[L]$="q";
col(1)[U]$="A";
col(2)[L]$="S(q)";
col(3)[L]$=strGew$+strT1$+strT1$;
col(3)[C]$=strT1$+strT1$; //Benennung der Spalten

range rtest=[%(strExp$)]%(strExp$)!col(3)[1:itest];
rtest=1; //Gewichtungsfaktor=1

dlgPath path:=strLogPath$ title:="Pfad zur Ablage der Export-Datei" init:=strLogPath$;
strLogLocation$ = strLogPath$ +"\" +strExp$ + ".dat";
type -gb strLogLocation$;
type "$(itest)";
type %(strPr$);
type -ge;
expASC path:=strLogLocation$ overwrite:=1 longname:=0 units:=0 comment:=0; //Export Datei für RMC

}

// Abschnitt AnzElem=2

if (AnzElem==2) {
getn
(Elementsymbol der Komponente A) %%P
(Elementsymbol der Komponente B) %%Q
(f1 Komponente A) F1A
(f2 Komponente A) F2A
(f1 Komponente B) F1B
(f2 Komponente B) F2B
(Formfaktoren der Komponenten); //Abfrage Formfaktoren

getn
(Molenbruch Komponete A) C1
(Molenbruch Komponente B) C2
(Molenbrueche der Komponenten); //Abfrage Molenbruch

strT1$=%P;
strT2$=%Q; //String Definition

newbook name:=strPr$ result:=bn$ option:=1;
layer.name$=strPr$;
wks.ncols=11; //Neues Workbook

dlgFile fname:=path$ group:=*.DAT title:="Bitte f0-beinhaltende *.DAT-Datei einlesen"; //Einlesen f0

impasc fname:=path$
options.Names.AutoNames:=0
options.Names.FNameToSht:=0
options.Names.FNameToBk:=0
options.Names.FNAmeToBkComm:=0
options.Cols.NumCols:=3
options.FileStruct.NumericSeparator:=0; //Import-Optionen

col(1)[L]$="q";
col(1)[U]$="A";
col(2)[L]$=strF0$+strT1$;
col(2)[C]$=strT1$;
col(3)[L]$=strF0$+strT2$;
col(3)[U]$=strT2$;
col(4)[L]$=strFS$+strT1$;
col(4)[C]$=strT1$;
col(5)[L]$=strFS$+strT2$;
col(5)[C]$=strT2$;
col(6)[L]$="<f>^2";
col(7)[L]$="<f^2>";
col(8)[L]$=strGew$+strT1$+strT1$;
col(8)[C]$=strT1$+strT1$;
col(9)[L]$=strDGew$+strT1$+strT2$;
col(9)[C]$=strT1$+strT2$;
col(10)[L]$=strGew$+strT2$+strT2$;
col(10)[C]$=strT2$+strT2$;
col(11)[L]$="w Summe"; // Benennung der Spalten

itest=wks.maxrows;
wks.nrows=itest; //leere Spalten löschen

col(4)=(col(2)+F1A)^2+F2A; //Berechnung f^2(A)
col(5)=(col(3)+F1B)^2+F2B; //Berechnung f^1(B)
col(6)=(C1*(col(2)+F1A)+C2*(col(3)+F1B))^2+(C1*F2A+C2*F2B)^2; //Berechnung <f>^2
col(7)=C1*(col(2)+F1A)^2+C2*(col(3)+F1B)^2+C1*(F2A)^2+C2*(F2B)^2; // Berechnung <f^2>
col(8)=(C1^2*((col(2)+F1A)^2+(F2A)^2))/(col(6)); //Berechnug w(AA)
col(9)=2*(C1*C2*((col(2)+F1A)*(col(3)+F1B)+F2A*F2B))/(col(6)); //Berechnung w(AB)
col(10)=(C2^2*((col(3)+F1B)^2+(F2B)^2))/(col(6)); //Berechnung w(BB)
col(11)=col(8)+col(9)+col(10); // Berechnung Summe Gewichtungsfaktoren

newbook name:=strExp$ result:=bn$ option:=1;
layer.name$=strExp$;
wks.ncols=5; //Neues Buch für exp. Datei

dlgFile fname:=path$ group:=*.DAT title:="Bitte exp. Sq einlesen";

impasc fname:=path$
options.Names.AutoNames:=0
options.Names.FNameToSht:=0
options.Names.FNameToBk:=0
options.Names.FNAmeToBkComm:=0
options.Cols.NumCols:=3
options.FileStruct.NumericSeparator:=0; //Import-Optionen

col(1)[L]$="q";
col(1)[U]$="A";
col(2)[L]$="S(q)";

colcopy irng:=[%(strPr$)]%(strPr$)!(8:10) orng:=(3:5) data:=1
format:=1 lname:=1 units:=1 comments:=1;

itest=wks.maxrows;
wks.nrows=itest; //leere Spalten löschen

dlgPath path:=strLogPath$ title:="Pfad zur Ablage der Export-Datei" init:=strLogPath$;
strLogLocation$ = strLogPath$ +"\" +strExp$ + ".dat";
type -gb strLogLocation$;
type "$(itest)";
type %(strPr$);
type -ge;
expASC path:=strLogLocation$ overwrite:=1 longname:=0 units:=0 comment:=0; //Export Datei für RMC

}

//Abschnitt AnzElem=3

if (AnzElem==3) {
getn
(Elementsymbol Komponente A) %%P
(Elementsymbol Komponente B) %%Q
(Elementsymbol Komponente C) %%S
(Elementsymbole der Komponenten); //Abfrage Elementsymbole

getn
(f1 Komponente A) F1A
(f2 Komponente A) F2A
(f1 Komponente B) F1B
(f2 Komponente B) F2B
(f1 Komponente C) F1C
(f2 Komponente C) F2C
(Formfaktoren der Komponenten); //Abfrage Formfaktoren

getn
(Molenbruch Komponente A) C1
(Molenbruch Komponente B) C2
(Molenbruch Komponente C) C3
(Molenbrueche der Komponenten); //Abfrage Molenbrueche

strT1$=%P;
strT2$=%Q;
strT3$=%S; //String Defintion

newbook name:=strPr$ result:=bn$ option:=1;
layer.name$=strPr$;
wks.ncols=16; //Neues Book

dlgFile fname:=path$ group:=*.DAT title:="Bitte f0-beinhaltende Datei einlesen"; //Einlesen f0

impasc fname:=path$
options.Names.AutoNames:=0
options.Names.FNameToSht:=0
options.Names.FNameToBk:=0
options.Names.FNAmeToBkComm:=0
options.Cols.NumCols:=4
options.FileStruct.NumericSeparator:=0; //Import-Optionen

itest=wks.maxrows;
wks.nrows=itest; //leere Spalten löschen

col(1)[L]$="q";
col(1)[U]$="A";
col(2)[L]$=strF0$+strT1$;
col(2)[C]$=strT1$;
col(3)[L]$=strF0$+strT2$;
col(3)[U]$=strT2$;
col(4)[L]$=strF0$+strT3$;
col(4)[U]$=strT3$;
col(5)[L]$=strFS$+strT1$;
col(5)[C]$=strT1$;
col(6)[L]$=strFS$+strT2$;
col(6)[C]$=strT2$;
col(7)[L]$=strFS$+strT3$;
col(7)[C]$=strT3$;
col(8)[L]$="<f>^2";
col(9)[L]$="<f^2>";
col(10)[L]$=strGew$+strT1$+strT1$;
col(10)[C]$=strT1$+strT1$;
col(11)[L]$=strDGew$+strT1$+strT2$;
col(11)[C]$=strT1$+strT2$;
col(12)[L]$=strDGew$+strT1$+strT3$;
col(12)[C]$=strT1$+strT3$;
col(13)[L]$=strGew$+strT2$+strT2$;
col(13)[C]$=strT2$+strT2$;
col(14)[L]$=strDGew$+strT2$+strT3$;
col(14)[C]$=strT2$+strT3$;
col(15)[L]$=strGew$+strT3$+strT3$;
col(15)[C]$=strT3$+strT3$;
col(16)[L]$="w Summe"; // Benennung der Spalten

col(5)=(col(2)+F1A)^2+(F2A)^2; //Berechnung f^2(A)
col(6)=(col(3)+F1B)^2+(F2B)^2; //Berechnung f^2(B)
col(7)=(col(4)+F1C)^2+(F2C)^2; //Berechnung f^2(C)
col(8)=(C1*(col(2)+F1A)+C2*(col(3)+F1B)+C3*(col(4)+F1C))^2+(C1*F2A+C2*F2B+C3*F2C)^2; //Berechnung <f>^2
col(9)=C1*col(5)+C2*col(6)+C3*col(7); //Berechnung <f^2>
col(10)=(C1^2*((col(2)+F1A)^2+(F2A)^2))/(col(8)); //Berechnung w(11)
col(11)=2*(C1*C2*((col(2)+F1A)*(col(3)+F1B)+F2A*F2B))/(col(8)); //Berechnung w(12)
col(12)=2*(C1*C3*((col(2)+F1A)*(col(4)+F1C)+F2A*F2C))/(col(8)); //Berechnung w(13)
col(13)=(C2^2*((col(3)+F1B)^2+(F2B)^2))/(col(8)); //Berechnung w(22)
col(14)=2*(C2*C3*((col(3)+F1B)*(col(4)+F1C)+F2B*F2C))/(col(8)); //Berechnung w(23)
col(15)=(C3^2*((col(4)+F1C)^2+(F2C)^2))/(col(8)); //Berechnung w(33)
col(16)=col(10)+col(11)+col(12)+col(13)+col(14)+col(15); //Berechnung Summe Gewichtungsfaktoren

newbook name:=strExp$ result:=bn$ option:=1;
layer.name$=strExp$;
wks.ncols=8; //Neues Buch für exp. Datei

dlgFile fname:=path$ group:=*.DAT title:="Bitte exp. Sq einlesen";

impasc fname:=path$
options.Names.AutoNames:=0
options.Names.FNameToSht:=0
options.Names.FNameToBk:=0
options.Names.FNAmeToBkComm:=0
options.Cols.NumCols:=3
options.FileStruct.NumericSeparator:=0; //Import-Optionen

col(1)[L]$="q";
col(1)[U]$="A";
col(2)[L]$="S(q)";

colcopy irng:=[%(strPr$)]%(strPr$)!(10:15) orng:=(3:8) data:=1
format:=1 lname:=1 units:=1 comments:=1;

itest=wks.maxrows;
wks.nrows=itest; //leere Spalten löschen

dlgPath path:=strLogPath$ title:="Pfad zur Ablage der Export-Datei" init:=strLogPath$;
strLogLocation$ = strLogPath$ +"\" +strExp$ + ".dat";
type -gb strLogLocation$;
type "$(itest)";
type %(strPr$);
type -ge;
expASC path:=strLogLocation$ overwrite:=1 longname:=0 units:=0 comment:=0; //Export Datei für RMC

}

easwar

USA
1965 Posts

Posted - 01/23/2012 :  3:19:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It would be easier for us to check if you send relevant data files/OPJ etc associated with this code. Please send to tech support using the "Send File to Tech Support" link on top right of the forum page. You could zip up all your files into one file and upload. Then in your e-mail to tech, please refer to this post.

Easwar
OriginLab
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